| @@ -1,13 +1,12 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /* |
| 3 | -Plugin Name: VWO | |
| 4 | -Plugin URI: https://vwo.com/ | |
| 5 | -Description: VWO is the all-in-one platform that helps you conduct visitor research, build an optimization roadmap, and run continuous experimentation. Simply enable the plugin and start running tests on your Wordpress website without doing any other code changes. Visit <a href="https://vwo.com/">Visual Website Optimizer</a> for more details. | |
| 6 | -Author: Wingify | |
| 7 | -Version: 2.7 | |
| 8 | -visual-website-optimizer.php | |
| 9 | -Author URI: https://wingify.com | |
| 3 | +Plugin Name: Visual Website Optimizer | |
| 4 | +Plugin URI: http://visualwebsiteoptimizer.com/ | |
| 5 | +Description: Visual Website Optimizer is the world's easiest to use A/B, split and multivariate testing tool. Simply enable the plugin and start running tests on your Wordpress website without doing any other code changes. Visit <a href="http://visualwebsiteoptimizer.com/">Visual Website Optimizer</a> for more details. | |
| 6 | +Author: Andy Bailey | |
| 7 | +Version: 2.1 | |
| 8 | +Author URI: http://fiddyp.co.uk | |
| 10 | 9 | |
| 11 | 10 | This relies on the actions being present in the themes header.php and footer.php |
| 12 | 11 | * header.php code before the closing </head> tag |
| 13 | 12 | * wp_head(); |
| @@ -51,12 +50,12 @@ | ||
| 51 | 50 | |
| 52 | 51 | //------------------------------------------------------------------------// |
| 53 | 52 | //---Hook-----------------------------------------------------------------// |
| 54 | 53 | //------------------------------------------------------------------------// |
| 55 | -add_action( 'wp_head', 'vwo_clhf_headercode',1 ); | |
| 56 | -add_action( 'admin_menu', 'vwo_clhf_plugin_menu' ); | |
| 57 | -add_action( 'admin_init', 'vwo_clhf_register_mysettings' ); | |
| 58 | -add_action( 'admin_notices','vwo_clhf_warn_nosettings'); | |
| 54 | +add_action ( 'wp_head', 'clhf_headercode',1 ); | |
| 55 | +add_action( 'admin_menu', 'clhf_plugin_menu' ); | |
| 56 | +add_action( 'admin_init', 'clhf_register_mysettings' ); | |
| 57 | +add_action( 'admin_notices','clhf_warn_nosettings'); | |
| 59 | 58 | |
| 60 | 59 | |
| 61 | 60 | //------------------------------------------------------------------------// |
| 62 | 61 | //---Functions------------------------------------------------------------// |
| @@ -61,14 +60,14 @@ | ||
| 61 | 60 | //------------------------------------------------------------------------// |
| 62 | 61 | //---Functions------------------------------------------------------------// |
| 63 | 62 | //------------------------------------------------------------------------// |
| 64 | 63 | // options page link |
| 65 | -function vwo_clhf_plugin_menu() { | |
| 66 | - add_options_page('Visual Website Optimizer', 'VWO', 'create_users', 'clhf_vwo_options', 'vwo_clhf_plugin_options'); | |
| 64 | +function clhf_plugin_menu() { | |
| 65 | + add_options_page('Visual Website Optimizer', 'VWO', 'create_users', 'clhf_vwo_options', 'clhf_plugin_options'); | |
| 67 | 66 | } |
| 68 | 67 | |
| 69 | 68 | // whitelist settings |
| 70 | -function vwo_clhf_register_mysettings(){ | |
| 69 | +function clhf_register_mysettings(){ | |
| 71 | 70 | register_setting('clhf_vwo_options','vwo_id','intval'); |
| 72 | 71 | register_setting('clhf_vwo_options','code_type'); |
| 73 | 72 | register_setting('clhf_vwo_options','settings_tolerance','intval'); |
| 74 | 73 | register_setting('clhf_vwo_options','library_tolerance','intval'); |
| @@ -76,9 +75,9 @@ | ||
| 76 | 75 | |
| 77 | 76 | //------------------------------------------------------------------------// |
| 78 | 77 | //---Output Functions-----------------------------------------------------// |
| 79 | 78 | //------------------------------------------------------------------------// |
| 80 | -function vwo_clhf_headercode(){ | |
| 79 | +function clhf_headercode(){ | |
| 81 | 80 | // runs in the header |
| 82 | 81 | global $clhf_header_script_sync, $clhf_header_script_async; |
| 83 | 82 | $vwo_id = get_option('vwo_id'); |
| 84 | 83 | $code_type = get_option('code_type'); |
| @@ -86,13 +85,9 @@ | ||
| 86 | 85 | if($code_type == 'SYNC') |
| 87 | 86 | echo str_replace('VWO_ID', $vwo_id, $clhf_header_script_sync); // only output if options were saved |
| 88 | 87 | else { |
| 89 | 88 | $settings_tolerance = get_option('settings_tolerance'); |
| 90 | - if(!is_numeric($settings_tolerance)) $settings_tolerance = 2000; | |
| 91 | - | |
| 92 | 89 | $library_tolerance = get_option('library_tolerance'); |
| 93 | - if(!is_numeric($library_tolerance)) $library_tolerance = 2500; | |
| 94 | - | |
| 95 | 90 | $clhf_header_script_async = str_replace('VWO_ID', $vwo_id, $clhf_header_script_async); |
| 96 | 91 | $clhf_header_script_async = str_replace('SETTINGS_TOLERANCE', $settings_tolerance, $clhf_header_script_async); |
| 97 | 92 | echo str_replace('LIBRARY_TOLERANCE', $library_tolerance, $clhf_header_script_async); |
| 98 | 93 | } |
| @@ -101,12 +96,12 @@ | ||
| 101 | 96 | //------------------------------------------------------------------------// |
| 102 | 97 | //---Page Output Functions------------------------------------------------// |
| 103 | 98 | //------------------------------------------------------------------------// |
| 104 | 99 | // options page |
| 105 | -function vwo_clhf_plugin_options() { | |
| 100 | +function clhf_plugin_options() { | |
| 106 | 101 | echo '<div class="wrap">';?> |
| 107 | 102 | <h2>Visual Website Optimizer</h2> |
| 108 | - <p>You need to have a <a href="https://vwo.com/">Visual Website Optimizer</a> account in order to use this plugin. This plugin inserts the neccessary code into your Wordpress site automatically without you having to touch anything. In order to use the plugin, you need to enter your VWO Account ID:</p> | |
| 103 | + <p>You need to have a <a href="http://visualwebsiteoptimizer.com/">Visual Website Optimizer</a> account in order to use this plugin. This plugin inserts the neccessary code into your Wordpress site automatically without you having to touch anything. In order to use the plugin, you need to enter your VWO Account ID:</p> | |
| 109 | 104 | <form method="post" action="options.php"> |
| 110 | 105 | <?php settings_fields( 'clhf_vwo_options' ); ?> |
| 111 | 106 | <table class="form-table"> |
| 112 | 107 | <tr valign="top"> |
| @@ -117,9 +112,9 @@ | ||
| 117 | 112 | <th scope="row">Code (default: Asynchronous)</th> |
| 118 | 113 | <td> |
| 119 | 114 | <input style="vertical-align: text-top;" type="radio" onclick="selectCodeType();" name="code_type" id="code_type_async" value="ASYNC" <?php if(get_option('code_type')!='SYNC') echo "checked"; ?> /> Asynchronous |
| 120 | 115 | <input style="vertical-align: text-top;" type="radio" onclick="selectCodeType();" name="code_type" id="code_type_sync" value="SYNC" <?php if(get_option('code_type')=='SYNC') echo "checked"; ?> /> Synchronous |
| 121 | - <a href="https://vwo.com/blog/asynchronous-code" target="_blank">[Help]</a> | |
| 116 | + <a href="http://visualwebsiteoptimizer.com/split-testing-blog/asynchronous-code" target="_blank">[Help]</a> | |
| 122 | 117 | </td> |
| 123 | 118 | </tr> |
| 124 | 119 | <tr valign="top" id='asyncOnly1' <?php if(get_option('code_type')=='SYNC') echo "style='display:none;'" ?>> |
| 125 | 120 | <th scope="row">Settings Timeout</th> |
| @@ -126,9 +121,9 @@ | ||
| 126 | 121 | <td style="vertical-align: middle;"><input type="text" name="settings_tolerance" value="<?php echo get_option('settings_tolerance')?get_option('settings_tolerance'):2000; ?>" />ms (default: 2000)</td> |
| 127 | 122 | </tr> |
| 128 | 123 | <tr valign="top" id='asyncOnly2' <?php if(get_option('code_type')=='SYNC') echo "style='display:none;'" ?>> |
| 129 | 124 | <th scope="row">Library Timeout</th> |
| 130 | - <td style="vertical-align: middle;"><input type="text" name="library_tolerance" value="<?php echo get_option('library_tolerance')?get_option('library_tolerance'):2500; ?>" />ms (default: 2500)</td> | |
| 125 | + <td style="vertical-align: middle;"><input type="text" name="library_tolerance" value="<?php echo get_option('library_tolerance')?get_option('library_tolerance'):1500; ?>" />ms (default: 1500)</td> | |
| 131 | 126 | </tr> |
| 132 | 127 | </table> |
| 133 | 128 | |
| 134 | 129 | <script type="text/javascript"> |
| @@ -147,14 +142,14 @@ | ||
| 147 | 142 | } |
| 148 | 143 | } |
| 149 | 144 | </script> |
| 150 | 145 | <p class="submit"><input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /></p> |
| 151 | - <p>Your Account ID (a number) can be found in <i>Settings</i> area (top-right) after you <a href="https://app.vwo.com">login</a> into your Visual Website Optimizer account.</p> | |
| 146 | + <p>Your Account ID (a number) can be found in <i>Settings</i> area (top-right) after you <a href="https://v2.visualwebsiteoptimizer.com">login</a> into your Visual Website Optimizer account.</p> | |
| 152 | 147 | <?php |
| 153 | 148 | echo '</div>'; |
| 154 | 149 | } |
| 155 | 150 | |
| 156 | -function vwo_clhf_warn_nosettings(){ | |
| 151 | +function clhf_warn_nosettings(){ | |
| 157 | 152 | if (!is_admin()) |
| 158 | 153 | return; |
| 159 | 154 | |
| 160 | 155 | $clhf_option = get_option("vwo_id"); |
| @@ -161,5 +156,5 @@ | ||
| 161 | 156 | if (!$clhf_option || $clhf_option < 1){ |
| 162 | 157 | echo "<div id='vwo-warning' class='updated fade'><p><strong>Visual Website Optimizer is almost ready.</strong> You must <a href=\"options-general.php?page=clhf_vwo_options\">enter your Account ID</a> for it to work.</p></div>"; |
| 163 | 158 | } |
| 164 | 159 | } |
| 165 | -?> | |
| 160 | +?> | |