SlideShare a Scribd company logo
Diagnosing WordPress
Presented by Tim Butler
What do to when things go wrong
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!
About this talk….
Aimed at developers and agencies
Just as applicable to business owners
Start with the basics and work our way up
Before we get started…..
One quick takeaway….
Make sure you have a backup!!
How you usually find out there’s a
problem...
“WHY IS MY WEBSITE DOWN!!!!”
Additional management “assistance”
Software equivalent of what you’re facing
What you actually need….
The path to Zen
Where we’ll be focussing
Preparation
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
Preparation
Monitoring
Monitoring
Forearmed is forewarned
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/
Monitoring
Diagnostics
Diagnostics
OR
Catastrophic error…..
Diagnostics - Server Logs
Diagnostics - Server Logs
Let's look in the logs...
Diagnostics - Server Logs
80% of your issues will be identified in the logs
wp-content/plugins/tims-shady-plugin/tims-shady-plugin.php
Diagnostics - Server Logs
Consider centralised logging
SaaS Open Source
(host yourself)
https://papertrailapp.com/ https://www.graylog.org/
Diagnostics - Server Logs
24 hour snapshot
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...
WordPress Debugging
Diagnostics - WordPress Debugging
Great way to see more info on soft failures eg,
“Two out of the 5,000 products in my store have an issue”
Diagnostics - WordPress Debugging
PHP / WordPress Log levels
Normal Debug enabled
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);
Diagnostics - WordPress Debugging
By default: wp-content/debug.log
[23-Jul-2018 06:32:09 UTC] PHP Notice: Undefined index: country in
/var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/wp-content/plugins/woocommerce/includes/class-wc-geolite-integration.php on line 60
[23-Jul-2018 06:32:09 UTC] PHP Stack trace:
[23-Jul-2018 06:32:09 UTC] PHP 1. {main}() /var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/index.php:0
[23-Jul-2018 06:32:09 UTC] PHP 2. require() /var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/index.php:17
[23-Jul-2018 06:32:09 UTC] PHP 3. require_once() /var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/wp-blog-header.php:13
[23-Jul-2018 06:32:09 UTC] PHP 4. require_once() /var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/wp-load.php:37
[23-Jul-2018 06:32:09 UTC] PHP 5. require_once() /var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/wp-config.php:80
[23-Jul-2018 06:32:09 UTC] PHP 6. do_action() /var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/wp-settings.php:450
[23-Jul-2018 06:32:09 UTC] PHP 7. WP_Hook->do_action() /var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/wp-includes/plugin.php:453
[23-Jul-2018 06:32:09 UTC] PHP 8. WP_Hook->apply_filters() /var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/wp-includes/class-wp-hook.php:310
[23-Jul-2018 06:32:09 UTC] PHP 9. WooCommerce->init() /var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/wp-includes/class-wp-hook.php:286
[23-Jul-2018 06:32:09 UTC] PHP 10. WC_Customer->__construct()
/var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/wp-content/plugins/woocommerce/includes/class-woocommerce.php:480
[23-Jul-2018 06:32:09 UTC] PHP 11. WC_Data_Store->read()
/var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/wp-content/plugins/woocommerce/includes/class-wc-customer.php:116
[23-Jul-2018 06:32:09 UTC] PHP 12. WC_Customer_Data_Store_Session->read()
/var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/wp-content/plugins/woocommerce/includes/class-wc-data-store.php:156
[23-Jul-2018 06:32:09 UTC] PHP 13. WC_Customer_Data_Store_Session->set_defaults()
…...
Diagnostics - Diving a little deeper
Diagnostics
Make sure you have a backup!
Next items - run on staging / dev copy
Diagnostics - Diving a little deeper
https://en-au.wordpress.org/plugins/query-monitor/
What if there’s no errors in the logs?
Diagnostics - Query Monitor
● Shows database queries
● See WordPress hooks
● See Theme templates used
● See HTTP calls
● … And more!
Diagnostics - Query Monitor
0.06 second page load
3.8MB peak memory
0.003 second db queries
19 database queries
Diagnostics - Query Monitor
Database
Diagnostics - Query Monitor
Templates
Diagnostics - Query Monitor
HTTP Calls
Diagnostics - Query Monitor
“Something’s loading JQuery twice….”
Diagnostics - Query Monitor
What’s the impact of WooCommerce?
Diagnostics - Query Monitor
“Admin is slower..”
Some premium plugins can have issues refreshing,
with a 30 second timeout
HTTP Calls
We need to go deeper
Diagnostics - Query Monitor
Diagnostics
Warning: These examples require root access to a server
(your dev server!) or a localised, development install.
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/
Diagnostics - XDebug
Debugging WordPress with xDebug
2:10 pm - Alex Bishop
Diagnostics - XDebug
If it’s compiled in:
zend_extension=xdebug.so
xdebug.profiler_enable_trigger=1
xdebug.profiler_enable_trigger_value=wordcamptest
Diagnostics - XDebug
“My website is slow”
Not database queries…. Must be code
Diagnostics - XDebug
Creates /tmp/cachegrind.out.26139.07d29e
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
Diagnostics - XDebug
z
Really shouldn’t let this developer near an editor
wp-content/plugins/tims-shady-plugin/tims-shady-plugin.php
Diagnostics - XDebug
Debugging WordPress with xDebug
2:10 pm - Alex Bishop
Diagnostics - Digging Deeper
Option 2 - New Relic / APM
https://newrelic.com/
“A complete view of your applications and operating environment”
APM = Application Performance Management
Diagnostics - New Relic
WordPress specific Tools
Other APM’s also available
Diagnostics - New Relic (Lite)
Option 2 - New Relic
Diagnostics - New Relic (Lite)
Diagnostics - New Relic (Lite)
Diagnostics - New Relic (Essentials)
Hooks
Diagnostics - New Relic (Essentials)
Plugins and Themes
Diagnostics - New Relic (Essentials)
Database
Two quick, get out of jail free cards
Get out of Jail free cards
Check wp_options table for expired transients
Check WordPress core files via WP-CLI
wp core verify-checksums
Summary
Summary
1. Remember your path to Zen
2. Find your server log locations
3. Familiarise yourself with the tools before you need them
One final reminder...
Make sure you have a backup!!
Questions?
Feel free to ask in person
or via @timbutler

