SlideShare una empresa de Scribd logo
1 de 27
Debugging Common Errors
in WordPress
By Steve Mortiboy
What we’ll learn
• Where to get help when you have a problem
• What to do before you start debugging
• Standard troubleshooting procedures
• WP_DEBUG
• Understanding error messages
• Debug Tools
WordPress Support – The Truths
• Your site is down, you need support
• Who you gonna call?
• WordPress is open source software
• It’s community developed, community supported
• There is no phone number you can call
• There is no email address you can use for help
WordPress Support Forums
• https://wordpress.org/support/
• General Support Forums
• Plugin support forums
• Theme support forums
• Other forums
WordPress Support Forums
Other Support Resources
• Google
• Plugin / Theme developer support
• IRC - https://make.wordpress.org/support/irc-support-channel/
• Twitter
• Paid support
Free vs Paid Support
• When should you pay for support?
• If you make money from WordPress
• If your site is critical to your business
• If you can afford it
How to ask for support
• http://www.wpbeginner.com/beginners-guide/
how-to-properly-ask-for-wordpress-support-and-get-it/
Before you begin debugging
• ALWAYS back up your site and your database
• Back up your WordPress files and the database
• Make sure you can restore from a backup
• Practice this a few times and be sure it always works
• Backup plugins:
https://ithemes.com/purchase/backupbuddy/
https://wordpress.org/plugins/backwpup/
https://wordpress.org/plugins/backupwordpress/
https://wordpress.org/plugins/updraftplus/
Create a test environment
• Copy your site to create a test site
• Debugging on a live site is not always a good idea
• Debug with a local install using MAMP / WAMP
• https://www.mamp.info/
• http://www.wampserver.com/en/
• Debug in a subdomain (test.mydomain.com)
• https://www.cpanel.com/media/tutorials/subdomain.htm
• Make sure you have FTP access to your test site
Isolating the cause
• Deactivate all plugins
• Switch to the default Twenty Sixteen theme
• Activate each plugin one at a time
• Activate your theme
• Does the problem occur during one of these steps
Enable WP_DEBUG
• WP_DEBUG
• define('WP_DEBUG', true);
• WP_DEBUG_LOG
• define('WP_DEBUG_LOG', true);
• Log file is found at /wp-content/debug.log
• WP_DEBUG_DISPLAY
• define('WP_DEBUG_DISPLAY', false);
• https://codex.wordpress.org/Debugging_in_WordPress
Check the debug log
• Once you’ve enabled WP_DEBUG check the log file
• The log file could contain errors, warnings and notices
• Errors and warnings are what you’re looking for
• Notices are informational only
Understanding error messages
Fatal error:
Call to undefined function my_function()
in /wp-content/themes/mytheme/functions.php
on line 12
Understanding error messages
Fatal error:
Cannot redeclare post_meta_function()
(previously declared
in /wp-content/themes/responsive/functions.php:114)
in /wp-content/themes/mytheme/functions.php on line 26
Understanding error messages
Fatal error:
Allowed memory size of 67108864 bytes exhausted
(tried to allocate 17472 bytes)
in /wp-content/plugins/myplugin/class.php
on line 198
Searching Google for errors
• Error messages in your debug log are specific to your site
• Remove specific site information such as paths before
searching
• In the example below, remove the text in black which is
site specific:
/home/mysite/public_html/wp-content/themes/mytheme/functions.php
Further reading
• http://codex.wordpress.org/
Common_WordPress_Errors#Specific_Error_Messages
The White Screen of Death
The White Screen of Death
• Don’t panic
• Disable all plugins
• Deactivate your theme
• Enable WP_DEBUG and WP_DEBUG_LOG
• Check the log files
• Ask for help
Further reading
• https://codex.wordpress.org/
Common_WordPress_Errors#The_White_Screen_of_Death
Caching
• Caching prevents good troubleshooting
• Caching can come from:
• Your browser
• Your hosting provider
• A third party service
• A performance plugin
• Empty all caches and disable all caching before
troubleshooting
Debug Plugins
• Debug Bar:
https://wordpress.org/plugins/debug-bar/
• Debug Bar Extender:
https://wordpress.org/plugins/debug-bar-extender/
• Query Monitor:
https://wordpress.org/plugins/query-monitor/
What you can do next
• Practice backing up and restoring your site
• Practice creating a test site
• Make sure you are familiar with WP_DEBUG
• Participate in the WordPress.org Support Forums
• Network with WordPress developers and users
Questions?
• Support
• Security
• Performance
• Development
• Design
• SEO

Más contenido relacionado

La actualidad más candente

WordPress 101 wcmelb 2013
WordPress 101 wcmelb 2013WordPress 101 wcmelb 2013
WordPress 101 wcmelb 2013Warren Denley
 
Introduction To WordPress
Introduction To WordPressIntroduction To WordPress
Introduction To WordPressCraig Bailey
 
GDI - Intro to WordPress
GDI - Intro to WordPressGDI - Intro to WordPress
GDI - Intro to WordPressSuzette Franck
 
Introduction to WordPress
Introduction to WordPressIntroduction to WordPress
Introduction to WordPressEunus Hosen
 
