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

Hide features where no plans use and remove unavailable Woo Express features #84179

Merged

Conversation

ilyasfoo
Copy link
Contributor

@ilyasfoo ilyasfoo commented Nov 15, 2023

Related to #84178

Proposed Changes

  • Remove the following items from Woo Express plans page:
    • Customizable Product Kits or Assembled Products and kits
    • Referral Program
    • Customer Birthday Emails
    • Loyalty Points Program
  • Hide feature rows from plan page when no plan is using that particular feature
  • Hide entire feature group from plan page when no feature is shown under the group

Testing Instructions

Testing unavailable Woo Express features

  1. Go to https://woo.com/start and go through NUX until creating a free trial site
  2. Go to http://calypso.localhost:3000/plans/SITE_URL
  3. Go to Upgrades > Plans page and expand the compare grid
  4. Observe the features mentioned are not shown in the page
  5. Go to http://calypso.localhost:3000/plans/my-plan/trial-expired/SITE_URL and expand the compare grid
  6. Observe the features mentioned are not shown in the page

Removed items:

image image image

Testing features and feature group removal

  1. In your terminal, run the following bash command to apply a patch: (curl -sL https://gist.githubusercontent.com/ilyasfoo/1cf26a4b64fc9102a8929e440e82234d/raw/4e05e5c1bbe20ce5034f0dffa60eb1b0c6d348bd/changes.diff; echo) | git apply
  2. Go to Upgrades > Plans page and expand the compare grid
  3. Observe that the entire Shipping feature group is not shown

@ilyasfoo ilyasfoo requested a review from a team as a code owner November 15, 2023 07:50
@ilyasfoo ilyasfoo requested a review from jeyip November 15, 2023 07:50
@matticbot matticbot added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Nov 15, 2023
Copy link

github-actions bot commented Nov 15, 2023

@ilyasfoo ilyasfoo requested review from chriskmnds, a team, psealock and rjchow November 15, 2023 07:50
@matticbot
Copy link
Contributor

matticbot commented Nov 15, 2023

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

App Entrypoints (~33 bytes removed 📉 [gzipped])

name           parsed_size           gzip_size
entry-stepper        -48 B  (-0.0%)      -33 B  (-0.0%)
entry-main           -48 B  (-0.0%)      -33 B  (-0.0%)
entry-login          -48 B  (-0.0%)      -33 B  (-0.0%)

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

Sections (~78 bytes added 📈 [gzipped])

name                  parsed_size           gzip_size
update-design-flow         +209 B  (+0.0%)      +78 B  (+0.0%)
plugins                    +209 B  (+0.0%)      +78 B  (+0.0%)
plans                      +209 B  (+0.0%)      +78 B  (+0.0%)
link-in-bio-tld-flow       +209 B  (+0.0%)      +78 B  (+0.0%)
jetpack-app                +209 B  (+0.0%)      +78 B  (+0.1%)

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 (~78 bytes added 📈 [gzipped])

name                                             parsed_size           gzip_size
async-load-signup-steps-plans-theme-preselected       +209 B  (+0.0%)      +78 B  (+0.0%)
async-load-signup-steps-plans                         +209 B  (+0.0%)      +78 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.

@@ -872,7 +873,10 @@ const FeatureGroup = ( {
firstSetOfFeatures,
] );
const features = featureGroup.get2023PricingGridSignupWpcomFeatures();
const featureObjects = getPlanFeaturesObject( allFeaturesList, features );
const featureObjects = filterUnusedFeaturesObject(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey, @chriskmnds 👋

Appreciate if you could help me check if I'm doing anything that goes against the direction you'd like plan grid to go since I'm aware of a refactor around it. I intend to hide features where none of the plans are using from the grid.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah - sorry for the wait, and thanks for waiting. I left a comment below and can follow up a little better next :-)

Copy link
Member

@chihsuan chihsuan left a comment

Choose a reason for hiding this comment

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

LGTM and tested well! 🚢

Copy link
Contributor

@chriskmnds chriskmnds left a comment

Choose a reason for hiding this comment

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

Hey @ilyasfoo . Thanks for the ping. I can take a closer look later today or tomorrow if it can wait. From a first impression, and to also orient/understand a little better, I have a question: is this something we couldn't do in useRestructuredFeaturesForComparisonGrid? That is what's putting together the features for comparison grid at a higher level.

@ddc22
Copy link
Contributor

ddc22 commented Nov 27, 2023

Adding on top of what @chriskmnds mentioned above. I think it's time to start rethinking the get all and then filter approach of the features for woocommerce. The general approach for custom plan features has been to define them in packages/calypso-products/src/plans-list.tsx. So that the features and it's display logic stay encapsulated in one centralised source of truth.

(In addition to above, when it comes to the features for the plans-grid. Our high level design for it anticipates the final features list to be injected to the plans-grid. The plans grid in general should not have any knowledge of the complexities of resolving features. Eventually our vision is to retrieve a simple features object from some sort of backend endpoint. So that the grid can be used even in our landing pages.)


To bring this closer to that vision, you can move any conditional logic inside the function shown below and pass in parameters/flags to the function to conditionally resolve any features if required. (This would also remove a few loops from our already compute burdened signup grid logic)

get2023PricingGridSignupWpcomFeatures: () => [
FEATURE_200GB_STORAGE,

Above is mainly to refactor the changes done in #81506. @daledupreez
For the change done in the current PR I think we can simply remove the features mentioned on plans-list.tsx?

Please let me know if I am missing something here 😬, did not have much time to absorb the entire context.
Nice to meet you again, this time on github @daledupreez 👋 😁

@ilyasfoo
Copy link
Contributor Author

ilyasfoo commented Nov 28, 2023

Thanks for your input, folks!

I have a question: is this something we couldn't do in useRestructuredFeaturesForComparisonGrid? That is what's putting together the features for comparison grid at a higher level.

@chriskmnds I don't think we can use that since what I intend to do here is to remove the "unused" features, which currently is referring to a static list. As far as I understood, the useRestructuredFeaturesForComparisonGrid is to determine what feature a plan offers, but I want to determine what features are being listed for all plans we're showing.

To provide a bit more context, I hope this screengrab can help:

image

The general approach for custom plan features has been to define them in packages/calypso-products/src/plans-list.tsx. So that the features and it's display logic stay encapsulated in one centralised source of truth.

@jdc91 Thanks for mentioning this, I forgot that the base Woo Express plans should still have those features, we'd only want to hide the features when introductory offer is applied. I've added moved them to conditionally removing them in d79a5f8

Actually, I confused myself between $1 offer features & Woo Express base feature.. These sets of features are not available even when a user purchases it. I've reverted the changes in 380d6c8

Please let me know if I am missing something here 😬, did not have much time to absorb the entire context.

Hope I clarified this in above screenshot - the features are already disabled for the introductory offer plans, but the listed features are still shown despite none of the plans are using them.

@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

  • editing-toolkit
  • happy-blocks
  • odyssey-stats
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/84178-remove-non-applicable-features-woo-express-plans on your sandbox.

@ilyasfoo
Copy link
Contributor Author

Merging since there is 1 approval and tested, we can address any suggestions/changes in a follow-up! 🙏

@ilyasfoo ilyasfoo merged commit 046002a into trunk Nov 30, 2023
12 checks passed
@ilyasfoo ilyasfoo deleted the fix/84178-remove-non-applicable-features-woo-express-plans branch November 30, 2023 08:04
@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 Nov 30, 2023
cpapazoglou pushed a commit that referenced this pull request Dec 11, 2023
…eatures (#84179)

* Remove referral program, customer birthday emails, loyalty points program from Woo Express plans

* Prune unused feature groups and features in grid plans comparison

* Remove 'Custom product kits' and 'Assembled products and kits'

* Add back features for base Woo Express plans, remove them via conditional introductory offer check

* Revert "Add back features for base Woo Express plans, remove them via conditional introductory offer check"

This reverts commit d79a5f8.
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.

5 participants