More Related Content

PPTX
Improving WordPress Performance: Xdebug and PHP profiling
PDF
Profiling PHP with Xdebug / Webgrind
PDF
Xdebug and Drupal8 tests (PhpUnit and Simpletest)
PPTX
Your Script Just Killed My Site
PDF
Find WordPress performance bottlenecks with XDebug PHP profiling
PDF
PHP 2014/15 - Visión global del ecosistema PHP
PDF
Frontend SPOF
PDF
Magento 2 Development
Improving WordPress Performance: Xdebug and PHP profiling
Profiling PHP with Xdebug / Webgrind
Xdebug and Drupal8 tests (PhpUnit and Simpletest)
Your Script Just Killed My Site
Find WordPress performance bottlenecks with XDebug PHP profiling
PHP 2014/15 - Visión global del ecosistema PHP
Frontend SPOF
Magento 2 Development

What's hot (20)

PPTX
Hybrid app
PDF
Introduction to PhoneGap and PhoneGap Build
PDF
Automatic testing and quality assurance for WordPress plugins
PDF
Testing and updating WordPress - Advanced techniques for avoiding regressions
PDF
html5 & phonegap
PPT
Sxsw 20090314
PPT
Google在Web前端方面的经验
PPTX
Drupal Development Tips
PPTX
Nahlédněte za oponu VersionPressu
PPT
Even Faster Web Sites at jQuery Conference '09
PPTX
Leveraging Continuous Integration For Fun And Profit!
PDF
Magento with Composer
ODP
Passo a Passo para criar uma aplicação Móvel Híbrida
PPT
Js unit testing
PDF
Sara Harkousse - "Web Components: It's all rainbows and unicorns! Is it?"
PDF
How QCLean Works? Introduction to Browser Extensions
PPTX
Puppeteer - Headless Chrome Node API
PDF
Desarrollo Profesional con PHP 2014/15 - Nivel Bajo / Medio
PDF
Mykhailo Bodnarchuk "The history of the Codeception project"
PDF
Puppeteer - A web scraping & UI Testing Tool
Hybrid app
Introduction to PhoneGap and PhoneGap Build
Automatic testing and quality assurance for WordPress plugins
Testing and updating WordPress - Advanced techniques for avoiding regressions
html5 & phonegap
Sxsw 20090314
Google在Web前端方面的经验
Drupal Development Tips
Nahlédněte za oponu VersionPressu
Even Faster Web Sites at jQuery Conference '09
Leveraging Continuous Integration For Fun And Profit!
Magento with Composer
Passo a Passo para criar uma aplicação Móvel Híbrida
Js unit testing
Sara Harkousse - "Web Components: It's all rainbows and unicorns! Is it?"
How QCLean Works? Introduction to Browser Extensions
Puppeteer - Headless Chrome Node API
Desarrollo Profesional con PHP 2014/15 - Nivel Bajo / Medio
Mykhailo Bodnarchuk "The history of the Codeception project"
Puppeteer - A web scraping & UI Testing Tool
Ad