SoCal WordPress Meetup - iWeb to WordPress aka WP99
SoCal WordPress Meetup - iWeb to WordPress aka WP99SoCal WordPress Meetup - iWeb to WordPress aka WP99
SoCal WordPress Meetup - iWeb to WordPress aka WP99Noel Saw
 
WordPress Tips and Tricks (DFW Meetup)
WordPress Tips and Tricks (DFW Meetup)WordPress Tips and Tricks (DFW Meetup)
WordPress Tips and Tricks (DFW Meetup)Stephanie Leary
 
The Basics of WordPress
The Basics of WordPressThe Basics of WordPress
The Basics of WordPressThom Allen
 
WordPress Webinar Training Presentation
WordPress Webinar Training PresentationWordPress Webinar Training Presentation
WordPress Webinar Training PresentationMayeCreate Design
 
WordPress Setup and Security (Please look for the newer version!)
WordPress Setup and Security (Please look for the newer version!)WordPress Setup and Security (Please look for the newer version!)
WordPress Setup and Security (Please look for the newer version!)Michael Carnell
 
Up and Running with WordPress - Site Shack Nashville Web Design
Up and Running with WordPress - Site Shack Nashville Web DesignUp and Running with WordPress - Site Shack Nashville Web Design
Up and Running with WordPress - Site Shack Nashville Web DesignJudy Wilson
 
WordCamp KC WordPress Basics
WordCamp KC WordPress BasicsWordCamp KC WordPress Basics
WordCamp KC WordPress BasicsJim Grant
 
Introduction to Wordpress
Introduction to WordpressIntroduction to Wordpress
Introduction to WordpressReuben Rock
 
Best Friend || Worst Enemy: WordPress Multisite
Best Friend || Worst Enemy: WordPress MultisiteBest Friend || Worst Enemy: WordPress Multisite
Best Friend || Worst Enemy: WordPress MultisiteTaylor McCaslin
 
WordPress Themes Demystified
WordPress Themes DemystifiedWordPress Themes Demystified
WordPress Themes DemystifiedChris Burgess
 
Alice Phieu - WordPress For Beginners
Alice Phieu - WordPress For BeginnersAlice Phieu - WordPress For Beginners
Alice Phieu - WordPress For BeginnersAlice Phieu
 
Introduction to WordPress
Introduction to WordPressIntroduction to WordPress
Introduction to WordPressLumosTech
 
WordPress Website Creation Training Course Slides
WordPress Website Creation Training Course SlidesWordPress Website Creation Training Course Slides
WordPress Website Creation Training Course SlidesEquinet Academy
 
WordPress Hampton Roads Meetup 9-18-12
WordPress Hampton Roads Meetup 9-18-12WordPress Hampton Roads Meetup 9-18-12
WordPress Hampton Roads Meetup 9-18-12Melodie Laylor
 
Wordpress CMS tutorial and guide manual
Wordpress CMS tutorial and guide manualWordpress CMS tutorial and guide manual
Wordpress CMS tutorial and guide manualRalph Francis Cue
 

La actualidad más candente (20)

WordPress 101 wcmelb 2013
WordPress 101 wcmelb 2013WordPress 101 wcmelb 2013
WordPress 101 wcmelb 2013
 
Introduction To WordPress
Introduction To WordPressIntroduction To WordPress
Introduction To WordPress
 
GDI - Intro to WordPress
GDI - Intro to WordPressGDI - Intro to WordPress
GDI - Intro to WordPress
 
Introduction to WordPress
Introduction to WordPressIntroduction to WordPress
Introduction to WordPress
 
SoCal WordPress Meetup - iWeb to WordPress aka WP99
SoCal WordPress Meetup - iWeb to WordPress aka WP99SoCal WordPress Meetup - iWeb to WordPress aka WP99
SoCal WordPress Meetup - iWeb to WordPress aka WP99
 
WordPress Tips and Tricks (DFW Meetup)
WordPress Tips and Tricks (DFW Meetup)WordPress Tips and Tricks (DFW Meetup)
WordPress Tips and Tricks (DFW Meetup)
 
The Basics of WordPress
The Basics of WordPressThe Basics of WordPress
The Basics of WordPress
 
WordPress Webinar Training Presentation
WordPress Webinar Training PresentationWordPress Webinar Training Presentation
WordPress Webinar Training Presentation
 
WordPress Setup and Security (Please look for the newer version!)
WordPress Setup and Security (Please look for the newer version!)WordPress Setup and Security (Please look for the newer version!)
WordPress Setup and Security (Please look for the newer version!)
 
Up and Running with WordPress - Site Shack Nashville Web Design
Up and Running with WordPress - Site Shack Nashville Web DesignUp and Running with WordPress - Site Shack Nashville Web Design
Up and Running with WordPress - Site Shack Nashville Web Design
 
WordCamp KC WordPress Basics
WordCamp KC WordPress BasicsWordCamp KC WordPress Basics
WordCamp KC WordPress Basics
 
Introduction to Wordpress
Introduction to WordpressIntroduction to Wordpress
Introduction to Wordpress
 
Best Friend || Worst Enemy: WordPress Multisite
Best Friend || Worst Enemy: WordPress MultisiteBest Friend || Worst Enemy: WordPress Multisite
Best Friend || Worst Enemy: WordPress Multisite
 
