0815

Du musst dich anmelden um Beiträge und Themen zu erstellen. Einloggen · Registrieren

Display Performance Statistics for WordPress Pages

Everyone is familair with the following information:

<!-- 33 queries in 0.333 seconds -->

These statistics are usually seen in the footer area of individual pages and serve as a general indicator of performance. The “queries” refer to the number of times WordPress requested information from the database, while the number of seconds indicates the amount of time required for Apache to generate the page. This information is generated by including the following code in your footer template file (or wherever you would like):

<!-- <?php echo get_num_queries(); ?> queries in <?php timer_stop(3); ?> seconds -->

Or, if you don’t like the idea of sharing this information with the entire world, you can limit its display to logged-in administrators only:

<?php if (current_user_can('level_10')) {

	echo '<!-- ' . get_num_queries() . ' queries in ' . timer_stop(3) . ' seconds -->';

} ?>

Easy breezy beautiful!

Source: Digging into WordPress




0