Themergency fooplugins.com

Debug Like a Boss with Debug Bar

| 0 comments

This is day 2 of my WordPress Developer Advent Calendar.

As a WordPress developer, you often need to track down bugs. Sometimes you need to inspect SQL queries that are hitting your database. Sometimes you need to see what the value of certain a transient is, or check the values of a form post. Sound familiar?

I often take the easy route and end up dumping variable info to the screen. This is very bad! Do not do this. OK, let’s be realistic: TRY not to do this. And with the Debug Bar plugin for WordPress, you will never need to var_dump again!

What is the Debug Bar?

The Debug Bar adds a new “Debug” option to the admin bar. So when you click it, it takes you to a new “debug dashboard” that is filled with awesome info only a developer will care about. Read more about it.

What Makes It Awesome?

It is extensible! The plugin authors did not try and think of every possible debugging scenario out there. Rather, they made the plugin easily extensible so that you can create your own add-on plugin that suits your needs. I created my own called Debug Bar Screen Info which simply displays the data inside the current WP_Screen object.

Debug Bar Add-On’s

Debug Bar Add-On Description WP.org GitHub
Debug Bar Constants Debug Bar Constants adds three new panels to the Debug Bar that display the defined WP and PHP constants for the current request. http://wordpress.org/plugins/debug-bar-constants https://github.com/jrfnl/Debug-Bar-Constants
Debug Bar Post Types Debug Bar Post Types adds a new panel to the Debug Bar with detailed information about registered post types. http://wordpress.org/plugins/debug-bar-post-types https://github.com/jrfnl/Debug-Bar-Post-Types
Debug Bar Screen Info Show screen info of the current admin page in a new tab within the debug bar. http://wordpress.org/plugins/debug-bar-screen-info https://github.com/fooplugins/debug-bar-screen-info
Debug Bar Actions and Filters Addon This plugin adds two more tabs in the Debug Bar to display all the hooks(Actions and Filters) for the current request. http://wordpress.org/plugins/debug-bar-actions-and-filters-addon n/a
Debug Bar Cron Debug Bar Cron adds a new panel to Debug Bar that displays information about WP scheduled events. http://wordpress.org/plugins/debug-bar-cron n/a
Debug Bar Super Globals Displays Super Global valiables for the current request.Like $_POST, $_GET, and $_COOKIE. http://wordpress.org/plugins/debug-bar-super-globals n/a
Debug Bar Post Meta Very simple extention to the debug bar to get a list of post meta for the current post. http://wordpress.org/plugins/tdd-debug-bar-post-meta n/a
Debug Bar Transients Debug Bar Transients adds a new panel to Debug Bar that displays information about WordPress transients. http://wordpress.org/plugins/debug-bar-transients n/a
Debug Bar Console Adds a PHP/MySQL console to the debug bar http://wordpress.org/plugins/debug-bar-console n/a

What Are You Waiting For?

Install the Debug Bar plugin and these add-on’s now, and spend less time debugging and more time writing code!