Similar to Diagnosing WordPress: What to do when things go wrong (20)

PDF
Here Be Dragons - Debugging WordPress
PDF
Debugging WordPress
PDF
Debugging - Figuring it out yourself (WordCamp Dublin 2019)
KEY
Philip Arthur Moore: Best Practices — On Breaking and Fixing WordPress Themes
PDF
WordCamp SF 2011: Debugging in WordPress
PPTX
Debugging WordPress for Site Owners
PDF
Application Performance Monitoring for WordPress
PDF
Debugging and Profiling in WordPress: What is My Site Doing?
PDF
Use Xdebug to profile PHP
PDF
Debugging, Monitoring and Profiling in TYPO3
 
PPTX
Elite Bug Squashing
PDF
Debugging WordPress with xDebug
KEY
doing_it_right() with WordPress
PDF
Debugging WordPress Core and Plugins!
PDF
Become a Better Developer with Debugging Techniques for Drupal (and more!)
PDF
Php Debugging from the Trenches
PDF
Getting Started with WordPress Development
PDF
DevCraft: ProTips for WordPress Teams
PPTX
Resolving problems & high availability
PPT
WordPress Harrisburg Meetup - Best Practices
Here Be Dragons - Debugging WordPress
Debugging WordPress
Debugging - Figuring it out yourself (WordCamp Dublin 2019)
Philip Arthur Moore: Best Practices — On Breaking and Fixing WordPress Themes
WordCamp SF 2011: Debugging in WordPress
Debugging WordPress for Site Owners
Application Performance Monitoring for WordPress
Debugging and Profiling in WordPress: What is My Site Doing?
Use Xdebug to profile PHP
Debugging, Monitoring and Profiling in TYPO3
 
Elite Bug Squashing
Debugging WordPress with xDebug
doing_it_right() with WordPress
Debugging WordPress Core and Plugins!
Become a Better Developer with Debugging Techniques for Drupal (and more!)
Php Debugging from the Trenches
Getting Started with WordPress Development
DevCraft: ProTips for WordPress Teams
Resolving problems & high availability
WordPress Harrisburg Meetup - Best Practices
Ad

More from WordCamp Sydney (20)

PDF
Don’t Panic: How To Troubleshoot Your WordPress Site
PDF
WordPress Hosting Survival Guide
PDF
Preparing For The Flood. How Do You Conduct Load Testing To Ready Your WordPr...
PDF
Goodbye Themes, Hello Elementor – Beyond Creating Basic Websites
PDF
Divi 4.x and WooCommerce Changes
PDF
Why No One Is Reading Your Blog Posts (And How To Change That)
PDF
Our Wild Journey Implementing A Headless WordPress Blog
PDF
Escaping Client Hell: 6 Practical Tips To Make Freelancing Fun Again
PDF
Planning Your Website Roadmap: Why Every Website Project Needs One To Save It...
PDF
Website Delivered – It’s The START Of The Relationship!
PDF
5 Steps To Avoiding Burnout: Creating A Healthy Work/Life Balance
PDF
The Healthy Baker - Flipping the Brief
PDF
Gutenberg Block Editor Tips & Tricks
PDF
Let's Get Engaged
PDF
The Science Of WordPress
PDF
Basics of Search Engine Optimisation
PDF
The Future of Web Content (an introduction to the new WordPress editor)
PDF
Beyond the Theme: Affirming the role of the designer in the WordPress ecosystem
PDF
5 Ecommerce Trends to Implement Now
PDF
Modern Local Environment for WordPress in 2018
Don’t Panic: How To Troubleshoot Your WordPress Site
WordPress Hosting Survival Guide
Preparing For The Flood. How Do You Conduct Load Testing To Ready Your WordPr...
Goodbye Themes, Hello Elementor – Beyond Creating Basic Websites
Divi 4.x and WooCommerce Changes
Why No One Is Reading Your Blog Posts (And How To Change That)
Our Wild Journey Implementing A Headless WordPress Blog
Escaping Client Hell: 6 Practical Tips To Make Freelancing Fun Again
Planning Your Website Roadmap: Why Every Website Project Needs One To Save It...
Website Delivered – It’s The START Of The Relationship!
5 Steps To Avoiding Burnout: Creating A Healthy Work/Life Balance
The Healthy Baker - Flipping the Brief
Gutenberg Block Editor Tips & Tricks
Let's Get Engaged
The Science Of WordPress
Basics of Search Engine Optimisation
The Future of Web Content (an introduction to the new WordPress editor)
Beyond the Theme: Affirming the role of the designer in the WordPress ecosystem
5 Ecommerce Trends to Implement Now
Modern Local Environment for WordPress in 2018

