wp-config.php Settings Overview Under Tools
Adds a Tools > Config Constants screen that shows the value of important wp-config.php settings, such as debug mode, memory limits, cron, caching and file editing, without opening the file.
Opens WPIDE on
Code
// Constants to display.
$wpide_config_constants = array( 'WP_ENVIRONMENT_TYPE', 'WP_DEBUG', 'WP_DEBUG_LOG', 'WP_DEBUG_DISPLAY', 'SCRIPT_DEBUG', 'SAVEQUERIES', 'WP_MEMORY_LIMIT', 'WP_MAX_MEMORY_LIMIT', 'WP_CACHE', 'DISABLE_WP_CRON', 'ALTERNATE_WP_CRON', 'WP_CRON_LOCK_TIMEOUT', 'WP_POST_REVISIONS', 'AUTOSAVE_INTERVAL', 'EMPTY_TRASH_DAYS', 'DISALLOW_FILE_EDIT', 'DISALLOW_FILE_MODS', 'AUTOMATIC_UPDATER_DISABLED', 'WP_AUTO_UPDATE_CORE', 'FORCE_SSL_ADMIN', 'CONCATENATE_SCRIPTS', 'COMPRESS_SCRIPTS', 'WP_HOME', 'WP_SITEURL', 'WP_CONTENT_DIR', 'UPLOADS', 'DB_CHARSET', 'DB_COLLATE', 'WP_ALLOW_REPAIR', 'MULTISITE' );
add_action( 'admin_menu', function () use ( $wpide_config_constants ) {
add_management_page( 'Config Constants', 'Config Constants', 'manage_options', 'wpide-config-constants', function () use ( $wpide_config_constants ) {
echo '<div class="wrap"><h1>wp-config.php Constants</h1><table class="widefat striped" style="max-width:900px"><thead><tr><th>Constant</th><th>Value</th></tr></thead><tbody>';
foreach ( $wpide_config_constants as $name ) {
if ( preg_match( '/KEY|SALT|PASSWORD|SECRET|TOKEN/', $name ) ) {
continue;
}
if ( ! defined( $name ) ) {
$value = '<em>not set</em>';
} else {
$raw = constant( $name );
$value = '<code>' . esc_html( is_bool( $raw ) ? ( $raw ? 'true' : 'false' ) : var_export( $raw, true ) ) . '</code>';
}
printf( '<tr><td><code>%s</code></td><td>%s</td></tr>', esc_html( $name ), $value );
}
echo '</tbody></table></div>';
} );
} );
Notes
Secret keys, salts and database passwords are never shown; add more names to $wpide_config_constants.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.