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

Memberships: Rename to "Recurring Payments" #12488

Merged
merged 7 commits into from
May 30, 2019
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 Payment Button.",
Copy link
Member

Choose a reason for hiding this comment

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

Should it be payments?

Suggested change
"You'll need to upgrade your plan to use the Recurring Payment Button.",
"You'll need to upgrade your plan to use the Recurring Payments Button.",

Same for the other instances below.

'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 Payment 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 Payment 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,7 +8,7 @@
"mailchimp",
"map",
"markdown",
"membership-button",
"recurring-payments",
"publicize",
"related-posts",
"repeat-visitor",
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