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

Revert "Plans: Remove freeTrials a/b test" #2575

Merged
merged 1 commit into from
Jan 19, 2016
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 7 additions & 3 deletions client/components/plans/plan-actions/index.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/**
* External dependencies
*/
var config = require( 'config' ),
React = require( 'react' ),
var React = require( 'react' ),
classNames = require( 'classnames' );

/**
Expand All @@ -13,6 +12,7 @@ var analytics = require( 'analytics' ),
isFreePlan = productsValues.isFreePlan,
isBusiness = productsValues.isBusiness,
isEnterprise = productsValues.isEnterprise,
getABTestVariation = require( 'lib/abtest' ).getABTestVariation,
cartItems = require( 'lib/cart-values' ).cartItems,
puchasesPaths = require( 'me/purchases/paths' );

Expand Down Expand Up @@ -154,7 +154,11 @@ module.exports = React.createClass( {
},

shouldOfferFreeTrial: function() {
if ( ! config.isEnabled( 'upgrades/free-trials' ) || ! this.props.enableFreeTrials ) {
if ( getABTestVariation( 'freeTrials' ) !== 'offered' ) {
return false;
}

if ( ! this.props.enableFreeTrials ) {
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions client/components/plans/plans-compare/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* External dependencies
*/
var React = require( 'react' ),
config = require( 'config' ),
connect = require( 'react-redux' ).connect,
page = require( 'page' ),
classNames = require( 'classnames' ),
Expand All @@ -13,6 +12,7 @@ var React = require( 'react' ),
* Internal dependencies
*/
var observe = require( 'lib/mixins/data-observe' ),
getABTestVariation = require( 'lib/abtest' ).getABTestVariation,
SidebarNavigation = require( 'my-sites/sidebar-navigation' ),
PlanFeatures = require( 'components/plans/plan-features' ),
PlanHeader = require( 'components/plans/plan-header' ),
Expand Down Expand Up @@ -108,7 +108,7 @@ var PlansCompare = React.createClass( {
? this.props.sitePlans.data.some( property( 'canStartTrial' ) )
: false;

if ( ! config.isEnabled( 'upgrades/free-trials' ) ) {
if ( getABTestVariation( 'freeTrials' ) !== 'offered' ) {
return false;
}

Expand Down
8 changes: 8 additions & 0 deletions client/lib/abtest/active-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ module.exports = {
},
defaultVariation: 'original'
},
freeTrials: {
datestamp: '20160112',
variations: {
notOffered: 90,
offered: 10
},
defaultVariation: 'notOffered'
},
monthlyPlanPricing: {
datestamp: '20160118',
variations: {
Expand Down
4 changes: 2 additions & 2 deletions client/my-sites/plans/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
* External dependencies
*/
var React = require( 'react' ),
config = require( 'config' ),
connect = require( 'react-redux' ).connect,
find = require( 'lodash/collection/find' );

/**
* Internal dependencies
*/
var analytics = require( 'analytics' ),
getABTestVariation = require( 'lib/abtest' ).getABTestVariation,
observe = require( 'lib/mixins/data-observe' ),
PlanList = require( 'components/plans/plan-list' ),
PlanOverview = require( './plan-overview' ),
Expand Down Expand Up @@ -76,7 +76,7 @@ var Plans = React.createClass( {
businessPlan,
premiumPlan;

if ( ! this.props.sitePlans.hasLoadedFromServer || ! config.isEnabled( 'upgrades/free-trials' ) ) {
if ( ! this.props.sitePlans.hasLoadedFromServer || getABTestVariation( 'freeTrials' ) !== 'offered' ) {
return null;
}

Expand Down
6 changes: 6 additions & 0 deletions client/signup/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ import isEmpty from 'lodash/lang/isEmpty';
/**
* Internal Dependencies
*/
import { abtest } from 'lib/abtest';
import i18n from 'lib/mixins/i18n';
import config from 'config';
import { defaultFlowName } from 'signup/config/flows';
import route from 'lib/route';
import analytics from 'analytics';
import layoutFocus from 'lib/layout-focus';
Expand Down Expand Up @@ -69,6 +71,10 @@ export default {
},

redirectToFlow( context, next ) {
if ( utils.getFlowName( context.params ) === defaultFlowName && abtest( 'freeTrials' ) === 'offered' ) {
return page.redirect( utils.getValidPath( { flowName: 'free-trial' } ) );
}

if ( context.path !== utils.getValidPath( context.params ) ) {
return page.redirect( utils.getValidPath( context.params ) );
}
Expand Down
3 changes: 2 additions & 1 deletion client/signup/steps/plans/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var React = require( 'react' ),
* Internal dependencies
*/
var productsList = require( 'lib/products-list' )(),
getABTestVariation = require( 'lib/abtest' ).getABTestVariation,
analytics = require( 'analytics' ),
featuresList = require( 'lib/features-list' )(),
plansList = require( 'lib/plans-list' )(),
Expand Down Expand Up @@ -108,7 +109,7 @@ module.exports = React.createClass( {
let headerText = this.translate( 'Pick a plan that\'s right for you.' ),
subHeaderText;

if ( this.isFreeTrialFlow() ) {
if ( this.isFreeTrialFlow() && getABTestVariation( 'freeTrials' ) === 'offered' ) {
subHeaderText = this.translate(
'Try WordPress.com Premium or Business free for 14 days, no credit card required.'
);
Expand Down
1 change: 0 additions & 1 deletion config/development.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
"upgrades/domain-management/site-redirect": true,
"upgrades/domain-management/transfer": true,
"upgrades/domain-search": true,
"upgrades/free-trials": true,

"manage/customize": true,

Expand Down
1 change: 0 additions & 1 deletion config/wpcalypso.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"upgrades/domain-management/site-redirect": true,
"upgrades/domain-management/transfer": true,
"upgrades/domain-search": true,
"upgrades/free-trials": true,

"notifications2beta": true,
"muse": true,
Expand Down