30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

v0.0.12 — Feature 043: WordPress core rollback via WP.org Core API

Highlights

Adds a third ability to the Core tab introduced in 0.0.11: acrossai-abilities-manager/wp-core-rollback. Rolls back WordPress core to an earlier offered version via WP core's Core_Upgrader::upgrade() — the same class the built-in dashboard uses for forward updates.

Uses only WordPress functions. No bundled updater code, no custom download, no custom integrity verification. Inspired by Andy Fragen's core-rollback plugin (MIT-licensed) — read wp-content/plugins/core-rollback/src/Core.php for the underlying technique.

Key observation superseding Feature 042's out-of-scope statement: Core_Upgrader::upgrade($offer) does NOT inspect whether $offer->version is older or newer than currently-installed. Any well-formed offer works, either direction. WordPress core does not need a WP_Downgrader class — the existing Core_Upgrader handles rollback perfectly given the right offer object.

Ability details

  • Input: version (required, string) — target WordPress version. locale (optional, string) — defaults to get_locale().
  • Output: success, updated, from_version, to_version, message.
  • Requires: BOTH manage_options AND update_core. Honours DISALLOW_FILE_MODS via File_Mods_Guard. Multisite-guarded.
  • Refuses non-downgrade: if version_compare($target, $current, '>='), returns a clean error steering the caller to wp-core-update. No Core_Upgrader invocation happens on the wrong-direction path.
  • Data source: WP.org Core API 1.7 endpoint (https://api.wordpress.org/core/version-check/1.7/) via wp_remote_get(). Hardcoded URL as a class constant (no SSRF surface). Per-locale offer list cached in acrossai_abilities_manager_core_offers_{locale} site transient with DAY_IN_SECONDS TTL. 15s HTTP timeout. Standard WordPress User-Agent header. WordPress 4.0 floor on cached offers.
  • Annotations: destructive=true — rolling WordPress back is a real production operation, and MCP / UI clients should surface it accordingly.

First outbound HTTP request from the plugin

Historically the plugin has made zero outbound HTTP requests on its own; the Add-ons page delegates to the WordPress plugin installer's own contact with WordPress.org, and every other ability operates on the local site. wp-core-rollback introduces the plugin's first direct outbound request — to api.wordpress.org/core/version-check/1.7/. The URL is hardcoded, the request is bounded by a per-locale day-long transient cache (≤ 1 request / day / locale / site regardless of how often the ability is invoked), the HTTP timeout is 15 seconds, and only the sanitized locale is derived from user input.

No breaking changes

No changes to existing abilities, REST endpoints, capability requirements, or database schema. Safe upgrade.

Quality gates

  • PHPStan L8 — zero errors
  • PHPCS strict (WPCS) — zero errors
  • PHPUnit — 163 tests / 531 assertions (up from 153 / 504 on 0.0.11; +10 tests / +27 assertions covering Feature 043)

Pull requests

  • Feature: #77 — Feature 043 — WordPress core rollback via WP.org Core API
  • Release: #78 — Release 0.0.12 — bump version + changelog

Keep reading