Script to help diagnose WordPress speed

Ever wanted to know exactly how many times your browser is querying the server? Or how long it takes for you page to load? Even Yslow cannot detect these queries!

Just add the script below to your functions.php file in your WordPress installation and the queries will appear in the bottom left or your browser as long as your logged in (and only if you logged in).

[php]
<?
php if (is_user_logged_in()) {
?>
<div id="speed-test" style="padding:10px;background:#F66;color:#fff;font-weight:bold; position:fixed;bottom:0;">
<?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?> seconds.
</div>
<?php } ?>
[/php]

If you like this script or need help installing it please leave a comment.

This entry was posted in Web Development. Bookmark the permalink. Follow any comments here with the RSS feed for this post. Post a comment or leave a trackback: Trackback URL.

1 Response to:  Script to help diagnose WordPress speed

  1. xavi
    Posted November 18, 2009 at 7:55 am | Permalink

    thank you for this !
    keep the good work :)

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">