Changeset 2765514
- Timestamp:
- 08/03/2022 05:40:50 AM (4 years ago)
- Location:
- vmv-preloader/trunk
- Files:
-
- 9 added
- 2 edited
-
CrawlerDetect (added)
-
CrawlerDetect/init.php (added)
-
CrawlerDetect/src (added)
-
CrawlerDetect/src/CrawlerDetect.php (added)
-
CrawlerDetect/src/Fixtures (added)
-
CrawlerDetect/src/Fixtures/AbstractProvider.php (added)
-
CrawlerDetect/src/Fixtures/Crawlers.php (added)
-
CrawlerDetect/src/Fixtures/Exclusions.php (added)
-
CrawlerDetect/src/Fixtures/Headers.php (added)
-
readme.txt (modified) (2 diffs)
-
vmv/vmv-miscellaneous.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vmv-preloader/trunk/readme.txt
r2736175 r2765514 5 5 Requires at least: 5.5 6 6 Tested up to: 6.0 7 Stable tag: 1. 0.07 Stable tag: 1.1.0 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 14 14 https://www.youtube.com/watch?v=xYw0HmdU94k 15 15 16 VMV Preloader is a modern solution with SVG/JavaScript animation. With a small size (~50kB/~20kB gzip). It offers visual feedback in the event of content being loaded.16 VMV Preloader is a modern solution with SVG/JavaScript/CSS animation. With a small size (~17kB OR ~7kB gzip - usually gzip compress allowed by hosting provider). It offers visual feedback in the event of content being loaded. 17 17 This solution increase the chance of a new user wait load your Wordpress website. 18 18 -
vmv-preloader/trunk/vmv/vmv-miscellaneous.php
r2765301 r2765514 3 3 exit; 4 4 } 5 6 require_once(__DIR__.'/../CrawlerDetect/init.php'); 7 use Jaybizzle\CrawlerDetect\CrawlerDetect; 5 8 6 9 function vmv_admin_frontend() { … … 41 44 42 45 function vmv_preloader_head_section() { 46 $CrawlerDetect = new CrawlerDetect; 47 $isNotCrawler = !$CrawlerDetect->isCrawler(); 43 48 $option = vmv_preloader_get_option(); 44 49 $pluginActivated = $option['pluginActivated']; … … 56 61 57 62 $currentCookie = 'vmv_PredL_' . $t4; 58 if ( ( ! isset( $_COOKIE[ $currentCookie ] ) && $pluginActivated ) || $demoView == 'true') {63 if ( (( ! isset( $_COOKIE[ $currentCookie ] ) && $pluginActivated ) || $demoView == 'true' ) && $isNotCrawler ) { 59 64 echo ' 60 65 <style data-vmv-s0 data-stamp="'.$t4.'" data-y1="'.$demoView.'"> … … 81 86 82 87 function vmv_preloader_footer_section(){ 88 $CrawlerDetect = new CrawlerDetect; 89 $isNotCrawler = !$CrawlerDetect->isCrawler(); 83 90 $option = vmv_preloader_get_option(); 84 91 $pluginActivated = $option['pluginActivated']; … … 126 133 127 134 $currentCookie = 'vmv_PredL_' . $t4; 128 if ( ( ! isset( $_COOKIE[ $currentCookie ] ) && $pluginActivated ) || $demoView == 'true') {135 if ( (( ! isset( $_COOKIE[ $currentCookie ] ) && $pluginActivated ) || $demoView == 'true' ) && $isNotCrawler ) { 129 136 if ( $themeFile == 'KadisokaFont__bDEsYzEsYzIsYix3LHQ=.json' ) { 130 137 if($previousL1 !== $l1) { … … 172 179 <div data-l1="$l1" id="_vmv_" data-w1="$w1" data-w2="$w2" data-w3="$w3" data-w4="$w4" data-t2="$t2" data-bg3="$b3" data-t1="$t1" data-strategy="$strategy"><div class="_vmv_pr__b"><div class="_vmv_pr__b-in"><div class="_vmv_pr__b-in-in"><svg class="_vmv_pr__svg" xmlns="http://www.w3.org/2000/svg"><defs class="_vmv_pr__svg-defs"></defs><g fill-rule="evenodd" fill="none" class="_vmv_pr__svg-glyphs">$dataSVGToTemplate</g></svg><div class="_vmv_pr__ind"><div class="_vmv_pr__ind-in _vmv_pr__ind-in-pr-1"></div><div class="_vmv_pr__ind-in _vmv_pr__ind-in-pr-2"></div></div></div></div></div></div> 173 180 <style data-vmv-s1 > 174 #_vmv_{--bg-b0: $b0;--bg-b1: $b1;--bg-b2: $b2;--bg-b4: $b4;--fill: $c1;--fill-shadow: $c2;--pulse-left: $dataSVGPulseLeftToTemplate;--pulse-bottom:$dataSVGPulseBottomToTemplate;position:fixed;top:0;left:0;height:100vh;width:100vw;background-color:var(--bg-b0);z-index:2147483638;background-blend-mode:screen;line-height:1;font-size:1px;overflow:hidden;transform:translateZ(2147483638em)}#_vmv_.is-hidding{transition:all .5s}._vmv_pr__b{opacity:1;display:flex;height:100%;width:100%;justify-content:center;align-items:center;position:relative}._vmv_pr__b-in{position:relative;transform:scale(var(--vmv_scale))}._vmv_pr__b-in-in{transform:scale(var(--scaleBox))}._vmv_pr__b--r-bg{background:radial-gradient(var(--bg-b4),var(--bg-b1),var(--bg-b2))}._vmv_pr__b--l-bg{background:linear-gradient(var(--bg-b4),var(--bg-b1),var(--bg-b2))}._vmv_pr__svg{ max-width:none;overflow:visible;filter:drop-shadow(1px 1px 3px var(--fill-shadow));transform:translateZ(2111221em)}._vmv_pr__svg{position:relative}._vmv_pr__ind{opacity:0;transition:opacity .2s;position:absolute;bottom:0;left:100%;margin-left:var(--pulse-left);margin-bottom:var(--pulse-bottom);width:100px;height:100px;transform-origin:0 100%}181 #_vmv_{--bg-b0: $b0;--bg-b1: $b1;--bg-b2: $b2;--bg-b4: $b4;--fill: $c1;--fill-shadow: $c2;--pulse-left: $dataSVGPulseLeftToTemplate;--pulse-bottom:$dataSVGPulseBottomToTemplate;position:fixed;top:0;left:0;height:100vh;width:100vw;background-color:var(--bg-b0);z-index:2147483638;background-blend-mode:screen;line-height:1;font-size:1px;overflow:hidden;transform:translateZ(2147483638em)}#_vmv_.is-hidding{transition:all .5s}._vmv_pr__b{opacity:1;display:flex;height:100%;width:100%;justify-content:center;align-items:center;position:relative}._vmv_pr__b-in{position:relative;transform:scale(var(--vmv_scale))}._vmv_pr__b-in-in{transform:scale(var(--scaleBox))}._vmv_pr__b--r-bg{background:radial-gradient(var(--bg-b4),var(--bg-b1),var(--bg-b2))}._vmv_pr__b--l-bg{background:linear-gradient(var(--bg-b4),var(--bg-b1),var(--bg-b2))}._vmv_pr__svg{display:none;position:relative;max-width:none;overflow:visible;filter:drop-shadow(1px 1px 3px var(--fill-shadow));transform:translateZ(2111221em)}._vmv_pr__ind{opacity:0;transition:opacity .2s;position:absolute;bottom:0;left:100%;margin-left:var(--pulse-left);margin-bottom:var(--pulse-bottom);width:100px;height:100px;transform-origin:0 100%} 175 182 ._vmv_pr__ind-in{width:0;position:absolute;border-radius:50%;border:1px solid $c1;top:50%;left:50%;transform:translateX(-50%) translateY(-50%);filter:drop-shadow(1px 1px 3px var(--str-shadow))}._vmv_pr__ind-in-pr-1{animation:pulse 1.5s ease infinite 0s}._vmv_pr__ind-in-pr-2{animation:pulse 1.5s ease infinite .4s}._vmv_pr__ind-in:before{content:'';display:block;padding-top:100%}@keyframes pulse{0%{width:0;opacity:0}30%{opacity:1}100%{width:100%;opacity:0}}.vmv-fill{stroke-dasharray:var(--pathLength);stroke-dashoffset:var(--pathLength);animation:filling var(--timeDuration) linear forwards var(--timeDelay);transition:none}@keyframes filling{0%{stroke-dashoffset:var(--pathLength)}100%{stroke-dashoffset:0}} 176 183 </style> … … 180 187 const _VMV_baseHeight = '.$dataSVGHeightToTemplate.'; 181 188 const _VMV_baseWidth = '.$dataSVGWidthToTemplate.'; 189 (()=>{const t=document.getElementById("_vmv_"),e=1e3*t.dataset.t1||0,i=t.dataset.strategy,s=t.dataset.w1||80,d=t.dataset.w2||0,o=t.dataset.w3||0,n=t.dataset.w4||0,a=t.dataset.t2||5;let r,_=!1,m=!1;if(void 0===window._vmv_hidden||window._vmv_hidden&&t)return t.remove(),w(),!1;"fullLoad"===i&&(r=setTimeout((()=>{m=!0,h()}),e),window.onload=function(){h&&(clearTimeout(r),m=!0,h())}),setTimeout((()=>{window._vmv_s0.remove(),document.getElementById("_vmv_fade").remove()}),500);const l=t.querySelector("._vmv_pr__svg");t.querySelector("._vmv_pr__svg-defs"),t.querySelector("._vmv_pr__svg-glyphs"),l.querySelectorAll("#Signature > g");l.setAttribute("viewBox",`0 0 ${_VMV_baseWidth} ${_VMV_baseHeight}`),l.style.width=4*_VMV_baseWidth+"px",l.style.height=4*_VMV_baseHeight+"px";const c=t.querySelector("._vmv_pr__b");function h(){_&&!m&&(t.querySelector("._vmv_pr__ind").style.opacity=1),_&&m&&(t.classList.add("is-hidding"),setTimeout((()=>{t.style.opacity=0}),500),setTimeout((()=>{t.remove(),w(),function(){if(window._vmv_demo)return!1;(function(){const t=Object.assign({},localStorage);for(let e in t)e.includes(window._vmv_prefix)&&localStorage.removeItem(e);document.cookie.split(";").forEach((t=>{t.includes(window._vmv_prefix)&&(document.cookie=`${t}; max-age=-1;`)}))})(),localStorage.setItem(`${window._vmv_prefix}_${window._vmv_stamp}`,"done"),document.cookie=`${window._vmv_prefix}_${window._vmv_stamp}=done; max-age=31104000; path=/`}()}),1e3))}function w(){[...document.querySelectorAll("script, style")].forEach((t=>{const e=t?.dataset;if(e)for(const[i]of Object.entries(e))(i.includes("vmvJ")||i.includes("vmvS"))&&t.remove()}))}!function(){const s=document.querySelector("._vmv_pr__svg");[...s.querySelectorAll("#Signature > g")].forEach(((t,e)=>{const i=t.getAttribute("id");t.setAttribute("id",`${i}__ROOT__${e}`)}));const d=s.querySelectorAll("path[clip-path]"),o=document.createElement("style");o.setAttribute("data-vmv-s2","");const n=document.querySelector("style[data-vmv-s1]");let r=.3,w="",u=1;const v=d.length;var p,g;d.forEach(((t,s)=>{t.classList.add("vmv-fill");let d=t.parentElement;const n=`${t.getAttribute("id")}-t${s}`;t.setAttribute("id",n),d.getAttribute("id").includes("__ROOT__")||(d=d.parentElement);const l=d.getAttribute("id"),c=Number(t.getTotalLength().toFixed(3));w===l?u++:u=1;const p=Number(t.parentElement.dataset.duration)||1,g=Number((c*a*p/1e3).toFixed(3));o.innerHTML+=`#${l} path#${n} {--pathLength: ${c};--timeDelay: ${r}s; --timeDuration: ${g}s;}`,r=Number((r+g).toFixed(3)),w=l,v-1===s&&(o.innerHTML+="._vmv_pr__svg-glyphs {stroke: var(--fill) !important;}",t.addEventListener("animationend",(function(){_=!0,"end"===i&&e>=1e3&&setTimeout((()=>{m=!0,h()}),e),h()}),!1))})),g=o,(p=n).parentNode.insertBefore(g,p.nextSibling),l.style.display="block";const b="radial"===t.dataset.bg3?"_vmv_pr__b--r-bg":"_vmv_pr__b--l-bg";c.classList.add(b)}(),setTimeout((()=>{c.style.width="101%"}));const u=new class{constructor(t,e,i,s){this.mobile=window.matchMedia("(max-width:767px)"),this.tablet=window.matchMedia("(min-width:768px) and (max-width: 1023px)"),this.desktop=window.matchMedia("(min-width:1024px) and (max-width: 1399px)"),this.wide_desktop=window.matchMedia("(min-width:1400px)"),this.w1_width=null,this.w2_width=null,this.w3_width=null,this.w4_width=null,this.initWidth(t,e,i,s)}initWidth(t,e,i,s){this.w1_width=0===Number(t)?.8:Number(t)/100,this.w2_width=0===Number(e)?this.w1_width:Number(e)/100,this.w3_width=0===Number(i)?this.w2_width:Number(i)/100,this.w4_width=0===Number(s)?this.w3_width:Number(s)/100}getWidthCorrection(){return this.mobile.matches?this.w1_width:this.tablet.matches?this.w2_width:this.desktop.matches?this.w3_width:this.wide_desktop.matches?this.w4_width:void 0}}(s,d,o,n);let v=0;function p(){t.style.paddingLeft="1px",v=t.getBoundingClientRect().width,t.style.paddingLeft="0px",animationBoxWidth=v*u.getWidthCorrection(),t.style.setProperty("--vmv_scale",""+animationBoxWidth/(_VMV_baseWidth+70))}t.style.setProperty("--scaleBox","0.25"),window.addEventListener("resize",p),p()})(); 182 190 (()=>{const t=document.getElementById("_vmv_"),e=1e3*t.dataset.t1||0,i=t.dataset.strategy,d=t.dataset.w1||80,o=t.dataset.w2||0,s=t.dataset.w3||0,n=t.dataset.w4||0,a=t.dataset.t2||5;let r,_=!1,m=!1;if(void 0===window._vmv_hidden||window._vmv_hidden&&t)return t.remove(),w(),!1;"fullLoad"===i&&(r=setTimeout((()=>{m=!0,h()}),e),window.onload=function(){h&&(clearTimeout(r),m=!0,h())}),setTimeout((()=>{window._vmv_s0.remove(),document.getElementById("_vmv_fade").remove()}),500);const l=t.querySelector("._vmv_pr__svg");t.querySelector("._vmv_pr__svg-defs"),t.querySelector("._vmv_pr__svg-glyphs"),l.querySelectorAll("#Signature > g");l.setAttribute("viewBox",`0 0 ${_VMV_baseWidth} ${_VMV_baseHeight}`),l.style.width=4*_VMV_baseWidth+"px",l.style.height=4*_VMV_baseHeight+"px";const c=t.querySelector("._vmv_pr__b");function h(){_&&!m&&(t.querySelector("._vmv_pr__ind").style.opacity=1),_&&m&&(t.classList.add("is-hidding"),setTimeout((()=>{t.style.opacity=0}),500),setTimeout((()=>{t.remove(),w(),function(){if(window._vmv_demo)return!1;(function(){const t=Object.assign({},localStorage);for(let e in t)e.includes(window._vmv_prefix)&&localStorage.removeItem(e);document.cookie.split(";").forEach((t=>{t.includes(window._vmv_prefix)&&(document.cookie=`${t}; max-age=-1;`)}))})(),localStorage.setItem(`${window._vmv_prefix}_${window._vmv_stamp}`,"done"),document.cookie=`${window._vmv_prefix}_${window._vmv_stamp}=done; max-age=31104000; path=/`}()}),1e3))}function w(){[...document.querySelectorAll("script, style")].forEach((t=>{const e=t?.dataset;if(e)for(const[i]of Object.entries(e))(i.includes("vmvJ")||i.includes("vmvS"))&&t.remove()}))}!function(){const d=document.querySelector("._vmv_pr__svg");[...d.querySelectorAll("#Signature > g")].forEach(((t,e)=>{const i=t.getAttribute("id");t.setAttribute("id",`${i}__ROOT__${e}`)}));const o=d.querySelectorAll("path[clip-path]"),s=document.createElement("style");s.setAttribute("data-vmv-s2","");const n=document.querySelector("style[data-vmv-s1]");let r=.2,l="",w=1;const u=o.length;var v,p;o.forEach(((t,d)=>{t.classList.add("vmv-fill");let o=t.parentElement;const n=`${t.getAttribute("id")}-t${d}`;t.setAttribute("id",n),o.getAttribute("id").includes("__ROOT__")||(o=o.parentElement);const c=o.getAttribute("id"),v=Number(t.getTotalLength().toFixed(3));l===c?w++:w=1;const p=Number(t.parentElement.dataset.duration)||1,g=Number((v*a*p/1e3).toFixed(3));s.innerHTML+=`#${c} path#${n} {--pathLength: ${v};--timeDelay: ${r}s; --timeDuration: ${g}s;}`,r=Number((r+g).toFixed(3)),l=c,u-1===d&&(s.innerHTML+="._vmv_pr__svg-glyphs {stroke: var(--fill) !important;}",t.addEventListener("animationend",(function(){_=!0,"end"===i&&e>=1e3&&setTimeout((()=>{m=!0,h()}),e),h()}),!1))})),p=s,(v=n).parentNode.insertBefore(p,v.nextSibling);const g="radial"===t.dataset.bg3?"_vmv_pr__b--r-bg":"_vmv_pr__b--l-bg";c.classList.add(g)}(),setTimeout((()=>{c.style.width="101%"}));const u=new class{constructor(t,e,i,d){this.mobile=window.matchMedia("(max-width:767px)"),this.tablet=window.matchMedia("(min-width:768px) and (max-width: 1023px)"),this.desktop=window.matchMedia("(min-width:1024px) and (max-width: 1399px)"),this.wide_desktop=window.matchMedia("(min-width:1400px)"),this.w1_width=null,this.w2_width=null,this.w3_width=null,this.w4_width=null,this.initWidth(t,e,i,d)}initWidth(t,e,i,d){this.w1_width=0===Number(t)?.8:Number(t)/100,this.w2_width=0===Number(e)?this.w1_width:Number(e)/100,this.w3_width=0===Number(i)?this.w2_width:Number(i)/100,this.w4_width=0===Number(d)?this.w3_width:Number(d)/100}getWidthCorrection(){return this.mobile.matches?this.w1_width:this.tablet.matches?this.w2_width:this.desktop.matches?this.w3_width:this.wide_desktop.matches?this.w4_width:void 0}}(d,o,s,n);let v=0;function p(){t.style.paddingLeft="1px",v=t.getBoundingClientRect().width,t.style.paddingLeft="0px",animationBoxWidth=v*u.getWidthCorrection(),t.style.setProperty("--vmv_scale",""+animationBoxWidth/(_VMV_baseWidth+70))}t.style.setProperty("--scaleBox","0.25"),window.addEventListener("resize",p),p()})(); 183 191 </script>';
Note: See TracChangeset
for help on using the changeset viewer.