Skip to content

Comments

PTO Square: Use wait-for-plugins step when checking if WooCommerce is installed#101786

Merged
epeicher merged 4 commits intotrunkfrom
fix/is-woo-active-taking-long
Mar 25, 2025
Merged

PTO Square: Use wait-for-plugins step when checking if WooCommerce is installed#101786
epeicher merged 4 commits intotrunkfrom
fix/is-woo-active-taking-long

Conversation

@epeicher
Copy link
Contributor

@epeicher epeicher commented Mar 24, 2025

Resolves https://linear.app/a8c/issue/DOTOBRD-34/pto-square-check-if-woocommerce-is-active-is-taking-too-long

Proposed Changes

  • Use the existing wait-for-plugin-install step when checking if WooCommerce plugin is installed
  • Remove the existing check of the woocommerce_is_active option

Why are these changes being made?

  • Checking the option woocommerce_is_active takes too long as it requires the option to be synchronized to the cached database
  • Using the existing step wait-for-plugin-install is faster as it does not depend on synchronization steps

Testing Instructions

  • Apply this change
  • Execute the PTO flow by navigating to /setup/new-hosted-site/plans?partnerBundle=square
  • Create a Business site and follow the checkout
  • Confirm that after creating the site, the flow redirects to the WooCommerce Launchpad and you can see the Get paid with Square in one of the Launchpad steps.
  • Repeat for the Commerce site and confirm the flow redirects to the WooCommerce Launchpad too as in the previous step
    CleanShot 2025-03-24 at 16 47 53@2x

Regression testing

new-hosted-site flow without partnerBundle

  • Create a site by following the flow starting with https://wordpress.com/hosting/ and clicking Create a site or navigating to /setup/new-hosted-site
  • Ensure there are no unexpected errors and the sites can be created successfully.

entrepreneur flow

  • Create a site by following the flow starting with https://wordpress.com/ecommerce/ and clicking Get Started with Commerce or navigating to /setup/entrepreneur
  • Follow all the flow
  • Ensure there are no unexpected errors and the site can be created successfully.

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

@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

  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/is-woo-active-taking-long on your sandbox.

@epeicher epeicher marked this pull request as draft March 24, 2025 15:58
@github-actions
Copy link

github-actions bot commented Mar 24, 2025

@matticbot
Copy link
Contributor

matticbot commented Mar 24, 2025

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

App Entrypoints (~7 bytes added 📈 [gzipped])

Details
name                   parsed_size           gzip_size
entry-stepper              -1188 B  (-0.1%)       -8 B  (-0.0%)
entry-subscriptions         -141 B  (-0.0%)      -43 B  (-0.0%)
entry-domains-landing       -141 B  (-0.0%)      -43 B  (-0.0%)
entry-browsehappy           -141 B  (-0.1%)      -43 B  (-0.1%)
entry-login                  -75 B  (-0.0%)       +5 B  (+0.0%)
entry-main                   -49 B  (-0.0%)      +20 B  (+0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~38383 bytes removed 📉 [gzipped])

Details
name                           parsed_size            gzip_size
transferring-hosted-site-flow    -292085 B  (-98.1%)   -97361 B  (-97.8%)
stats                               +128 B   (+0.0%)      +39 B   (+0.0%)
reader                              +103 B   (+0.0%)      +61 B   (+0.0%)
jetpack-cloud-overview              +103 B   (+0.0%)      +42 B   (+0.0%)
a8c-for-agencies-overview           +103 B   (+0.0%)      +55 B   (+0.0%)
entrepreneur-flow                    +84 B   (+0.0%)      +29 B   (+0.1%)
subscribers                          +56 B   (+0.0%)      +18 B   (+0.0%)
earn                                 +56 B   (+0.0%)      +18 B   (+0.0%)
home                                 -47 B   (-0.0%)      -19 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 (~628 bytes removed 📉 [gzipped])

Details
name                                                 parsed_size           gzip_size
async-load-calypso-my-sites-stats-pages-subscribers       -140 B  (-0.1%)     -628 B  (-1.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.

@epeicher epeicher marked this pull request as ready for review March 24, 2025 16:25
@epeicher epeicher requested a review from a team March 24, 2025 16:56
@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 24, 2025
@epeicher epeicher requested review from a team and removed request for a team March 24, 2025 16:56
@epeicher
Copy link
Contributor Author

Moving back to In Progress as I will be fixing the tests

@epeicher epeicher added [Status] In Progress and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Mar 24, 2025
@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 24, 2025
@epeicher epeicher requested a review from a team March 24, 2025 17:37
@epeicher
Copy link
Contributor Author

Ready for review. @Automattic/serenity , I added you as a reviewer as I saw you created the WAIT_FOR_PLUGIN_INSTALL that I have slightly modified, hopefully without impacting existing behaviour 😄

Copy link
Contributor

@gavande1 gavande1 left a comment

Choose a reason for hiding this comment

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

I have tested this, and it is working as expected. The flow sends a request to the plugin's endpoint before redirecting the user to the wp-admin. 👍

Copy link
Contributor

@gcsecsey gcsecsey left a comment

Choose a reason for hiding this comment

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

The changes look good to me.

I tested with both Business and eCommerce sites, and both work as described. ✅

Business:

CleanShot.2025-03-25.at.11.16.55.mp4

eCommerce:

CleanShot.2025-03-25.at.11.20.15.mp4

@epeicher epeicher merged commit 2166618 into trunk Mar 25, 2025
17 of 18 checks passed
@epeicher epeicher deleted the fix/is-woo-active-taking-long branch March 25, 2025 11:28
@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 Mar 25, 2025
@epeicher
Copy link
Contributor Author

Merging this, if we find any issues, we can always create a follow-up task

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.

4 participants