PageSourceSearch

https://bearpost.org/wp-content/plugins/wordpress-popular-posts/assets/js/wpp.min_ver-6.1.3.js

js bearpost.org collected 2026-09-26 14:44:43 UTC 2,812 bytes, 1 lines download raw bytes

1var e,t,n,o=null,a=(e=function(){},t=!!HTMLElement.prototype.attachShadow,{get:function(t,o,a,l){n("GET",t,o,a="function"==typeof a?a:e,l)},post:function(t,o,a,l){n("POST",t,o,a="function"==typeof a?a:e,l)},ajax:n=function(e,t,n,o,a){var l=new XMLHttpRequest,i=t,r=n,p={"X-Requested-With":"XMLHttpRequest"};"POST"==(e=-1!=["GET","POST"].indexOf(e)?e:"GET")&&(p["Content-Type"]="application/x-www-form-urlencoded"),"object"==typeof a&&Object.keys(a).length&&(p=Object.assign({},p,a)),l.open(e,i+("GET"==e?"?"+r:""),!0);for(const e in p)p.hasOwnProperty(e)&&l.setRequestHeader(e,p[e]);l.onreadystatechange=function(){4===l.readyState&&200<=l.status&&300>l.status&&"function"==typeof o&&o.call(void 0,l.response)},l.send("POST"==e?r:null)},theme:function(e){if(t){let t=document.createElement("style"),n=document.createElement("ul");n.innerHTML='<li><a href="#"></a></li>',e.parentNode.appendChild(n);let o=getComputedStyle(n.querySelector("li")),a=getComputedStyle(n.querySelector("li a"));t.innerHTML=".wpp-list li {font-size: "+o.fontSize+"}",t.innerHTML+=".wpp-list li a {color: "+a.color+"}",e.parentNode.removeChild(n);let l=e.attachShadow({mode:"open"});for(l.append(t);e.firstElementChild;)l.append(e.firstElementChild)}}});!function(){try{var e=document.querySelector("script#wpp-json"),t=!0;if((o=JSON.parse(e.textContent)).ID){if("1"==o.sampling_active)t=1===Math.floor(Math.random()*o.sampling_rate)+1;t&&a.post(o.ajax_url,"_wpnonce="+o.token+"&wpp_id="+o.ID+"&sampling="+o.sampling_active+"&sampling_rate="+o.sampling_rate,(function(e){o.debug&&window.console&&window.console.log&&window.console.log(JSON.parse(e))}))}}catch(e){console.error("WPP: Couldn't read JSON data")}}(),document.addEventListener("DOMContentLoaded",(function(){for(var e=document.querySelectorAll(".wpp-widget-placeholder, .wpp-widget-block-placeholder"),t=0;t<e.length;)i(e[t]),t++;var n=document.querySelectorAll(".popular-posts-sr");if(n.length)for(var l=0;l<n.length;l++)a.theme(n[l]);function i(e){let t=e.getAttribute("data-widget-id"),n="GET",l="",i={},r="";if(t)l=o.ajax_url+"/widget/"+t.split("-")[1],r="is_single="+o.ID+(o.lang?"&lang="+o.lang:""),i={"X-WP-Nonce":o.token};else{n="POST",l=o.api_url+"/v2/widget?is_single="+o.ID+(o.lang?"&lang="+o.lang:""),i={"Content-Type":"application/json","X-WP-Nonce":o.token};let t=e.parentNode.querySelector('script[type="application/json"]');if(t){let e=JSON.parse(t.textContent);r=JSON.stringify(e)}}a.ajax(n,l,r,(function(t){!function(e,t){t.insertAdjacentHTML("afterend",JSON.parse(e).widget);let n=t.parentNode,o=n.querySelector(".popular-posts-sr"),l=n.querySelector('script[type="application/json"]');l&&n.removeChild(l);n.removeChild(t),n.classList.add("wpp-ajax"),o&&a.theme(o);let i=new Event("wpp-onload",{bubbles:!0,cancelable:!1});n.dispatchEvent(i)}(t,e)}),i)}}));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.