Skip to content

Commit 764abf4

Browse files
authored
fix: show success banner immediately on multisite wizard complete page (#880)
After all 4 install steps succeed, the JS auto-submits the form which redirects to the complete step. Previously, section_complete() checked is_multisite() to decide whether to show the success banner or manual instructions. But is_multisite() returns false on the first load after MULTISITE=true is written to wp-config.php, because the current PHP process loaded before the constant existed (OPcache or same-request timing). This caused users to see scary 'unable to configure' manual instructions despite a fully successful automated install. Fix: add a handle_install_complete() handler for the install step that redirects to the complete step with result=success as a query parameter. section_complete() already checks for this parameter, so the green success banner now appears immediately without requiring a page refresh.
1 parent 524108c commit 764abf4

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

inc/admin-pages/class-multisite-setup-admin-page.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ public function get_sections() {
147147
'description' => __('Setting up your WordPress Multisite network...', 'multisite-ultimate'),
148148
'next_label' => Core_Installer::get_instance()->all_done() ? __('Begin Ultimate Multisite Setup →', 'ultimate-multisite') : __('Install', 'ultimate-multisite'),
149149
'disable_next' => true,
150+
'handler' => [$this, 'handle_install_complete'],
150151
'back' => false,
151152
'fields' => [
152153
'terms' => [
@@ -307,6 +308,27 @@ public function handle_configure(): void {
307308
exit;
308309
}
309310

311+
/**
312+
* Handles the install step form submission.
313+
*
314+
* The JS auto-submits the form after all AJAX installation steps succeed.
315+
* This handler redirects to the complete step with result=success so
316+
* that section_complete() can show the success banner immediately,
317+
* even when is_multisite() returns false because OPcache is serving
318+
* a stale wp-config.php that doesn't yet have the MULTISITE constant.
319+
*
320+
* @since 2.6.1
321+
* @return void
322+
*/
323+
public function handle_install_complete(): void {
324+
325+
$next_url = add_query_arg('result', 'success', $this->get_next_section_link());
326+
327+
wp_safe_redirect($next_url);
328+
329+
exit;
330+
}
331+
310332
/**
311333
* Completion section view.
312334
*

0 commit comments

Comments
 (0)