Skip to content

Commit

Permalink
Update plan references in Marketing (#64470)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
gmovr authored Jun 10, 2022
1 parent 0dcdf84 commit 1fdf339
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 25 deletions.
2 changes: 1 addition & 1 deletion client/my-sites/marketing/tools/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const MarketingTools: FunctionComponent = () => {
<MarketingToolsFeature
title={ translate( 'Want to connect with your audience on Facebook and Instagram?' ) }
description={ translate(
'Discover an easy way to advertise your brand across Facebook and Instagram. Capture website actions to help you target audiences and measure results. {{em}}Available on Pro plan{{/em}}.',
'Discover an easy way to advertise your brand across Facebook and Instagram. Capture website actions to help you target audiences and measure results. {{em}}Available on Business and eCommerce plans{{/em}}.',
{
components: {
em: <em />,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
findFirstSimilarPlanKey,
TYPE_PRO,
TYPE_PREMIUM,
FEATURE_CLOUDFLARE_ANALYTICS,
FEATURE_GOOGLE_ANALYTICS,
} from '@automattic/calypso-products';
Expand Down Expand Up @@ -117,10 +117,10 @@ export function CloudflareAnalyticsSettings( {
const renderForm = () => {
const placeholderText = isRequestingSettings ? translate( 'Loading' ) : '';

const nudgeTitle = translate( 'Available with the Pro plan' );
const nudgeTitle = translate( 'Available with Premium plans or higher' );

const plan = findFirstSimilarPlanKey( site.plan.product_slug, {
type: TYPE_PRO,
type: TYPE_PREMIUM,
} );

const nudge = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const GoogleAnalyticsSimpleForm = ( {
} ) => {
const analyticsSupportUrl = localizeUrl( 'https://wordpress.com/support/google-analytics/' );
const nudgeTitle = translate(
'Connect your site to Google Analytics in seconds with the Pro plan'
'Connect your site to Google Analytics in seconds with the Premium plan'
);

useEffect( () => {
Expand Down
25 changes: 7 additions & 18 deletions client/my-sites/site-settings/seo-settings/form.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import {
isWpComAnnualPlan,
FEATURE_ADVANCED_SEO,
FEATURE_SEO_PREVIEW_TOOLS,
TYPE_BUSINESS,
TYPE_PRO,
findFirstSimilarPlanKey,
} from '@automattic/calypso-products';
import { Card, Button, FormInputValidation } from '@automattic/components';
Expand Down Expand Up @@ -247,32 +246,22 @@ export class SiteSettingsFormSEO extends Component {

const generalTabUrl = getGeneralTabUrl( slug );

// the Pro plan only has an annual term for now.
const upsellType =
selectedSite.plan && isWpComAnnualPlan( selectedSite.plan.product_slug )
? TYPE_PRO
: TYPE_BUSINESS;
const upsellTitle =
upsellType === TYPE_PRO
? translate(
'Boost your search engine ranking with the powerful SEO tools in the Pro plan'
)
: translate(
'Boost your search engine ranking with the powerful SEO tools in the Business plan'
);

const upsellProps =
siteIsJetpack && ! isAtomic
? {
title: translate( 'Boost your search engine ranking' ),
feature: FEATURE_SEO_PREVIEW_TOOLS,
href: `/checkout/${ slug }/${ PRODUCT_UPSELLS_BY_FEATURE[ FEATURE_ADVANCED_SEO ] }`,
}
: {
title: upsellTitle,
title: translate(
'Boost your search engine ranking with the powerful SEO tools in the Business plan'
),
feature: FEATURE_ADVANCED_SEO,
plan:
selectedSite.plan &&
findFirstSimilarPlanKey( selectedSite.plan.product_slug, {
type: upsellType,
type: TYPE_BUSINESS,
} ),
};

Expand Down
4 changes: 2 additions & 2 deletions client/my-sites/site-settings/seo-settings/test/form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
PLAN_PREMIUM_2_YEARS,
PLAN_PERSONAL,
PLAN_PERSONAL_2_YEARS,
PLAN_WPCOM_PRO,
PLAN_BUSINESS,
PLAN_JETPACK_FREE,
PLAN_JETPACK_PERSONAL,
PLAN_JETPACK_PERSONAL_MONTHLY,
Expand Down Expand Up @@ -159,7 +159,7 @@ describe( 'UpsellNudge should get appropriate plan constant', () => {
<SeoForm { ...props } siteIsJetpack={ false } selectedSite={ { plan: { product_slug } } } />
);
expect( comp.find( 'UpsellNudge' ) ).toHaveLength( 1 );
expect( comp.find( 'UpsellNudge' ).props().plan ).toBe( PLAN_WPCOM_PRO );
expect( comp.find( 'UpsellNudge' ).props().plan ).toBe( PLAN_BUSINESS );
} );
} );

Expand Down

0 comments on commit 1fdf339

Please sign in to comment.