Plugin Directory

Changeset 490592


Ignore:
Timestamp:
01/16/2012 01:05:43 PM (14 years ago)
Author:
lassebunk
Message:

add update support and some comments

Location:
abtest/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • abtest/trunk/abtest.php

    r490378 r490592  
    33Plugin Name:  A/B Test for WordPress
    44Plugin URI:   http://lassebunk.dk/plugins/abtest/
    5 Version:      1.0.3
     5Version:      1.0.4
    66Description:  Easily perform A/B tests on any WordPress site.
    77Author:       Lasse Bunk
     
    99*/
    1010
     11// Start the session
    1112session_start();
     13
     14// We check database migrations on each call to ensure migrations when the plugin is updated
    1215require 'includes/install.php';
    13 
    14 register_activation_hook(__FILE__, 'abtest_install');
     16abtest_migrate_if_needed();
     17
     18// Ensure that widgets can also contain A/B Test shortcodes
    1519add_filter('widget_text', 'do_shortcode');
    1620wp_enqueue_script("jquery");
    1721
     22// Set up the viewed variations and hit goals queue
    1823$abtest_viewed_variations = array();
    1924$abtest_hit_goals = array();
  • abtest/trunk/includes/install.php

    r490307 r490592  
    11<?php
    2 function abtest_install() {
    3   abtest_migrate();
    4 }
    5 
    6 function abtest_migrate() {
     2function abtest_migrate_if_needed() {
    73    global $wpdb;
    84
     
    117  $needed_migration = count($migs);
    128 
    13   for ($i = $current_migration; $i < $needed_migration; $i++) {
    14     $mig = $migs[$i];
    15     $wpdb->query($mig);
    16   }
     9  if ($current_migration != $needed_migration) {
     10    for ($i = $current_migration; $i < $needed_migration; $i++) {
     11      $mig = $migs[$i];
     12      $wpdb->query($mig);
     13    }
    1714 
    18   if ($current_migration == 0) {
    19     add_option('abtest_current_migration', $needed_migration);
    20   } else {
    21     update_option('abtest_current_migration', $needed_migration);
     15    if ($current_migration == 0) {
     16      add_option('abtest_current_migration', $needed_migration);
     17    } else {
     18      update_option('abtest_current_migration', $needed_migration);
     19    }
    2220  }
    2321}
  • abtest/trunk/readme.txt

    r490580 r490592  
    33Donate link: http://lassebunk.dk/donate/
    44Tags: ab testing, split testing, multivariate testing, themes, content, stylesheets, javascripts
    5 Stable tag: 1.0.3
     5Stable tag: 1.0.4
    66
    77A/B split testing for WordPress made easy.
     
    4848== Changelog ==
    4949
    50 = 1.0.0 =
    51 * Initial version.
     50= 1.0.4 =
     51* Support for updating the plugin (checking database version on each call).
     52
     53= 1.0.3 =
     54* Support for database table prefixes (like <code>wp_</code>).
     55
     56= 1.0.2 =
     57* Support for IP filters, e.g. to filter out visits and conversions from your home or office IPs.
    5258
    5359= 1.0.1 =
     
    5561* Support for split testing themes, e.g. which theme performs better.
    5662
    57 = 1.0.2 =
    58 * Support for IP filters, e.g. to filter out visits and conversions from your home or office IPs.
    59 
    60 = 1.0.3 =
    61 * Support for database table prefixes (like <code>wp_</code>).
     63= 1.0.0 =
     64* Initial version.
    6265
    6366== Upgrade Notice ==
Note: See TracChangeset for help on using the changeset viewer.