I am on a mission to find out which plugins are used on a large wordpress installation. Furthermore i need to find out which parts of which plugin is used exactly.
So i decided to record some code coverage data using the php-xdebug plugin.
<?php xdebug_start_code_coverage(); /** ... */ define('WP_USE_THEMES', true); /** Loads the WordPress Environment and Template */ require( dirname( __FILE__ ) . '/wp-blog-header.php' ); file_put_contents("coverage_report/coverage_".time().".json",json_encode(xdebug_get_code_coverage())); xdebug_stop_code_coverage();
So that gives me a lot of information already and it basically works. But i noticed, that some parts of plugins that i definetly know are being used are not reported here. Especially those parts that are registered in the "init" hook in wordpress seem to not show up in the coverage report. I have plugins that send a redirect in those init hook functions.
My question is: is the index.php the right place to put those calls ? Or is the another place where i can catch EVERY request made to the wordpress system ?