WordPress Themes Demystified
WordPress Themes DemystifiedWordPress Themes Demystified
WordPress Themes Demystified
 
Alice Phieu - WordPress For Beginners
Alice Phieu - WordPress For BeginnersAlice Phieu - WordPress For Beginners
Alice Phieu - WordPress For Beginners
 
Introduction to WordPress
Introduction to WordPressIntroduction to WordPress
Introduction to WordPress
 
Beginning WordPress
Beginning WordPressBeginning WordPress
Beginning WordPress
 
WordPress Website Creation Training Course Slides
WordPress Website Creation Training Course SlidesWordPress Website Creation Training Course Slides
WordPress Website Creation Training Course Slides
 
WordPress Hampton Roads Meetup 9-18-12
WordPress Hampton Roads Meetup 9-18-12WordPress Hampton Roads Meetup 9-18-12
WordPress Hampton Roads Meetup 9-18-12
 
Wordpress CMS tutorial and guide manual
Wordpress CMS tutorial and guide manualWordpress CMS tutorial and guide manual
Wordpress CMS tutorial and guide manual
 

Destacado

Outside the WordPress Bubble
Outside the WordPress BubbleOutside the WordPress Bubble
Outside the WordPress BubbleJohn Eckman
 
Money Making Blogs
Money Making BlogsMoney Making Blogs
Money Making BlogsChris Lema
 
Power Up Your Non-Profit Website With WordPress
Power Up Your Non-Profit Website With WordPressPower Up Your Non-Profit Website With WordPress
Power Up Your Non-Profit Website With WordPressRaymund Mitchell
 
Adventures in Non-Profit Web Design
Adventures in Non-Profit Web DesignAdventures in Non-Profit Web Design
Adventures in Non-Profit Web DesignMelodie Laylor
 
WCCHS: Responsive Design with WordPress
WCCHS: Responsive Design with WordPressWCCHS: Responsive Design with WordPress
WCCHS: Responsive Design with WordPressJoe Casabona
 
Introduction to WordPress Multisite
Introduction to WordPress MultisiteIntroduction to WordPress Multisite
Introduction to WordPress MultisiteCraig Taylor
 
BuddyPress Presentation - WCPhilly
BuddyPress Presentation - WCPhillyBuddyPress Presentation - WCPhilly
BuddyPress Presentation - WCPhillyTimothy F McKenna
 
Rapid application development for WordPress using AWF
Rapid application development for WordPress using AWFRapid application development for WordPress using AWF
Rapid application development for WordPress using AWFTim Plummer
 
Como oferecer boas experiências online com a criação de sites de qualidade - ...
Como oferecer boas experiências online com a criação de sites de qualidade - ...Como oferecer boas experiências online com a criação de sites de qualidade - ...
Como oferecer boas experiências online com a criação de sites de qualidade - ...Keyla Silva
 
Congrats. You're having a WordPress Site. WordCamp Philly
Congrats. You're having a WordPress Site. WordCamp PhillyCongrats. You're having a WordPress Site. WordCamp Philly
Congrats. You're having a WordPress Site. WordCamp PhillyTrailer Trash Design
 
Work, Life, Blog Balance
Work, Life, Blog BalanceWork, Life, Blog Balance
Work, Life, Blog BalanceAlicia Murray
 
Understanding WordPress Filters and Actions
Understanding WordPress Filters and ActionsUnderstanding WordPress Filters and Actions
Understanding WordPress Filters and ActionsIan Wilson
 
WordPress Community: Choose your own adventure
WordPress Community: Choose your own adventureWordPress Community: Choose your own adventure
WordPress Community: Choose your own adventureAndrea Middleton
 
WordPress 101 - Foundation Friday at WordCamp Chicago 2014 #WCChi
WordPress 101 - Foundation Friday at WordCamp Chicago 2014 #WCChiWordPress 101 - Foundation Friday at WordCamp Chicago 2014 #WCChi
WordPress 101 - Foundation Friday at WordCamp Chicago 2014 #WCChiShanta Nathwani
 
Intro to WordPress Child Themes
Intro to WordPress Child ThemesIntro to WordPress Child Themes
Intro to WordPress Child Themesvegasgeek
 
Converting Website Visitors Into Business Leads
Converting Website Visitors Into Business LeadsConverting Website Visitors Into Business Leads
Converting Website Visitors Into Business LeadsScott Towne
 
Testing Made Easy
Testing Made EasyTesting Made Easy
Testing Made EasyMicah Wood
 

Destacado (20)

Outside the WordPress Bubble
Outside the WordPress BubbleOutside the WordPress Bubble
Outside the WordPress Bubble
 
WordPress as a CMS
WordPress as a CMSWordPress as a CMS
WordPress as a CMS
 
Money Making Blogs
Money Making BlogsMoney Making Blogs
Money Making Blogs
 
Power Up Your Non-Profit Website With WordPress
Power Up Your Non-Profit Website With WordPressPower Up Your Non-Profit Website With WordPress
Power Up Your Non-Profit Website With WordPress
 
WordCamp 2015
WordCamp 2015WordCamp 2015
WordCamp 2015
 
Adventures in Non-Profit Web Design
Adventures in Non-Profit Web DesignAdventures in Non-Profit Web Design
Adventures in Non-Profit Web Design
 