Recently uploaded (20)

PDF
Unit-1 introduction to cyber security discuss about how to secure a system
PPTX
artificial intelligence overview of it and more
PPTX
presentation_pfe-universite-molay-seltan.pptx
PPTX
Introuction about WHO-FIC in ICD-10.pptx
PDF
The New Creative Director: How AI Tools for Social Media Content Creation Are...
PPTX
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
PPTX
Slides PPTX World Game (s) Eco Economic Epochs.pptx
PPTX
Power Point - Lesson 3_2.pptx grad school presentation
PPTX
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
PDF
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
PPT
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
PDF
Paper PDF World Game (s) Great Redesign.pdf
PPTX
E -tech empowerment technologies PowerPoint
PDF
Testing WebRTC applications at scale.pdf
PDF
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
PDF
Tenda Login Guide: Access Your Router in 5 Easy Steps
PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PPTX
Internet___Basics___Styled_ presentation
PDF
How to Ensure Data Integrity During Shopify Migration_ Best Practices for Sec...
Unit-1 introduction to cyber security discuss about how to secure a system
artificial intelligence overview of it and more
presentation_pfe-universite-molay-seltan.pptx
Introuction about WHO-FIC in ICD-10.pptx
The New Creative Director: How AI Tools for Social Media Content Creation Are...
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
Slides PPTX World Game (s) Eco Economic Epochs.pptx
Power Point - Lesson 3_2.pptx grad school presentation
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
522797556-Unit-2-Temperature-measurement-1-1.pptx
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
Paper PDF World Game (s) Great Redesign.pdf
E -tech empowerment technologies PowerPoint
Testing WebRTC applications at scale.pdf
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
Tenda Login Guide: Access Your Router in 5 Easy Steps
INTERNET------BASICS-------UPDATED PPT PRESENTATION
Internet___Basics___Styled_ presentation
How to Ensure Data Integrity During Shopify Migration_ Best Practices for Sec...

