diff --git a/_inc/client/components/welcome-new-plan/index.jsx b/_inc/client/components/welcome-new-plan/index.jsx deleted file mode 100644 index 77df7fa39b98f..0000000000000 --- a/_inc/client/components/welcome-new-plan/index.jsx +++ /dev/null @@ -1,91 +0,0 @@ -/** - * External dependencies - */ -import PropTypes from 'prop-types'; -import React, { Component } from 'react'; -import { connect } from 'react-redux'; -import { getPlanClass } from 'lib/plans/constants'; -import analytics from 'lib/analytics'; - -/** - * Internal dependencies - */ -import { getSitePlan } from 'state/site'; -import { updateSettings } from 'state/settings'; -import WelcomePersonal from './personal'; -import WelcomePremium from './premium'; -import WelcomeProfessional from './professional'; - -class WelcomeNewPlan extends Component { - constructor() { - super(); - this.state = { - planWelcomeDismissed: false, - }; - - this.boundDismiss = this.dismissWelcome.bind( this ); - } - - dismissWelcome() { - const planClass = getPlanClass( this.props.sitePlan.product_slug ); - analytics.tracks.recordEvent( 'jetpack_warm_welcome_plan_dismiss', { - planClass: planClass, - } ); - - this.setState( { planWelcomeDismissed: true } ); - this.props.dismiss(); - } - - render() { - const planClass = getPlanClass( this.props.sitePlan.product_slug ); - const defaultProps = { - dismiss: this.boundDismiss, - siteRawUrl: this.props.siteRawUrl, - planClass: planClass, - }; - - // Hide from non-admins - if ( - ! this.props.newPlanActivated || - ! this.props.userCanManageModules || - this.state.planWelcomeDismissed - ) { - return false; - } - - switch ( planClass ) { - case 'is-personal-plan': - return ; - case 'is-premium-plan': - return ; - case 'is-business-plan': - return ; - default: - return false; - } - } -} - -WelcomeNewPlan.propTypes = { - dismiss: PropTypes.func, - newPlanActivated: PropTypes.bool, - userCanManageModules: PropTypes.bool, -}; - -WelcomeNewPlan.defaultProps = { - newPlanActivated: false, - userCanManageModules: false, -}; - -export default connect( - state => { - return { - sitePlan: getSitePlan( state ), - }; - }, - dispatch => ( { - dismiss: () => { - return dispatch( updateSettings( { show_welcome_for_new_plan: false } ) ); - }, - } ) -)( WelcomeNewPlan ); diff --git a/_inc/client/components/welcome-new-plan/monitor-akismet-backups-prompt.jsx b/_inc/client/components/welcome-new-plan/monitor-akismet-backups-prompt.jsx deleted file mode 100644 index c891605d81feb..0000000000000 --- a/_inc/client/components/welcome-new-plan/monitor-akismet-backups-prompt.jsx +++ /dev/null @@ -1,37 +0,0 @@ -/** - * External dependencies - */ -import React from 'react'; -import { translate as __ } from 'i18n-calypso'; - -/** - * Internal dependencies - */ -import { imagePath } from 'constants/urls'; -import InlineModuleToggle from 'components/module-settings/inline-module-toggle'; - -class MonitorAkismetBackupsPrompt extends React.Component { - render() { - return ( -
- { -

- { __( - 'Your Jetpack plan gives you everything you need to keep your hard work safe, including ' + - 'on-demand backups and malware scans with one-click restores and issue resolution. Your site will ' + - 'be fully protected against spam, malicious code, and brute force login attempts.' - ) } -

- - - -
- ); - } -} - -export default MonitorAkismetBackupsPrompt; diff --git a/_inc/client/components/welcome-new-plan/personal.jsx b/_inc/client/components/welcome-new-plan/personal.jsx deleted file mode 100644 index 0f03c2a5ec121..0000000000000 --- a/_inc/client/components/welcome-new-plan/personal.jsx +++ /dev/null @@ -1,93 +0,0 @@ -/** - * External dependencies - */ -import PropTypes from 'prop-types'; -import React, { Component } from 'react'; -import { translate as __ } from 'i18n-calypso'; -import analytics from 'lib/analytics'; - -/** - * Internal dependencies - */ -import JetpackDialogue from 'components/jetpack-dialogue'; -import Button from 'components/button'; -import { imagePath } from 'constants/urls'; -import MonitorAkismetBackupsPrompt from './monitor-akismet-backups-prompt'; - -class WelcomePersonal extends Component { - constructor( props ) { - super( props ); - - // Preparing event handlers once to avoid calling bind on every render - this.clickCtaDismissGetStarted = this.clickCtaDismiss.bind( this, 'get-started' ); - } - - componentDidMount() { - analytics.tracks.recordEvent( 'jetpack_warm_welcome_plan_view', { - planClass: this.props.planClass, - } ); - } - - clickCtaDismiss( cta ) { - analytics.tracks.recordEvent( 'jetpack_warm_welcome_plan_click', { - planClass: this.props.planClass, - cta: cta, - } ); - - this.props.dismiss(); - } - - renderInnerContent() { - return ( -
-

- { __( - 'Thanks for choosing Jetpack Personal. Jetpack is now backing up your site and ' + - 'scanning for security threats.' - ) } -

- { -

- { __( - 'With Jetpack Personal, you have access to more than 100 free, professionally-designed WordPress ' + - 'themes. Choose the theme that best fits your site and customize colors, images, or add a variety of ' + - 'new widgets.' - ) } -

- -
- -
-
- ); - } - - render() { - return ( - - } - title={ __( 'Explore your Jetpack Personal plan!' ) } - content={ this.renderInnerContent() } - dismiss={ this.props.dismiss } - className="jp-welcome-new-plan is-personal" - /> - ); - } -} - -WelcomePersonal.propTypes = { - dismiss: PropTypes.func, -}; - -export default WelcomePersonal; diff --git a/_inc/client/components/welcome-new-plan/premium.jsx b/_inc/client/components/welcome-new-plan/premium.jsx deleted file mode 100644 index 86756747ca6e6..0000000000000 --- a/_inc/client/components/welcome-new-plan/premium.jsx +++ /dev/null @@ -1,130 +0,0 @@ -/** - * External dependencies - */ -import PropTypes from 'prop-types'; -import React, { Component } from 'react'; -import { translate as __ } from 'i18n-calypso'; -import analytics from 'lib/analytics'; - -/** - * Internal dependencies - */ -import Button from 'components/button'; -import Card from 'components/card'; -import JetpackDialogue from 'components/jetpack-dialogue'; -import { imagePath } from 'constants/urls'; -import VideoPressPrompt from './videopress-prompt'; -import MonitorAkismetBackupsPrompt from './monitor-akismet-backups-prompt'; -import InlineModuleToggle from 'components/module-settings/inline-module-toggle'; - -class WelcomePremium extends Component { - constructor( props ) { - super( props ); - - // Preparing event handlers once to avoid calling bind on every render - this.clickCtaDismissVideo = this.clickCtaDismiss.bind( this, 'video' ); - this.clickCtaDismissAds = this.clickCtaDismiss.bind( this, 'ads' ); - this.clickCtaDismissGetStarted = this.clickCtaDismiss.bind( this, 'get-started' ); - } - componentDidMount() { - analytics.tracks.recordEvent( 'jetpack_warm_welcome_plan_view', { - planClass: this.props.planClass, - } ); - } - - clickCtaDismiss( cta ) { - analytics.tracks.recordEvent( 'jetpack_warm_welcome_plan_click', { - planClass: this.props.planClass, - cta: cta, - } ); - - this.props.dismiss(); - } - - renderInnerContent() { - return ( -
-

- { __( - 'Thanks for choosing Jetpack Premium. Jetpack is now backing up your site, scanning for ' + - ' security threats, and enabling monetization features.' - ) } -

- { -

- { __( - 'With Jetpack Premium, you can create the perfect site, no matter its purpose. Customize your site’s' + - ' appearance with one of more than 100 free themes, or enhance your content with unlimited HD video ' + - '-- all hosted free of ads or watermarks.' - ) } -

- { -

- { __( - 'Using Jetpack’s powerful sharing tools, you can automatically share your newest posts on social media,' + - ' or schedule your content to be re-shared at any date or time you choose. And along with growing your ' + - 'following, you can grow your business with tools like payment buttons and ads.' - ) } -

- - - - -

- { __( 'Start exploring Jetpack Premium now to see all the benefits of your new plan.' ) } -

-
- -
-
- ); - } - - renderBelowContent() { - return ( -
- - { __( 'Monetize your site with ads' ) } - -
- ); - } - - render() { - return ( - - } - title={ __( 'Explore your Jetpack Premium plan!' ) } - content={ this.renderInnerContent() } - belowContent={ this.renderBelowContent() } - dismiss={ this.props.dismiss } - className="jp-welcome-new-plan is-premium" - /> - ); - } -} - -WelcomePremium.propTypes = { - dismiss: PropTypes.func, -}; - -export default WelcomePremium; diff --git a/_inc/client/components/welcome-new-plan/professional.jsx b/_inc/client/components/welcome-new-plan/professional.jsx deleted file mode 100644 index 403e5fd12747f..0000000000000 --- a/_inc/client/components/welcome-new-plan/professional.jsx +++ /dev/null @@ -1,167 +0,0 @@ -/** - * External dependencies - */ -import PropTypes from 'prop-types'; -import React, { Component } from 'react'; -import { translate as __ } from 'i18n-calypso'; -import analytics from 'lib/analytics'; - -/** - * Internal dependencies - */ -import Button from 'components/button'; -import Card from 'components/card'; -import JetpackDialogue from 'components/jetpack-dialogue'; -import { imagePath } from 'constants/urls'; -import MonitorAkismetBackupsPrompt from './monitor-akismet-backups-prompt'; -import VideoPressPrompt from './videopress-prompt'; -import InlineModuleToggle from 'components/module-settings/inline-module-toggle'; - -class WelcomeProfessional extends Component { - constructor( props ) { - super( props ); - - // Preparing event handlers once to avoid calling bind on every render - this.clickCtaDismissThemes = this.clickCtaDismiss.bind( this, 'themes' ); - this.clickCtaDismissAds = this.clickCtaDismiss.bind( this, 'ads' ); - this.clickCtaDismissSearch = this.clickCtaDismiss.bind( this, 'search' ); - this.clickCtaDismissSeo = this.clickCtaDismiss.bind( this, 'seo' ); - this.clickCtaDismissGetStarted = this.clickCtaDismiss.bind( this, 'get-started' ); - } - - componentDidMount() { - analytics.tracks.recordEvent( 'jetpack_warm_welcome_plan_view', { - planClass: this.props.planClass, - } ); - } - - clickCtaDismiss( cta ) { - analytics.tracks.recordEvent( 'jetpack_warm_welcome_plan_click', { - planClass: this.props.planClass, - cta: cta, - } ); - - this.props.dismiss(); - } - - renderInnerContent() { - return ( -
-

- { __( - 'Thanks for choosing Jetpack Professional. Jetpack is now backing up your content in real-time,' + - ' indexing your content for search, scanning for security threats, and granting access to premium themes.' - ) } -

- { -

- { __( - 'With Jetpack Professional, you can create the perfect site with one of over 300 professionally-designed' + - ' WordPress themes, including more than 200 premium themes. Customize your content with a variety of ' + - 'widgets, or add unlimited videos to your posts and pages -- displayed free of ads or watermarks.' - ) } -

-

- { __( - "Give your visitor's a great search experience by letting them filter and sort fast, relevant search results." - ) } -

- - { -

- { __( - 'Growing your following is easy with your Professional plan, thanks to content sharing and scheduling,' + - ' SEO tools, and built-in subscription options. You can monetize your site with a Simple Payments button ' + - 'and in-line ads, and monitor the success of your efforts by integrating with Google Analytics.' - ) } -

- - - - - - -

- { __( - 'Start exploring Jetpack Professional now to see all the benefits of your new plan.' - ) } -

-
- -
-
- ); - } - - renderBelowContent() { - return ( -
- - { __( 'Install premium themes' ) } - - - { __( 'Monetize your site with ads' ) } - - - { __( 'Add the Search (Jetpack) widget to your sidebar' ) } - - - { __( 'Review SEO features' ) } - -
- ); - } - - render() { - return ( - - } - title={ __( 'Explore your Jetpack Professional plan!' ) } - content={ this.renderInnerContent() } - belowContent={ this.renderBelowContent() } - dismiss={ this.props.dismiss } - className="jp-welcome-new-plan is-professional" - /> - ); - } -} - -WelcomeProfessional.propTypes = { - dismiss: PropTypes.func, -}; - -export default WelcomeProfessional; diff --git a/_inc/client/components/welcome-new-plan/social-seo-ads-prompt.jsx b/_inc/client/components/welcome-new-plan/social-seo-ads-prompt.jsx deleted file mode 100644 index 33fc8df4cb542..0000000000000 --- a/_inc/client/components/welcome-new-plan/social-seo-ads-prompt.jsx +++ /dev/null @@ -1,38 +0,0 @@ -/** - * External dependencies - */ -import React from 'react'; -import { translate as __ } from 'i18n-calypso'; - -/** - * Internal dependencies - */ -import { imagePath } from 'constants/urls'; -import InlineModuleToggle from 'components/module-settings/inline-module-toggle'; - -class SocialSeoAdsPrompt extends React.Component { - render() { - return ( -
- { -

- { __( - 'Growing your following is easy with your Professional plan, thanks to content sharing and scheduling,' + - ' SEO tools, and built-in subscription options. You can monetize your site with a Simple Payments button ' + - 'and in-line ads, and monitor the success of your efforts by integrating with Google Analytics.' - ) } -

- - - - -
- ); - } -} - -export default SocialSeoAdsPrompt; diff --git a/_inc/client/components/welcome-new-plan/style.scss b/_inc/client/components/welcome-new-plan/style.scss deleted file mode 100644 index 667fc3bfcb46e..0000000000000 --- a/_inc/client/components/welcome-new-plan/style.scss +++ /dev/null @@ -1,12 +0,0 @@ -.jp-welcome-new-plan { - overflow: initial; -} - -.jp-welcome-new-plan__button { - margin-top: rem( 24px ); -} - -img.jp-welcome__svg { - margin: rem( 40px ) auto 0; - max-width: rem( 240px ); -} diff --git a/_inc/client/components/welcome-new-plan/videopress-prompt.jsx b/_inc/client/components/welcome-new-plan/videopress-prompt.jsx deleted file mode 100644 index 40fe6a244c34f..0000000000000 --- a/_inc/client/components/welcome-new-plan/videopress-prompt.jsx +++ /dev/null @@ -1,28 +0,0 @@ -/** - * External dependencies - */ -import React from 'react'; -import { translate as __ } from 'i18n-calypso'; - -/** - * Internal dependencies - */ -import InlineModuleToggle from 'components/module-settings/inline-module-toggle'; - -class VideoPressPrompt extends React.Component { - render() { - return ( -
-

- { __( - 'VideoPress allows you to upload videos from your computer to be hosted on WordPress.com, ' + - 'rather than on your host’s servers. You can then insert these on your self-hosted Jetpack site. ' - ) } -

- -
- ); - } -} - -export default VideoPressPrompt; diff --git a/_inc/client/main.jsx b/_inc/client/main.jsx index 9a2eea25d8588..b9430a7ff0ce8 100644 --- a/_inc/client/main.jsx +++ b/_inc/client/main.jsx @@ -28,11 +28,7 @@ import { userCanConnectSite, getTracksUserData, } from 'state/initial-state'; -import { - areThereUnsavedSettings, - clearUnsavedSettingsFlag, - showWelcomeForNewPlan, -} from 'state/settings'; +import { areThereUnsavedSettings, clearUnsavedSettingsFlag } from 'state/settings'; import { getSearchTerm } from 'state/search'; import AtAGlance from 'at-a-glance/index.jsx'; import MyPlan from 'my-plan/index.jsx'; @@ -46,7 +42,6 @@ import AdminNotices from 'components/admin-notices'; import Tracker from 'components/tracker'; import analytics from 'lib/analytics'; import restApi from 'rest-api'; -import WelcomeNewPlan from 'components/welcome-new-plan'; import QueryRewindStatus from 'components/data/query-rewind-status'; import { getRewindStatus } from 'state/rewind'; @@ -135,7 +130,6 @@ class Main extends React.Component { nextProps.isLinked !== this.props.isLinked || nextProps.route.path !== this.props.route.path || nextProps.searchTerm !== this.props.searchTerm || - nextProps.newPlanActivated !== this.props.newPlanActivated || nextProps.rewindStatus !== this.props.rewindStatus ); } @@ -266,11 +260,6 @@ class Main extends React.Component { { navComponent } { this.renderJumpstart() } { pageComponent } - ); }; @@ -322,7 +311,6 @@ export default connect( userCanManageModules: userCanManageModules( state ), userCanConnectSite: userCanConnectSite( state ), isSiteConnected: isSiteConnected( state ), - newPlanActivated: showWelcomeForNewPlan( state ), rewindStatus: getRewindStatus( state ), }; }, diff --git a/_inc/client/state/settings/actions.js b/_inc/client/state/settings/actions.js index 117d557908b80..1f78851c9fb91 100644 --- a/_inc/client/state/settings/actions.js +++ b/_inc/client/state/settings/actions.js @@ -115,11 +115,7 @@ export const updateSettings = ( newOptionValues, noticeMessages = {} ) => { dispatch( removeNotice( 'module-setting-update' ) ); dispatch( removeNotice( 'module-setting-update-success' ) ); - const suppressNoticeFor = [ - 'dismiss_dash_app_card', - 'dismiss_empty_stats_card', - 'show_welcome_for_new_plan', - ]; + const suppressNoticeFor = [ 'dismiss_dash_app_card', 'dismiss_empty_stats_card' ]; if ( 'object' === typeof newOptionValues && ! some( suppressNoticeFor, optionValue => optionValue in newOptionValues ) diff --git a/_inc/client/state/settings/reducer.js b/_inc/client/state/settings/reducer.js index 6e34a9d481dc1..df186a871df64 100644 --- a/_inc/client/state/settings/reducer.js +++ b/_inc/client/state/settings/reducer.js @@ -190,12 +190,3 @@ export function appsCardDismissed( state ) { export function emptyStatsCardDismissed( state ) { return get( state.jetpack.settings.items, 'dismiss_empty_stats_card', false ); } - -/** - * Returns true if a new plan has been purchased. - * @param {Object} state Global state tree - * @return {Boolean} Whether a new plan has been purchased. - */ -export function showWelcomeForNewPlan( state ) { - return get( state.jetpack.settings.items, 'show_welcome_for_new_plan', false ); -} diff --git a/_inc/lib/class.core-rest-api-endpoints.php b/_inc/lib/class.core-rest-api-endpoints.php index bf9e5f759b194..550981f3c8b89 100644 --- a/_inc/lib/class.core-rest-api-endpoints.php +++ b/_inc/lib/class.core-rest-api-endpoints.php @@ -2376,15 +2376,6 @@ public static function get_updateable_data_list( $selector = '' ) { 'jp_group' => 'settings', ), - // Show welcome for newly purchased plan - 'show_welcome_for_new_plan' => array( - 'description' => '', - 'type' => 'boolean', - 'default' => 0, - 'validate_callback' => __CLASS__ . '::validate_boolean', - 'jp_group' => 'settings', - ), - ); // Add modules to list so they can be toggled diff --git a/_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php b/_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php index 368b381a0fb12..c0ffedbfa5f04 100644 --- a/_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php +++ b/_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php @@ -956,11 +956,6 @@ public function update_data( $request ) { } break; - case 'show_welcome_for_new_plan': - // If option value was the same, consider it done. - $updated = get_option( $option ) !== $value ? update_option( $option, (bool) $value ) : true; - break; - default: // If option value was the same, consider it done. $updated = get_option( $option ) != $value ? update_option( $option, $value ) : true; diff --git a/class.jetpack-plan.php b/class.jetpack-plan.php index febda8fafa2e8..8eeea8538f329 100644 --- a/class.jetpack-plan.php +++ b/class.jetpack-plan.php @@ -51,11 +51,6 @@ public static function update_from_sites_response( $response ) { return false; } - // Set flag for newly purchased plan. - if ( 'jetpack_free' !== $results['plan']['product_slug'] ) { - update_option( 'show_welcome_for_new_plan', true ); - } - // Store the new plan in an option and return true if updated. $result = update_option( self::PLAN_OPTION, $results['plan'], true ); if ( ! $result ) { diff --git a/tests/php/test_class.jetpack-plan.php b/tests/php/test_class.jetpack-plan.php index c032166c716c1..5ce6abc4f824a 100644 --- a/tests/php/test_class.jetpack-plan.php +++ b/tests/php/test_class.jetpack-plan.php @@ -8,7 +8,6 @@ class WP_Test_Jetpack_Plan extends WP_UnitTestCase { public function setUp() { delete_option( 'jetpack_active_plan' ); - delete_option( 'show_welcome_for_new_plan' ); } public function test_update_from_sites_response_failure_to_update() {