WCCHS: Responsive Design with WordPress
WCCHS: Responsive Design with WordPressWCCHS: Responsive Design with WordPress
WCCHS: Responsive Design with WordPress
 
Introduction to WordPress Multisite
Introduction to WordPress MultisiteIntroduction to WordPress Multisite
Introduction to WordPress Multisite
 
BuddyPress Presentation - WCPhilly
BuddyPress Presentation - WCPhillyBuddyPress Presentation - WCPhilly
BuddyPress Presentation - WCPhilly
 
Rapid application development for WordPress using AWF
Rapid application development for WordPress using AWFRapid application development for WordPress using AWF
Rapid application development for WordPress using AWF
 
Como oferecer boas experiências online com a criação de sites de qualidade - ...
Como oferecer boas experiências online com a criação de sites de qualidade - ...Como oferecer boas experiências online com a criação de sites de qualidade - ...
Como oferecer boas experiências online com a criação de sites de qualidade - ...
 
Congrats. You're having a WordPress Site. WordCamp Philly
Congrats. You're having a WordPress Site. WordCamp PhillyCongrats. You're having a WordPress Site. WordCamp Philly
Congrats. You're having a WordPress Site. WordCamp Philly
 
Work, Life, Blog Balance
Work, Life, Blog BalanceWork, Life, Blog Balance
Work, Life, Blog Balance
 
Understanding WordPress Filters and Actions
Understanding WordPress Filters and ActionsUnderstanding WordPress Filters and Actions
Understanding WordPress Filters and Actions
 
WordPress Community: Choose your own adventure
WordPress Community: Choose your own adventureWordPress Community: Choose your own adventure
WordPress Community: Choose your own adventure
 
WordPress 101 - Foundation Friday at WordCamp Chicago 2014 #WCChi
WordPress 101 - Foundation Friday at WordCamp Chicago 2014 #WCChiWordPress 101 - Foundation Friday at WordCamp Chicago 2014 #WCChi
WordPress 101 - Foundation Friday at WordCamp Chicago 2014 #WCChi
 
Intro to WordPress Child Themes
Intro to WordPress Child ThemesIntro to WordPress Child Themes
Intro to WordPress Child Themes
 
Converting Website Visitors Into Business Leads
Converting Website Visitors Into Business LeadsConverting Website Visitors Into Business Leads
Converting Website Visitors Into Business Leads
 
Dev Work Flow
Dev Work FlowDev Work Flow
Dev Work Flow
 
Testing Made Easy
Testing Made EasyTesting Made Easy
Testing Made Easy
 

Similar a Debugging common errors in WordPress by Steve Mortiboy

WordPress Plugins and Security
WordPress Plugins and SecurityWordPress Plugins and Security
WordPress Plugins and SecurityThink Media Inc.
 
The WordPress Hosting Decision: It All Starts Here
The WordPress Hosting Decision: It All Starts HereThe WordPress Hosting Decision: It All Starts Here
The WordPress Hosting Decision: It All Starts HereBusiness Vitality LLC
 
Emergency WordPress Troubleshooting
Emergency WordPress TroubleshootingEmergency WordPress Troubleshooting
Emergency WordPress TroubleshootingTiffany Bridge
 
Battling the WSOD - A Tech Support Tale
Battling the WSOD - A Tech Support TaleBattling the WSOD - A Tech Support Tale
Battling the WSOD - A Tech Support TaleKayleigh Thorpe
 
Be Securious – Hack Your Own Site for Better Security
Be Securious –  Hack Your Own Site for Better SecurityBe Securious –  Hack Your Own Site for Better Security
Be Securious – Hack Your Own Site for Better Securitysecuriously
 
Becoming A WordPress Beta Tester
Becoming A WordPress Beta TesterBecoming A WordPress Beta Tester
Becoming A WordPress Beta TesterKim Parsell
 
Debugging WordPress for Site Owners
Debugging WordPress for Site OwnersDebugging WordPress for Site Owners
Debugging WordPress for Site OwnersAndrew Wikel
 
Your Site Has Been Hacked, Now What?
Your Site Has Been Hacked, Now What?Your Site Has Been Hacked, Now What?
Your Site Has Been Hacked, Now What?Michele Butcher-Jones
 
15 Essential WordPress Plugins (and 5 That Will Just Blow Your Mind)
15 Essential WordPress Plugins (and 5 That Will Just Blow Your Mind)15 Essential WordPress Plugins (and 5 That Will Just Blow Your Mind)
15 Essential WordPress Plugins (and 5 That Will Just Blow Your Mind)Mykl Roventine
 
Protect Your WordPress From The Inside Out
Protect Your WordPress From The Inside OutProtect Your WordPress From The Inside Out
Protect Your WordPress From The Inside OutSiteGround.com
 
Rapid WordPress theme development
Rapid WordPress theme developmentRapid WordPress theme development
Rapid WordPress theme developmentJonny Allbut
 
WordPress Theme Reviewers Team
WordPress Theme Reviewers TeamWordPress Theme Reviewers Team
WordPress Theme Reviewers TeamMario Peshev
 
Most widely used WordPress tips and tricks of 2016
Most widely used WordPress tips and tricks of 2016Most widely used WordPress tips and tricks of 2016
Most widely used WordPress tips and tricks of 2016Reegan
 
