fix: fall back to subdomain for blogname when title is empty on duplication#895
fix: fall back to subdomain for blogname when title is empty on duplication#895superdav42 merged 2 commits intomainfrom
Conversation
…cation When $args->title arrives empty (e.g. via WooCommerce checkout flow), the duplicated site kept the template's blogname instead of the customer's site name. Now falls back to the subdomain portion of the site's domain, ensuring the blogname always reflects the new site.
|
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 28 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 (1)
✨ 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 |
🔨 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 4006dbc 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:
|
…omain title When $args->title is empty (e.g. WooCommerce checkout flow), the fallback now produces 'Ikenabazan' instead of 'ikenabazan'.
🔨 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: |
Summary
$args->titleis empty during site duplication (happens via WooCommerce checkout flow), the conditional on line 326 skipped theupdate_blog_optioncall entirely, leaving the duplicated site with the template's blogname (e.g. "Plantilla Belleza") instead of the customer's site name.update_blog_option— when title is empty, fall back to the subdomain portion of the site's domain (e.g.ikenabazanfromikenabazan.example.com).Changes
inc/helpers/class-site-duplicator.php— replaced theif (!empty)guard with a ternary that falls back topreg_replace('/\..*$/', '', $args->domain), ensuringblognameis always set to something meaningful after duplication.