Skip to content

fix(updates): major WordPress releases need Saddle's own setting (#359) - #360

Merged
ifahimreza merged 2 commits into
mainfrom
fix/359-core-major-setting
Oct 12, 2026
Merged

ifahimreza merged 2 commits into
mainfrom
fix/359-core-major-setting

Conversation

@ifahimreza

@ifahimreza ifahimreza commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Closes #359. On Fahim's "fix major release issue what best fit and release 1.5.2".

Why

update-core (#357) applied a major release when WordPress's own "automatic updates for all new versions" switch was on. WordPress turns that switch on for every site installed since 5.6, so on most sites an app could apply a major release the owner never chose to allow. The switch also answers a different question: what WordPress does on its own, unattended. An update through Saddle is attended (preview, then confirm), like the "Update to version" button in Dashboard → Updates, which ignores that switch.

What

  • New setting: Major WordPress releases, the fourth switch under Saddle → Settings → Safety. Off by default, saved the moment it is flipped (POST /preferences, owner only), like the other three. Its id is the address an app hands the owner when it is refused (#saddle-field-saddle-core_major_updates). One setter, Saddle_Offer_Runner::set_core_majors(), for the switch and the settings registry (field control: custom, so no generic form draws it twice).
  • No tool can turn it on. Core fields are agent: read (update-module-settings refuses with saddle_setting_owner_only), update-option only writes its allowlist, and the option saddle_core_major_updates is on Saddle_Settings_Guard::PROTECTED_OPTIONS, so a module's setter that touches it is put back.
  • update-core applies a major only when it is on, whatever WordPress's own switch says. Minor and security releases are unchanged. When both are offered, the minor still comes first.
  • The runner checks again when the run starts. If the owner turns the setting off after the confirm, the item is skipped, core is never asked, and the activity log says why.
  • Copy updated: tool description, the refusal (names Saddle → Settings and Dashboard → Updates), the context line, readme feature bullet and 1.5.2 changelog line, the CLAUDE.md hard line, ROADMAP. .pot regenerated.

Visible change

Yes: a fourth Safety switch on Saddle → Settings, "Major WordPress releases", with the line "Apps can update WordPress to a new major version." and a "?" that explains it. Admin bundle rebuilt.

Testing

  • 1512 tests, 1 skip that was already there (PHP 8.2, SQLite); phpcs 0 errors (6 warnings, none new); JS 342/342, lint:js clean
  • The owner's POST /preferences turns it on and off; an editor gets 403 and nothing changes
  • New: a major is refused by default even with WordPress's switch on; allowed with the Saddle setting even with WordPress's switch off (preview lists untested plugins); the runner hands an allowed major to core; the runner skips a major turned off after the confirm without calling the upgrader; the field is agent: read, default false, protected; update-module-settings refuses it
  • Real install (Playground, the built 1.5.2 zip, WordPress 7.0.7 offered 7.1.3 by WordPress.org): refused by default, with WordPress's own switch off and again with it on; update-module-settings refused with the owner's link; update-option refused; the owner turned it on through /preferences; the preview showed a major with its three risks; the confirmed run updated the site 7.0.7 → 7.1.3 in 79 s and the site stayed up. On a second install the Safety switch showed, saved on a click, and get-module-settings read it as on.
  • A pin test keeps WordPress's 5.6 default (auto_update_core_major = enabled), the reason for this change

🤖 Generated with Claude Code

ifahimreza and others added 2 commits October 13, 2026 05:07
update-core applied a major release when WordPress's "automatic updates for
all new versions" switch was on. WordPress turns that on by default for
sites installed since 5.6, so on most sites the owner never chose it, and
it decides what WordPress does unattended, not what an app may do after a
preview.

- New setting "Major WordPress releases" in Saddle → Settings → Updates,
  off by default. agent: read, and its option is protected, so no tool and
  no module setter can turn it on.
- update-core applies a major only when it is on, whatever WordPress's own
  switch says. Minor and security releases are unchanged.
- The runner checks it again when the run starts: turned off after the
  confirm, the update is skipped and logged.
- Copy: tool description, refusal, context line, readme, CLAUDE.md hard
  line, ROADMAP. .pot regenerated.

Closes #359

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Saddle → Settings is drawn by hand, so a schema field alone never showed:
the owner had no switch to flip. It is now the fourth Safety switch, saved
on flip through POST /preferences like the other three, with the id the
app's refusal links to (#saddle-field-saddle-core_major_updates). The
registry field is control: custom so no generic form draws it twice.
Set through one setter, Saddle_Offer_Runner::set_core_majors().

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ifahimreza ifahimreza mentioned this pull request Oct 12, 2026
12 tasks done
@ifahimreza
ifahimreza merged commit d50067d into main Oct 12, 2026
8 checks passed
@ifahimreza
ifahimreza deleted the fix/359-core-major-setting branch October 12, 2026 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

update-core: major releases need Saddle's own setting, off by default

1 participant