Skip to content

Instantly share code, notes, and snippets.

@taotiwordpress
Created March 4, 2022 23:30
Show Gist options
  • Save taotiwordpress/b978976056a75625b99957a5f8e428fc to your computer and use it in GitHub Desktop.
Save taotiwordpress/b978976056a75625b99957a5f8e428fc to your computer and use it in GitHub Desktop.
Debugging Cheatsheet #cheatsheet #debugging

Debugging

Options to Enable Debugging

These changes need to be made in your active wp-config.php file in order to be used (or dumped in a wp-config-local.php file).

<?php

/* PHP errors, notices and warnings will be displayed */
define( 'WP_DEBUG', true );

/* Disable display of errors and warnings */
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

/* Use dev versions of core JS and CSS files (only needed if you are modifying these core files) */
define( 'SCRIPT_DEBUG', true );

/* Enable Debug logging to the /wp-content/debug.log file */
define( 'WP_DEBUG_LOG', true );

/* Display queries in current page */
define( 'SAVEQUERIES', true ); 

/* Disable WP Fatal error handler */
define( 'WP_DISABLE_FATAL_ERROR_HANDLER', true );

Plugins

Note: The 'Debug Bar' plugin is the default and many of those listed are child-plugins. That said, the 'Debug Bar' plugin was actually abandoned and so work is done through the new 'Query Monitor' plugin.

Second Note: The 'Query Monitor' plugin covers much of the functionality offered in the plugins below, though perhaps not as specific and definitely not the Timber add-on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment