SlideShare ist ein Scribd-Unternehmen logo
1 von 67
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

Google在Web前端方面的经验
Google在Web前端方面的经验Google在Web前端方面的经验
Google在Web前端方面的经验
yiditushe
 

Was ist angesagt? (20)

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

Ähnlich wie Diagnosing WordPress: What to do when things go wrong

WordPress Plugin Development 201
WordPress Plugin Development 201WordPress Plugin Development 201
WordPress Plugin Development 201
ylefebvre
 
Xdebug - Derick Rethans - Barcelona PHP Conference 2008
Xdebug - Derick Rethans - Barcelona PHP Conference 2008Xdebug - Derick Rethans - Barcelona PHP Conference 2008
Xdebug - Derick Rethans - Barcelona PHP Conference 2008
phpbarcelona
 
Zepplin_Pronko_Magento_Festival Hall 1_Final
Zepplin_Pronko_Magento_Festival Hall 1_FinalZepplin_Pronko_Magento_Festival Hall 1_Final
Zepplin_Pronko_Magento_Festival Hall 1_Final
Max Pronko
 

Ähnlich wie Diagnosing WordPress: What to do when things go wrong (20)

WordPress Plugin Development 201
WordPress Plugin Development 201WordPress Plugin Development 201
WordPress Plugin Development 201
 
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsEffizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
 
Xdebug - Derick Rethans - Barcelona PHP Conference 2008
Xdebug - Derick Rethans - Barcelona PHP Conference 2008Xdebug - Derick Rethans - Barcelona PHP Conference 2008
Xdebug - Derick Rethans - Barcelona PHP Conference 2008
 
Debugging - Figuring it out yourself (WordCamp Dublin 2019)
Debugging - Figuring it out yourself (WordCamp Dublin 2019)Debugging - Figuring it out yourself (WordCamp Dublin 2019)
Debugging - Figuring it out yourself (WordCamp Dublin 2019)
 
PHP: Debugger, Profiler and more
PHP: Debugger, Profiler and morePHP: Debugger, Profiler and more
PHP: Debugger, Profiler and more
 
Improving qa on php projects
Improving qa on php projectsImproving qa on php projects
Improving qa on php projects
 
Debugging PHP with xDebug inside of Eclipse PDT 2.1
Debugging PHP with xDebug inside of Eclipse PDT 2.1Debugging PHP with xDebug inside of Eclipse PDT 2.1
Debugging PHP with xDebug inside of Eclipse PDT 2.1
 
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
 
Xdebug
XdebugXdebug
Xdebug
 
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
 
Xdebug from a to x
Xdebug from a to xXdebug from a to x
Xdebug from a to x
 
Zepplin_Pronko_Magento_Festival Hall 1_Final
Zepplin_Pronko_Magento_Festival Hall 1_FinalZepplin_Pronko_Magento_Festival Hall 1_Final
Zepplin_Pronko_Magento_Festival Hall 1_Final
 
Spug pt session2 - debuggingl
Spug pt session2 - debugginglSpug pt session2 - debuggingl
Spug pt session2 - debuggingl
 
IDE and Toolset For Magento Development
IDE and Toolset For Magento DevelopmentIDE and Toolset For Magento Development
IDE and Toolset For Magento Development
 
Security, more important than ever!
Security, more important than ever!Security, more important than ever!
Security, more important than ever!
 
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
 
Php through the eyes of a hoster: PHPNW10
Php through the eyes of a hoster: PHPNW10Php through the eyes of a hoster: PHPNW10
Php through the eyes of a hoster: PHPNW10
 
Use Xdebug to profile PHP
Use Xdebug to profile PHPUse Xdebug to profile PHP
Use Xdebug to profile PHP
 
Xdebug - Your first, last, and best option for troubleshooting PHP code
Xdebug - Your first, last, and best option for troubleshooting PHP codeXdebug - Your first, last, and best option for troubleshooting PHP code
Xdebug - Your first, last, and best option for troubleshooting PHP code
 
The swiss knife of a word press developer
The swiss knife of a word press developerThe swiss knife of a word press developer
The swiss knife of a word press developer
 

Mehr von WordCamp Sydney

Website Delivered – It’s The START Of The Relationship!
Website Delivered – It’s The START Of The Relationship!Website Delivered – It’s The START Of The Relationship!
Website Delivered – It’s The START Of The Relationship!
WordCamp Sydney
 

Mehr von WordCamp Sydney (20)

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

Kürzlich hochgeladen

call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
ydyuyu
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
ydyuyu
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理
F
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Monica Sydney
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
ayvbos
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
ydyuyu
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Monica Sydney
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
ayvbos
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
pxcywzqs
 

Kürzlich hochgeladen (20)

APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency Dallas
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
 

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