|
|
|
If you are running a WordPress blog, you might want to keep a keen eye on its plugins to know how many queries and the time required to process them they are producing on your web pages. This is particular useful if you are trying to optimize your database in order to save the resources your server has assigned to your blog. Here is a simple code to add to your blog’s pages.
Just add this code wherever you want within your blog’s theme (usually it is added to single.php and page.php files):
<?php echo $wpdb->num_queries; ?> <?php _e(‘queries’); ?>. <?php timer_stop(1); ?> <?php _e(‘seconds’); ?>
If you want to know a little more about this code, I have dissected it below, describing what the single pieces do:
- <?php echo $wpdb->num_queries; ?> = display the number of queries the page has got.
- <?php timer_stop(1); ?> = returns the time to process the page.
Tags: trick, WebTalk, Wordpress
Related Articles
Latest Articles
If you can not find what you are looking for, you might want to try Google Advanced Search and get thousands of results, specifically selected for you.
Google Advanced Search
|
Leave a Comment
Best screen resolution 1280x800 or higher.
Web Talk is best viewed in Firefox.

Comments
How to fix “Windows Explorer has stopped working” in Windows 7: Thesres no machine throttling!! How do i...
An Incredible Way to Reveal Passwords Behind Asterisks: good for finding someone elses password i guess, lol
An Incredible Way to Reveal Passwords Behind Asterisks: using the browser’s saved password viewer will sometimes...
An Incredible Way to Reveal Passwords Behind Asterisks: or you could just go to tools>options>security&g t;saved...
An Incredible Way to Reveal Passwords Behind Asterisks: this should be fun at work and on public work stations. This...
An Incredible Way to Reveal Passwords Behind Asterisks: Firefox users should install this add on…....
An Incredible Way to Reveal Passwords Behind Asterisks: Note this only works if you did in fact have your browser remember...
An Incredible Way to Reveal Passwords Behind Asterisks: Nice code, useful, does it work after cleaning internet browsers...
An Incredible Way to Reveal Passwords Behind Asterisks: (“There are no passwords in forms on this page.”)
An Incredible Way to Reveal Passwords Behind Asterisks: Thanks. Doesn’t seems to be working correctly in IE6. 1....