Debugging WordPress Core and Plugins!
- 2. Overview
@bronsonquick
● Who Am I?
● Why Debugging Is Important
● Quick Debugging Wins
● WordPress Constants For Debugging
● Issues With Constants
● Chassis
● WordPress Plugins For Debugging
● Query Monitor
● Interactive Debugging
● Xdebug
- 3. Who Am I?
@bronsonquick
● Senior WordPress Developer
● Core Contributor
● Occasional WordPress Podcaster - WP Dev Table
● Maintainer Of Chassis
● Occasional WordCamp Organiser - WordCamp Gold Coast
& WordCamp Brisbane
● Massive Smashing Pumpkins Fan
● Vinyl Addict
● Guitar Fan
- 9. define( ‘SCRIPT_DEBUG’, true );
WordPress will use the "dev" versions
of core CSS and JavaScript files
rather than the minified versions.
@bronsonquick
- 10. define( ‘SAVEQUERIES’, true );
Saves the database queries to an
array and that array can be displayed
to help analyze those queries.
@bronsonquick
- 12. Issues With That Approach
@bronsonquick
● z-index issues - WordPress admin & themes
● Admin Ajax calls
● XML-RPC
● Cron jobs
● RSS Feeds
● REST API
● ….
- 13. Chassis
@bronsonquick
● Chassis - A Virtual Machine For WordPress Development
https://github.com/Chassis/Chassis/
● Docs - http://chassis.io/
● VirtualBox - https://www.virtualbox.org/
● Vagrant - https://www.vagrantup.com/
● Zeroconf networking (Bonjour)
- 15. Improving Debugging With Plugins
@bronsonquick
● Debug Bar - https://wordpress.org/plugins/debug-bar/
● Debug Bar Extender - https://wordpress.org/plugins/debug-bar-extender/
● Debug Bar Cron - https://wordpress.org/plugins/debug-bar-cron/
● Debug Bar Transients - https://wordpress.org/plugins/debug-bar-transients/
● Log Deprecated Notices - https://wordpress.org/plugins/log-deprecated-notices/
● Rewrite Rules Inspector - https://wordpress.org/support/view/plugin-reviews/rewrite-rules-
inspector/
● Developer - https://wordpress.org/plugins/developer/
- 17. Query Monitor
@bronsonquick
● Query Monitor - https://wordpress.org/plugins/query-monitor/
● Query, Caller, Component
Function - Core, Plugin & Theme
● HTTP Requests..
● Hooks & Actions That Are Fired
● HTTP Header Added - X-QM-Redirect-Trace
● Ajax Debugging (jQuery) - Clickable stack trace in your console
● Number Queries Performed, Slow Queries, Queries with errors, Memory Usage, Time
Taken, PHP Version, MySQL versions, Request Parameters, Clickable Stack Traces
● REST API Debugging