Skip to content

Commit

Permalink
Chance to view the "B" theme was off by 1%
Browse files Browse the repository at this point in the history
  • Loading branch information
mintindeed committed Mar 6, 2012
1 parent 67a1272 commit 92a8612
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions class-mint-ab-testing.php
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ public function javascript_redirect() {
var use_alternate_theme = false;

if ( false == this.has_endpoint() ) {
if ( Math.floor( Math.random()*101 ) <= <?php echo $options->get_option( 'ratio' ); ?> ) {
if ( Math.floor( Math.random()*101 ) < <?php echo $options->get_option( 'ratio' ); ?> ) {
use_alternate_theme = true;
}
}
Expand Down Expand Up @@ -610,7 +610,7 @@ public function has_cookie() {
*/
public function won_lottery() {
$options = Mint_AB_Testing_Options::instance();
if ( ! isset( $_COOKIE[Mint_AB_Testing_Options::cookie_name] ) && rand( 0, 100 ) <= $options->get_option( 'ratio' ) ) {
if ( ! isset( $_COOKIE[Mint_AB_Testing_Options::cookie_name] ) && rand( 0, 100 ) < $options->get_option( 'ratio' ) ) {
return true;
}

Expand Down

0 comments on commit 92a8612

Please sign in to comment.