Fix admin bar migration bug for upgrading users#149
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughAdds a version-gated migration in the updater to set Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@admin/index.php`:
- Around line 735-738: Limit the migration so it only affects legacy upgrades
and doesn't overwrite explicit user choices: in update_tables_and_options()
change the condition that currently sets
wp_slimstat::$settings['use_separate_menu'] for versions < '5.4.1' to instead
run only for versions before the admin-bar redesign (e.g.,
version_compare(wp_slimstat::$settings['version'], '5.4.0', '<')), and only
assign 'on' when the key is missing or clearly a legacy/empty value (check
!isset(wp_slimstat::$settings['use_separate_menu']) ||
wp_slimstat::$settings['use_separate_menu'] === '' or other legacy sentinel) so
existing explicit 'no' values are preserved.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 44b915ef-3f0f-4db7-9fe7-592137289faf
📒 Files selected for processing (1)
admin/index.php
92c8177 to
3aae654
Compare
Review: Version gate needs adjustmentIssue:
|
| File | Line | Change |
|---|---|---|
wp-slimstat.php |
6 | Plugin header Version: → 5.4.1 |
wp-slimstat.php |
23 | SLIMSTAT_ANALYTICS_VERSION → '5.4.1' |
readme.txt |
8 | Stable tag: → 5.4.1 |
3aae654 to
e595990
Compare
Added version-gated migration for 5.4.1 to ensure 'use_separate_menu' setting is properly set to 'on' for users upgrading from older versions where the empty() check failed for the string 'no'. Fixes #146
e595990 to
c5db37d
Compare
Added version-gated migration for 5.4.1 to ensure 'use_separate_menu' setting is properly set to 'on' for users upgrading from older versions where the empty() check failed for the string 'no'.
Close #146
Describe your changes
...
Submission Review Guidelines:
CHANGELOG.md.Type of change
Summary by CodeRabbit
Bug Fix
Chores