Show the Enable auto-updates toggle for the self-updater #101

Merged
thatguygriff merged 1 commits from feature/auto-update-toggle into main 2026-07-24 11:47:25 +00:00
Owner

What

The Enable auto-updates toggle was missing for this plugin on the Plugins screen. It's now shown.

Why

WordPress only renders the auto-updates toggle for a plugin that appears in the update_plugins site transient's response or no_update list — that presence is what sets core's internal update-supported flag. UpdateChecker::provideUpdate() only populated the response side (when a newer release existed), so between releases the plugin was absent from the transient entirely and core treated it as not update-supported → no toggle. (This is unrelated to being in the wordpress.org directory.)

How

provideUpdate() now returns a no_update payload (installed version, empty package) whenever no newer release is offered — including when the Gitea release lookup fails — so the plugin stays in the transient and the toggle appears and persists. The response path (one-click and unattended updates) is unchanged.

  • src/Update/UpdateChecker.php — return the no_update payload instead of passing false through when current/failed.
  • tests/Unit/Update/UpdateCheckerTest.php — the not-newer / failure / no-asset cases now assert the no_update payload.
  • docs/features/plugin-self-update.md, CHANGELOG.md — documented under 1.1.1.

Testing

composer test (513 tests), composer lint, composer cs all pass.

🤖 Generated with Claude Code

## What The **Enable auto-updates** toggle was missing for this plugin on the Plugins screen. It's now shown. ## Why WordPress only renders the auto-updates toggle for a plugin that appears in the `update_plugins` site transient's `response` **or** `no_update` list — that presence is what sets core's internal `update-supported` flag. `UpdateChecker::provideUpdate()` only populated the `response` side (when a newer release existed), so between releases the plugin was absent from the transient entirely and core treated it as not update-supported → no toggle. (This is unrelated to being in the wordpress.org directory.) ## How `provideUpdate()` now returns a `no_update` payload (installed version, empty package) whenever no newer release is offered — including when the Gitea release lookup fails — so the plugin stays in the transient and the toggle appears and persists. The `response` path (one-click and unattended updates) is unchanged. - `src/Update/UpdateChecker.php` — return the `no_update` payload instead of passing `false` through when current/failed. - `tests/Unit/Update/UpdateCheckerTest.php` — the not-newer / failure / no-asset cases now assert the `no_update` payload. - `docs/features/plugin-self-update.md`, `CHANGELOG.md` — documented under 1.1.1. ## Testing `composer test` (513 tests), `composer lint`, `composer cs` all pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
thatguygriff added 1 commit 2026-07-24 11:47:00 +00:00
Show the Enable auto-updates toggle for the self-updater
CI / Tests (PHP 8.1) (pull_request) Successful in 47s
CI / Tests (PHP 8.2) (pull_request) Successful in 47s
CI / No Debug Code (pull_request) Successful in 3s
CI / Coding Standards (pull_request) Successful in 3m7s
CI / Tests (PHP 8.3) (pull_request) Successful in 2m38s
CI / PHPStan (pull_request) Successful in 2m50s
CI / Build Plugin Zip (pull_request) Skipped
51dd032668
WordPress only renders the "Enable auto-updates" toggle for a plugin that
appears in the update_plugins transient's response or no_update list, which
is what sets core's update-supported flag. UpdateChecker only populated the
response side (when a newer release existed), so between releases the plugin
was absent from the transient and the toggle never showed.

provideUpdate() now returns a no_update payload (installed version, empty
package) whenever no newer release is offered — including when the release
lookup fails — so the plugin stays in the transient and the toggle appears.
The response path (one-click and unattended updates) is unchanged.

Bumps to 1.1.1 so the fix ships to installed sites via the self-updater.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
thatguygriff merged commit 1fe28d5575 into main 2026-07-24 11:47:25 +00:00
thatguygriff deleted branch feature/auto-update-toggle 2026-07-24 11:47:25 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Unsupervised/unsupervised-scheduler#101