WordCamp Ottawa 2016: Updates
WordCamp Ottawa 2016: UpdatesWordCamp Ottawa 2016: Updates
WordCamp Ottawa 2016: Updatesthe___miked
 
WordPress Security
WordPress SecurityWordPress Security
WordPress SecurityNathan Platt
 
Intro to WordPress Plugins
Intro to WordPress PluginsIntro to WordPress Plugins
Intro to WordPress Pluginszamoose
 
WordPress Security and Best Practices
WordPress Security and Best PracticesWordPress Security and Best Practices
WordPress Security and Best PracticesRobert Vidal
 

Similar a Debugging common errors in WordPress by Steve Mortiboy (20)

WordPress Plugins and Security
WordPress Plugins and SecurityWordPress Plugins and Security
WordPress Plugins and Security
 
The WordPress Hosting Decision: It All Starts Here
The WordPress Hosting Decision: It All Starts HereThe WordPress Hosting Decision: It All Starts Here
The WordPress Hosting Decision: It All Starts Here
 
Emergency WordPress Troubleshooting
Emergency WordPress TroubleshootingEmergency WordPress Troubleshooting
Emergency WordPress Troubleshooting
 
Battling the WSOD - A Tech Support Tale
Battling the WSOD - A Tech Support TaleBattling the WSOD - A Tech Support Tale
Battling the WSOD - A Tech Support Tale
 
Be Securious – Hack Your Own Site for Better Security
Be Securious –  Hack Your Own Site for Better SecurityBe Securious –  Hack Your Own Site for Better Security
Be Securious – Hack Your Own Site for Better Security
 
Becoming A WordPress Beta Tester
Becoming A WordPress Beta TesterBecoming A WordPress Beta Tester
Becoming A WordPress Beta Tester
 
I Have My WordPress Site Now What?
I Have My WordPress Site Now What?I Have My WordPress Site Now What?
I Have My WordPress Site Now What?
 
Debugging WordPress for Site Owners
Debugging WordPress for Site OwnersDebugging WordPress for Site Owners
Debugging WordPress for Site Owners
 
Your Site Has Been Hacked, Now What?
Your Site Has Been Hacked, Now What?Your Site Has Been Hacked, Now What?
Your Site Has Been Hacked, Now What?
 
15 Essential WordPress Plugins (and 5 That Will Just Blow Your Mind)
15 Essential WordPress Plugins (and 5 That Will Just Blow Your Mind)15 Essential WordPress Plugins (and 5 That Will Just Blow Your Mind)
15 Essential WordPress Plugins (and 5 That Will Just Blow Your Mind)
 
WordPress Workshop
WordPress WorkshopWordPress Workshop
WordPress Workshop
 
Protect Your WordPress From The Inside Out
Protect Your WordPress From The Inside OutProtect Your WordPress From The Inside Out
Protect Your WordPress From The Inside Out
 
Rapid WordPress theme development
Rapid WordPress theme developmentRapid WordPress theme development
Rapid WordPress theme development
 
WordPress Theme Reviewers Team
WordPress Theme Reviewers TeamWordPress Theme Reviewers Team
WordPress Theme Reviewers Team
 
WordPress Complete Tutorial
WordPress Complete TutorialWordPress Complete Tutorial
WordPress Complete Tutorial
 
Most widely used WordPress tips and tricks of 2016
Most widely used WordPress tips and tricks of 2016Most widely used WordPress tips and tricks of 2016
Most widely used WordPress tips and tricks of 2016
 
WordCamp Ottawa 2016: Updates
WordCamp Ottawa 2016: UpdatesWordCamp Ottawa 2016: Updates
WordCamp Ottawa 2016: Updates
 
WordPress Security
WordPress SecurityWordPress Security
WordPress Security
 
Intro to WordPress Plugins
Intro to WordPress PluginsIntro to WordPress Plugins
Intro to WordPress Plugins
 
WordPress Security and Best Practices
WordPress Security and Best PracticesWordPress Security and Best Practices
WordPress Security and Best Practices
 

Más de Steve Mortiboy

Successfully Implementing Open Graph
Successfully Implementing Open GraphSuccessfully Implementing Open Graph
Successfully Implementing Open GraphSteve Mortiboy
 
Optimizing images in WordPress to improve site performance and sSEO
Optimizing images in WordPress to improve site performance and sSEOOptimizing images in WordPress to improve site performance and sSEO
Optimizing images in WordPress to improve site performance and sSEOSteve Mortiboy
 
Understanding SEO in 2018 by Steve Mortiboy
Understanding SEO in 2018 by Steve MortiboyUnderstanding SEO in 2018 by Steve Mortiboy
Understanding SEO in 2018 by Steve MortiboySteve Mortiboy
 
Local SEO - Getting your local business on google
Local SEO - Getting your local business on googleLocal SEO - Getting your local business on google
Local SEO - Getting your local business on googleSteve Mortiboy
 
Fixing common problems with SEO by Steve Mortiboy
Fixing common problems with SEO by Steve MortiboyFixing common problems with SEO by Steve Mortiboy
Fixing common problems with SEO by Steve MortiboySteve Mortiboy
 
