Prep Plugin for release on WordPress.org (#23)
* Update translation text domain * Escape everything that should be escaped. * Add nonce checks where needed. * Sanitize all inputs. * Apply Code style changes across the codebase. * Correct many deprecation notices. * Optimize load order of many filters. * Add Proper Build script * Use emojii flags * Fix i18n deprecation notice for translating too early * Put all scripts in footer and load async
This commit is contained in:
4
assets/js/visits-counter.min.js
vendored
4
assets/js/visits-counter.min.js
vendored
@ -1,3 +1 @@
|
||||
(() => {
|
||||
"use strict";const CreateCookie=(name,value,days)=>{let expires;if(days){const date=new Date;date.setTime(date.getTime()+days*24*60*60*1e3),expires="; expires="+date.toUTCString()}else expires="";document.cookie=name+"="+value+expires+"; path=/"},ReadCookie=name=>{const nameEQ=name+"=",ca=document.cookie.split(";");for(let i=0;i<ca.length;i++){let c=ca[i];for(;c.charAt(0)===" ";)c=c.substring(1,c.length);if(c.indexOf(nameEQ)===0)return c.substring(nameEQ.length,c.length)}return null},countVisit=()=>{if(ReadCookie("WUVISIT")==="1")return;const countVisit2=async()=>{const url=new URL(wu_visits_counter.ajaxurl);url.searchParams.set("action","wu_count_visits"),url.searchParams.set("code",wu_visits_counter.code),await fetch(url),CreateCookie("WUVISIT","1",1)};document.addEventListener("DOMContentLoaded",()=>{setTimeout(function(){countVisit2()},1e4)})};countVisit();
|
||||
})()
|
||||
(()=>{var e=(e=>{var n=e+"=",i=document.cookie.split(";");for(let t=0;t<i.length;t++){let e=i[t];for(;" "===e.charAt(0);)e=e.substring(1,e.length);if(0===e.indexOf(n))return e.substring(n.length,e.length)}return null})("WUVISIT");if("1"!==e){let e=async()=>{var e=new URL(wu_visits_counter.ajaxurl);e.searchParams.set("action","wu_count_visits"),e.searchParams.set("code",wu_visits_counter.code),await fetch(e),((e,t,n)=>{let i;var r;i=n?((r=new Date).setTime(r.getTime()+24*n*60*60*1e3),"; expires="+r.toUTCString()):"",document.cookie=e+"="+t+i+"; path=/"})("WUVISIT","1",1)};document.addEventListener("DOMContentLoaded",()=>{setTimeout(function(){e()},1e4)})}})();
|
||||
|
Reference in New Issue
Block a user