Skip to content

Commit

Permalink
Paid stats: add Stats reference on Personal checkout (#97305)
Browse files Browse the repository at this point in the history
* Add `FEATURE_STATS_COMMERCIAL` description and update `FEATURE_STATS_PAID` title/description under `stats/paid-wpcom-v3` feature flag

* Replace `FEATURE_STATS_PAID` with conditional logic to use `FEATURE_STATS_COMMERCIAL` under `stats/paid-wpcom-v3` feature flag

* Update packages/calypso-products/src/features-list.tsx

Co-authored-by: Louis Laugesen <[email protected]>

* Update packages/calypso-products/src/features-list.tsx

Co-authored-by: Louis Laugesen <[email protected]>

---------

Co-authored-by: Louis Laugesen <[email protected]>
  • Loading branch information
Initsogar and lsl authored Dec 11, 2024
1 parent 377418f commit c780b16
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 14 deletions.
13 changes: 13 additions & 0 deletions packages/calypso-products/src/features-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ import {
FEATURE_COMMISSION_FEE_STANDARD_FEATURES,
FEATURE_COMMISSION_FEE_WOO_FEATURES,
FEATURE_STATS_PAID,
FEATURE_STATS_COMMERCIAL,
FEATURE_SENSEI_SUPPORT,
FEATURE_SENSEI_UNLIMITED,
FEATURE_SENSEI_INTERACTIVE,
Expand Down Expand Up @@ -1863,6 +1864,18 @@ const FEATURES_LIST: FeatureList = {
},
[ FEATURE_STATS_PAID ]: {
getSlug: () => FEATURE_STATS_PAID,
getTitle: () => {
return isEnabled( 'stats/paid-wpcom-v3' )
? i18n.translate( 'Stats beyond the last 7 days' )
: i18n.translate( 'In-depth site analytics dashboard' );
},
getDescription: () =>
i18n.translate(
'Deep-dive analytics and conversion data to help you make decisions to grow your site.'
),
},
[ FEATURE_STATS_COMMERCIAL ]: {
getSlug: () => FEATURE_STATS_COMMERCIAL,
getTitle: () => i18n.translate( 'In-depth site analytics dashboard' ),
getDescription: () =>
i18n.translate(
Expand Down
42 changes: 28 additions & 14 deletions packages/calypso-products/src/plans-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ import {
PRODUCT_JETPACK_STATS_YEARLY,
TERM_CENTENNIALLY,
FEATURE_STATS_PAID,
FEATURE_STATS_COMMERCIAL,
PRODUCT_JETPACK_SCAN_BI_YEARLY,
PRODUCT_JETPACK_ANTI_SPAM_BI_YEARLY,
PRODUCT_JETPACK_VIDEOPRESS_BI_YEARLY,
Expand Down Expand Up @@ -850,12 +851,18 @@ const getPlanPersonalDetails = (): IncompleteWPcomPlan => ( {
FEATURE_PREMIUM_CONTENT_JP,
FEATURE_PAID_SUBSCRIBERS_JP,
],
getCheckoutFeatures: () => [
FEATURE_CUSTOM_DOMAIN,
FEATURE_AD_FREE_EXPERIENCE,
FEATURE_FAST_DNS,
FEATURE_PAID_SUBSCRIBERS_JP,
],
getCheckoutFeatures: () => {
const baseFeatures = [
FEATURE_CUSTOM_DOMAIN,
FEATURE_AD_FREE_EXPERIENCE,
FEATURE_FAST_DNS,
FEATURE_PAID_SUBSCRIBERS_JP,
];

return isEnabled( 'stats/paid-wpcom-v3' )
? [ ...baseFeatures, FEATURE_STATS_PAID ]
: baseFeatures;
},
// Features not displayed but used for checking plan abilities
getIncludedFeatures: () => [ FEATURE_AUDIO_UPLOADS ],
getInferiorFeatures: () => [],
Expand Down Expand Up @@ -1287,7 +1294,7 @@ const getPlanPremiumDetails = (): IncompleteWPcomPlan => ( {
WPCOM_FEATURES_PREMIUM_THEMES_UNLIMITED,
FEATURE_UNLTD_SOCIAL_MEDIA_JP,
FEATURE_VIDEOPRESS_JP,
FEATURE_STATS_PAID,
isEnabled( 'stats/paid-wpcom-v3' ) ? FEATURE_STATS_COMMERCIAL : FEATURE_STATS_PAID,
FEATURE_PAYMENT_TRANSACTION_FEES_4,
],
getNewsletterHighlightedFeatures: () => [
Expand All @@ -1307,7 +1314,7 @@ const getPlanPremiumDetails = (): IncompleteWPcomPlan => ( {
FEATURE_VIDEOPRESS_JP,
FEATURE_UNLTD_SOCIAL_MEDIA_JP,
FEATURE_WORDADS,
FEATURE_STATS_PAID,
isEnabled( 'stats/paid-wpcom-v3' ) ? FEATURE_STATS_COMMERCIAL : FEATURE_STATS_PAID,
],
getLinkInBioHighlightedFeatures: () => [ FEATURE_CUSTOM_DOMAIN ],
getBlogOnboardingSignupFeatures: () => [
Expand All @@ -1323,7 +1330,7 @@ const getPlanPremiumDetails = (): IncompleteWPcomPlan => ( {
FEATURE_VIDEOPRESS_JP,
FEATURE_UNLTD_SOCIAL_MEDIA_JP,
FEATURE_SITE_ACTIVITY_LOG_JP,
FEATURE_STATS_PAID,
isEnabled( 'stats/paid-wpcom-v3' ) ? FEATURE_STATS_COMMERCIAL : FEATURE_STATS_PAID,
],
getBlogSignupFeatures: () =>
[
Expand Down Expand Up @@ -1376,7 +1383,7 @@ const getPlanPremiumDetails = (): IncompleteWPcomPlan => ( {
WPCOM_FEATURES_PREMIUM_THEMES_UNLIMITED,
FEATURE_WORDADS,
FEATURE_STYLE_CUSTOMIZATION,
FEATURE_STATS_PAID,
isEnabled( 'stats/paid-wpcom-v3' ) ? FEATURE_STATS_COMMERCIAL : FEATURE_STATS_PAID,
FEATURE_VIDEOPRESS_JP,
FEATURE_UNLTD_SOCIAL_MEDIA_JP,
FEATURE_SITE_ACTIVITY_LOG_JP,
Expand All @@ -1391,7 +1398,11 @@ const getPlanPremiumDetails = (): IncompleteWPcomPlan => ( {
[ FEATURE_COMMISSION_FEE_STANDARD_FEATURES ]: i18n.translate( '4%' ),
} ),
get2023PlanComparisonJetpackFeatureOverride: () => {
return [ FEATURE_PAYPAL_JP, FEATURE_VIDEOPRESS_JP, FEATURE_STATS_PAID ];
return [
FEATURE_PAYPAL_JP,
FEATURE_VIDEOPRESS_JP,
isEnabled( 'stats/paid-wpcom-v3' ) ? FEATURE_STATS_COMMERCIAL : FEATURE_STATS_PAID,
];
},
// Features not displayed but used for checking plan abilities
getIncludedFeatures: () => [
Expand Down Expand Up @@ -1968,7 +1979,7 @@ const getJetpackBusinessDetails = (): IncompleteJetpackPlan => ( {
WPCOM_FEATURES_SCAN,
WPCOM_FEATURES_ANTISPAM,
WPCOM_FEATURES_BACKUPS,
FEATURE_STATS_PAID,
isEnabled( 'stats/paid-wpcom-v3' ) ? FEATURE_STATS_COMMERCIAL : FEATURE_STATS_PAID,
] ),
getInferiorFeatures: () => [ FEATURE_JETPACK_BACKUP_DAILY, FEATURE_JETPACK_BACKUP_DAILY_MONTHLY ],
} );
Expand Down Expand Up @@ -2244,7 +2255,7 @@ const getPlanJetpackCompleteDetails = (): IncompleteJetpackPlan => ( {
WPCOM_FEATURES_SCAN,
WPCOM_FEATURES_ANTISPAM,
WPCOM_FEATURES_BACKUPS,
FEATURE_STATS_PAID,
isEnabled( 'stats/paid-wpcom-v3' ) ? FEATURE_STATS_COMMERCIAL : FEATURE_STATS_PAID,
] ),
getInferiorFeatures: () => [
FEATURE_JETPACK_BACKUP_DAILY,
Expand Down Expand Up @@ -2357,7 +2368,10 @@ const getPlanJetpackGrowthDetails = (): IncompleteJetpackPlan => ( {
translate(
'Essential tools to help you grow your audience, track visitor engagement, and turn leads into loyal customers and advocates.'
),
getPlanCardFeatures: () => [ FEATURE_JETPACK_SOCIAL_V1_MONTHLY, FEATURE_STATS_PAID ],
getPlanCardFeatures: () => [
FEATURE_JETPACK_SOCIAL_V1_MONTHLY,
isEnabled( 'stats/paid-wpcom-v3' ) ? FEATURE_STATS_COMMERCIAL : FEATURE_STATS_PAID,
],
getIncludedFeatures: () => [
FEATURE_EARN_AD,
FEATURE_UNLIMITED_SUBSCRIBERS,
Expand Down

0 comments on commit c780b16

Please sign in to comment.