Skip to content

Backup: remove the four REST routes only the legacy dashboard called - #53859

Draft
CGastrell wants to merge 2 commits into
remove/jetpack-2314-backup-legacy-dashboardfrom
remove/jetpack-2314-backup-legacy-routes
Draft

CGastrell wants to merge 2 commits into
remove/jetpack-2314-backup-legacy-dashboardfrom
remove/jetpack-2314-backup-legacy-routes

Conversation

@CGastrell

@CGastrell CGastrell commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Fixes JETPACK-2314

Do not merge until

Proposed changes

Part 3 of 3 for JETPACK-2314.

  1. Backup: record a Tracks event when the dashboard crashes #53821: record a Tracks event when the dashboard crashes.
  2. Backup: remove the legacy dashboard #53857: remove the legacy dashboard (the JS, the enqueue path and the rollback).
  3. This PR: remove the four REST routes that only the legacy dashboard called, and bump the Backup namespace.

Routes removed

All four are registered in Jetpack_Backup::register_rest_routes() in projects/packages/backup/src/class-jetpack-backup.php.

  • GET /jetpack/v4/backup-capabilities and its callback get_backup_capabilities(). The redesigned dashboard uses the live GET /jetpack/v4/site/capabilities bridge route instead.
  • GET /jetpack/v4/has-backup-plan. The route is removed. get_backup_plan_state() and has_backup_plan() stay, because jetpack_check_user_licenses() uses them.
  • GET /jetpack/v4/site/current-purchases and its callback get_site_current_purchases(). This is not the My Jetpack my-jetpack/v1/site/purchases route, which stays.
  • POST/PUT/PATCH /jetpack/v4/site/dismissed-review-request and its callback manage_dismissed_backup_review_request(). The redesigned dashboard has no review prompt. The dismissed_backup_review_* Jetpack options stay, so stored values are not lost.

Evidence that nothing in the repo calls them

git grep over projects/ (excluding CHANGELOG.md) for each route path and each callback name finds:

  • No match in src/dashboard, routes/, packages/init, other packages, the Jetpack plugin, wpcomsh, jetpack-mu-wpcom or e2e specs.
  • Only comments and tests of the removed code. I reworded one comment in class-capabilities-bridge.php that named /backup-capabilities.
  • One real dependent: Jetpack_Eager_Load_Packages_Test and Jetpack_Backup_Init_Options_Test used /jetpack/v4/has-backup-plan as the marker that Jetpack_Backup::initialize() ran. Both now use /jetpack/v4/backup-promoted-product-info, which only the Backup package registers and the redesigned dashboard still calls.

The legacy JS that called the routes was removed in #53857.

Why the namespace bump

The file header of class-jetpack-backup.php asks for a version bump whenever the file changes. The bump also means any out-of-repo caller of the removed public methods gets a clear fatal, not a silent call into code that no longer registers the route.

The bump has a trade-off. initialize() returns early when did_action( 'jetpack_backup_initialized' ) is set, and that action is shared by every namespace version. The standalone plugin calls initialize() when its main file loads, before the Jetpack plugin. So with a new Jetpack plugin and an outdated standalone Backup plugin, the old copy serves the page and still registers the four routes. Jetpack's V0006 call is then a no-op. Under one shared V0005 namespace the Jetpack autoloader keeps the highest version of each class, so an old copy could not win. The routes are unused, so a stale copy that still registers them is harmless.

Automattic\Jetpack\Backup\V0005 becomes V0006 in every file that uses it (43 files, one mechanical replacement):

  • projects/packages/backup (source, actions.php, tests).
  • projects/packages/backup-helper-script-manager, which shares the namespace.
  • projects/packages/transport-helper, projects/plugins/backup, and the Jetpack plugin (class.jetpack.php, the two helper-script JSON endpoints, uninstall.php, and the Admin menu and Eager Load tests). Transport_Helper\V0005 is a different namespace and is unchanged.

No match for the old name remains in wpcomsh, jetpack-mu-wpcom, .phan or any composer/autoload map. The autoload maps are classmaps generated at build time. I did not touch the jetpack-mu-wpcom rollback code.

Related product discussion/links

Open questions

  • Answered by review: a search of the default branches found no caller of the four routes in wp-calypso, WordPress-Android, WordPress-iOS, or the WordPress.com, dash and VaultPress codebases. The WooCommerce apps were checked only for has-backup-plan and backup-capabilities, with no caller. The mobile apps read the WordPress.com v2 capabilities endpoint directly. Backup\V0005 appears on WordPress.com only in its deployed copy of the Jetpack plugin.
  • Is dropping the review-request prompt (site/dismissed-review-request) accepted as a product call? The redesigned dashboard has no equivalent.

Does this pull request change what data or activity we track or use?

No. It removes endpoints. It adds no tracking.

Testing instructions

Automated checks I ran on this branch. The backup PHP, Jest and typecheck runs are from after the 2026-11-18 rebase; the others are from the 2026-11-10 rebase:

  • jetpack test php packages/backup -v: OK (497 tests, 1280 assertions).
  • jetpack test php packages/backup-helper-script-manager (59 tests) and jetpack test php packages/transport-helper (10 tests): pass.
  • pnpm run test in projects/packages/backup: 82 suites, 977 tests pass.
  • pnpm run typecheck in projects/packages/backup: no errors.
  • jetpack phan packages/backup: 0 issues before the rebase. Phan crashes in my local environment now (while parsing the WordPress stubs), so CI covers it after the rebase.
  • vendor/bin/phpcs on projects/packages/backup/src, projects/packages/backup/tests/php and projects/packages/backup/actions.php: no errors (existing warnings only). The pre-commit hook also passed.
  • In a worktree Docker instance, before the rebase: Jetpack_Eager_Load_Packages_Test (21 tests) and Jetpack_Admin_Menu_Test (3 tests) pass. Not re-run after the rebase; CI covers them.

