Skip to content

Admin UI: Add Upgrade Jetpack menu item for free users#47418

Merged
CGastrell merged 47 commits intotrunkfrom
feature/upsell-to-pro-wp-admin-menu
Apr 1, 2026
Merged

Admin UI: Add Upgrade Jetpack menu item for free users#47418
CGastrell merged 47 commits intotrunkfrom
feature/upsell-to-pro-wp-admin-menu

Conversation

@DevinWalker
Copy link
Copy Markdown
Contributor

@DevinWalker DevinWalker commented Mar 3, 2026

Proposed changes:

image

Adds a styled "Upgrade Jetpack" submenu item to the Jetpack wp-admin menu for sites on the free plan.

  • Displays an "Upgrade Jetpack" label in Jetpack green (#069e08) at the bottom of the Jetpack submenu (position 999)
  • Suppressed automatically for any site with an active paid plan or license (checks jetpack_active_plan option and jetpack_site_products)
  • Hidden on WordPress.com platform sites (self-hosted only)
  • Only visible to users with manage_options capability
  • Implemented once in the shared packages/admin-ui Admin_Menu class — propagates automatically to every plugin that registers menus through it (Jetpack, Backup, Boost, Protect, Social, Search, VideoPress)
  • Inline styles are scoped to Jetpack admin screens only, avoiding unnecessary overhead

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

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

No.

Testing instructions:

  1. Activate any Jetpack plugin (Jetpack, Backup, Boost, Protect, Social, Search, or VideoPress) on a local WordPress install
  2. Log in as an administrator
  3. Open the Jetpack submenu in wp-admin — a green "Upgrade Jetpack" item should appear at the bottom
  4. To test the paid-plan suppression, run: wp option update jetpack_active_plan '{"is_free":false}' --format=json
  5. Refresh — the menu item should be gone
  6. Delete the option to restore: wp option delete jetpack_active_plan
  7. Confirm the item does not appear for editor-role users (only administrators)

Unit tests: jp test php packages/admin-ui

Changelog

  • Generate changelog entries for this PR (using AI).

Made with Cursor

DevinWalker and others added 14 commits March 2, 2026 14:58
Adjusts the menu positions for Jetpack admin menu items to place all links that open in new windows (external links marked with ↗) after internal links. This improves the user experience by grouping similar link types together.

Changes:
- Activity Log: moved from position 8 to 14
- Subscribers: moved from position 11 to 15
- Jetpack Manage: moved from position 15 to 16
- Scan & VaultPress Backup (external): base offset changed from 9 to 17
- Updated test to verify external links appear after Settings

Internal links (Settings at position 13) now appear before all external links.

Made-with: Cursor
Replace @automattic/jetpack-components Button with @wordpress/components Button in the BackupNowButton component for better consistency with WordPress core components.

Changes:
- Updated import to use @wordpress/components Button
- Removed custom weight prop (not supported by WordPress Button)
- Updated variant default to 'solid'
- Added size='compact' prop for appropriate button sizing

Made-with: Cursor
Simplify Jetpack admin menu item titles for better readability:
- "Akismet Anti-spam" → "Anti-spam"
- "VaultPress Backup" → "Backups"

These shorter titles provide a cleaner menu experience while maintaining clarity about the product functionality.

Made-with: Cursor
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Changed the variant prop in the BackupNowButton component from 'primary', 'secondary', 'tertiary' to 'solid', 'outline', 'minimal', 'unstyled' for improved flexibility in button styling.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…dule.scss

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Adds a styled "Upgrade to Pro" submenu item to the Jetpack wp-admin menu
for sites on the free plan. The item shows a star icon in Jetpack green
(#069e08) and links to the Jetpack upgrade page. It is suppressed for any
site with an active paid plan or license.

Because all Jetpack standalone plugins (Backup, Boost, Protect, Social,
Search, VideoPress) register their menus through the shared Admin_Menu
class, this single change propagates to every plugin automatically.

Made-with: Cursor
Copilot AI review requested due to automatic review settings March 3, 2026 06:13
@DevinWalker DevinWalker added the [Status] Needs Review This PR is ready for review. label Mar 3, 2026
@DevinWalker DevinWalker self-assigned this Mar 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 3, 2026

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 or WordPress.com Site Helper), and enable the feature/upsell-to-pro-wp-admin-menu branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack feature/upsell-to-pro-wp-admin-menu
bin/jetpack-downloader test jetpack-mu-wpcom-plugin feature/upsell-to-pro-wp-admin-menu

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] Scan [JS Package] Components [Package] Admin Ui [Package] Backup [Package] My Jetpack [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Tests] Includes Tests RNA labels Mar 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 3, 2026

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!


Beta 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.


Jetpack 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.


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.


Boost 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.


Search 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.


Social 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.


Starter Plugin 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.


Protect 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.


Videopress 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.


Mu Wpcom plugin:

  • Next scheduled release: WordPress.com Simple releases happen semi-continuously (PCYsg-Jjm-p2)

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


Inspect 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.


