Today I want to tell you about configuring of beautiful plugin, must have for WordPress developers – Debug Bar. It allows you to see debug info on any page of the site. I need it to see debug info secretly (which doesn’t allow WP_DEBUG). More details about plugin and one of the “pitfalls” under the cut.
A little about plugin functionality
Plugin adds “Debug” menu item at the right part of Admin Bar.
When WP_DEBUG and SAVEQUERIES are disabled it shows:
- Server info: hosting domain, php and mysql version, memory, that PHP used to generate current page.
- Current request info: request link and information about rewrite rule.
- The amount of objects cache (Object Cache).
- Calling of deprecated functions by plugins (Deprecated).
WP_DEBUG (tracks PHP Warnings and Notices to make them easier to find) and SAVEQUERIES (mysql queries are tracked and displayed) options must be enabled for fully functioning. Read this to toggle options.
Such items will be added to Debug Bar menu if options are enabled:
- Notices / Warnings – notices and warning list, which PHP generates and display if WP_DEBUG option is “true”, but now it is formatted.
- Queries – list of database queries, functions, which called them, and time spent on these operations.
- WP Query – full info about database query to get page content.
Also “Debug” menu item will be colored depending on errors during page generation, if WP_DEBUG option is enabled.
Remove the errors output on pages
I don’t understand, why this problem wasn’t described on plugin page. As we all know, the errors will be displayed on page if debug is enabled regardless of user authorization state. We must not allow this. After a brief search, I found an excellent option – WP_DEBUG_DISPLAY, which disables errors displaying. Add it as previous options, but set its value to “false”. So we get all we want – plugin catches errors and displays them in its window, and we don’t see them on page.
In conclusion
Debug Bar – excellent tool for plugin developers, which allows tracking plugin’s errors and correct them promptly.
There were at least 3 addons for this plugin in WordPress repository at the time of writing:
- Debug Bar Console – PHP / MySQL console.
- Debug-Bar-Extender – measure runtimes between checkpoints and lookup variable content.
- Debug Bar Query Tracer – trace what plugins are causing database queries.
По-русски