SEO for Business Owners by Steve Mortiboy
SEO for Business Owners by Steve MortiboySEO for Business Owners by Steve Mortiboy
SEO for Business Owners by Steve MortiboySteve Mortiboy
 
Successfully implementing open graph by steve mortiboy
Successfully implementing open graph by steve mortiboySuccessfully implementing open graph by steve mortiboy
Successfully implementing open graph by steve mortiboySteve Mortiboy
 
WordPress e-Commerce by Steve Mortiboy
WordPress e-Commerce by Steve MortiboyWordPress e-Commerce by Steve Mortiboy
WordPress e-Commerce by Steve MortiboySteve Mortiboy
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress developmentSteve Mortiboy
 
WordPress SEO for Content Authors
WordPress SEO for Content AuthorsWordPress SEO for Content Authors
WordPress SEO for Content AuthorsSteve Mortiboy
 

Más de Steve Mortiboy (10)

Successfully Implementing Open Graph
Successfully Implementing Open GraphSuccessfully Implementing Open Graph
Successfully Implementing Open Graph
 
Optimizing images in WordPress to improve site performance and sSEO
Optimizing images in WordPress to improve site performance and sSEOOptimizing images in WordPress to improve site performance and sSEO
Optimizing images in WordPress to improve site performance and sSEO
 
Understanding SEO in 2018 by Steve Mortiboy
Understanding SEO in 2018 by Steve MortiboyUnderstanding SEO in 2018 by Steve Mortiboy
Understanding SEO in 2018 by Steve Mortiboy
 
Local SEO - Getting your local business on google
Local SEO - Getting your local business on googleLocal SEO - Getting your local business on google
Local SEO - Getting your local business on google
 
Fixing common problems with SEO by Steve Mortiboy
Fixing common problems with SEO by Steve MortiboyFixing common problems with SEO by Steve Mortiboy
Fixing common problems with SEO by Steve Mortiboy
 
SEO for Business Owners by Steve Mortiboy
SEO for Business Owners by Steve MortiboySEO for Business Owners by Steve Mortiboy
SEO for Business Owners by Steve Mortiboy
 
Successfully implementing open graph by steve mortiboy
Successfully implementing open graph by steve mortiboySuccessfully implementing open graph by steve mortiboy
Successfully implementing open graph by steve mortiboy
 
WordPress e-Commerce by Steve Mortiboy
WordPress e-Commerce by Steve MortiboyWordPress e-Commerce by Steve Mortiboy
WordPress e-Commerce by Steve Mortiboy
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress development
 
WordPress SEO for Content Authors
WordPress SEO for Content AuthorsWordPress SEO for Content Authors
WordPress SEO for Content Authors
 

Último

Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxDyna Gilbert
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书rnrncn29
 
Company Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptxCompany Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptxMario
 
ETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptxETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptxNIMMANAGANTI RAMAKRISHNA
 
TRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptxTRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptxAndrieCagasanAkio
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书rnrncn29
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predieusebiomeyer
 
IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119APNIC
 
Unidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxUnidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxmibuzondetrabajo
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书zdzoqco
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa494f574xmv
 

Último (11)

Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptx
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
 
Company Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptxCompany Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptx
 
ETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptxETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptx
 
TRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptxTRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptx
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predi
 
IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119
 
Unidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxUnidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptx
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa
 

