| @@ -4,15 +4,15 @@ | ||
| 4 | 4 | * Plugin Name: VWO |
| 5 | 5 | * Plugin URI: https://vwo.com/ |
| 6 | 6 | * 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/">VWO</a> for more details. |
| 7 | 7 | * Author: VWO |
| 8 | - * Version: 4.1 | |
| 8 | + * Version: 4.4 | |
| 9 | 9 | * visual-website-optimizer.php |
| 10 | 10 | * Author URI: https://vwo.com/ |
| 11 | 11 | * |
| 12 | 12 | * @package VWO |
| 13 | 13 | * @author VWO |
| 14 | - * @version 4.1 | |
| 14 | + * @version 4.4 | |
| 15 | 15 | **/ |
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * Generate Common Code |
| @@ -94,18 +94,18 @@ | ||
| 94 | 94 | <!-- Start VWO Async SmartCode --> |
| 95 | 95 | <link rel="preconnect" href="https://dev.visualwebsiteoptimizer.com" /> |
| 96 | 96 | <script <?php echo vwo_clhf_ignore_js_attr(); ?> type='text/javascript' id='vwoCode'> |
| 97 | 97 | /* Fix: wp-rocket (application/ld+json) */ |
| 98 | - window._vwo_code || (function() { | |
| 99 | - var account_id= <?php echo esc_html( $vwo_id ); ?>, | |
| 100 | - version = 2.0, | |
| 101 | - settings_tolerance= <?php echo esc_html( $settings_tolerance ); ?>, | |
| 102 | - library_tolerance= <?php echo esc_html( $library_tolerance ); ?>, | |
| 103 | - use_existing_jquery= <?php echo ( $use_existing_jquery ) ? 'true' : 'false'; ?>, | |
| 98 | + window._vwo_code || (function () { | |
| 99 | + var account_id=<?php echo esc_html( $vwo_id ); ?>, // replace 1 with ${accountId} in release string | |
| 100 | + version=2.1, | |
| 101 | + settings_tolerance=<?php echo esc_html( $settings_tolerance ); ?>, | |
| 102 | + library_tolerance=<?php echo esc_html( $library_tolerance ); ?>, | |
| 103 | + use_existing_jquery=<?php echo ( $use_existing_jquery ) ? 'true' : 'false'; ?>, | |
| 104 | 104 | hide_element='body', |
| 105 | - hide_element_style = 'opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important', | |
| 105 | + hide_element_style='opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important', | |
| 106 | 106 | /* DO NOT EDIT BELOW THIS LINE */ |
| 107 | - f=false,w=window,d=document,v=d.querySelector('#vwoCode'),cK='_vwo_'+account_id+'_settings',cc={};try{var c=JSON.parse(localStorage.getItem('_vwo_'+account_id+'_config'));cc=c&&typeof c==='object'?c:{}}catch(e){}var stT=cc.stT==='session'?w.sessionStorage:w.localStorage;code={use_existing_jquery:function(){return typeof use_existing_jquery!=='undefined'?use_existing_jquery:undefined},library_tolerance:function(){return typeof library_tolerance!=='undefined'?library_tolerance:undefined},settings_tolerance:function(){return cc.sT||settings_tolerance},hide_element_style:function(){return'{'+(cc.hES||hide_element_style)+'}'},hide_element:function(){return typeof cc.hE==='string'?cc.hE:hide_element},getVersion:function(){return version},finish:function(){if(!f){f=true;var e=d.getElementById('_vis_opt_path_hides');if(e)e.parentNode.removeChild(e)}},finished:function(){return f},load:function(e){var t=this.getSettings(),n=d.createElement('script'),i=this;if(t){n.textContent=t;d.getElementsByTagName('head')[0].appendChild(n);if(!w.VWO||VWO.caE){stT.removeItem(cK);i.load(e)}}else{n.fetchPriority='high';n.src=e;n.type='text/javascript';n.onerror=function(){_vwo_code.finish()};d.getElementsByTagName('head')[0].appendChild(n)}},getSettings:function(){try{var e=stT.getItem(cK);if(!e){return}e=JSON.parse(e);if(Date.now()>e.e){stT.removeItem(cK);return}return e.s}catch(e){return}},init:function(){if(d.URL.indexOf('__vwo_disable__')>-1)return;var e=this.settings_tolerance();w._vwo_settings_timer=setTimeout(function(){_vwo_code.finish();stT.removeItem(cK)},e);var t=d.currentScript,n=d.createElement('style'),i=this.hide_element(),r=t&&!t.async&&i?i+this.hide_element_style():'',c=d.getElementsByTagName('head')[0];n.setAttribute('id','_vis_opt_path_hides');v&&n.setAttribute('nonce',v.nonce);n.setAttribute('type','text/css');if(n.styleSheet)n.styleSheet.cssText=r;else n.appendChild(d.createTextNode(r));c.appendChild(n);this.load('https://dev.visualwebsiteoptimizer.com/j.php?a='+account_id+'&u='+encodeURIComponent(d.URL)+'&vn='+version)}};w._vwo_code=code;code.init();})(); | |
| 107 | + f=false,w=window,d=document,v=d.querySelector('#vwoCode'),cK='_vwo_'+account_id+'_settings',cc={};try{var c=JSON.parse(localStorage.getItem('_vwo_'+account_id+'_config'));cc=c&&typeof c==='object'?c:{}}catch(e){}var stT=cc.stT==='session'?w.sessionStorage:w.localStorage;code={use_existing_jquery:function(){return typeof use_existing_jquery!=='undefined'?use_existing_jquery:undefined},library_tolerance:function(){return typeof library_tolerance!=='undefined'?library_tolerance:undefined},settings_tolerance:function(){return cc.sT||settings_tolerance},hide_element_style:function(){return'{'+(cc.hES||hide_element_style)+'}'},hide_element:function(){if(performance.getEntriesByName('first-contentful-paint')[0]){return''}return typeof cc.hE==='string'?cc.hE:hide_element},getVersion:function(){return version},finish:function(e){if(!f){f=true;var t=d.getElementById('_vis_opt_path_hides');if(t)t.parentNode.removeChild(t);if(e)(new Image).src='https://dev.visualwebsiteoptimizer.com/ee.gif?a='+account_id+e}},finished:function(){return f},addScript:function(e){var t=d.createElement('script');t.type='text/javascript';if(e.src){t.src=e.src}else{t.text=e.text}d.getElementsByTagName('head')[0].appendChild(t)},load:function(e,t){var i=this.getSettings(),n=d.createElement('script'),r=this;t=t||{};if(i){n.textContent=i;d.getElementsByTagName('head')[0].appendChild(n);if(!w.VWO||VWO.caE){stT.removeItem(cK);r.load(e)}}else{var o=new XMLHttpRequest;o.open('GET',e,true);o.withCredentials=!t.dSC;o.responseType=t.responseType||'text';o.onload=function(){if(t.onloadCb){return t.onloadCb(o,e)}if(o.status===200){_vwo_code.addScript({text:o.responseText})}else{_vwo_code.finish('&e=loading_failure:'+e)}};o.onerror=function(){if(t.onerrorCb){return t.onerrorCb(e)}_vwo_code.finish('&e=loading_failure:'+e)};o.send()}},getSettings:function(){try{var e=stT.getItem(cK);if(!e){return}e=JSON.parse(e);if(Date.now()>e.e){stT.removeItem(cK);return}return e.s}catch(e){return}},init:function(){if(d.URL.indexOf('__vwo_disable__')>-1)return;var e=this.settings_tolerance();w._vwo_settings_timer=setTimeout(function(){_vwo_code.finish();stT.removeItem(cK)},e);var t;if(this.hide_element()!=='body'){t=d.createElement('style');var i=this.hide_element(),n=i?i+this.hide_element_style():'',r=d.getElementsByTagName('head')[0];t.setAttribute('id','_vis_opt_path_hides');v&&t.setAttribute('nonce',v.nonce);t.setAttribute('type','text/css');if(t.styleSheet)t.styleSheet.cssText=n;else t.appendChild(d.createTextNode(n));r.appendChild(t)}else{t=d.getElementsByTagName('head')[0];var n=d.createElement('div');n.style.cssText='z-index: 2147483647 !important;position: fixed !important;left: 0 !important;top: 0 !important;width: 100% !important;height: 100% !important;background: white !important;';n.setAttribute('id','_vis_opt_path_hides');n.classList.add('_vis_hide_layer');t.parentNode.insertBefore(n,t.nextSibling)}var o='https://dev.visualwebsiteoptimizer.com/j.php?a='+account_id+'&u='+encodeURIComponent(d.URL)+'&vn='+version;if(w.location.search.indexOf('_vwo_xhr')!==-1){this.addScript({src:o})}else{this.load(o+'&x=true')}}};w._vwo_code=code;code.init();})(); | |
| 108 | 108 | </script> |
| 109 | 109 | <!-- End VWO Async SmartCode --> |
| 110 | 110 | <?php |
| 111 | 111 | // @codingStandardsIgnoreEnd |
| @@ -229,9 +229,9 @@ | ||
| 229 | 229 | echo '<div class="wrap">'; |
| 230 | 230 | ?> |
| 231 | 231 | <h2>VWO</h2> |
| 232 | 232 | <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> |
| 233 | - <form method="post" action="options.php"> | |
| 233 | + <form method="post" action="options.php" novalidate> | |
| 234 | 234 | <?php settings_fields( 'clhf_vwo_options' ); ?> |
| 235 | 235 | <table class="form-table"> |
| 236 | 236 | <tr valign="top"> |
| 237 | 237 | <th scope="row">Your VWO Account ID</th> |