I did not run a manual check on a connected site. After merge, a reviewer can request /wp-json/jetpack/v4/backup-capabilities as an admin and expect rest_no_route, and confirm Jetpack > Backup still loads.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the remove/jetpack-2314-backup-legacy-routes branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack remove/jetpack-2314-backup-legacy-routes

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions github-actions Bot added [Feature] WPCOM API [Package] Backup Helper Script Manager [Package] Transport Helper [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] In Progress [Tests] Includes Tests labels Oct 20, 2026
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: December 8, 2026
    • Code freeze: December 7, 2026

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Backup plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Oct 20, 2026
@jp-launch-control

jp-launch-control Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

No summary data is available for parent commit d46fdb8, so cannot calculate coverage changes. 😴

If that commit is a feature branch rather than a trunk commit, this is expected. Otherwise, this should be updated once coverage for d46fdb8 is available.

Full summary · PHP report · JS report

@dhasilva dhasilva left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[blocker] Static analysis (current) fails on a stale Phan baseline entry: the removed callbacks were the code that PhanTypeMismatchReturn covered. jp phan --update-baseline packages/backup fixes it.

[suggestion] The reason given for the namespace bump is backwards. The Jetpack autoloader keeps the highest version of each class across all active plugins, so under one V0005 namespace an older copy can't win. The bump creates that case instead:

  • initialize() returns on did_action( 'jetpack_backup_initialized' ), an action shared by every namespace version.
  • The standalone plugin calls initialize() when its main file loads, before the Jetpack plugin does.
  • So with a new Jetpack plugin and an outdated standalone Backup plugin, the old copy serves the page and still registers the four routes, and Jetpack's V0006 call is a no-op.

The bump is still worth keeping: it follows the file-header convention, and it keeps any out-of-repo caller of the removed public methods from hitting a fatal. Suggest the description give that reason and note the trade-off.

[suggestion] The package changelog entry is patch for removing four routes and three public methods. If this ships with #53857, one of the two package entries should be minor or major.

[suggestion] Jetpack_Backup_Test.php L227 and L299 both hard-code "six", and this PR had to edit both. Suggest dropping the number; the list right below is the count.

On the outside-callers question, searching default branches:

  • None of the four routes has a caller in wp-calypso, WordPress-Android, WordPress-iOS, or the WordPress.com, dash and VaultPress codebases. The WooCommerce apps have none for has-backup-plan or backup-capabilities, the two I checked there. A control search for rewind/capabilities matched in Calypso and both WordPress apps, so those repos were searchable; the apps read WordPress.com's v2 capabilities endpoint directly. The only WordPress.com hits are its deployed copy of the Jetpack plugin itself.
  • Backup\V0005 on WordPress.com appears only in that same deployed copy, so nothing there needs updating.

The rename is complete (no Backup\V0005 left, Transport_Helper\V0005 untouched), and the new /backup-promoted-product-info marker is valid since only initialize() registers it. PHPUnit passes locally: backup 431 tests, backup-helper-script-manager 59, transport-helper 10.

Generated by Claude.

@CGastrell
CGastrell force-pushed the remove/jetpack-2314-backup-legacy-routes branch from 2dffa56 to 401b90b Compare October 20, 2026 20:59
@CGastrell

Copy link
Copy Markdown
Contributor Author

Changes since the review, in 401b90b:

  • Rebased onto Backup: remove the legacy dashboard #53857 at c4a8529. One conflict: Admin_Wp_Build_Fallback_Test.php is deleted there, so it is deleted here.
  • Refreshed the Phan baseline for packages/backup. The stale PhanTypeMismatchReturn entry is gone. Phan reports 0 issues.
  • Removed the hard-coded "six" from the two comments in Jetpack_Backup_Test.php.
  • PR body: the namespace-bump section now gives the file-header convention and the out-of-repo-caller reason, and states the trade-off (an outdated standalone Backup plugin keeps serving the page and registering the four routes). The outside-callers question is marked answered by the review.
  • Package changelog stays patch. Backup: remove the legacy dashboard #53857's entry is minor.

Checks: PHPUnit for packages/backup OK (427 tests, 1099 assertions). Changelogger check passes.

@CGastrell CGastrell removed the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Nov 2, 2026
@CGastrell
CGastrell force-pushed the remove/jetpack-2314-backup-legacy-dashboard branch from c4a8529 to 242e30a Compare November 10, 2026 19:19
@CGastrell
CGastrell force-pushed the remove/jetpack-2314-backup-legacy-routes branch from 401b90b to 34fa295 Compare November 10, 2026 19:19
CGastrell and others added 2 commits November 18, 2026 15:51
Remove backup-capabilities, has-backup-plan, site/current-purchases and
site/dismissed-review-request. Bump the Backup namespace V0005 to V0006
so a stale copy loaded by another autoloader cannot register the old set.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@CGastrell
CGastrell force-pushed the remove/jetpack-2314-backup-legacy-dashboard branch from 242e30a to d46fdb8 Compare November 19, 2026 12:19
@CGastrell
CGastrell force-pushed the remove/jetpack-2314-backup-legacy-routes branch from 34fa295 to 56ee276 Compare November 19, 2026 12:19

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] WPCOM API [Package] Backup Helper Script Manager [Package] Backup [Package] Transport Helper [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] In Progress [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants