fix: show success banner immediately on multisite wizard complete page#880
fix: show success banner immediately on multisite wizard complete page#880superdav42 merged 2 commits intomainfrom
Conversation
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis change adds a completion handler to the install wizard section. The handler retrieves the next section link, appends a Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔨 Build Complete - Ready for Testing!📦 Download Build Artifact (Recommended)Download the zip build, upload to WordPress and test:
🌐 Test in WordPress Playground (Very Experimental)Click the link below to instantly test this PR in your browser - no installation needed! Login credentials: |
|
Performance Test Results Performance test results for 4204667 are in 🛎️! Note: the numbers in parentheses show the difference to the previous (baseline) test run. Differences below 2% or 0.5 in absolute values are not shown. URL:
|
🔨 Build Complete - Ready for Testing!📦 Download Build Artifact (Recommended)Download the zip build, upload to WordPress and test:
🌐 Test in WordPress Playground (Very Experimental)Click the link below to instantly test this PR in your browser - no installation needed! Login credentials: |
|
Merged via pulse (squash).
aidevops.sh v3.8.55 plugin for OpenCode v1.4.6 with claude-sonnet-4-6 spent 10m and 14,676 tokens on this as a headless worker. Solved in 56m. |
Summary
After the multisite setup wizard completes all 4 installation steps successfully, the "Complete" page showed manual wp-config.php instructions instead of the green success banner on the first load. Users had to refresh the page to see the success message. This was confusing — a fully successful automated install looked like a failure.
Root cause
section_complete()checksis_multisite()to decide whether to show the success banner or manual instructions. Butis_multisite()returnsfalseon the first page load afterMULTISITE=trueis written towp-config.php, because the PHP process that renders the complete page loadedwp-config.phpbefore the constant existed (same OPcache timing issue described in #837).The code already had a fallback:
'success' === $resultchecks for aresult=successquery parameter. But the install step had no form handler, so it useddefault_handler()which redirects to the next step without passingresult=success.Fix
Add
handle_install_complete()as the form handler for the install step. When the JS auto-submits the form after all AJAX steps succeed, this handler redirects to?step=complete&result=success. The existingsection_complete()check picks up the parameter and shows the green banner immediately.Before: Install succeeds → redirect to
?step=complete→is_multisite()returns false → manual instructions shownAfter: Install succeeds → redirect to
?step=complete&result=success→'success' === $resultis true → green banner shownFiles changed
inc/admin-pages/class-multisite-setup-admin-page.php— addedhandlerkey to theinstallstep definition, addedhandle_install_complete()method (+22 lines)Verification
Browser-tested on a fresh WordPress 6.7.2 single-site install:
result=successquery parameterRelated: #837, PR #874
Summary by CodeRabbit