Debug WordPress with GD Press Tools

GD Press Tools is very powerful plugin, and one of the most important features is that it can be used for different form of debugging. This post will cover all methods currently available in version 3.0.0. More will be added in the future, and will be covered by new tutorials eventually.

Debuging SQL queries

All database queries executed through WordPress are logged by the main WPDB class instance. Most plugins and themes also use this same instance, and this makes debugging of the executed queries centralized. But, by default there is nothing in WordPress core to display these queries.

SQL Debug In Footer

SQL Debug In Footer

So, GD Press Tools solves yet another missing useful tool, and allows you to get list of all executed queries in both frontend and admin pages. Plugin also (in Pro version only) can save queries into log text file. All this is controlled using several options in plugin Settings, from the Debug tab. One option enables the system, and the three after that add SQL into the footer of frontend and backend, and also into the file. You can also set the user levels able to use this option.

And the output is on the screenshot on the right, showing important data first (memory, time), and list of all queries, functions that called them and time spend executing.

Pretty Format replacement for print_r

gdp_r Debug

gdp_r Debug

Print_r is most used PHP function during development. But, if you need to take a look of a large object or array, this function can be very useless. So, plugin ads new function (only in Pro version), and this function performs formating of data in different form allowing drilling through object or array of any size and depth.

And this function example output is on the image. Each object and array is node that can be opened to reveal another level. Initially, it’s closed to a single node, and will not disrupt much the page layout wherever is displayed.

Plugin ads small JavaScript (jQuery powered) and CSS for styling into header of pages, and you can use function called gdp_r. It’s used as print_r, and has only one parameter, and that is variable to be displayed.

Example: gdp_r($var);

That’s it for now, more tutorials coming soon.

Debug WordPress with GD Press Tools, 5.0 out of 5 based on 1 rating

Leave a Reply

Follow us on Twitter

Social Networks

Google Plus Profile Subscribe to RSS feed LinkedIn Profile Follow me on Pinterest Watch our Youtube Videos Find us on Flickr
CoolHandle
Envato
Get Clicky Web Analytics

Feedburner Feedburner updates

Sign up to receive news from this website to your email.

Dev4Press on YouTube

Archives