debugging and profiling in wordpress: what is my site doing?

42
Debugging and Profiling in WordPress: What Is My Site Doing? Peter Baylies aka @pbaylies on Twitter Semper Fi Web Design

Upload: peter-baylies

Post on 07-Dec-2014

295 views

Category:

Internet


9 download

DESCRIPTION

An survey of debugging and profiling tools and methodologies for WordPress.

TRANSCRIPT

Page 1: Debugging and Profiling in WordPress: What is My Site Doing?

Debugging and Profiling in WordPress:" " " What Is My Site Doing?

Peter Baylies aka @pbaylies on Twitter

Semper Fi Web Design

Page 2: Debugging and Profiling in WordPress: What is My Site Doing?

Methodology• Troubleshooting - be systematic

• Test against a development server

• Deactivate conflicting plugins

• Test against a default theme

• When all else fails...

Page 3: Debugging and Profiling in WordPress: What is My Site Doing?

Getting Started• Edit your wp-config.php

• define( 'WP_DEBUG', true );

• define( 'WP_DEBUG_DISPLAY', false );

• Other options?

Page 4: Debugging and Profiling in WordPress: What is My Site Doing?
Page 5: Debugging and Profiling in WordPress: What is My Site Doing?

http://codex.wordpress.org/Debugging_in_WordPress !WP_DEBUG_LOG - debug.log file in /wp-content/ SCRIPT_DEBUG - use dev .css and .js for core SAVEQUERIES - track MySQL queries !

Advice and plugin recommendations too!

Page 6: Debugging and Profiling in WordPress: What is My Site Doing?
Page 7: Debugging and Profiling in WordPress: What is My Site Doing?

Debugging Tools• Debug Bar - It's like FireBug for WordPress.

• Debug Bar Extender - with even more features.

• Query Monitor - Another take on both and more.

• Collect all three!

• ...yes, there are lots more.

Page 8: Debugging and Profiling in WordPress: What is My Site Doing?
Page 9: Debugging and Profiling in WordPress: What is My Site Doing?
Page 10: Debugging and Profiling in WordPress: What is My Site Doing?
Page 11: Debugging and Profiling in WordPress: What is My Site Doing?
Page 12: Debugging and Profiling in WordPress: What is My Site Doing?
Page 13: Debugging and Profiling in WordPress: What is My Site Doing?

What is 'Profiling'?• extensive performance metrics

• data collection, data analysis

• can track function calls, runtimes, control flow

Page 14: Debugging and Profiling in WordPress: What is My Site Doing?
Page 15: Debugging and Profiling in WordPress: What is My Site Doing?

P3 Plugin Profiler• Made by GoDaddy

• Generates pretty graphs!

• It's ok I guess?

• Be careful interpreting its advice.

• Honestly - this isn't a real profiling tool at all.

Page 16: Debugging and Profiling in WordPress: What is My Site Doing?
Page 17: Debugging and Profiling in WordPress: What is My Site Doing?
Page 18: Debugging and Profiling in WordPress: What is My Site Doing?
Page 19: Debugging and Profiling in WordPress: What is My Site Doing?
Page 20: Debugging and Profiling in WordPress: What is My Site Doing?
Page 21: Debugging and Profiling in WordPress: What is My Site Doing?

XHProf• Made by Facebook

• It's a PHP extension - some assembly required.

• There's a WordPress plugin to help you use it: WP XHProf Profiler"

• Execution time and memory use of all functions

• Shows a call graph of all functions

Page 22: Debugging and Profiling in WordPress: What is My Site Doing?
Page 23: Debugging and Profiling in WordPress: What is My Site Doing?
Page 24: Debugging and Profiling in WordPress: What is My Site Doing?
Page 25: Debugging and Profiling in WordPress: What is My Site Doing?
Page 26: Debugging and Profiling in WordPress: What is My Site Doing?
Page 27: Debugging and Profiling in WordPress: What is My Site Doing?
Page 28: Debugging and Profiling in WordPress: What is My Site Doing?
Page 29: Debugging and Profiling in WordPress: What is My Site Doing?

XDebug• Full-featured PHP debugging extension.

• Again, some assembly required.

• But once you have it working, it's very handy.

• Can integrate with many code editors.

• In theory can even do breakpoints (!)

• http://xdebug.org/docs/remote

Page 30: Debugging and Profiling in WordPress: What is My Site Doing?
Page 31: Debugging and Profiling in WordPress: What is My Site Doing?
Page 32: Debugging and Profiling in WordPress: What is My Site Doing?
Page 33: Debugging and Profiling in WordPress: What is My Site Doing?
Page 34: Debugging and Profiling in WordPress: What is My Site Doing?
Page 35: Debugging and Profiling in WordPress: What is My Site Doing?
Page 36: Debugging and Profiling in WordPress: What is My Site Doing?
Page 37: Debugging and Profiling in WordPress: What is My Site Doing?
Page 38: Debugging and Profiling in WordPress: What is My Site Doing?
Page 39: Debugging and Profiling in WordPress: What is My Site Doing?
Page 40: Debugging and Profiling in WordPress: What is My Site Doing?
Page 41: Debugging and Profiling in WordPress: What is My Site Doing?

Live Demo!• This is the fun part.

• Which of these would you like to see more of?

• Where did I confuse you the most?

Page 42: Debugging and Profiling in WordPress: What is My Site Doing?

Questions?• Thank you!

• Find this presentation on SlideShare

• Find me on Twitter: @pbaylies