GH#836: add Network Activate button in setup wizard for non-network-active plugin#851
Conversation
…ive plugin When Ultimate Multisite is not network active, the Pre-install Checks step now shows a 'Network Activate' button instead of only a 'Read More' link. - Add ajax_network_activate() AJAX handler in Setup_Wizard_Admin_Page to perform network activation of the plugin - Update renders_requirements_table() to compute can_activate flag and nonce, passing them to the wp-ultimo plugin requirement item - Update requirements_table.php view: show 'Network Activate' button when can_activate is true; on AJAX failure, reveal the 'Read More' fallback link; update bottom error message to reference the button - Add inline JS (jQuery) to call the AJAX handler and reload on success, or surface the fallback link on failure - Add tests for the new AJAX action hook registration and permission guard Resolves #836
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 48 minutes and 2 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 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 |
Merge SummaryIssue: #836 — If ultimate multisite is not network active in setup wizard it should try to activate it What was implemented:
Files changed:
Verification: 37 PHPUnit tests pass, PHPStan level 0 clean. aidevops.sh v3.8.24 plugin for OpenCode v1.4.3 with claude-sonnet-4-6 spent 10m and 294 tokens on this as a headless worker. Overall, 23s since this issue was created. |
🔨 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 d478a0e 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:
|
Summary
When Ultimate Multisite is not network active, the Pre-install Checks step in the setup wizard previously showed only a Read More link. This PR replaces that link with a Network Activate button that attempts to activate the plugin automatically. The Read More link is preserved as a hidden fallback, shown only when AJAX activation fails.
Changes
inc/admin-pages/class-setup-wizard-admin-page.phpajax_network_activate()method — nonce-protected,manage_network-gated AJAX handler that callsactivate_plugin(WP_ULTIMO_PLUGIN_BASENAME, '', true)wp_ajax_wu_setup_network_activateaction in__construct()renders_requirements_table()to compute$is_network_activeand$can_network_activateand passcan_activate,network_activate_nonce, andhas_activate_buttonto the templateviews/wizards/setup/requirements_table.phpcan_activateis true on a plugin requirement row, shows a primary Network Activate button with a spinner$has_activate_buttonis truetests/WP_Ultimo/Admin_Pages/Setup_Wizard_Admin_Page_Test.phptest_constructor_registers_network_activate_ajax_action— verifies action hook registrationtest_ajax_network_activate_sends_json_error_without_permission— provides valid nonce, sets user to 0, expects JSON error responseVerification
Resolves #836