The document discusses debugging WordPress websites. It provides tips on examining server logs to find errors, enabling WP_DEBUG in wp-config.php to output debugging information, and using the wp-cli command line interface to manage plugins, themes and check for errors. Common errors like "headers already sent" are presented along with solutions. The presenter's contact details and promise to share the slides on social media are listed at the end.
1. D E B U G G I N G W O R D P R E S S
B R E C H T RY C K A E R T
2. B R E C H T
RY C K A E R T
• Works at combell.com
• WP user since 1.5
• Passionate about
WordPress Security &
Performance
@brechtryckaert
brechtryckaert.com
3. W H E N L A U N C H I N G
Y O U R N E W W E B S I T E
4. O R W H E N U P D AT I N G Y O U R
P L U G I N S O R T H E M E S
5. … O R E V E N M I G R AT I N G
Y O U R W E B S I T E …
6.
7.
8. W H O ’ S E X P E R I E N C E D
T H I S B E F O R E ?
25. W P _ D E B U G
In wp-config.php:
define( 'WP_DEBUG', false );
Enable debugging:
define( 'WP_DEBUG', true );
26. W P _ D E B U G
Extra statements:
define('WP_DEBUG_LOG', true);
Creates logfile in:
/wp-content/debug.log
27. W P _ D E B U G
Prevent public displaying of errors:
define('WP_DEBUG_DISPLAY', false);
28. W P _ D E B U G
Ideal setup:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
29. A D D I N G W P - C L I
T O Y O U R T O O L K I T
30. W P - C L I
wp plugin list
wp plugin deactivate
wp plugin activate
wp theme list
wp theme deactivate
wp theme activate
wp checksum core
wp checksum plugin (from version 1.5)
31. W P T H E M E L I S T R E S U LT
Parse error: syntax error, unexpected '$z9973449' (T_VARIABLE) in /data/sites/web/somewebsite/
www/wp-includes/post-template.php on line 1
Warning: array_splice() expects parameter 1 to be array, string given in /data/sites/web/somewebsite/
www/wp-content/plugins/akismet/favicon_316779.ico(105) : eval()'d code(165) : eval()'d code(202) :
eval()'d code on line 206
Warning: Invalid argument supplied for foreach() in /data/sites/web/somewebsite/www/wp-content/
plugins/akismet/favicon_316779.ico(105) : eval()'d code(165) : eval()'d code(202) : eval()'d code on
line 207
32. W P T H E M E L I S T R E S U LT
Parse error: syntax error, unexpected '$z9973449' (T_VARIABLE) in /data/sites/web/somewebsite/
www/wp-includes/post-template.php on line 1
Warning: array_splice() expects parameter 1 to be array, string given in /data/sites/web/somewebsite/
www/wp-content/plugins/akismet/favicon_316779.ico(105) :
eval()'d code(165) : eval()'d code(202) : eval()'d code on line 206
Warning: Invalid argument supplied for foreach() in /data/sites/web/somewebsite/www/wp-content/
plugins/akismet/favicon_316779.ico(105) : eval()'d code(165) : eval()'d code(202) : eval()'d code on
line 207
33. T Y P I C A L E R R O R S
A N D H O W T O F I X T H E M
34.
35.
36.
37.
38. Warning: Cannot modify header information - headers already sent by (output started at /data/sites/
web/somewebsite/www/wp-settings.php:84) in /data/sites/web/somewebsite/www/wp-includes/
option.php on line 920
39. Warning: Cannot modify header information - headers already sent by
(output started at /data/sites/web/somewebsite/www/wp-settings.php:84) in /data/sites/web/
somewebsite/www/wp-includes/option.php on line 920
40. Warning: Cannot modify header information - headers already sent by
(output started at /data/sites/web/somewebsite/www/wp-settings.php:84) in /data/sites/web/
somewebsite/www/wp-includes/option.php on line 920
Fix:
Enabe output_buffering
42. T H A N K Y O U !
S L I D E S W I L L B E T W E E T E D O N
@ B R E C H RY C K A E R T
A N D P U B L I S H E D O N
H T T P S : / / B R E C H T RY C K A E R T. C O M