| @@ -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.10 | |
| 8 | + * Version: 4.7 | |
| 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.10 | |
| 14 | + * @version 4.7 | |
| 15 | 15 | **/ |
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * Generate Common Code |
| @@ -55,14 +55,8 @@ | ||
| 55 | 55 | $js_attr = ''; |
| 56 | 56 | if ( function_exists( 'get_vwo_clhf_ignore_js' ) && $ignore_js ) { |
| 57 | 57 | $js_attr = 'data-cfasync="false" nowprocket'; |
| 58 | 58 | } |
| 59 | - // Always exclude VWO scripts from Jetpack Boost deferral | |
| 60 | - if ( ! empty( $js_attr ) ) { | |
| 61 | - $js_attr .= ' data-jetpack-boost="ignore"'; | |
| 62 | - } else { | |
| 63 | - $js_attr = 'data-jetpack-boost="ignore"'; | |
| 64 | - } | |
| 65 | 59 | return $js_attr; |
| 66 | 60 | } |
| 67 | 61 | |
| 68 | 62 | /** |
| @@ -86,12 +80,12 @@ | ||
| 86 | 80 | |
| 87 | 81 | /** |
| 88 | 82 | * Generate Asynchronous Code |
| 89 | 83 | * |
| 90 | - * @param int $vwo_id integer. | |
| 91 | - * @param int $settings_tolerance integer. | |
| 92 | - * @param int $library_tolerance integer. | |
| 93 | - * @param bool $use_existing_jquery boolean. | |
| 84 | + * @param int $vwo_id integer. | |
| 85 | + * @param int $settings_tolerance integer. | |
| 86 | + * @param int $library_tolerance integer. | |
| 87 | + * @param bool $use_existing_jquery boolean. | |
| 94 | 88 | * @return string String for async script. |
| 95 | 89 | */ |
| 96 | 90 | function get_vwo_clhf_script_async_code( $vwo_id, $settings_tolerance, $library_tolerance, $use_existing_jquery ) { |
| 97 | 91 | ob_start(); |
| @@ -101,20 +95,17 @@ | ||
| 101 | 95 | <link rel="preconnect" href="https://dev.visualwebsiteoptimizer.com" /> |
| 102 | 96 | <script <?php echo vwo_clhf_ignore_js_attr(); ?> type='text/javascript' id='vwoCode'> |
| 103 | 97 | /* Fix: wp-rocket (application/ld+json) */ |
| 104 | 98 | window._vwo_code || (function () { |
| 105 | - var w=window, | |
| 106 | - d=document; | |
| 107 | 99 | var account_id=<?php echo esc_html( $vwo_id ); ?>, |
| 108 | - version=2.2, | |
| 109 | - settings_tolerance=<?php echo esc_html( $settings_tolerance ); ?>, | |
| 110 | - library_tolerance=<?php echo esc_html( $library_tolerance ); ?>, | |
| 111 | - use_existing_jquery=<?php echo ( $use_existing_jquery ) ? 'true' : 'false'; ?>, | |
| 112 | - platform='web', | |
| 113 | - hide_element='body', | |
| 114 | - hide_element_style='opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important'; | |
| 115 | - /* DO NOT EDIT BELOW THIS LINE */ | |
| 116 | - if(f=!1,v=d.querySelector('#vwoCode'),cc={},-1<d.URL.indexOf('__vwo_disable__')||w._vwo_code)return;try{var e=JSON.parse(localStorage.getItem('_vwo_'+account_id+'_config'));cc=e&&'object'==typeof e?e:{}}catch(e){}function r(t){try{return decodeURIComponent(t)}catch(e){return t}}var s=function(){var e={combination:[],combinationChoose:[],split:[],exclude:[],uuid:null,consent:null,optOut:null},t=d.cookie||'';if(!t)return e;for(var n,i,o=/(?:^|;\s*)(?:(_vis_opt_exp_(\d+)_combi=([^;]*))|(_vis_opt_exp_(\d+)_combi_choose=([^;]*))|(_vis_opt_exp_(\d+)_split=([^:;]*))|(_vis_opt_exp_(\d+)_exclude=[^;]*)|(_vis_opt_out=([^;]*))|(_vwo_global_opt_out=[^;]*)|(_vwo_uuid=([^;]*))|(_vwo_consent=([^;]*)))/g;null!==(n=o.exec(t));)try{n[1]?e.combination.push({id:n[2],value:r(n[3])}):n[4]?e.combinationChoose.push({id:n[5],value:r(n[6])}):n[7]?e.split.push({id:n[8],value:r(n[9])}):n[10]?e.exclude.push({id:n[11]}):n[12]?e.optOut=r(n[13]):n[14]?e.optOut=!0:n[15]?e.uuid=r(n[16]):n[17]&&(i=r(n[18]),e.consent=i&&3<=i.length?i.substring(0,3):null)}catch(e){}return e}();function i(){var e=function(){if(w.VWO&&Array.isArray(w.VWO))for(var e=0;e<w.VWO.length;e++){var t=w.VWO[e];if(Array.isArray(t)&&('setVisitorId'===t[0]||'setSessionId'===t[0]))return!0}return!1}(),t='a='+account_id+'&u='+encodeURIComponent(w._vis_opt_url||d.URL)+'&vn='+version+'&ph=1'+('undefined'!=typeof platform?'&p='+platform:'')+'&st='+w.performance.now();e||((n=function(){var e,t=[],n={},i=w.VWO&&w.VWO.appliedCampaigns||{};for(e in i){var o=i[e]&&i[e].v;o&&(t.push(e+'-'+o+'-1'),n[e]=!0)}if(s&&s.combination)for(var r=0;r<s.combination.length;r++){var a=s.combination[r];n[a.id]||t.push(a.id+'-'+a.value)}return t.join('|')}())&&(t+='&c='+n),(n=function(){var e=[],t={};if(s&&s.combinationChoose)for(var n=0;n<s.combinationChoose.length;n++){var i=s.combinationChoose[n];e.push(i.id+'-'+i.value),t[i.id]=!0}if(s&&s.split)for(var o=0;o<s.split.length;o++)t[(i=s.split[o]).id]||e.push(i.id+'-'+i.value);return e.join('|')}())&&(t+='&cc='+n),(n=function(){var e={},t=[];if(w.VWO&&Array.isArray(w.VWO))for(var n=0;n<w.VWO.length;n++){var i=w.VWO[n];if(Array.isArray(i)&&'setVariation'===i[0]&&i[1]&&Array.isArray(i[1]))for(var o=0;o<i[1].length;o++){var r,a=i[1][o];a&&'object'==typeof a&&(r=a.e,a=a.v,r&&a&&(e[r]=a))}}for(r in e)t.push(r+'-'+e[r]);return t.join('|')}())&&(t+='&sv='+n)),s&&s.optOut&&(t+='&o='+s.optOut);var n=function(){var e=[],t={};if(s&&s.exclude)for(var n=0;n<s.exclude.length;n++){var i=s.exclude[n];t[i.id]||(e.push(i.id),t[i.id]=!0)}return e.join('|')}();return n&&(t+='&e='+n),s&&s.uuid&&(t+='&id='+s.uuid),s&&s.consent&&(t+='&consent='+s.consent),w.name&&-1<w.name.indexOf('_vis_preview')&&(t+='&pM=true'),w.VWO&&w.VWO.ed&&(t+='&ed='+w.VWO.ed),t}code={nonce:v&&v.nonce,use_existing_jquery:function(){return'undefined'!=typeof use_existing_jquery?use_existing_jquery:void 0},library_tolerance:function(){return'undefined'!=typeof library_tolerance?library_tolerance:void 0},settings_tolerance:function(){return cc.sT||settings_tolerance},hide_element_style:function(){return'{'+(cc.hES||hide_element_style)+'}'},hide_element:function(){return performance.getEntriesByName('first-contentful-paint')[0]?'':'string'==typeof cc.hE?cc.hE:hide_element},getVersion:function(){return version},finish:function(e){var t;f||(f=!0,(t=d.getElementById('_vis_opt_path_hides'))&&t.parentNode.removeChild(t),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',e.src?t.src=e.src:t.text=e.text,v&&t.setAttribute('nonce',v.nonce),d.getElementsByTagName('head')[0].appendChild(t)},load:function(e,t){t=t||{};var n=new XMLHttpRequest;n.open('GET',e,!0),n.withCredentials=!t.dSC,n.responseType=t.responseType||'text',n.onload=function(){if(t.onloadCb)return t.onloadCb(n,e);200===n.status?_vwo_code.addScript({text:n.responseText}):_vwo_code.finish('&e=loading_failure:'+e)},n.onerror=function(){if(t.onerrorCb)return t.onerrorCb(e);_vwo_code.finish('&e=loading_failure:'+e)},n.send()},init:function(){var e,t=this.settings_tolerance();w._vwo_settings_timer=setTimeout(function(){_vwo_code.finish()},t),'body'!==this.hide_element()?(n=d.createElement('style'),e=(t=this.hide_element())?t+this.hide_element_style():'',t=d.getElementsByTagName('head')[0],n.setAttribute('id','_vis_opt_path_hides'),v&&n.setAttribute('nonce',v.nonce),n.setAttribute('type','text/css'),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(d.createTextNode(e)),t.appendChild(n)):(n=d.getElementsByTagName('head')[0],(e=d.createElement('div')).style.cssText='z-index: 2147483647 !important;position: fixed !important;left: 0 !important;top: 0 !important;width: 100% !important;height: 100% !important;background: white !important;',e.setAttribute('id','_vis_opt_path_hides'),e.classList.add('_vis_hide_layer'),n.parentNode.insertBefore(e,n.nextSibling));var n='https://dev.visualwebsiteoptimizer.com/j.php?'+i();-1!==w.location.search.indexOf('_vwo_xhr')?this.addScript({src:n}):this.load(n+'&x=true',{l:1})}};w._vwo_code=code;code.init();})(); | |
| 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 | + hide_element='body', | |
| 105 | + hide_element_style = 'opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;transition:none !important;', | |
| 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(){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||o.status===304){_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();})(); | |
| 117 | 108 | </script> |
| 118 | 109 | <!-- End VWO Async SmartCode --> |
| 119 | 110 | <?php |
| 120 | 111 | // @codingStandardsIgnoreEnd |
| @@ -305,28 +296,18 @@ | ||
| 305 | 296 | ], |
| 306 | 297 | ]); |
| 307 | 298 | ?> |
| 308 | 299 | </div> |
| 309 | - <div class="main-grid__description" style="width:350px;"> | |
| 310 | - <div style="font-size: 18px; font-weight: 700; color: #000000; margin-bottom: 8px;">New to VWO?</div> | |
| 311 | - <div style="font-size: 14px; color: #757575; font-weight: 400; line-height: 20px; margin-bottom: 20px;">Create a free account to start optimising your website, no credit card required.</div> | |
| 312 | - <div> | |
| 313 | - <a target="_blank" href="https://vwo.com/free-trial/?utm_source=integration_wordpress&utm_medium=referral&utm_campaign=plugin_page&utm_content=config_screen_banner" style="text-decoration: none; display: block; width: 162px; background: #fff; color: #2271B1; border: 1px solid #2271B1; padding: 10px 12px; font-size: 14px; font-weight: 600; cursor: pointer; text-align: center; border-radius: 8px;"> | |
| 314 | - Get Started for Free</a> | |
| 315 | - <div> | |
| 316 | - <div style="margin-bottom: 28px; margin-top: 20px;"> | |
| 317 | - <div style="font-weight: 600; color: #363A42; font-size: 14px; margin-bottom: 8px;">VWO Dashboard?</div> | |
| 318 | - <div style="font-size: 14px; color: #757575; font-weight: 400;">Visit our knowledge base to learn how to use the VWO dashboard.</div> | |
| 319 | - <a href="https://app.vwo.com" target="_blank" style="display: inline-flex; align-items: center; color: #2271B1; border-radius: 8px; padding: 6px 12px; font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: none; margin-top: 10px; border: 1px solid #2271B1;"> | |
| 320 | - <span style="margin-right: 4px;">Go to Dashboard</span> | |
| 321 | - <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 32 32"> | |
| 322 | - <path fill="#2271B1" d="M17.88 1v3.75h5.62l-9.38 9.38 3.76 3.74 9.37-9.37v5.63H31V1H17.87zm9.37 26.25H4.75V4.75h7.5V1H1v30h30V19.75h-3.75v7.5z"/> | |
| 323 | - </svg> | |
| 324 | - </a> | |
| 325 | - </div> | |
| 326 | - <div style="font-size: 13px;"> | |
| 327 | - Need help? Visit our <a style="color: inherit;" href="https://help.vwo.com/hc/en-us/articles/360020745993-Integrating-VWO-With-WordPress">Knowledge Base</a> for guides and FAQs. | |
| 328 | - </div> | |
| 300 | + <div class="main-grid__description"> | |
| 301 | + <h2>Get Started Easily</h2> | |
| 302 | + <p> | |
| 303 | + Enter your <b>VWO Account ID</b> to begin. | |
| 304 | + <br> | |
| 305 | + New to VWO? | |
| 306 | + <a target="_blank" href="https://vwo.com/free-trial/?utm_source=integration_wordpress&utm_medium=referral&utm_campaign=plugin_page&utm_content=config_screen_banner">Create an account</a> and start optimizing <br/>your website effortlessly. | |
| 307 | + <br><br><br> | |
| 308 | + Need help? Visit our <a target="_blank" href="https://help.vwo.com/hc/en-us/articles/360020745993-Integrating-VWO-With-WordPress">knowledge base</a>. | |
| 309 | + </p> | |
| 329 | 310 | </div> |
| 330 | 311 | </main> |
| 331 | 312 | <?php |
| 332 | 313 | } |