Debugging common errors in WordPress by Steve Mortiboy

  • 1. Debugging Common Errors in WordPress By Steve Mortiboy
  • 2. What we’ll learn • Where to get help when you have a problem • What to do before you start debugging • Standard troubleshooting procedures • WP_DEBUG • Understanding error messages • Debug Tools
  • 3. WordPress Support – The Truths • Your site is down, you need support • Who you gonna call? • WordPress is open source software • It’s community developed, community supported • There is no phone number you can call • There is no email address you can use for help
  • 4. WordPress Support Forums • https://wordpress.org/support/ • General Support Forums • Plugin support forums • Theme support forums • Other forums
  • 6. Other Support Resources • Google • Plugin / Theme developer support • IRC - https://make.wordpress.org/support/irc-support-channel/ • Twitter • Paid support
  • 7. Free vs Paid Support • When should you pay for support? • If you make money from WordPress • If your site is critical to your business • If you can afford it
  • 8. How to ask for support • http://www.wpbeginner.com/beginners-guide/ how-to-properly-ask-for-wordpress-support-and-get-it/
  • 9. Before you begin debugging • ALWAYS back up your site and your database • Back up your WordPress files and the database • Make sure you can restore from a backup • Practice this a few times and be sure it always works • Backup plugins: https://ithemes.com/purchase/backupbuddy/ https://wordpress.org/plugins/backwpup/ https://wordpress.org/plugins/backupwordpress/ https://wordpress.org/plugins/updraftplus/
  • 10. Create a test environment • Copy your site to create a test site • Debugging on a live site is not always a good idea • Debug with a local install using MAMP / WAMP • https://www.mamp.info/ • http://www.wampserver.com/en/ • Debug in a subdomain (test.mydomain.com) • https://www.cpanel.com/media/tutorials/subdomain.htm • Make sure you have FTP access to your test site
  • 11. Isolating the cause • Deactivate all plugins • Switch to the default Twenty Sixteen theme • Activate each plugin one at a time • Activate your theme • Does the problem occur during one of these steps
  • 12. Enable WP_DEBUG • WP_DEBUG • define('WP_DEBUG', true); • WP_DEBUG_LOG • define('WP_DEBUG_LOG', true); • Log file is found at /wp-content/debug.log • WP_DEBUG_DISPLAY • define('WP_DEBUG_DISPLAY', false); • https://codex.wordpress.org/Debugging_in_WordPress
  • 13. Check the debug log • Once you’ve enabled WP_DEBUG check the log file • The log file could contain errors, warnings and notices • Errors and warnings are what you’re looking for • Notices are informational only
  • 14. Understanding error messages Fatal error: Call to undefined function my_function() in /wp-content/themes/mytheme/functions.php on line 12
  • 15. Understanding error messages Fatal error: Cannot redeclare post_meta_function() (previously declared in /wp-content/themes/responsive/functions.php:114) in /wp-content/themes/mytheme/functions.php on line 26
  • 16. Understanding error messages Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 17472 bytes) in /wp-content/plugins/myplugin/class.php on line 198
  • 17. Searching Google for errors • Error messages in your debug log are specific to your site • Remove specific site information such as paths before searching • In the example below, remove the text in black which is site specific: /home/mysite/public_html/wp-content/themes/mytheme/functions.php
  • 19. The White Screen of Death
  • 20. The White Screen of Death • Don’t panic • Disable all plugins • Deactivate your theme • Enable WP_DEBUG and WP_DEBUG_LOG • Check the log files • Ask for help
  • 22. Caching • Caching prevents good troubleshooting • Caching can come from: • Your browser • Your hosting provider • A third party service • A performance plugin • Empty all caches and disable all caching before troubleshooting
  • 23. Debug Plugins • Debug Bar: https://wordpress.org/plugins/debug-bar/ • Debug Bar Extender: https://wordpress.org/plugins/debug-bar-extender/ • Query Monitor: https://wordpress.org/plugins/query-monitor/
  • 24. What you can do next • Practice backing up and restoring your site • Practice creating a test site • Make sure you are familiar with WP_DEBUG • Participate in the WordPress.org Support Forums • Network with WordPress developers and users
  • 26.
  • 27. • Support • Security • Performance • Development • Design • SEO

Notas del editor

  1. Welcome Introduction
  2. In this session I’ll discuss: Where to get help What to do before starting Standard troubleshooting steps How to use WP-DEBUG Breaking down and understanding those pesky error messages Various tools you can use for debugging So why should this matter to you? You may have been here - It’s 4pm on a Friday and you just made a change to your mission critical site and now it’s down This session will help you get through this nightmare
  3. So let’s start by talking about some truths about WordPress support We all agree WordPress is great, we love it It’s free, it’s open source, it’s well developed, it’s highly customizable with plugins and themes But it’s community developed and community supported There’s no support team you can call or email Take a second to look around you Everyone here is part of the WordPress community Which means everyone here is part of the support community You all know something about WordPress that can help someone less knowledgeable And when you need help you look for help from someone more knowledgeable
  4. I’m sure you’re all very familiar with the WordPress.org support forums You can find general support, support for plugins and themes in the WordPress.org repo
  5. Here are the forums On left in the sidebar of each forum page is the Forum Search Perhaps not the best search in the world but it’s useful when searching for a specific error message You can also perform a site search in Google
  6. Here are some other resources you can use for support
  7. We all like free, but we can’t expect everything to be free Free could mean community support Paid support in general will be better than free support So when should you pay for support? If you make money from WordPress, you sell a service or product that uses WordPress then you should pay for support Ask yourself if it’s wrong to change your client for your time but then expect a plugin or theme developer to give their time for free If your site is for a business and especially if it’s important to your business then you should pay for support Your site generates revenue or is part of your sales and marketing so shouldn’t that mean it’s important enough that you pay for better support If you can afford it, then pay Too many great developers have left the WordPress community and their plugins or themes have gone away because they couldn’t sustain a business model where they gave their time away for free If you don’t want to see that continue to happen, perhaps to a plugin or theme you use, then help the developer out by paying for support
  8. It’s worth checking out this blog post by WP Beginner about how to ask for support Too often I see someone ask for help in a manner that is unpleasant If you’re respectful and helpful, you should receive the same in return
  9. Now we’ve discussed support options, let’s move on to debugging Before you begin troubleshooting anything ALWAYS back up your site I recommend a backup plugin that backs up the files and database I also recommend you make sure you know how to restore from your backup Practice the backup and restore process a few times to make sure you’re comfortable with it and that it works every time I use BackupBuddy from iThemes but there are other free and paid backup plugins available
  10. Now you’ve backed up your site you can clone it by restoring the backup to a test site Do you really want to be debugging and outputting messages on your live site? Use a local environment with MAMP or WAMP Or create a subdomain on your hosting and restore your site there Creating a subdomain is easy in cPanel and I strongly recommend learning how to do this Make sure you have FTP access to your site, you’ll need this to set WP_DEBUG and access the debug log
  11. Whenever you start debugging, there are a set of standard steps you should always follow This will help you isolate the cause of your problem The steps are: Deactivate all plugins If the problem is resolved then you know it was probably caused by one of the plugins you deactivated Switch to the default Twenty Sixteen theme If the problem is resolved the you know is was probably caused by your theme Activate each plugin one at a time until the problem occurs The likelihood is that the plugin you activated when the problem reoccurred is the plugin that’s causing the issue If you’ve deactivated all plugins and switched to the Twenty Sixteen theme and you still see the problem, you may need to reinstall WordPress
  12. WP_DEBUG is a tool to help you debug problems on your site You enable this is your wp-config.php file The three main constants we can use in the wp-config.php file for debugging are: WP_DEBUG – when you set this to true it will trigger WordPress debug mode and any errors will be output to your browser WP_DEBUG_LOG – is a companion to WP_DEBUG. When you set this to true, WordPress will output debug information to a log file kept in the /wp-content/ directory WP_DEBUG_DISPLAY – is another companion to WP_DEBUG. When you set this to false, errors will not be output to the screen This last constant is useful if you’re debugging a live website and you don’t want the public to see ugly errors all over the screen Always disable WP_DEBUG once you’re done
  13. Now that you’ve enabled WP_DEBUG, check the log file for error messages The log may contain a lot of information so it’s important to know what to look for You may see errors, warnings and notices Errors and warnings indicate a problem that you need to investigate Notices are informational and can usually be ignored
  14. Let’s look at a few examples of some error messages We’ll break down each one so you can understand what they mean In this error we see it says we have an undefined function In other words, something is looking for a function that doesn’t exist We see a path to a functions.php file in our theme We see the line number in that file where the call is being made So if we were to look at line 12 of the functions.php file in our mytheme theme we’d see code that’s calling a function called my_function but my_function doesn’t exist As this is a theme problem, we’d contact the theme developer and ask for help Remember to Google for the error message first to see if it’s being reported by other users and if the theme developer has responded with a fix
  15. In this error we see it says that a function cannot be redeclared In other words, the function has already been used by something else We see a line number in a functions.php file where the function can be found And we see a line number in another file where the function can be found again You cannot have two functions with the same name or you’ll see this error As this is a theme issue, we can ask the theme developer for support Again, we’d Google the error message first to see if it’s already been reported and fixed or being fixed
  16. In this last example, we see that memory has been exhausted In other words, WordPress has run out of memory We can see that it ran out of memory when trying to run a plugin We could try increasing memory, there are instructions in the WordPress documentation on how to do this Or we could follow the standard troubleshooting steps earlier to see if this is a plugin conflict We may also want to contact the plugin developer and ask for help Remember to Google the error message first to see if it’s a known issue
  17. When you paste the error message in Google you may not get a result because the full message will be specific to your website So be selective what you paste into Google In the example here, the part of the file path in black is specific to only our site Remove that text from the error before you Google it and just leave the part of the path starting with /wp-content
  18. Here’s a link to further help on the WordPress Codex
  19. You may have heard of or experienced the dreaded white screen of death It can be the most intimidating of errors in WordPress You do something such as activate a plugin or theme or save a change you made to a file and reload your web page and you get a blank screen Don’t worry, there may be information there but it’s hidden from view
  20. There’s a standard process many developers will recommend you follow First, disable all plugins You can do this by FTPing to your server, navigate to the /wp-content/ directory and renaming the plugins directory to old-plugins Next, deactivate your theme by renaming it to old-theme, do this using FTP and navigating to the /wp-content/themes/ directory Next, enable WP_DEBUG and WP_DEBUG_LOG and make sure WP_DEBUG_DISPLAY is set to true so that errors will be displayed on the screen Next, refresh the browser and see if any error messages appear on the screen or in the log file in /wp-content/ Finally, ask for help in the WordPress support forums
  21. You can find help with the white screen of death on the WordPress Codex
  22. Whenever you’re debugging, you have to be aware of caching Caching can happen in your browser, so clear use an incognito window and clear your browser cache Caching can come from your hosting provider and they might not tell you what caching they do Caching can come from a third party service provider such as CloudFlare or a CDN service Caching can come from a plugin such as WP Super Cache Make sure you empty all caches on any caching service and on any caching plugin and then disable caching You can sometimes see if a page is cached by looking at the source code of the page and searching for the word cache I have a couple of examples where caching can seriously frustrate your troubleshooting effort --- WP Engine caching of the WP-Admin --- Caching of PHP files by a hosting provider
  23. If you want to take your debugging to the next level, there are also some great plugins for debugging WordPress Debug Bar is written by the WordPress team, it adds a debug menu to the admin bar that helpful debugging information Debug Bar Extender is a companion to Debug Bar and adds some more features Query Monitor is a popular plugin amongst developers that displays information about database queries, memory usage and other information It’s worthwhile asking around the community to see what different developers use and recommend
  24. Practice your backup and restore process You want to be very comfortable with this process so that when you need it, you can do it easily Practice creating a test site both locally on MAMP or WAMP and on your hosting using a sub-domain Again, make sure you’re comfortable with this process and can repeat both these processes with any site Familiarize yourself with using WP_DEBUG and the debug log Participate in the WordPress.org Support Forums This will help you practice everything above and help others Use events like WordCamps and Meetups as well as online communities to network with people who can answer your questions and help you practice your skils