Make WordPress Core

Changeset 58435


Ignore:
Timestamp:
06/18/2024 02:37:55 PM (7 months ago)
Author:
costdev
Message:

Upgrade/Install: Delay automatic updates after installation.

After installation, the user is directed to the Log In page. This triggers the wp_schedule_update_checks() function which is hooked to init and schedules updates to run immediately if no other events exist. As a result of more robust use of maintenance mode for automatic updates added in [58128], the user may be presented with a maintenance mode screen just after installing WordPress.

To improve the user experience, this schedules core updates for 1 hour, plugin updates for 1.5 hours, and theme updates for 2 hours after installation.

Follow-up to [58128], [58139], [58308], [58309].

Props afragen, hellofromTonya, peterwilsoncc, nithi22, dd32.
Fixes #61457. See #58281, #61391.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/upgrade.php

    r57787 r58435  
    5353        wp_cache_flush();
    5454        make_db_current_silent();
     55
     56        /*
     57         * Ensure update checks are delayed after installation.
     58         *
     59         * This prevents users being presented with a maintenance mode screen
     60         * immediately after installation.
     61         */
     62        wp_unschedule_hook( 'wp_version_check' );
     63        wp_unschedule_hook( 'wp_update_plugins' );
     64        wp_unschedule_hook( 'wp_update_themes' );
     65
     66        wp_schedule_event( time() + HOUR_IN_SECONDS, 'twicedaily', 'wp_version_check' );
     67        wp_schedule_event( time() + ( 1.5 * HOUR_IN_SECONDS ), 'twicedaily', 'wp_update_plugins' );
     68        wp_schedule_event( time() + ( 2 * HOUR_IN_SECONDS ), 'twicedaily', 'wp_update_themes' );
     69
    5570        populate_options();
    5671        populate_roles();
Note: See TracChangeset for help on using the changeset viewer.