Skip to content

Instantly share code, notes, and snippets.

@josanua
Last active January 25, 2024 23:54
Show Gist options
  • Select an option

  • Save josanua/bb0acb65ee08d424f0c5e3475f8a3e02 to your computer and use it in GitHub Desktop.

Select an option

Save josanua/bb0acb65ee08d424f0c5e3475f8a3e02 to your computer and use it in GitHub Desktop.
wp-settings-helper
<?php
/************ Debugging ************/
https://codex.wordpress.org/Debugging_in_WordPress
// in wp-config file
define('WP_DEBUG', true); //Enabling WP_DEBUG will cause all PHP errors, notices and warnings to be displayed.
define('WP_DEBUG_DISPLAY', true); // This should be used in conjunction with WP_DEBUG_LOG so that errors can be reviewed later.
// all errors to also be saved to a debug.log
define( 'WP_DEBUG_LOG', true ); // WP_DEBUG must be enabled (true)
// will force WordPress to use the "dev" versions of some core CSS and JavaScript
define( 'SCRIPT_DEBUG', true ); // Some scripts (notably the core jQuery package) do not honor SCRIPT_DEBUG.
// saves the database queries to an array and that array can be displayed
define( 'SAVEQUERIES', true ); // The array is stored in the global $wpdb->queries.
// --- Example wp-config.php for Debugging --- //
// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );
// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', 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 );
// --- another settings example --- //
// Insert this before /* That's all, stop editing! Happy blogging. */
@ini_set('log_errors','On'); // enable or disable php error logging (use 'On' or 'Off')
@ini_set('display_errors','On'); // enable or disable public display of errors (use 'On' or 'Off')
@ini_set('error_log','/Applications/MAMP/htdocs/wptest/php-errors.log'); // path to server-writable log file
/** Alow upload different files **/
define('ALLOW_UNFILTERED_UPLOADS', true);
/** Disable autoupdate */
site https://codex.wordpress.org/Configuring_Automatic_Background_Updates
// add the following line to wp-config.php:
// for core only
define( 'WP_AUTO_UPDATE_CORE', false ); // disabled
define( 'WP_AUTO_UPDATE_CORE', true ); // enabled
define( 'WP_AUTO_UPDATE_CORE', minor ); // allow minor updates only
// use functions.php for these snippets.
add_filter( 'auto_update_theme', '__return_false' );
add_filter( 'auto_update_plugin', '__return_false' );
// disable update notifications
function remove_core_updates(){
global $wp_version;
return(object) array(
'last_checked'=> time(),
'version_checked'=> $wp_version,);
}
add_filter('pre_site_transient_update_themes', 'remove_core_updates');
add_filter('pre_site_transient_update_plugins', 'remove_core_updates');
// for wp-config.php
// Disable Plugin and Theme Update and Installation
define( 'DISALLOW_FILE_MODS', true ); // Off autoupdate
/************ Connect SSL Enable SSL ************/
define('FORCE_SSL_ADMIN', true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment