fix(settings): preserve legacy false toggle values - #1674
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthrough
ChangesDefault-aware false setting handling
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@inc/class-settings.php`:
- Around line 285-292: Update the setting type validation around
get_setting_defaults() so numeric-string defaults such as precision and
next_invoice_number are classified as numeric rather than generic strings,
allowing saved 'false' values to retain the intended numeric-setting
compatibility behavior. Add a regression assertion covering at least one of
these settings.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: f4d7a60b-5357-4b4d-9be9-378545b01d27
📒 Files selected for processing (3)
inc/class-settings.phptests/WP_Ultimo/Settings_Test.phptests/unit/Cart_Should_Collect_Payment_Test.php
🔨 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
Root causeA previous settings recovery change treated every saved literal Verification
Merged via PR #1674 to main. aidevops.sh v3.32.181 spent 58s on this as a headless bash routine. |
Summary
\"false\"strings for toggle/numeric settings instead of treating them as missing.false.Root cause
A previous settings recovery change treated every saved literal
\"false\"value as missing. For installs whereallow_trial_without_payment_methodhad been saved as the string\"false\", that changed checkout behavior after update: the value fell back to the default off state, so Stripe started asking for card details during free trials.Verification
vendor/bin/phpcs inc/class-settings.php tests/WP_Ultimo/Settings_Test.php tests/unit/Cart_Should_Collect_Payment_Test.phpvendor/bin/phpunit --filter Settings_Testvendor/bin/phpunit --filter Cart_Should_Collect_Payment_Testvendor/bin/phpstan analyse inc/class-settings.php --memory-limit=512MSummary by CodeRabbit
"false"."false"as missing and fall back to defaults."false"behavior."false"handling across text, toggle, and numeric-like settings.