Making WordPress.org


Ignore:
Timestamp:
06/05/2019 04:34:52 AM (7 years ago)
Author:
dd32
Message:

Plugin Directory: Jobs: Update the Tested-up-to version in the API update-check endpoints when the plugin directory automatically bumps the tested-up-to value for plugins.

This also runs the 'Meta Sync' cron task whenever a new WordPress release is made, to help speed up the rate at which Plugins show the latest version in their 'tested' fields.

Fixes #4468.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/jobs/class-manager.php

    r8461 r8918  
    234234     *
    235235     * The jobs are queued for 1 minutes time to avoid recurring job failures from repeating too soon.
     236     *
     237     * This method is called on wp-admin pageviews and on a two-minutely cron task.
    236238     */
    237239    public function register_cron_tasks() {
     
    249251        }
    250252        if ( ! wp_next_scheduled( 'plugin_directory_check_cronjobs' ) ) {
     253            // This function
    251254            wp_schedule_event( time() + 60, 'every_120s', 'plugin_directory_check_cronjobs' );
    252255        }
    253256        if ( ! wp_next_scheduled ( 'plugin_directory_translation_sync' ) ) {
    254257            wp_schedule_event( time() + 60, 'daily', 'plugin_directory_translation_sync' );
     258        }
     259
     260        // Check to see if `WP_CORE_LATEST_RELEASE` has changed since we last ran.
     261        if ( defined( 'WP_CORE_LATEST_RELEASE' ) && get_option( 'plugins_last_core_release_seen' ) !== WP_CORE_LATEST_RELEASE ) {
     262            update_option( 'plugins_last_core_release_seen', WP_CORE_LATEST_RELEASE );
     263
     264            // If the next "Meta Sync" is more than 5 minutes away, perform one ASAP.
     265            if ( wp_next_scheduled( 'plugin_directory_meta_sync' ) > ( time() + 5 * MINUTE_IN_SECONDS ) ) {
     266                wp_schedule_single_event( time() + 10, 'plugin_directory_meta_sync' );
     267            }
    255268        }
    256269    }
Note: See TracChangeset for help on using the changeset viewer.