Skip to content

Instantly share code, notes, and snippets.

@cliffordp
Last active October 5, 2023 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cliffordp/2c18439a37e0f0c078adbf2b2535ef22 to your computer and use it in GitHub Desktop.
Save cliffordp/2c18439a37e0f0c078adbf2b2535ef22 to your computer and use it in GitHub Desktop.
Cliff's WP_DEBUG defaults
<?php
/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*
* For information on other constants that can be used for debugging,
* visit the Codex.
*
* @link https://codex.wordpress.org/Debugging_in_WordPress
*/
define( 'WP_DEBUG', true );
if (
defined( 'WP_DEBUG' )
&& WP_DEBUG
) {
@error_reporting( E_ALL | E_STRICT );
@ini_set( 'display_errors', true );
@ini_set( 'log_errors_max_len', '0' );
// Unlimited length var_dump()
@ini_set( 'xdebug.var_display_max_depth', -1 );
@ini_set( 'xdebug.var_display_max_children', -1 );
@ini_set( 'xdebug.var_display_max_data', -1 );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', true );
define( 'SCRIPT_DEBUG', true );
define( 'SAVEQUERIES', true ); // $wpdb->queries
define( 'WP_CACHE', false );
// define( 'DISABLE_WP_CRON', true );
} else {
define( 'WP_DEBUG_LOG', false );
define( 'WP_DEBUG_DISPLAY', false );
define( 'CONCATENATE_SCRIPTS', true ); // JavaScript and CSS files
define( 'COMPRESS_SCRIPTS', true );
define( 'COMPRESS_CSS', true );
define( 'ENFORCE_GZIP', true );
define( 'DISALLOW_FILE_EDIT', true ); // Disable the Plugin and Theme Editor
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment