run * 4. In wp-admin/includes/class-wp-automatic-updater.php $this->run() checks to make sure we're on the main site if on a network, and also if the autoupdates are disabled (by plugin, by being on a version controlled site, etc ) * 5. In wp-admin/includes/class-wp-automatic-updater.php $this->run() then checks to see which plugins have new versions (version/update check) * 6. In wp-admin/includes/class-wp-automatic-updater.php $this->run() then calls $this->update() for each plugin installed who has an upgrade. * 7 In wp-admin/includes/class-wp-automatic-updater.php $this->update() double checks filesystem access and then installs the plugin if able * * Notes: * - This autoupdater only works if WordPress core detects no version control. If you want to test this, do it on a new WP site without any .git folders anywhere. * - This autoupdater only works if the file access is able to be written to * - This autoupdater only works if a new version has been detected, and will run not the second the update is released, but whenever the cron for wp_version_check is next released. This is generally run every 8-12 hours. * - However, that cron can be disabled, the autoupdater can be turned off via constant or filter, version control or file lock can be detected, and other plugins can be installed (incl in functions of theme) that turn off all * all automatic plugin updates. * - If you want to test this is working, you have to manually run the wp_version_check cron. Install the WP Crontrol plugin or Core Control plugin, and run the cron manually using it. * - Again, because you skimmed over it the first time, if you want to test this manually you need to test this on a new WP install without version control for core, plugins, etc, without file lock, with license key entered (for pro only) * and use the WP Crontrol or Core Control plugin to run wp_version_check * - You may have to manually remove an option called "auto_update.lock" from the WP options table * - You may need to run wp_version_check multiple times (note though that they must be spaced at least 60 seconds apart) * - Because WP's updater asks the OS if the file is writable, make sure you do not have any files/folders for the plugin you are trying to autoupdate open when testing. * - You may need to delete the plugin info transient to get it to hard refresh the plugin info. */ function monsterinsights_get_major_version( $version ) { $exploded_version = explode( '.', $version ); if ( isset( $exploded_version[2] ) ) { return $exploded_version[0] . '.' . $exploded_version[1] . '.' . $exploded_version[2]; } else { return $exploded_version[0] . '.' . $exploded_version[1] . '.0'; } }