• Resolved burtonlo

    (@burtonlo)


    I’ve inherited a site that has your plugin activated, but I don’t know if the site is actually using the plugin.

    I’m trying to review plugins to see if we really need them, no fault of yours at all, but can you help me determine whether your plugin is being used? How would I determine that?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Maciej Bis

    (@mbis)

    Hi @burtonlo,

    you can use this code snippet to display the table with all custom permalinks set with my plugin that differ from the native permalinks:

    function pm_debug_pm_urls() {
    	if(isset($_GET['debug_urls'])) {
    		global $permalink_manager, $permalink_manager_uris;
    
    		if(!empty($permalink_manager_uris)) {
    			$uri_post_class = $permalink_manager->functions['uri-functions-post'];
    			$home_url = Permalink_Manager_Helper_Functions::get_permalink_base();
    
    			remove_filter( '_get_page_link', array($uri_post_class, 'custom_post_permalinks'), 99, 2);
    			remove_filter( 'page_link', array($uri_post_class, 'custom_post_permalinks'), 99, 2);
    			remove_filter( 'post_link', array($uri_post_class, 'custom_post_permalinks'), 99, 2);
    			remove_filter( 'post_type_link', array($uri_post_class, 'custom_post_permalinks'), 99, 2);
    			remove_filter( 'attachment_link', array($uri_post_class, 'custom_post_permalinks'), 99, 2);
    
    			$html = "<table border=\"1\">";
    			$html .= sprintf("<thead><tr><th>%s</th><th>%s</th></tr></thead>", 'Original URL', 'Permalink Manager URL');
    			foreach($permalink_manager_uris as $id => $uri) {
    				if(!is_numeric($id)) { continue; }
    
    				$original_permalink = user_trailingslashit(get_permalink($id));
    				$custom_permalink = user_trailingslashit($home_url . "/" . $uri);
    
    				if($original_permalink == $custom_permalink && $original_permalink !== '/') { continue; }
    
    				$html .= sprintf("<tr><td>%s</td><td>%s</td></tr>", $original_permalink, $custom_permalink);
    			}
    		}
    
    		echo $html;
    		die();
    	}
    }
    add_action('init', 'pm_debug_pm_urls');

    Please paste it to functions.php file in your (child) theme directory and then trigger by adding ?debug_urls=1 parameter to any URL, eg.:
    https://yourwebsite.com/?debug_urls=1

    Best regards,
    Maciej

    Thread Starter burtonlo

    (@burtonlo)

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How can I determine whether the plugin has been used?’ is closed to new replies.