Skip to content

Let WordPress.com choose the plugin's main screen - #9

Merged
fredrikekelund merged 6 commits into
trunkfrom
add/main-screen-flag
Oct 1, 2026
Merged

fredrikekelund merged 6 commits into
trunkfrom
add/main-screen-flag

Conversation

@fredrikekelund

@fredrikekelund fredrikekelund commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Why

The next wp.org release makes the Reprint screen the plugin's main entry point (#7), but the WordPress.com side of the Reprint flow may not be live on release day. This lets WordPress.com decide which screen is main, so the plugin can ship independently: WordPress.com flips to Reprint when its UI is ready, and can flip back without another plugin release.

The flag is temporary. About two weeks after release we revert this PR, and the plugin behaves as trunk does today.

What

  • Reprint\Main_Screen asks WordPress.com whether the main screen is reprint or blogvault, and caches the answer for the time the server specifies.
  • The sidebar row, the Settings link and the activation redirect follow that answer. Both screens stay reachable at their URLs.
  • If WordPress.com can't be reached, the site keeps its last answer; a site that never had one uses BlogVault. Multisite always uses BlogVault and never asks.
  • The e2e blueprints mock the endpoint, so CI never calls WordPress.com.

Testing instructions

  1. Check out 245096-ghe-Automattic/wpcom on your sandbox
  2. Sandbox public-api.wordpress.com
  3. Create a new local WordPress site (using Studio, for example)
  4. Install the plugin build from this branch on that site
  5. Click the Migrate to WordPress.com link in the wp-admin sidebar
  6. Ensure that you are taken to the BlogVault screen (/wp-admin/admin.php?page=wpcom-migration) and not the Reprint screen (/wp-admin/admin.php?page=wpcom-migration-status)

🤖 Generated with Claude Code

fredrikekelund and others added 6 commits September 28, 2026 13:36
Main_Screen asks public-api.wordpress.com which screen is main, keeps the
answer for its ttl, and falls back to BlogVault when it has never had one.
Every e2e blueprint answers the endpoint from a must-use plugin.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The sidebar row, the Settings link and the activation redirect lead to the
Reprint screen only while the main screen flag says so; otherwise to the
BlogVault screen. Both stay reachable at their URLs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The flag goes by reverting this PR; the markers only added noise.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A deactivation that skips its hooks, as the upgrader's does, left the
stored answer in place; activation now clears it too. The fetch no longer
follows redirects, each of which would get its own 2 s timeout.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
WordPress.com serves it at wpcom/v2/migration-plugin-config.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@fredrikekelund
fredrikekelund merged commit 3524ba3 into trunk Oct 1, 2026
5 checks passed
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.

1 participant