Successfully reported this slideshow.

WordPress Debugging Tips and Tricks

1

Share

Loading in …3
×
1 of 24
1 of 24

WordPress Debugging Tips and Tricks

1

Share

Download to read offline

Everyone’s code has bugs. Luckily there are almost as many tools to help squash bugs as there are bugs to be squashed. In this talk, we’ll take a detailed look at how to debug and fix some common issues associated with WordPress sites.

We’ll explore how Chrome’s Developer Tools can help us pinpoint front end bugs.

Then, we’ll take a look under the hood with the Query Monitor plugin and see what’s going on behind the scenes with your WordPress site, including database queries, included template files, and more.

With all these tools in your toolbox, you can ensure that your code is in the best possible shape and ready to ship!

Everyone’s code has bugs. Luckily there are almost as many tools to help squash bugs as there are bugs to be squashed. In this talk, we’ll take a detailed look at how to debug and fix some common issues associated with WordPress sites.

We’ll explore how Chrome’s Developer Tools can help us pinpoint front end bugs.

Then, we’ll take a look under the hood with the Query Monitor plugin and see what’s going on behind the scenes with your WordPress site, including database queries, included template files, and more.

With all these tools in your toolbox, you can ensure that your code is in the best possible shape and ready to ship!

More Related Content

Related Books

Free with a 14 day trial from Scribd

See all

Related Audiobooks

Free with a 14 day trial from Scribd

See all

WordPress Debugging Tips and Tricks

  1. 1. WordPress Debugging Tips and Tricks KEANAN KOPPENHAVER KEANAN@DOEJO.COM ! @KKOPPENHAVER
  2. 2. This is one of those audience participation talks.
  3. 3. Step 1: Identify the problem
  4. 4. Step 2: Find the cause
  5. 5. Step 3: Find the solution
  6. 6. Step 4: Repeat
  7. 7. Part 1 | Front End
  8. 8. What are Dev Tools?
  9. 9. (Spoiler Alert: They help with debugging step 2)
  10. 10. Developer Tools • Bundled with most major browsers (Chrome, Firefox, Safari) • Allow you to inspect elements, console, network traffic and much more • You can even code in dev tools (please don’t)
  11. 11. Demo: Chrome Dev Tools
  12. 12. Bonus Tip: Safari Dev Tools work with iOS simulator
  13. 13. Part 2 | Back End
  14. 14. if ( $env == ‘development’ ) { PLEASE USE WP_DEBUG; (or WP_DEBUG_LOG) }
  15. 15. Query Monitor • Dev plugin runs in the background on every page when enabled • You can monitor much more than queries… • Hooks, theme info, request info, oh my!
  16. 16. Demo: Query Monitor
  17. 17. Let’s talk about server logs
  18. 18. [03-May-2016 21:12:56 UTC] PHP Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /Users/doejo/code/Dev/ wordpress/wp-content/themes/clientname/lib/admin-helpers.php:303 Stack trace: #0 /Users/doejo/code/Dev/wordpress/wp-includes/plugin.php(525): RootsSageExtrasrestrict_adding_tags('') #1 /Users/doejo/code/Dev/wordpress/wp-settings.php(393): do_action('init') #2 /Users/doejo/code/Dev/wordpress/wp-config.php(85): require_once('/Users/doejo/co...') #3 /Users/doejo/code/Dev/wordpress/wp-load.php(37): require_once('/Users/doejo/co...') #4 /Users/doejo/code/Dev/wordpress/wp-admin/admin.php(31): require_once('/Users/doejo/co...') #5 /Users/doejo/code/Dev/wordpress/wp-admin/post.php(12): require_once('/Users/doejo/co...') #6 {main} thrown in /Users/doejo/code/Dev/wordpress/wp-content/themes/ clientname/lib/admin-helpers.php on line 303
  19. 19. [03-May-2016 21:12:56 UTC] PHP Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /Users/doejo/code/Dev/ wordpress/wp-content/themes/clientname/lib/ admin-helpers.php:303
  20. 20. Questions? KEANAN KOPPENHAVER KEANAN@DOEJO.COM ! @KKOPPENHAVER

×