Skip to content
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

Stats: Remove legacy purchase page forced redirection #95436

Merged
merged 2 commits into from
Oct 18, 2024

Conversation

dognose24
Copy link
Contributor

Related to https://github.com/Automattic/red-team/issues/139

Proposed Changes

  • Remove the unused code from the always false condition about the shouldRenderPaywall flag.
  • Remove possibly unused notice id focus_jetpack_purchase and related code, which seemed to pause the redirection for the Personal purchase page after clicking the I will do it later button.

Why are these changes being made?

  • The force purchase page redirection is no longer used. We use a paywall lock on each module or card now. More information: pejTkB-1t3-p2.

Testing Instructions

  • Spin this change up with the Calypso Live branch.
  • Prepare a site with the commercial paywall.
  • Ensure the module paywall on Stats Traffic, Insights, and module pages work as previously.

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 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)?

@dognose24 dognose24 added the [Feature] Stats Everything related to our analytics product at /stats/ label Oct 16, 2024
@dognose24 dognose24 requested a review from a team October 16, 2024 17:27
@dognose24 dognose24 self-assigned this Oct 16, 2024
@matticbot matticbot added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Oct 16, 2024
@matticbot
Copy link
Contributor

matticbot commented Oct 16, 2024

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

Sections (~627 bytes removed 📉 [gzipped])

name                parsed_size           gzip_size
stats                   -1960 B  (-0.2%)     -619 B  (-0.2%)
google-my-business        -26 B  (-0.0%)       -8 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 (~103 bytes added 📈 [gzipped])

name                                              parsed_size           gzip_size
async-load-calypso-my-sites-stats-pages-purchase       +213 B  (+0.3%)     +111 B  (+0.6%)
async-load-store-app-store-stats                        -26 B  (-0.0%)       -8 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.

@@ -1,35 +1,14 @@
import config from '@automattic/calypso-config';
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels the whole stats-redirect module could be removed, couldn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! Indeed, the LoadStatsPage component has already checked the user with authority.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in 0d909a1.

@matticbot
Copy link
Contributor

matticbot commented Oct 17, 2024

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

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

  • blaze-dashboard
  • command-palette-wp-admin
  • help-center
  • notifications
  • odyssey-stats
  • whats-new

To test WordPress.com changes, run install-plugin.sh $pluginSlug update/stats_remove_legacy_purchase_page_redirection on your sandbox.

@kangzj kangzj force-pushed the update/stats_remove_legacy_purchase_page_redirection branch from 0d909a1 to 1bf5895 Compare October 17, 2024 20:16
@dognose24
Copy link
Contributor Author

I will split the refactor for the stats-redirect folder to another PR.

@kangzj kangzj merged commit a4d15f3 into trunk Oct 18, 2024
11 checks passed
@kangzj kangzj deleted the update/stats_remove_legacy_purchase_page_redirection branch October 18, 2024 02:06
@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 Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Stats Everything related to our analytics product at /stats/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants