WPDB Profiling

v 1.3.3

WPDB Profiling allows you to examine database queries rendered against your WordPress installation. This information can be useful to locate plugins that have slow query times or do not properly cache. Recommended for installations that see moderate to heavy traffic.

This plugin will give you the total number of queries to the db per page, as well as the total time it took to render those queries out to the page. Additionally, line by line each individual query will display with the originating SQL statement, time executed and the function call used to execute the query.

This is especially handy if you are debugging a slow WordPress install and can’t seem to locate the cause of the load. It is also a great way to identify plugins that may not have proper caching enabled or supported.

This is NOT a full page load profiler. This simply shows you the total DB queries and the time it takes to execute.

Installation:

  1. Unpack the wpdb-profiling directory to your `/wp-content/plugins/` directory
  2. Activate the plugin through the `Plugins` menu in WordPress
  3. Edit wp-config.php and add `define(‘SAVEQUERIES’, true);` or verify it is already there.
  4. Using the plugin management screen, you can toggle the plugin on and off depending on the settings you desire.

Change Log:

v1.3.3

  • Fixing a bug where the css is always enabled, even if the plugin isn’t.

v1.3.2

  • Adds front end functionality to the wp-admin. Helpful for debugging admin or plugin scripts under development inside wp-admin.

v1.3

  • Support to disable post revisions: Post revisions can bloat your database by retaining previously saved versions of your post, which you may never use.
  • Support to disable auto saving: Auto saving can bloat your database by assigning different id’s each time an item is saved, this adding an unnecessary record to the db.

v1.2.1

  • Update to license information

v1.2

  • New configuration options to specify which user levels can view profiling (no longer restricted to Administrator)
  • ?showqueries=true can now be used in addition to ?showqueries=yes
  • Users not logged in can never view profiling

v1.1.1

  • ?showqueries=yes $GET parameter can only be used if logged in user is an administrator (user Level 10)

v1.1

  • New wp-admin interface allows you to toggle plugin settings. Options are (Always show profiling when logged in as an administrator?) and (Allow the ?show_queries=yes parameter in URL to show profiling?)
  • Enable / Disable profiling on the front end when logged in as administrator (user Level 10) to the wp-admin interface.
  • Enable / Disable ?show_queries=yes $_GET parameter via wp-admin config to allow / prevent url request for query list.
  • Check whether WP_CACHE and SAVEQUERIES are set on the back end – display success / failure notices and suggestions if one is missing.

v1.0.2

  • Checks if define(‘WP_CACHE’, true); is present. If not, provides plugin suggestions for DB caching.
  • Plugin automatically enabled if your user has Level 10 permissions (administrator) by default.
  • If user Level < 10 or not logged in, you can continue to pass ?show_queries=yes via the url if you are not logged in.
  • Sets define(‘SAVEQUERIES’, true); in plugin should it not be by default.

v1.0.1

  • Groups duplicate function calls and gives a total time for the grouped calls.
  • Styles the profiling a bit to mirror Kohana’s profiling coloring.
  • Added a fix to PHP 5.2.1 where scientific notation was displaying instead of the true time.

2 Responses to “WPDB Profiling”

  1. Jeremias says:

    Hey,

    I really like that one, as I have a lot of plugins on my site. And already deleted one that I would have never suspected to slow things down.

    Thanks for that.

    Report this comment

Leave a Reply

Want to receive announcements about the latest plugin releases? Sign up for our email newsletter: