Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade/Install: Delay automatic updates after installation. #6828

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/wp-admin/includes/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@ function wp_install( $blog_title, $user_name, $user_email, $is_public, $deprecat
wp_check_mysql_version();
wp_cache_flush();
make_db_current_silent();

/*
* Ensure update checks are delayed after installation.
*
* This prevents users being presented with a maintenance mode screen
* immediately after installation.
*/
wp_unschedule_hook( 'wp_version_check' );
wp_unschedule_hook( 'wp_update_plugins' );
wp_unschedule_hook( 'wp_update_themes' );

wp_schedule_event( time() + HOUR_IN_SECONDS, 'twicedaily', 'wp_version_check' );
wp_schedule_event( time() + ( 1.5 * HOUR_IN_SECONDS ), 'twicedaily', 'wp_update_plugins' );
wp_schedule_event( time() + ( 2 * HOUR_IN_SECONDS ), 'twicedaily', 'wp_update_themes' );

populate_options();
populate_roles();

Expand Down
Loading