When working on WordPress websites, I often like to have a simple way to see how fast the pages are loading and how many queries are being executed per page. There are plugins which will output every chunk of data under the sun, but I find those plugins tend to get in the way while I’m actually working on a site. I only require the most rudimentary of information. For that, I use the following bit of code which I put into the mu-plugins folder of each development site I work on.

<?php

/*
 * Add performance stats for current site to the footer.
 *
 * @author Ryan Hellyer 
 */
function add_performance_stats() {
	echo "\n";
	echo '<!-- Blog ' . get_current_blog_id() . ' was created in ' . timer_stop( 0 ) . ' seconds via ' . get_num_queries() . ' queries -->';
	echo "\n";
}
add_action( 'wp_footer', 'add_performance_stats', 9999 );

rev-counter