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

Jetpack Search: enable purchases via "...search/yearly" routes. #43865

Merged
merged 3 commits into from
Jul 2, 2020

Conversation

AnnaMag
Copy link
Contributor

@AnnaMag AnnaMag commented Jul 2, 2020

Changes proposed in this Pull Request

  • Process purchases via /jetpack/connect/jetpack_search/yearly and /jetpack/connect/wpcom_search/yearly routes.
    At the moment inputting urls is disabled at those screens. We use /jetpack/connect/jetpack_search for yearly product type, but since /yearly had been defined as a route, we should keep it functional.
    Also, here we adapt product type definition such that it is independent of the actual route.

Second fix is processing purchases for Jetpack sites- we correct the condition that moderated WP.com vs. JP site type of product at checkout. It was adding an empty product and as such, redirecting to /plans.

Testing instructions

  • Go to /jetpack/connect/(jetpack|wpcom)_search/yearly and verify the purchase process.
  • Verify the purchase for a Jetpack site.

Those are defined adding /yearly to the url. We take those as default
and skip including yearly in product type slug. So e.g. jetpack_search
is the yearly version, while jetpack_search_monthly, its monthly
version.
@AnnaMag AnnaMag added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. Pre-launch Tasks that need to be completed before launch [Feature] Search Jetpack Search - A feature to speed up and improve the look of Search on your site. labels Jul 2, 2020
@AnnaMag AnnaMag requested a review from gibrown July 2, 2020 13:40
@AnnaMag AnnaMag self-assigned this Jul 2, 2020
@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

matticbot commented Jul 2, 2020

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

Sections (~7 bytes removed 📉 [gzipped])

name             parsed_size           gzip_size
jetpack-connect        -35 B  (-0.0%)       -7 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.

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.

It would not work with the new route, which is shorter.
@AnnaMag AnnaMag force-pushed the add/process-yearly-search branch 2 times, most recently from f2cb215 to 2c7a3d4 Compare July 2, 2020 18:43
Atm it is adding an empty product to the Cart and redirecting to /plans.
@AnnaMag AnnaMag force-pushed the add/process-yearly-search branch from 2c7a3d4 to cc26a25 Compare July 2, 2020 18:51
Copy link
Member

@gibrown gibrown left a comment

Choose a reason for hiding this comment

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

Seems to all be working and code looks good

@AnnaMag AnnaMag merged commit 717a031 into master Jul 2, 2020
@AnnaMag AnnaMag deleted the add/process-yearly-search branch July 2, 2020 19:24
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Search Jetpack Search - A feature to speed up and improve the look of Search on your site. Pre-launch Tasks that need to be completed before launch [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants