Admin UI: Add Upgrade Jetpack menu item for free users#47418
Admin UI: Add Upgrade Jetpack menu item for free users#47418
Conversation
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
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
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
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:
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:
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:
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. |
There was a problem hiding this comment.
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.
projects/plugins/boost/app/assets/src/js/layout/header/header.module.scss
Outdated
Show resolved
Hide resolved
projects/packages/backup/src/js/components/back-up-now/index.jsx
Outdated
Show resolved
Hide resolved
projects/packages/backup/src/js/components/back-up-now/index.jsx
Outdated
Show resolved
Hide resolved
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
There was a problem hiding this comment.
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.
Did you try moving the
It seems to not be very legible with some of the admin color schemes
|
|
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., What Looks Good
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 ? |
Yep, that's the plan. We have to start making sales. This will provide a valuable new inbound lead channel.
Nope, no hacking it. If you really want it gone, and don't want to pay for the upgrade, do it with CSS.
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? |
|
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. |
|
p1775064062972139/1775050064.954349-slack-C052XEUUBL4 👍 |
|
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. |
|
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. |
|
Follow-up for color schemes: @keoshi can you review if it looks good as v1 to be in the release? |
|
@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. |
|
@tbradsha, can you elaborate a bit more on why showing the upsell at multisite would be an issue? Looks fine to me.
|
|
More discussion here: p1775143980027909-slack-CDLH4C1UZ |






Proposed changes:
Adds a styled "Upgrade Jetpack" submenu item to the Jetpack wp-admin menu for sites on the free plan.
#069e08) at the bottom of the Jetpack submenu (position 999)jetpack_active_planoption andjetpack_site_products)manage_optionscapabilitypackages/admin-uiAdmin_Menuclass — propagates automatically to every plugin that registers menus through it (Jetpack, Backup, Boost, Protect, Social, Search, VideoPress)Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
wp option update jetpack_active_plan '{"is_free":false}' --format=jsonwp option delete jetpack_active_planUnit tests:
jp test php packages/admin-uiChangelog
Made with Cursor