WordPress updates defined vs add_filter?

Skimming through the Core_Upgrader::should_update_to_version() method, it looks like we can override the defined( ‘WP_AUTO_UPDATE_CORE’ ) // true (all), false, minor check, used to setup the local boolean variables$upgrade_dev, $upgrade_minor and $upgrade_major, with the following filters: … apply_filters( ‘allow_dev_auto_core_updates’, $upgrade_dev ) … apply_filters( ‘allow_minor_auto_core_updates’, $upgrade_minor ) … apply_filters( ‘allow_major_auto_core_updates’, $upgrade_major ) … So these filters have … Read more

Automatic updates in plugin – not hosted on wordpress repository

You actually have several questions in there, so I’ll answer them one by one: However, if I simply do this on my main plugin file, it doesn’t work: add_filter(‘pre_set_site_transient_update_plugins’, array(‘XYZ’, ‘check_update’)); First of all, I’d like to understand what’s the difference between the two scenarios. This is failing because you are calling the method statically, … Read more

Automate WordPress Database Upgrade

So are you going to automate your backup as well to be triggered before the DB upgrade starts? While the question has merit especially in a multisite context (in which the scenario is a little different) I am not sure that it is smart thing to do. That message could have said “this is your … Read more

Prevent/Disable Automatic Update Check

How to disable core auto updates but enable plugins and themes auto updates If you want to stop the autoupdates of the WordPress core, but to enable them for your Plugins and/or Themes, you can add these lines in the wp-config.php file: Stop the core auto updates: define( ‘WP_AUTO_UPDATE_CORE’, false ); Then Enable the plugins/themes: … Read more

What is a “forced plugin update”, how can I avoid it and use it for my plugins

To answer the first question… If you look within the WP_Automatic_Updater class found in wp-admin/includes/class-wp-upgrader.php we note the method is_disabled which is used by the method should_update to determine whether or not an automatic update is allowed. The is_disabled method will return true under the following conditions, if DISALLOW_FILE_MODS constant is defined and is true … Read more

How To/What triggers a WordPress auto update?

As of WordPress 4.7.3, auto-updates are triggered whenever the following sequence is successful. All the code is in the file wp-includes/update.php. 1. _maybe_update_core() is called (via the admin_init action). This function is run via the the admin_init action, which executes at the beginning of every admin page before the page is rendered. The update process … Read more