Skip to content

Reader - fix domain free plan upsell banner. #102240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 1, 2025

Conversation

Addison-Stavlo
Copy link
Contributor

@Addison-Stavlo Addison-Stavlo commented Mar 31, 2025

Related to # #101295

Proposed Changes

Fixes two issue with the banner:

  1. The banner would disappear if there was no site currently selected in state. I updated the upsell nudge component to fall back to the most recently selected site Id and then primary site id if no site is currently selected.
    • Unlike most places upsells exist, the reader can be loaded in a state where no site is currently selected. However, it "feels like" a site is selected due to its appearance in the top admin bar. The top admin bar displays the site by the same fallback logic. Updating this component to fallback to these other site ID values allows it to work consistently in places like the reader, without changing its behavior in contexts were individual sites are always selected.
  2. We update the banner to link to the specific flow build for this upsell, instead of the plans page for the site.

BEFORE
reader-banner-disappear-before
When clicked, the banner would land at:
Screenshot 2025-03-31 at 12 02 04 PM

AFTER
reader-upsell-disappear-after
When clicked, the banner will land at:
Screenshot 2025-03-31 at 12 01 04 PM

Why are these changes being made?

  1. We don't want the banner to disappear when it shouldn't. This limits opportunities for users to get the promotional upgrade, and our ability to upsell.
  2. When it does work, we want it going to the newer flow that gives a better user experience for the upsell.

Testing Instructions

  • Create a new account with 1 site on a free plan.
  • Visit the reader, you should see the upsell banner.
  • Click "W" in the masterbar to navigate to /sites.
  • Without clicking anything else on /sites, click "Reader" in the masterbar.
  • Verify the upsell is still present. This is where it would previously disappear.
  • Click on the upsell and verify you are sent to the multi-step flow for this promotion. previously this was the plans page.

For testing the extra change/case around replacing the getSelectedSiteSlug selector with getSiteSlug, you can verify that these both provide the same return value when a site is selected.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

Copy link

github-actions bot commented Mar 31, 2025

@matticbot
Copy link
Contributor

matticbot commented Mar 31, 2025

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~344 bytes added 📈 [gzipped])

name                             parsed_size           gzip_size
themes                                +125 B  (+0.0%)      +26 B  (+0.0%)
staging-site                          +125 B  (+0.0%)      +30 B  (+0.0%)
site-settings                         +125 B  (+0.0%)      +27 B  (+0.0%)
settings-security                     +125 B  (+0.0%)      +34 B  (+0.0%)
settings-podcast                      +125 B  (+0.0%)      +33 B  (+0.0%)
settings-performance                  +125 B  (+0.0%)       +7 B  (+0.0%)
settings                              +125 B  (+0.0%)      +27 B  (+0.0%)
posts-custom                          +125 B  (+0.0%)      +32 B  (+0.0%)
posts                                 +125 B  (+0.0%)      +32 B  (+0.0%)
plugins                               +125 B  (+0.0%)      +24 B  (+0.0%)
overview                              +125 B  (+0.0%)      +27 B  (+0.0%)
marketing                             +125 B  (+0.0%)      +30 B  (+0.0%)
jetpack-cloud-plugin-management       +125 B  (+0.0%)      +24 B  (+0.0%)
hosting                               +125 B  (+0.0%)      +27 B  (+0.0%)
earn                                  +125 B  (+0.0%)      +37 B  (+0.0%)
domains                               +125 B  (+0.0%)      +38 B  (+0.0%)
activity                              +125 B  (+0.0%)      +26 B  (+0.0%)
a8c-for-agencies-plugins              +125 B  (+0.0%)      +24 B  (+0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Async-loaded Components (~307 bytes added 📈 [gzipped])

name                                                     parsed_size           gzip_size
async-load-calypso-blocks-jitm-templates-sidebar-banner       +291 B  (+0.6%)      +68 B  (+0.4%)
async-load-calypso-blocks-jitm-templates-notice               +291 B  (+0.6%)      +70 B  (+0.4%)
async-load-calypso-blocks-jitm-templates-default              +291 B  (+0.6%)      +68 B  (+0.4%)
async-load-calypso-reader-sidebar                             +160 B  (+0.2%)      +44 B  (+0.2%)
async-load-design-blocks                                      +125 B  (+0.0%)      +32 B  (+0.0%)
async-load-calypso-my-sites-current-site-notice               +125 B  (+0.2%)      +25 B  (+0.1%)
async-load-calypso-components-web-preview-component           +125 B  (+0.0%)      +32 B  (+0.0%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • blaze-dashboard
  • notifications
  • odyssey-stats
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/reader-domain-plan-upsell-banner on your sandbox.

@Addison-Stavlo Addison-Stavlo marked this pull request as ready for review March 31, 2025 16:35
@Addison-Stavlo Addison-Stavlo requested a review from a team as a code owner March 31, 2025 16:35
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Mar 31, 2025
@Addison-Stavlo Addison-Stavlo self-assigned this Mar 31, 2025
Copy link
Contributor

@DustyReagan DustyReagan left a comment

Choose a reason for hiding this comment

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

Tests well and makes sense to me.

@Addison-Stavlo Addison-Stavlo merged commit 7f666c1 into trunk Apr 1, 2025
19 checks passed
@Addison-Stavlo Addison-Stavlo deleted the fix/reader-domain-plan-upsell-banner branch April 1, 2025 12:07
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Apr 1, 2025
JessBoctor pushed a commit to JessBoctor/wp-calypso that referenced this pull request Apr 15, 2025
* ensure upsell banner can fallback to most recently selected or primary site

* update reader upsell banner to point to correct domain flow

* undo commented logic check

* update other selectors to use the calculated siteId value
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.

3 participants