Wpcomsh plugin:

  • Next scheduled release: Atomic deploys happen twice daily on weekdays (p9o2xV-2EN-p2)

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


Automattic For agencies client 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.


Classic Theme helper plugin 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.


Paypal Payment buttons 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.


Wpcloud Sso 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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an “Upgrade to Pro” upsell entry to the Jetpack wp-admin submenu for free-plan sites (via the shared packages/admin-ui menu wrapper), and adjusts related menu ordering/styling across several Jetpack packages/plugins.

Changes:

  • Add conditional “Upgrade to Pro” submenu item + inline styling in Automattic\Jetpack\Admin_UI\Admin_Menu (free-plan + manage_options).
  • Reorder/admin-menu-position tweaks so external links appear after internal links in the Jetpack submenu.
  • Misc UI/text updates (e.g., Backup menu label, Boost header padding, admin page subtitle padding, readme contributor lists) with changelog entries.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
projects/packages/admin-ui/src/class-admin-menu.php Adds free-plan detection, registers the “Upgrade to Pro” submenu item, and outputs inline CSS styling on Jetpack screens.
projects/packages/admin-ui/tests/php/Admin_Menu_Test.php Adds unit tests for upgrade menu visibility and CSS output gating.
projects/packages/admin-ui/composer.json Adds package deps for plans/redirect utilities used by the new logic.
projects/packages/admin-ui/changelog/feature-upsell-to-pro-wp-admin-menu Changelog entry for the new upsell menu item.
projects/packages/admin-ui/changelog/update-header-and-nav-cleanup-and-improvements Changelog entry for Akismet menu label change.
projects/plugins/jetpack/tests/php/general/Jetpack_Admin_Menu_Test.php Updates ordering assertions to ensure external links come after internal links.
projects/plugins/jetpack/modules/subscriptions.php Adjusts submenu position to support new ordering.
projects/plugins/jetpack/modules/scan/class-admin-sidebar-link.php Adjusts submenu insertion offset to support new ordering.
projects/packages/my-jetpack/src/class-activitylog.php Moves Activity Log submenu position later (external-link ordering).
projects/packages/my-jetpack/src/class-jetpack-manage.php Moves Jetpack Manage submenu position later (external-link ordering).
projects/packages/my-jetpack/changelog/update-header-and-nav-cleanup-and-improvements Changelog entry for menu reordering behavior.
projects/packages/backup/src/class-jetpack-backup.php Renames submenu label from “VaultPress Backup” to “Backups”.
projects/packages/backup/src/js/components/back-up-now/index.jsx Switches Button import and updates props/defaults for the BackupNowButton UI.
projects/packages/backup/changelog/simplify-menu-title Changelog entry for “Backups” label change.
projects/packages/backup/changelog/update-header-and-nav-cleanup-and-improvements Changelog entry for Button component change.
projects/plugins/jetpack/readme.txt Updates contributor list.
projects/plugins/boost/readme.txt Updates contributor list.
projects/plugins/boost/app/assets/src/js/layout/header/header.module.scss Removes header description padding.
projects/plugins/boost/changelog/update-header-and-nav-cleanup-and-improvements Changelog entry for Boost readme/style adjustments.
projects/plugins/jetpack/changelog/update-header-and-nav-cleanup-and-improvements Changelog entry for admin menu ordering change.
projects/js-packages/components/components/admin-page/style.module.scss Removes subtitle padding in Jetpack admin page header styling.
projects/js-packages/components/changelog/update-header-and-nav-cleanup-and-improvements Changelog entry for the admin-page subtitle padding change.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

simison added 9 commits April 1, 2026 14:42
Added backward-compatible paid-plan detection via jetpack_active_plan['class'] (non-free counts as paid).
Warning was:

> Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1
simison
simison previously approved these changes Apr 1, 2026
Copy link
Copy Markdown
Member

@simison simison left a comment

Choose a reason for hiding this comment

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

Tested Jetpack with free (upsell) and with paid (no upsell), as well as WP.com simple free site (no upsell) and Atomic paid site (no upsell). 👍

I was struggling to get tests pass with the static cached $is_free, and couldn't find a way so I undid it here for now:

is_free_plan() now caches result statically across the whole PHP request in projects/packages/admin-ui/src/class-admin-menu.php.

It uses static $is_free = null; and returns cached value on later calls.
Your test suite first runs a free-plan case, which sets that cache to true.
Later tests set paid plan/options, but should_show_upgrade_menu() still reads cached true, so the upgrade item and CSS still appear.

Still looking at sorting some test failures before merging.

@anomiex
Copy link
Copy Markdown
Contributor

anomiex commented Apr 1, 2026

I was struggling to get tests pass with the static cached $is_free, and couldn't find a way so I undid it here for now:

Did you try moving the $is_free to being a private static property on the class, instead of a static within the method, and then using reflection to clear it when necessary?

Displays an "Upgrade Jetpack" label in Jetpack green (#069e08) at the bottom of the Jetpack submenu

It seems to not be very legible with some of the admin color schemes

Blue Ocean Sunrise
blue ocean sunrise

@CGastrell
Copy link
Copy Markdown
Contributor

Besides the contrast issue, I wonder:

This ships to all free-plan self-hosted sites at once. There's no filter, constant, or feature flag to disable it. If the upsell causes issues or negative user sentiment, the only recourse is a full code revert and deploy.

I can assume the idea is that people can't disable it, but should we consider a filter flag for it? Lke a filter hook (e.g., jetpack_show_upgrade_menu) so it can be disabled without a code deploy in case of emergencies?

What Looks Good

  • Capability check (manage_options) is correct
  • Test coverage is thorough — 15 test cases covering plan states, roles, and style output
  • The Redirect::get_url() pattern with a fallback URL is the right approach
  • Properly scoped to the shared Admin_Menu class so all Jetpack plugins get it automatically

Other than those 2 (color contrast and the filter flag) this looks good to me. I'd like to confirm these 2 concerns and that we are ok with it before merging. WDYT @DevinWalker @simison ?

@DevinWalker
Copy link
Copy Markdown
Contributor Author

@CGastrell

This ships to all free-plan self-hosted sites at once.

Yep, that's the plan. We have to start making sales. This will provide a valuable new inbound lead channel.

There's no filter, constant, or feature flag to disable it.

Nope, no hacking it. If you really want it gone, and don't want to pay for the upgrade, do it with CSS.

If the upsell causes issues or negative user sentiment, the only recourse is a full code revert and deploy.

If there's legit 1-star bombs for "Now they want us to pay money for this?!?!" it's a shame, but I'm assuming most users are used to this... look at what other top plugins do. If the sky is falling, we can revert and push a point release.


@anomiex that color issue is concerning. Good catch. For non-standard theme users we can alter the color so it doesn't look bad. I still would like the color to stand out. Some of those seems like a dark gray/black would work well. Do you want to handle that or should I?

@anomiex
Copy link
Copy Markdown
Contributor

anomiex commented Apr 1, 2026

Probably better for you to handle it. I'm not much of a designer, and this seems like it needs design sensibility to choose proper colors.

@CGastrell
Copy link
Copy Markdown
Contributor

p1775064062972139/1775050064.954349-slack-C052XEUUBL4 👍

@CGastrell CGastrell merged commit 943a2ed into trunk Apr 1, 2026
91 checks passed
@CGastrell CGastrell deleted the feature/upsell-to-pro-wp-admin-menu branch April 1, 2026 18:25
@github-actions github-actions bot added [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. and removed [Status] In Progress labels Apr 1, 2026
@DevinWalker
Copy link
Copy Markdown
Contributor Author

DevinWalker commented Apr 1, 2026

2026-04-01_12-30-55 2026-04-01_12-29-48

I was tempted to propose 👆

... but let's try this more subtle approach first.

@simison
Copy link
Copy Markdown
Member

simison commented Apr 1, 2026

Nice ones :-)

@keoshi noted in Slack earlier that the colour contrast issue was non-problem, so all good for this PR, but as they say, always be iterating!

Edit: Ah, read the thread more in detail — I see the colour contrast wasn't about the regular dark sidebar but about different colour schemes. We can detect that and sort than in a follow-up. The text could e.g. become white then.

@keoshi
Copy link
Copy Markdown
Contributor

keoshi commented Apr 2, 2026

Good catch by @anomiex. I'd only tested it in the Modern color scheme.

Detecting color schemes and generating an accessible color seems like over-engineering a bit, but without an actual button styling we could use to ensure proper contrast, I don't see another way.

I have to say though, if the goal is to draw attention to it, the current solution feels under-designed and fragile. The button might be a good idea that does that job better, could be more branded, and solves a11y concerns. Let me know if that's a possibility and we'll propose a few options.

@simison
Copy link
Copy Markdown
Member

simison commented Apr 2, 2026

Follow-up for color schemes:

@keoshi can you review if it looks good as v1 to be in the release?

@tbradsha
Copy link
Copy Markdown
Contributor

tbradsha commented Apr 2, 2026

@CGastrell Just to check, was this tested on Multisite? We don't want people to get the upgrade notice when they're not in the Network Admin.

@simison
Copy link
Copy Markdown
Member

simison commented Apr 2, 2026

@tbradsha, can you elaborate a bit more on why showing the upsell at multisite would be an issue? Looks fine to me.

image

@tbradsha
Copy link
Copy Markdown
Contributor

tbradsha commented Apr 2, 2026

More discussion here: p1775143980027909-slack-CDLH4C1UZ

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

Labels

[Feature] Scan [JS Package] Components [Package] Admin Ui [Package] Backup [Package] My Jetpack [Plugin] Automattic For Agencies Client [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Beta For serving live branches and the beta versions. https://github.com/automattic/jetpack-beta [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Classic Theme Helper Plugin [Plugin] Inspect [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] mu wpcom jetpack-mu-wpcom plugin [Plugin] Paypal Payment Buttons [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Starter Plugin [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. [Plugin] Wpcloud Sso [Plugin] Wpcomsh RNA [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants