Skip to content

Premium Analytics: Offer an Upgrade to Parse.ly item in the Stats options menu - #55470

Merged
adamwoodnz merged 1 commit into
stats-648-add-an-upgrade-to-parsely-card-to-the-bottom-offrom
stats-647-add-an-upgrade-to-parsely-item-to-the-stats
Nov 26, 2026
Merged

adamwoodnz merged 1 commit into
stats-648-add-an-upgrade-to-parsely-card-to-the-bottom-offrom
stats-647-add-an-upgrade-to-parsely-item-to-the-stats

Conversation

@adamwoodnz

@adamwoodnz adamwoodnz commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Fixes STATS-647

Stacked on #55429, which ships src/parsely-promo.php and the signup URL this registers against, and which is itself stacked on #55372. The base is the STATS-648 branch, not trunk. Retarget as each one merges.

Why

The Settings card from STATS-648 reaches a reader who goes looking for it. The options menu is on every dashboard page, so this puts the same offer in reach from wherever the reader already is, as the quietest permanent entry point of the three Upgrade to Parse.ly prompts.

Nothing is visible yet. The jetpack-stats-parsely-prompts feature flag gates it and defaults off.

Proposed changes

  • One more promo in src/parsely-promo.php, parsely/menu-upgrade on the options-menu placement: "Upgrade to Parse.ly" as its label, the same self-serve signup URL as the Settings card, no dismiss control, and offers_parsely_prompts() as its availability rule.
  • The file now registers two prompts, so configure_parsely_promo() and register_parsely_promo() take the plural. Both prompts register on init, which Premium Analytics: Offer an Upgrade to Parse.ly card on the Stats Settings page #55429 arranged so the copy is translated after the textdomain loads.

No frontend change. #55372 already wired the options menu to the placement, which is why the issue's pointer at stats-options-menu.tsx no longer applies: the slot draws the item, puts it in its own group below Settings, marks it as opening in a new tab and sends the view and click events.

Two limits the item inherits from the slot

  • It is not on the connect, locked-report or upgrade pages, each of which carries Premium Analytics' own upsell. It is on the dashboard and the Settings page, which is every page a qualifying reader sees.
  • One promo shows per placement, so a second options-menu promo registered later would have to outrank this one on order.

Screenshots

The item with the flag on and the gate forced, in its own group below Settings.

The Stats options menu open at the top right of the dashboard. Below Customize, Arrange tabs and Settings, separated by a rule, sits "Upgrade to Parse.ly" with a single opens-in-a-new-tab arrow and no leading icon.

Related product discussion/links

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

No new events. The slot's existing jetpack_premium_analytics_promo_view and jetpack_premium_analytics_promo_click now fire for parsely/menu-upgrade. No dismiss event, since a menu item has no close control. The signup URL carries the site's public name and host as query parameters, both already public.

Testing instructions

The flag is needed, plus an override so a local site qualifies:

add_filter( 'jetpack_feature_flag_enabled_jetpack-stats-parsely-prompts', '__return_true' );
add_filter( 'jetpack_premium_analytics_offers_parsely_prompts', '__return_true' );
  • Open Stats v2 and open the options menu (the three dots, top right). The last item is Upgrade to Parse.ly, in its own group below Settings, with one opens-in-a-new-tab arrow and no second icon.
  • It opens https://dash.parsely.com/self-serve in a new tab, with utm_source=jetpack, publisher_name set to the site's title and site_domain to its host.
  • Go to Settings and open the menu again. The item is there too.
  • Drop the offers_parsely_prompts override and the item goes, on a site that does not meet the tier and views conditions.
  • Turn off jetpack-stats-parsely-prompts with the gate override still on: the item goes.
  • If you have a promo registered on the options-menu placement for your own testing, turn it off. One promo shows per placement, and whichever sorts first wins.

Verified

  • Exercised in a browser on a local Jetpack site, on both the dashboard and the Settings page, with the flag on and the gate forced. The menu item renders as the mock does, its accessible name is "Upgrade to Parse.ly (opens in a new tab)" with one outbound marker, and the link carries utm_source, publisher_name and site_domain for the real site and opens in a new tab. With the gate override dropped, the script data offers no promos at all.
  • Rebased onto the current STATS-648 branch, which has since moved registration to init. premium-analytics PHP suite green on the rebased branch: 986 tests, 2480 assertions. PHPCS clean on the three changed files.
  • No JavaScript changed, so no Jest or typecheck run was needed for this commit.
  • Phan was not run locally, so watch that check here.

🤖 Generated with Claude Code

@adamwoodnz adamwoodnz self-assigned this Nov 25, 2026
@github-actions

github-actions Bot commented Nov 25, 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 stats-647-add-an-upgrade-to-parsely-item-to-the-stats branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack stats-647-add-an-upgrade-to-parsely-item-to-the-stats

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 commented Nov 25, 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!

@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 Nov 25, 2026
@jp-launch-control

jp-launch-control Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

No summary data is available for parent commit 9440a8e, 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 9440a8e is available.

Full summary · PHP report · JS report

