Everyone hates seeing the White Screen of Death, especially if it’s discovered by the client calling to tell you their site is down. Even more frustrating can be intermittent error and/or slow response times, as these can be much harder to diagnose.
Aimed at newer WordPress developers and advanced users, this talk will start with the basic diagnostics tools available and go all the way through to advanced debugging. Attendees should be able to leave this talk with an informed diagnostic approach to errors, rather than just panic.
Presented by Tim Butler @timbutler at WordCamp Sydney 2018
2. Who am I?
● IT professional with 20 years experience
● Head of infrastructure at Conetix
● NGINX Cookbook author
● Certified beer judge
Infrequent ramblings on Twitter: @timbutler
Probably seen more errors than Stack Overflow!
3. About this talk….
Aimed at developers and agencies
Just as applicable to business owners
Start with the basics and work our way up
13. Preparation
● Having a known state to compare to
○ Known plugins and versions installed
○ Known errors or PHP warnings
https://en-au.wordpress.org/plugins/stream/
● Ability to track changes
17. Monitoring
● You want to know of issues before your clients
● System MUST have a point of presence in Australia
https://statuscake.com https://www.panopta.com/
26. Diagnostics
Hard failures = easy to find
“Sometimes the site is slow to load”
“Two out of the 5,000 products in my store have an issue”
“My site seems slower this month”
“My site works perfectly for my customers but wp-admin takes forever”
Soft failures = harder...
30. Diagnostics - WordPress Debugging
Enable via management tools:
Or in the wp-config.php:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
46. Diagnostics - Digging Deeper
Option 1 - XDebug
“Xdebug is an extension for PHP to assist with debugging and development. It contains a
single step debugger to use with IDEs; it upgrades PHP's var_dump() function; it adds
stack traces for Notices, Warnings, Errors and Exceptions; it features functionality for
recording every function call and variable assignment to disk; it contains a profiler; and
it provides code coverage functionality for use with PHPUnit.”
https://xdebug.org/
51. Diagnostics - XDebug KCachegrind / QCachegrind
Webgrind
IDE (PHPStorm)
72.45% time was in apply_filters
This was a single call to excellent_coding
In this function was 100 calls to
password_hash
52. Diagnostics - XDebug
z
Really shouldn’t let this developer near an editor
wp-content/plugins/tims-shady-plugin/tims-shady-plugin.php