Skip to content

Commit

Permalink
Merge pull request #2453 from Automattic/add/plans-upgrade-button-test
Browse files Browse the repository at this point in the history
Plans: Add a/b test with 'upgrade' button in the sidebar
  • Loading branch information
drewblaisdell committed Jan 18, 2016
2 parents aae43c0 + 1f74785 commit d2beeb2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
8 changes: 8 additions & 0 deletions client/lib/abtest/active-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,12 @@ module.exports = {
},
defaultVariation: 'yearly'
},
plansUpgradeButton: {
datestamp: '20160118',
variations: {
original: 50,
button: 50
},
defaultVariation: 'original'
}
};
14 changes: 11 additions & 3 deletions client/my-sites/sidebar/sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,18 @@ module.exports = React.createClass( {
linkClass += ' is-paid-plan';
}

let planName = site.plan.product_name_short;
let planName = site.plan.product_name_short,
labelClass = 'plan-name';

if ( abtest( 'plansUpgradeButton' ) === 'button' && productsValues.isFreePlan( site.plan ) ) {
labelClass = 'add-new';
planName = 'Upgrade'; // TODO: translate this string if the test is removed
}

if ( productsValues.isFreeTrial( site.plan ) ) {
planName = this.translate( 'Trial' );
planName = this.translate( 'Trial', {
context: 'Label in the sidebar indicating that the user is on the free trial for a plan.'
} );
}

return (
Expand All @@ -338,7 +346,7 @@ module.exports = React.createClass( {
<Gridicon icon="clipboard" size={ 24 } />
<span className="menu-link-text">{ this.translate( 'Plan', { context: 'noun' } ) }</span>
</a>
<a href={ planLink } className="plan-name" onClick={ this.trackUpgradeClick }>{ planName }</a>
<a href={ planLink } className={ labelClass } onClick={ this.trackUpgradeClick }>{ planName }</a>
</li>
);
},
Expand Down

0 comments on commit d2beeb2

Please sign in to comment.