Skip to content

Commit

Permalink
Memberships: Rename to "Recurring Payments" (#12488)
Browse files Browse the repository at this point in the history
This renames the membership block to recurring payments button.
Associated filename changes go with this.

* Change copy of Memberships to Recurring Payments

* few fixes

* Change block id to recurring-payment-button

* Rename dir

* Block id change

* Reorder

* Settle on one capitalization
  • Loading branch information
artpi authored and jeherve committed May 30, 2019
1 parent 6d71d2d commit fe4fb9a
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class MembershipsButtonEdit extends Component {
isLarge
onClick={ () => this.setState( { addingMembershipAmount: PRODUCT_FORM } ) }
>
{ __( 'Add Memberships Amounts', 'jetpack' ) }
{ __( 'Add a Recurring Payments Plan', 'jetpack' ) }
</Button>
);
}
Expand Down Expand Up @@ -306,8 +306,8 @@ class MembershipsButtonEdit extends Component {
renderDisclaimer = () => {
return (
<div className="membership-button__disclaimer">
<ExternalLink href="https://en.support.wordpress.com/memberships/#related-fees">
{ __( 'Read more about memberships and related fees.', 'jetpack' ) }
<ExternalLink href="https://en.support.wordpress.com/recurring-payments/#related-fees">
{ __( 'Read more about Recurring Payments and related fees.', 'jetpack' ) }
</ExternalLink>
</div>
);
Expand All @@ -321,7 +321,7 @@ class MembershipsButtonEdit extends Component {
<InspectorControls>
<PanelBody title={ __( 'Product', 'jetpack' ) }>
<SelectControl
label={ __( 'Membership plan', 'jetpack' ) }
label={ __( 'Payment plan', 'jetpack' ) }
value={ this.props.attributes.planId }
onChange={ this.setMembershipAmount }
options={ this.state.products.map( product => ( {
Expand All @@ -331,8 +331,8 @@ class MembershipsButtonEdit extends Component {
} ) ) }
/>
</PanelBody>
<PanelBody title={ __( 'Member Management', 'jetpack' ) }>
<ExternalLink href={ `https://wordpress.com/earn/memberships/${ this.state.siteSlug }` }>
<PanelBody title={ __( 'Management', 'jetpack' ) }>
<ExternalLink href={ `https://wordpress.com/earn/payments/${ this.state.siteSlug }` }>
{ __( 'See your earnings, subscriber list, and products.', 'jetpack' ) }
</ExternalLink>
</PanelBody>
Expand All @@ -358,11 +358,14 @@ class MembershipsButtonEdit extends Component {
{ this.state.shouldUpgrade && (
<Placeholder
icon={ <BlockIcon icon={ icon } /> }
label={ __( 'Memberships', 'jetpack' ) }
label={ __( 'Recurring Payments', 'jetpack' ) }
notices={ notices }
>
<div className="components-placeholder__instructions wp-block-jetpack-membership-button">
{ __( "You'll need to upgrade your plan to use the Membership Button.", 'jetpack' ) }
{ __(
"You'll need to upgrade your plan to use the Recurring Payments button.",
'jetpack'
) }
<br />
<br />
<Button isDefault isLarge href={ this.state.upgradeURL } target="_blank">
Expand All @@ -385,12 +388,12 @@ class MembershipsButtonEdit extends Component {
connected === API_STATE_NOTCONNECTED && (
<Placeholder
icon={ <BlockIcon icon={ icon } /> }
label={ __( 'Memberships', 'jetpack' ) }
label={ __( 'Recurring Payments', 'jetpack' ) }
notices={ notices }
>
<div className="components-placeholder__instructions wp-block-jetpack-membership-button">
{ __(
'In order to start selling Membership plans, you have to connect to Stripe:',
'In order to start selling Recurring Payments plans, you have to connect to Stripe:',
'jetpack'
) }
<br />
Expand All @@ -413,11 +416,11 @@ class MembershipsButtonEdit extends Component {
products.length === 0 && (
<Placeholder
icon={ <BlockIcon icon={ icon } /> }
label={ __( 'Memberships', 'jetpack' ) }
label={ __( 'Recurring Payments', 'jetpack' ) }
notices={ notices }
>
<div className="components-placeholder__instructions wp-block-jetpack-membership-button">
{ __( 'Add your first Membership amount:', 'jetpack' ) }
{ __( 'Add your first Recurring Payments plan:', 'jetpack' ) }
<br />
<br />
{ this.renderAddMembershipAmount() }
Expand All @@ -432,13 +435,13 @@ class MembershipsButtonEdit extends Component {
products.length > 0 && (
<Placeholder
icon={ <BlockIcon icon={ icon } /> }
label={ __( 'Memberships', 'jetpack' ) }
label={ __( 'Recurring Payments', 'jetpack' ) }
notices={ notices }
>
<div className="components-placeholder__instructions wp-block-jetpack-membership-button">
{ __( 'Select payment amount:', 'jetpack' ) }
{ __( 'Select payment plan:', 'jetpack' ) }
{ this.renderMembershipAmounts() }
{ __( 'Or add another membership amount:', 'jetpack' ) }
{ __( 'Or add another Recurring Payments plan:', 'jetpack' ) }
<br />
{ this.renderAddMembershipAmount() }
{ this.renderDisclaimer() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { __, _x } from '@wordpress/i18n';
import edit from './edit';
import './editor.scss';

export const name = 'membership-button';
export const name = 'recurring-payments';

export const icon = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
Expand All @@ -22,7 +22,7 @@ export const icon = (
);

export const settings = {
title: __( 'Membership Button', 'jetpack' ),
title: __( 'Recurring Payments button', 'jetpack' ),
icon,
description: __( 'Button allowing you to sell subscription products.', 'jetpack' ),
category: 'jetpack',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
require_once JETPACK__PLUGIN_DIR . '/modules/memberships/class-jetpack-memberships.php';

jetpack_register_block(
'jetpack/membership-button',
'jetpack/recurring-payments',
array(
'render_callback' => array( Jetpack_Memberships::get_instance(), 'render_button' ),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Internal dependencies
*/
import './view.scss';
const name = 'membership-button';
const name = 'recurring-payments';
const blockClassName = 'wp-block-jetpack-' + name;

/**
Expand Down Expand Up @@ -64,7 +64,7 @@ const initializeMembershipButtonBlocks = () => {
activateSubscription( block, blogId, planId, poweredText, lang );
} catch ( err ) {
// eslint-disable-next-line no-console
console.error( 'Problem activating Membership Button ' + planId, err );
console.error( 'Problem activating Recurring Payments ' + planId, err );
}
} );
};
Expand Down
2 changes: 1 addition & 1 deletion extensions/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"mailchimp",
"map",
"markdown",
"membership-button",
"publicize",
"recurring-payments",
"related-posts",
"repeat-visitor",
"sharing",
Expand Down
4 changes: 2 additions & 2 deletions modules/memberships/class-jetpack-memberships.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Jetpack_Memberships {
*
* @var string
*/
private static $button_block_name = 'membership-button';
private static $button_block_name = 'recurring-payments';

/**
* These are defaults for wp_kses ran on the membership button.
Expand Down Expand Up @@ -120,7 +120,7 @@ private function setup_cpts() {
);
$order_args = array(
'label' => esc_html__( 'Plan', 'jetpack' ),
'description' => esc_html__( 'Memberships plans', 'jetpack' ),
'description' => esc_html__( 'Recurring Payments plans', 'jetpack' ),
'supports' => array( 'title', 'custom-fields', 'content' ),
'hierarchical' => false,
'public' => false,
Expand Down

0 comments on commit fe4fb9a

Please sign in to comment.