PluginProbe
Visual Website Optimizer / 2.8
Visual Website Optimizer v2.8
trunk 1.0 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4.0 4.1 4.10 All 37 releases
← All changes | visual-website-optimizer.php +31 -26 2.12.8 View file →
@@ -1,12 +1,13 @@
1 1 <?php
2 2 /*
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
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.8
8 +visual-website-optimizer.php
9 +Author URI: https://wingify.com
9 10
10 11 This relies on the actions being present in the themes header.php and footer.php
11 12 * header.php code before the closing </head> tag
12 13 * wp_head();
@@ -17,9 +18,9 @@
17 18 //---Config---------------------------------------------------------------//
18 19 //------------------------------------------------------------------------//
19 20
20 21 $clhf_header_script_sync = '
21 -<!-- Start Visual Website Optimizer Code -->
22 +<!-- Start VWO Code -->
22 23 <script type=\'text/javascript\'>
23 24 var _vis_opt_account_id = VWO_ID;
24 25 var _vis_opt_protocol = ((\'https:\' == document.location.protocol) ? \'https://\' : \'http://\');
25 26 document.write(\'<s\' + \'cript src="\' + _vis_opt_protocol + \'dev.visualwebsiteoptimizer.com/deploy/js_visitor_settings.php?v=1&a=\'+_vis_opt_account_id+\'&url=\'+encodeURIComponent(document.URL)+\'&random=\'+Math.random()+\'" type="text/javascript">\' + \'<\/s\' + \'cript>\');
@@ -30,13 +31,13 @@
30 31 <script type=\'text/javascript\'>
31 32 if(typeof(_vis_opt_settings_loaded) == "boolean" && typeof(_vis_opt_top_initialize) == "function"){ _vis_opt_top_initialize();
32 33 vwo_$(document).ready(function() { _vis_opt_bottom_initialize(); }); }
33 34 </script>
34 -<!-- End Visual Website Optimizer Code -->
35 +<!-- End VWO Code -->
35 36 ';
36 37
37 38 $clhf_header_script_async = '
38 -<!-- Start Visual Website Optimizer Asynchronous Code -->
39 +<!-- Start VWO Asynchronous Code -->
39 40 <script type=\'text/javascript\'>
40 41 var _vwo_code=(function(){
41 42 var account_id=VWO_ID,
42 43 settings_tolerance=SETTINGS_TOLERANCE,
@@ -43,9 +44,9 @@
43 44 library_tolerance=LIBRARY_TOLERANCE,
44 45 use_existing_jquery=false,
45 46 f=false,d=document;return{use_existing_jquery:function(){return use_existing_jquery;},library_tolerance:function(){return library_tolerance;},finish:function(){if(!f){f=true;var a=d.getElementById(\'_vis_opt_path_hides\');if(a)a.parentNode.removeChild(a);}},finished:function(){return f;},load:function(a){var b=d.createElement(\'script\');b.src=a;b.type=\'text/javascript\';b.innerText;b.onerror=function(){_vwo_code.finish();};d.getElementsByTagName(\'head\')[0].appendChild(b);},init:function(){settings_timer=setTimeout(\'_vwo_code.finish()\',settings_tolerance);this.load(\'//dev.visualwebsiteoptimizer.com/j.php?a=\'+account_id+\'&u=\'+encodeURIComponent(d.URL)+\'&r=\'+Math.random());var a=d.createElement(\'style\'),b=\'body{opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;}\',h=d.getElementsByTagName(\'head\')[0];a.setAttribute(\'id\',\'_vis_opt_path_hides\');a.setAttribute(\'type\',\'text/css\');if(a.styleSheet)a.styleSheet.cssText=b;else a.appendChild(d.createTextNode(b));h.appendChild(a);return settings_timer;}};}());_vwo_settings_timer=_vwo_code.init();
46 47 </script>
47 -<!-- End Visual Website Optimizer Asynchronous Code -->
48 +<!-- End VWO Asynchronous Code -->
48 49 ';
49 50
50 51
51 52 //------------------------------------------------------------------------//
@@ -50,12 +51,12 @@
50 51
51 52 //------------------------------------------------------------------------//
52 53 //---Hook-----------------------------------------------------------------//
53 54 //------------------------------------------------------------------------//
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');
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');
58 59
59 60
60 61 //------------------------------------------------------------------------//
61 62 //---Functions------------------------------------------------------------//
@@ -60,14 +61,14 @@
60 61 //------------------------------------------------------------------------//
61 62 //---Functions------------------------------------------------------------//
62 63 //------------------------------------------------------------------------//
63 64 // options page link
64 -function clhf_plugin_menu() {
65 - add_options_page('Visual Website Optimizer', 'VWO', 'create_users', 'clhf_vwo_options', 'clhf_plugin_options');
65 +function vwo_clhf_plugin_menu() {
66 + add_options_page('Visual Website Optimizer', 'VWO', 'create_users', 'clhf_vwo_options', 'vwo_clhf_plugin_options');
66 67 }
67 68
68 69 // whitelist settings
69 -function clhf_register_mysettings(){
70 +function vwo_clhf_register_mysettings(){
70 71 register_setting('clhf_vwo_options','vwo_id','intval');
71 72 register_setting('clhf_vwo_options','code_type');
72 73 register_setting('clhf_vwo_options','settings_tolerance','intval');
73 74 register_setting('clhf_vwo_options','library_tolerance','intval');
@@ -75,9 +76,9 @@
75 76
76 77 //------------------------------------------------------------------------//
77 78 //---Output Functions-----------------------------------------------------//
78 79 //------------------------------------------------------------------------//
79 -function clhf_headercode(){
80 +function vwo_clhf_headercode(){
80 81 // runs in the header
81 82 global $clhf_header_script_sync, $clhf_header_script_async;
82 83 $vwo_id = get_option('vwo_id');
83 84 $code_type = get_option('code_type');
@@ -85,9 +86,13 @@
85 86 if($code_type == 'SYNC')
86 87 echo str_replace('VWO_ID', $vwo_id, $clhf_header_script_sync); // only output if options were saved
87 88 else {
88 89 $settings_tolerance = get_option('settings_tolerance');
90 + if(!is_numeric($settings_tolerance)) $settings_tolerance = 2000;
91 +
89 92 $library_tolerance = get_option('library_tolerance');
93 + if(!is_numeric($library_tolerance)) $library_tolerance = 2500;
94 +
90 95 $clhf_header_script_async = str_replace('VWO_ID', $vwo_id, $clhf_header_script_async);
91 96 $clhf_header_script_async = str_replace('SETTINGS_TOLERANCE', $settings_tolerance, $clhf_header_script_async);
92 97 echo str_replace('LIBRARY_TOLERANCE', $library_tolerance, $clhf_header_script_async);
93 98 }
@@ -96,12 +101,12 @@
96 101 //------------------------------------------------------------------------//
97 102 //---Page Output Functions------------------------------------------------//
98 103 //------------------------------------------------------------------------//
99 104 // options page
100 -function clhf_plugin_options() {
105 +function vwo_clhf_plugin_options() {
101 106 echo '<div class="wrap">';?>
102 - <h2>Visual Website Optimizer</h2>
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>
107 + <h2>VWO</h2>
108 + <p>You need to have a <a href="https://vwo.com/">VWO</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>
104 109 <form method="post" action="options.php">
105 110 <?php settings_fields( 'clhf_vwo_options' ); ?>
106 111 <table class="form-table">
107 112 <tr valign="top">
@@ -112,9 +117,9 @@
112 117 <th scope="row">Code (default: Asynchronous)</th>
113 118 <td>
114 119 <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&nbsp;&nbsp;&nbsp;
115 120 <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
116 - &nbsp;<a href="http://visualwebsiteoptimizer.com/split-testing-blog/asynchronous-code" target="_blank">[Help]</a>
121 + &nbsp;<a href="https://vwo.com/blog/asynchronous-code" target="_blank">[Help]</a>
117 122 </td>
118 123 </tr>
119 124 <tr valign="top" id='asyncOnly1' <?php if(get_option('code_type')=='SYNC') echo "style='display:none;'" ?>>
120 125 <th scope="row">Settings Timeout</th>
@@ -121,9 +126,9 @@
121 126 <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>
122 127 </tr>
123 128 <tr valign="top" id='asyncOnly2' <?php if(get_option('code_type')=='SYNC') echo "style='display:none;'" ?>>
124 129 <th scope="row">Library Timeout</th>
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>
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>
126 131 </tr>
127 132 </table>
128 133
129 134 <script type="text/javascript">
@@ -142,19 +147,19 @@
142 147 }
143 148 }
144 149 </script>
145 150 <p class="submit"><input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /></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>
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 VWO account.</p>
147 152 <?php
148 153 echo '</div>';
149 154 }
150 155
151 -function clhf_warn_nosettings(){
156 +function vwo_clhf_warn_nosettings(){
152 157 if (!is_admin())
153 158 return;
154 159
155 160 $clhf_option = get_option("vwo_id");
156 161 if (!$clhf_option || $clhf_option < 1){
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>";
162 + echo "<div id='vwo-warning' class='updated fade'><p><strong>VWO 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>";
158 163 }
159 164 }
160 165 ?>