Skip to content

Instantly share code, notes, and snippets.

@michaeldozark
Last active December 23, 2015 09:39
Show Gist options
  • Save michaeldozark/6616352 to your computer and use it in GitHub Desktop.
Save michaeldozark/6616352 to your computer and use it in GitHub Desktop.
Better WordPress Debugging: Use WP_DEBUG flag, but only output errors to error log. Goes in wp-config.php. Thanks to ZippyKid for the idea.
define('WP_DEBUG', true); // false
if (WP_DEBUG) {
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors',0);
}
/**
* dynamic site and home urls
*/
define('WP_HOME','http://'. $_SERVER['SERVER_NAME']);
define('WP_SITEURL','http://'. $_SERVER['SERVER_NAME']);
/**
* reduce auto-saves and days in trash to reduce database growth
*/
define( 'AUTOSAVE_INTERVAL', 300 ); // 5 minutes
define( 'EMPTY_TRASH_DAYS', 5 ); // 5 days
define( 'WP_POST_REVISIONS', 3 ); // Last 3 revisions kept
/**
* restrict file editing and updates to prevent errors
*/
define( 'DISALLOW_FILE_EDIT', true ); // do not allow file editing from dashboard
define( 'WP_AUTO_UPDATE_CORE', 'minor' ); // make sure WordPress automatically applies minor updates
@michaeldozark
Copy link
Author

Added extra definitions for governing trash, revisions and dashboard file editing.

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