@adamwoodnz
adamwoodnz force-pushed the stats-647-add-an-upgrade-to-parsely-item-to-the-stats branch from 561de82 to 2781bc8 Compare November 25, 2026 22:39
@adamwoodnz
adamwoodnz added this pull request to stack #55478 November 26, 2026 02:41
The Settings card reaches a reader who goes looking for it. The options
menu is on every dashboard page, so this puts the same offer in reach
from wherever the reader already is.

The slot draws the menu item, places it in its own group and sends the
view and click events, so this is one more registration against the gate
and the signup URL the Settings card already uses. The file now holds
two prompts, hence the plural on its registration functions.

Both prompts stay behind the jetpack-stats-promos and
jetpack-stats-parsely-prompts feature flags, which default off.

# Conflicts:
#	projects/packages/premium-analytics/src/parsely-promo.php
#	projects/packages/premium-analytics/tests/php/Parsely_Promo_Test.php

# Conflicts:
#	projects/packages/premium-analytics/src/parsely-promo.php
#	projects/packages/premium-analytics/tests/php/Parsely_Promo_Test.php
@adamwoodnz
adamwoodnz force-pushed the stats-647-add-an-upgrade-to-parsely-item-to-the-stats branch from 2781bc8 to 6449efc Compare November 26, 2026 03:57
@adamwoodnz
adamwoodnz marked this pull request as ready for review November 26, 2026 19:04
@adamwoodnz
adamwoodnz requested a review from a team as a code owner November 26, 2026 19:04
@adamwoodnz adamwoodnz added [Status] Needs Review This PR is ready for review. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. [Status] In Progress labels Nov 26, 2026
@adamwoodnz

Copy link
Copy Markdown
Contributor Author

@claude please review this PR.

Three Codex rounds have run across the branch's life, the last one on the current head after two rebases. Each returned the same single P2, and I declined it each time:

Declined: add plugin changelog entries for Jetpack, Stats and Premium Analytics. The AGENTS.md test is whether a user of that plugin could notice the change. jetpack-stats-parsely-prompts defaults off and only a code filter can open it, so no user of any of those plugins can see this menu item from a release. Those entries belong in whichever PR flips the flag. #55372 and #55429 took the same line.

Worth a reviewer's attention:

CI: all green except two e2e jobs that died at config load with Error: Site URL could not be resolved, before any test ran. This PR changes no JavaScript. Reran both.

@claude

claude Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @adamwoodnz's task in 38s —— View job


Review: Upgrade to Parse.ly item in the Stats options menu

I found no blocking issues. This is small and correct.

Registration (src/parsely-promo.php:57-66)

  • options-menu is in Promo_Registry::PLACEMENTS, and cta_label, the only field that placement requires (class-promo-registry.php:163-165), is set. parsely_signup_url() is https, so it passes is_linkable(). cta_variant defaults to a valid value. Registration won't hit refuse().
  • The menu draws only cta_label/cta_url (stats-options-menu.tsx:204-218), so leaving out title/description/cta_variant is right. 'dismissible' => false is redundant, since the menu has no dismiss control, but it states the intent and the test pins it. Fine.
  • Both prompts use offers_parsely_prompts, so they show and hide together. The data-provider test covers that for each slug.

Rename and init deferral

  • configure_parsely_promos() / register_parsely_promos() keep Premium Analytics: Offer an Upgrade to Parse.ly card on the Stats Settings page #55429's did_action( 'init' ) / add_action( 'init', … ) shape unchanged. The only call site is class-analytics.php:404, which is updated.
  • git grep finds no remaining callers of the singular names. Both functions are @since $$next-version$$ on an unreleased branch, so renaming without a deprecation is fine.

Tests (tests/php/Parsely_Promo_Test.php)

  • The two init-timing tests carry over cleanly. One optional nit: test_the_prompts_register_at_once_when_init_has_already_run (around line 75) still asserts only parsely/settings-upgrade. The provider-driven gate test does prove the menu item registers through register_parsely_promos(). Only a regression that skipped the second register_promo() on the already-init path would get past it, so adding a second assertArrayHasKey( 'parsely/menu-upgrade', … ) is cheap but not required.
  • The new menu-item test and the provide_prompt_slugs provider each catch a distinct regression (wrong placement or URL, and a gate dropped from one prompt). No redundant tests.

Changelog

I agree with declining the plugin entries. Under AGENTS.md the test is whether a plugin's users could notice the change. jetpack-stats-parsely-prompts defaults off and only a code filter turns it on, so this falls under "reachable only under conditions the plugin never creates". Add the Jetpack and Stats entries in the PR that flips the flag. Whether plugins/premium-analytics needs an entry should be decided then too. The package entry is well formed: imperative mood, no self-prefix.

Nits (optional)

  • The string 'Upgrade to Parse.ly' and the parsely_signup_url() call appear in both registrations. Two copies is acceptable. A third prompt would be the time to pull them into locals.

Not run

I didn't run PHPUnit, PHPCS or Phan here. This is a static review only. As you noted, Phan wasn't run locally either, so watch that check.

@adamwoodnz
adamwoodnz merged commit 9db13a6 into trunk Nov 26, 2026
116 of 119 checks passed
@adamwoodnz
adamwoodnz deleted the stats-647-add-an-upgrade-to-parsely-item-to-the-stats branch November 26, 2026 21:35
@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] Needs Review This PR is ready for review. labels Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Premium Analytics [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.

1 participant