From 1f87d6b71767e86b815e62e5cc84ce17d05e8ddc Mon Sep 17 00:00:00 2001 From: costdev Date: Mon, 3 Jun 2024 21:25:10 +0000 Subject: [PATCH] Upgrade/Install: Don't toggle maintenance mode on translation updates. The Rollback Auto-Update feature introduced additional maintenance mode toggling. After installing WordPress in a non-English (US) language, translation updates are performed automatically. As there may be a large number of updates for Core and bundled themes, users will be presented with a maintenance notice upon visiting the newly installed website. To avoid concerning users that the website has failed to install correctly, this excludes translation updates from triggering the additional maintenance mode toggling. Follow-up to [58128]. Props benniledl, afragen, rajinsharwar, costdev. Fixes #61260. See #58281. Built from https://develop.svn.wordpress.org/trunk@58308 git-svn-id: http://core.svn.wordpress.org/trunk@57765 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-automatic-updater.php | 12 +++++++++--- wp-includes/version.php | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/class-wp-automatic-updater.php b/wp-admin/includes/class-wp-automatic-updater.php index d4ac511438..4692eab9f3 100644 --- a/wp-admin/includes/class-wp-automatic-updater.php +++ b/wp-admin/includes/class-wp-automatic-updater.php @@ -470,7 +470,9 @@ class WP_Automatic_Updater { * update could contain an error or warning, which could cause * the scrape to miss a fatal error in the plugin update. */ - $upgrader->maintenance_mode( true ); + if ( 'translation' !== $type ) { + $upgrader->maintenance_mode( true ); + } // Boom, this site's about to get a whole new splash of paint! $upgrade_result = $upgrader->upgrade( @@ -495,7 +497,9 @@ class WP_Automatic_Updater { * This avoids errors if the site is visited while fatal errors exist * or while files are still being moved. */ - $upgrader->maintenance_mode( true ); + if ( 'translation' !== $type ) { + $upgrader->maintenance_mode( true ); + } // If the filesystem is unavailable, false is returned. if ( false === $upgrade_result ) { @@ -613,7 +617,9 @@ class WP_Automatic_Updater { } // All processes are complete. Allow visitors to browse the site again. - $upgrader->maintenance_mode( false ); + if ( 'translation' !== $type ) { + $upgrader->maintenance_mode( false ); + } $this->update_results[ $type ][] = (object) array( 'item' => $item, diff --git a/wp-includes/version.php b/wp-includes/version.php index c796fa9a82..315f999d18 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.6-alpha-58307'; +$wp_version = '6.6-alpha-58308'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.