cPanel’s Site Software disables WordPress auto updates option. We can easily enable this option, for that we need to modify the following files and note that these files were only changed on WordPress sites that were installed using cPanel’s Site Software addon. Ensure to take a backup of these files before making any changes.
=> wp-admin/includes/update.php
=> wp-admin/update-core.php
=> wp-admin/includes/class-wp-upgrader.php
# vim wp-admin/includes/update.php
Open the update.php file using any editor and change the below line to another one.
function get_core_updates( $options = array() ) { # cPanel override: Disable all core updates to prevent conflict with cPAddons. return false; $options = array_merge( array( ‘available’ => true, ‘dismissed’ => false ), $options );
The above line of file change to,
function get_core_updates( $options = array() ) { $options = array_merge( array( ‘available’ => true, ‘dismissed’ => false ), $options ); $dismissed = get_site_option( ‘dismissed_update_core’ );
#vim wp-admin/update-core.php
Open the update-core.php file using any editor and change the below line,
function core_upgrade_preamble() { # cPanel override: Do not display the current or the latest version, because we’ve disabled updates. return; global $wp_version, $required_php_version, $required_mysql_version; $updates = get_core_updates();
Change to,
function core_upgrade_preamble() { global $wp_version, $required_php_version, $required_mysql_version; $updates = get_core_updates();
#vim wp-admin/includes/class-wp-upgrader.php
Open the above file using any editor and change the below line :
public function is_disabled() { return true; // Force this functionality to disabled because it is incompatible with cPAddons. // Background updates are disabled if you don’t want file changes. if ( defined( ‘DISALLOW_FILE_MODS’ ) && DISALLOW_FILE_MODS ) return true;
Change to,
public function is_disabled() { // Background updates are disabled if you don’t want file changes. if ( defined( ‘DISALLOW_FILE_MODS’ ) && DISALLOW_FILE_MODS ) return true;
# After these change please login to your WordPress admin panel and check, it works!!.
If you require help, contact SupportPRO Server Admin