-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Update isEligibleForProPlan selector to check if siteId is Pro as well #64457
Update isEligibleForProPlan selector to check if siteId is Pro as well #64457
Conversation
bd4ac0e
to
f344a76
Compare
77f42a2
to
8a4243d
Compare
f344a76
to
ead04bb
Compare
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~97 bytes added 📈 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~411 bytes added 📈 [gzipped])
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 (~133 bytes added 📈 [gzipped])
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. Generated by performance advisor bot at iscalypsofastyet.com. |
3024d34
to
ead04bb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation works OK for me!
I left one minor comment regarding the selectedSite
if ( | ||
siteId && | ||
( ( isJetpackSite( state, siteId ) && ! isAtomicSite( state, siteId ) ) || | ||
isSiteWPForTeams( state, siteId ) ) | ||
) { | ||
return false; | ||
} | ||
siteId = siteId || getSelectedSiteId( state ); | ||
const selectedSite = getSite( state, siteId || '' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is siteId || ''
really needed? And if ''
is used for the siteId would the selectedSite
return what we expect to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was needed to reconcile the type differences of the optional siteId
argument; isJetpackSite
, isAtomicSite
both expect number | null
whereas getSite
expects string | number
.
There may be other ways to address this, but I thought this was more descriptive. Also, in case ''
is passed, then selectedSite
becomes null
and currentPlan
will be undefined
- which should safely jump over to the Pro plan check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good -- and I've done several manual tests. 🟢
#64457) * Add plan check to the Pro plan eligibility checker * Add server-friendly plan check * Remove unnecessary and faulty current plan fetch
#64457) * Add plan check to the Pro plan eligibility checker * Add server-friendly plan check * Remove unnecessary and faulty current plan fetch
#64457) * Add plan check to the Pro plan eligibility checker * Add server-friendly plan check * Remove unnecessary and faulty current plan fetch
#64457) * Add plan check to the Pro plan eligibility checker * Add server-friendly plan check * Remove unnecessary and faulty current plan fetch
* Disable Pro and Starter config flags * Removing this check for now in the renew spec-- as the legacy plan notice will be removed (#64400) * Fix/pro plan reference in etk (#64476) * Disable Pro and Starter config flags * Removing this check for now in the renew spec-- as the legacy plan notice will be removed (#64400) * Swapping out the copy for pro plan in editing toolkit Co-authored-by: Claudiu Filip <claudiucelfilip@gmail.com> Co-authored-by: Even Tobiesen <52675688+gmovr@users.noreply.github.com> * Show upgrade button on the /plans/<site> for Starter and Pro plans (#64481) * Add Starter and Pro plan Business and Ecommerce upgrade whitelists * Add Pro plan to Business upgrade whitelist * Swapping out some text in the FAQ section that mentions the Pro plan (#64475) * Update isEligibleForProPlan selector to check if siteId is Pro as well (#64457) * Add plan check to the Pro plan eligibility checker * Add server-friendly plan check * Remove unnecessary and faulty current plan fetch * Plans: show notice for sites on unsupported plans (#64478) * Update plan references in Marketing (#64470) * Updated pro reference for Cloudflare UpsellNudge * Updated the UpsellNudge title with Premium plan * Updated reference from Pro in the SEO upsell. Note that the findFirstSimilarPlanKey() gives the wrong URL -- which is the same for these other upsells. * Updated reference from Pro plan in Facebook block in Marketing>Tools * Remove an extra space in copy * Updated test for the seo-settings form * Update link in UpsellNudge (#64496) * Updating the CTA urls to go to the plans page, as they used to do * Updating the specific UpsellNudge in the Settings > General form * Updating a test assertion for form-general.jsx to expect Business * Removing the check for the eligibleForProPlan here, as this will return false and we won't enter the conditional. (#64511) * Update/plan overhaul revert seo upsell preview (#64502) * Updating this nudge to Business Plan * Updating test for SEO preview upgrade nudge * Update plans references in upgrade nudges and CTAs (#64484) * Revert copy and plan in domain-to-plan-nudge to legacy (Personal) * Update copy in admin-sections in inline-help * Update contextual help texts from Pro to legacy * Changing the advertising-removed to reflect legacy plans (Business CTA) * Update reference to Personal plan required in DomainProductPrice, renderFreeWithPlanText * Update reference from Pro to Personal on domain search results domain mapping * Update copy in transfer domain step to legacy * Update theme upsell popover heading from Pro to legacy * Update backup upsell card from Pro to legacy * Update PurchaseDetail on thank you view from Pro to legacy/Business * Change Business plan upsell nudge (checkout) back to Business from Pro * Change upsell CTA in AdsWrapper to Business * Updated payment blocks/membership nudge from Pro to Personal * Updated CTA/nudge for hosting features from Pro to Business * Updated upgrade prompt on plugin install page to refer to Business plan * Fixed upgrade prompts/nudges in media-library from Pro to legacy * Updated footer card for migration confirmation step from Pro to Business * Updated reference to Business from Pro for mention on import or migrate step * Updated reference on migration upsell from Pro to Business * Updated reference to Business from Pro plan in scan/wpcom-upsell.tsx * Update upsell reference to Business instead of Pro * Updated reference from Pro to Personal in site-settings/podcasting-details * Changed text in UpsellNudge in stats-module under my-sites * Updated plans references in UpsellNudge(s) under themes * Updated title in upsellBanner for Jetpack * Updated reference in footer for blocks>import>ready * Updated plan reference in CTA for store intent * Updated strings in store features * Updated CTAs in focused launch * Reverting to existing strings for i18n * Added namespaced classname to button for lint * swapping out text for pro plan references in Settings --> Performance (#64564) * Change Pro plan mention on domain search (#64615) * Use starter plan copy overrides in all sitations * Mention paid annual plans instead of just paid * Fix: Upgrade now (to plans page) sometimes takes the user back to my-plan (#64606) * Remove unnecessary redirect and Plans navigations tab hide * Remove overhauled plans grid from the Plans page * Roll back domain search copy before Pro plan overhaul (#64618) * Restore old copy versions * Ensure transfer price is not shown for new annual plans copy * Remove Pro plan from top storage plan list (#64657) * Plans overhaul: revert Pro upsell in posts list (#64659) * Remove tos-related files * Remove unused variable * Small lint fix * Add previous admin section copy changes to new file * Skip Free to Pro test suite * User better method to disable Free to Pro upgrade test * Updated the tooltip/description for live chat support to not set a specific day/time range for more flexibility (#65721) * Starter can upgrade to Premium, and Pro Monthly can upgrade to Business or Ecommerce Monthly (#65724) * Starter can upgrade to Premium. Pro monthly can upgrade to Business or eCommerce monthly * Monthly Pro plan can upgrade to higher annual and bi-annual plans * Wrap legacy notice text in translation check * Plan Overhaul revert: Do not offer Starter plan to install premium plugins (#65772) * Use the Goals URL when declining Business Upsell (#65773) Co-authored-by: Even Tobiesen <52675688+gmovr@users.noreply.github.com> Co-authored-by: Jessie Harris <jessie.harris@automattic.com> Co-authored-by: Taegon Kim <gonom9@gmail.com> Co-authored-by: Christos <chriskmnds@gmail.com> Co-authored-by: Miguel Torres <miguel.torres@automattic.com>
#64457) * Add plan check to the Pro plan eligibility checker * Add server-friendly plan check * Remove unnecessary and faulty current plan fetch
* Disable Pro and Starter config flags * Removing this check for now in the renew spec-- as the legacy plan notice will be removed (#64400) * Fix/pro plan reference in etk (#64476) * Disable Pro and Starter config flags * Removing this check for now in the renew spec-- as the legacy plan notice will be removed (#64400) * Swapping out the copy for pro plan in editing toolkit Co-authored-by: Claudiu Filip <claudiucelfilip@gmail.com> Co-authored-by: Even Tobiesen <52675688+gmovr@users.noreply.github.com> * Show upgrade button on the /plans/<site> for Starter and Pro plans (#64481) * Add Starter and Pro plan Business and Ecommerce upgrade whitelists * Add Pro plan to Business upgrade whitelist * Swapping out some text in the FAQ section that mentions the Pro plan (#64475) * Update isEligibleForProPlan selector to check if siteId is Pro as well (#64457) * Add plan check to the Pro plan eligibility checker * Add server-friendly plan check * Remove unnecessary and faulty current plan fetch * Plans: show notice for sites on unsupported plans (#64478) * Update plan references in Marketing (#64470) * Updated pro reference for Cloudflare UpsellNudge * Updated the UpsellNudge title with Premium plan * Updated reference from Pro in the SEO upsell. Note that the findFirstSimilarPlanKey() gives the wrong URL -- which is the same for these other upsells. * Updated reference from Pro plan in Facebook block in Marketing>Tools * Remove an extra space in copy * Updated test for the seo-settings form * Update link in UpsellNudge (#64496) * Updating the CTA urls to go to the plans page, as they used to do * Updating the specific UpsellNudge in the Settings > General form * Updating a test assertion for form-general.jsx to expect Business * Removing the check for the eligibleForProPlan here, as this will return false and we won't enter the conditional. (#64511) * Update/plan overhaul revert seo upsell preview (#64502) * Updating this nudge to Business Plan * Updating test for SEO preview upgrade nudge * Update plans references in upgrade nudges and CTAs (#64484) * Revert copy and plan in domain-to-plan-nudge to legacy (Personal) * Update copy in admin-sections in inline-help * Update contextual help texts from Pro to legacy * Changing the advertising-removed to reflect legacy plans (Business CTA) * Update reference to Personal plan required in DomainProductPrice, renderFreeWithPlanText * Update reference from Pro to Personal on domain search results domain mapping * Update copy in transfer domain step to legacy * Update theme upsell popover heading from Pro to legacy * Update backup upsell card from Pro to legacy * Update PurchaseDetail on thank you view from Pro to legacy/Business * Change Business plan upsell nudge (checkout) back to Business from Pro * Change upsell CTA in AdsWrapper to Business * Updated payment blocks/membership nudge from Pro to Personal * Updated CTA/nudge for hosting features from Pro to Business * Updated upgrade prompt on plugin install page to refer to Business plan * Fixed upgrade prompts/nudges in media-library from Pro to legacy * Updated footer card for migration confirmation step from Pro to Business * Updated reference to Business from Pro for mention on import or migrate step * Updated reference on migration upsell from Pro to Business * Updated reference to Business from Pro plan in scan/wpcom-upsell.tsx * Update upsell reference to Business instead of Pro * Updated reference from Pro to Personal in site-settings/podcasting-details * Changed text in UpsellNudge in stats-module under my-sites * Updated plans references in UpsellNudge(s) under themes * Updated title in upsellBanner for Jetpack * Updated reference in footer for blocks>import>ready * Updated plan reference in CTA for store intent * Updated strings in store features * Updated CTAs in focused launch * Reverting to existing strings for i18n * Added namespaced classname to button for lint * swapping out text for pro plan references in Settings --> Performance (#64564) * Change Pro plan mention on domain search (#64615) * Use starter plan copy overrides in all sitations * Mention paid annual plans instead of just paid * Fix: Upgrade now (to plans page) sometimes takes the user back to my-plan (#64606) * Remove unnecessary redirect and Plans navigations tab hide * Remove overhauled plans grid from the Plans page * Roll back domain search copy before Pro plan overhaul (#64618) * Restore old copy versions * Ensure transfer price is not shown for new annual plans copy * Remove Pro plan from top storage plan list (#64657) * Plans overhaul: revert Pro upsell in posts list (#64659) * Remove tos-related files * Remove unused variable * Small lint fix * Add previous admin section copy changes to new file * Skip Free to Pro test suite * User better method to disable Free to Pro upgrade test * Updated the tooltip/description for live chat support to not set a specific day/time range for more flexibility (#65721) * Starter can upgrade to Premium, and Pro Monthly can upgrade to Business or Ecommerce Monthly (#65724) * Starter can upgrade to Premium. Pro monthly can upgrade to Business or eCommerce monthly * Monthly Pro plan can upgrade to higher annual and bi-annual plans * Wrap legacy notice text in translation check * Plan Overhaul revert: Do not offer Starter plan to install premium plugins (#65772) * Use the Goals URL when declining Business Upsell (#65773) * Disable Starter plan testsuite Co-authored-by: Even Tobiesen <52675688+gmovr@users.noreply.github.com> Co-authored-by: Jessie Harris <jessie.harris@automattic.com> Co-authored-by: Taegon Kim <gonom9@gmail.com> Co-authored-by: Christos <chriskmnds@gmail.com> Co-authored-by: Miguel Torres <miguel.torres@automattic.com>
Proposed Changes
This allows the
isEligibleForProPlan
to return true if the user is on Pro plan, event if theplans/pro-plan
flag is disabled.Without this, we can get inconsistent behavior and content with the current Pro plan.
Addresses #64450
Testing Instructions
Premium support
mentions on the right side/plans/[siteId]
pageFixes #64450