Diagnosing WordPress: What to do when things go wrong

  • 1. Diagnosing WordPress Presented by Tim Butler What do to when things go wrong
  • 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
  • 4. Before we get started…..
  • 5. One quick takeaway…. Make sure you have a backup!!
  • 6. How you usually find out there’s a problem...
  • 7. “WHY IS MY WEBSITE DOWN!!!!”
  • 9. Software equivalent of what you’re facing
  • 10. What you actually need….
  • 11. The path to Zen Where we’ll be focussing
  • 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/
  • 22. Diagnostics - Server Logs Let's look in the logs...
  • 23. Diagnostics - Server Logs 80% of your issues will be identified in the logs wp-content/plugins/tims-shady-plugin/tims-shady-plugin.php
  • 24. Diagnostics - Server Logs Consider centralised logging SaaS Open Source (host yourself) https://papertrailapp.com/ https://www.graylog.org/
  • 25. Diagnostics - Server Logs 24 hour snapshot
  • 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...
  • 28. Diagnostics - WordPress Debugging Great way to see more info on soft failures eg, “Two out of the 5,000 products in my store have an issue”
  • 29. Diagnostics - WordPress Debugging PHP / WordPress Log levels Normal Debug enabled
  • 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);
  • 31. Diagnostics - WordPress Debugging By default: wp-content/debug.log [23-Jul-2018 06:32:09 UTC] PHP Notice: Undefined index: country in /var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/wp-content/plugins/woocommerce/includes/class-wc-geolite-integration.php on line 60 [23-Jul-2018 06:32:09 UTC] PHP Stack trace: [23-Jul-2018 06:32:09 UTC] PHP 1. {main}() /var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/index.php:0 [23-Jul-2018 06:32:09 UTC] PHP 2. require() /var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/index.php:17 [23-Jul-2018 06:32:09 UTC] PHP 3. require_once() /var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/wp-blog-header.php:13 [23-Jul-2018 06:32:09 UTC] PHP 4. require_once() /var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/wp-load.php:37 [23-Jul-2018 06:32:09 UTC] PHP 5. require_once() /var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/wp-config.php:80 [23-Jul-2018 06:32:09 UTC] PHP 6. do_action() /var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/wp-settings.php:450 [23-Jul-2018 06:32:09 UTC] PHP 7. WP_Hook->do_action() /var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/wp-includes/plugin.php:453 [23-Jul-2018 06:32:09 UTC] PHP 8. WP_Hook->apply_filters() /var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/wp-includes/class-wp-hook.php:310 [23-Jul-2018 06:32:09 UTC] PHP 9. WooCommerce->init() /var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/wp-includes/class-wp-hook.php:286 [23-Jul-2018 06:32:09 UTC] PHP 10. WC_Customer->__construct() /var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/wp-content/plugins/woocommerce/includes/class-woocommerce.php:480 [23-Jul-2018 06:32:09 UTC] PHP 11. WC_Data_Store->read() /var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/wp-content/plugins/woocommerce/includes/class-wc-customer.php:116 [23-Jul-2018 06:32:09 UTC] PHP 12. WC_Customer_Data_Store_Session->read() /var/www/vhosts/wcsyd2.conetixtest.com/httpdocs/wp-content/plugins/woocommerce/includes/class-wc-data-store.php:156 [23-Jul-2018 06:32:09 UTC] PHP 13. WC_Customer_Data_Store_Session->set_defaults() …...
  • 32. Diagnostics - Diving a little deeper
  • 33. Diagnostics Make sure you have a backup! Next items - run on staging / dev copy
  • 34. Diagnostics - Diving a little deeper https://en-au.wordpress.org/plugins/query-monitor/ What if there’s no errors in the logs?
  • 35. Diagnostics - Query Monitor ● Shows database queries ● See WordPress hooks ● See Theme templates used ● See HTTP calls ● … And more!
  • 36. Diagnostics - Query Monitor 0.06 second page load 3.8MB peak memory 0.003 second db queries 19 database queries
  • 37. Diagnostics - Query Monitor Database
  • 38. Diagnostics - Query Monitor Templates
  • 39. Diagnostics - Query Monitor HTTP Calls
  • 40. Diagnostics - Query Monitor “Something’s loading JQuery twice….”
  • 41. Diagnostics - Query Monitor What’s the impact of WooCommerce?
  • 42. Diagnostics - Query Monitor “Admin is slower..” Some premium plugins can have issues refreshing, with a 30 second timeout HTTP Calls
  • 43. We need to go deeper
  • 45. Diagnostics Warning: These examples require root access to a server (your dev server!) or a localised, development install.
  • 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/
  • 47. Diagnostics - XDebug Debugging WordPress with xDebug 2:10 pm - Alex Bishop
  • 48. Diagnostics - XDebug If it’s compiled in: zend_extension=xdebug.so xdebug.profiler_enable_trigger=1 xdebug.profiler_enable_trigger_value=wordcamptest
  • 49. Diagnostics - XDebug “My website is slow” Not database queries…. Must be code
  • 50. Diagnostics - XDebug Creates /tmp/cachegrind.out.26139.07d29e
  • 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
  • 53. Diagnostics - XDebug Debugging WordPress with xDebug 2:10 pm - Alex Bishop
  • 54. Diagnostics - Digging Deeper Option 2 - New Relic / APM https://newrelic.com/ “A complete view of your applications and operating environment” APM = Application Performance Management
  • 55. Diagnostics - New Relic WordPress specific Tools Other APM’s also available
  • 56. Diagnostics - New Relic (Lite) Option 2 - New Relic
  • 57. Diagnostics - New Relic (Lite)
  • 58. Diagnostics - New Relic (Lite)
  • 59. Diagnostics - New Relic (Essentials) Hooks
  • 60. Diagnostics - New Relic (Essentials) Plugins and Themes
  • 61. Diagnostics - New Relic (Essentials) Database
  • 62. Two quick, get out of jail free cards
  • 63. Get out of Jail free cards Check wp_options table for expired transients Check WordPress core files via WP-CLI wp core verify-checksums
  • 65. Summary 1. Remember your path to Zen 2. Find your server log locations 3. Familiarise yourself with the tools before you need them
  • 66. One final reminder... Make sure you have a backup!!
  • 67. Questions? Feel free to ask in person or via @timbutler