fix: auto-promote custom domain to primary on DNS verification for 3-part domains#991
Conversation
…part domains The wu_transition_domain_stage hook replaces the previous wu_domain_post_save hook, which was re-firing on every save (including async_remove_old_primary_domains clearing the flag), causing the domain to be immediately re-promoted. The is_main_domain() TLD-counting heuristic (2-part = custom, 3-part = subdomain) incorrectly blocked promotion of legitimate 3-part custom domains such as shop.mybrand.com or prosite.example.com. Replaced with an explicit check against the WP network host so only native WP multisite subdomains (site.kursopro.com when network is kursopro.com) are excluded. Fixes: checklist item 5 (primary_domain=1 auto on DNS verify) Refs: #965 (original implementation)
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ 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 (2)
✨ 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. Review rate limit: 0/1 reviews remaining, refill in 25 minutes and 45 seconds.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 46571dd 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
maybe_auto_promote_primary_domain(added in fix: site provisioning hardening — limitations, membership inference, domain promotion #965) had two bugs: (1)is_main_domain()TLD-counting heuristic blocks any 3-part custom domain likeshop.mybrand.com, and (2) hookingwu_domain_post_savecaused re-fire on every save —async_remove_old_primary_domainsclearing the flag would immediately re-promote it.wu_transition_domain_stage(fires only on actual stage changes) and replaceis_main_domain()with an explicit network-host suffix check.What changed
inc/managers/class-domain-manager.phpwu_domain_post_savetowu_transition_domain_stage($old_stage, $new_stage, $domain_id)$old_stagewas already a done stageis_main_domain()with network-host suffix checktests/WP_Ultimo/Managers/Domain_Manager_Test.phpResolves #965 (follow-up fix)
aidevops.sh v3.13.10 plugin for OpenCode v1.3.17 with claude-sonnet-4-6 spent 22m and 7,279 tokens on this with the user in an interactive session.