This repository has been archived by the owner on Oct 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
/
tribe-sniffer.min.js
1 lines (1 loc) · 2.75 KB
/
tribe-sniffer.min.js
1
javascript:(function(){var e,t,n="",s=document.getElementsByClassName("tribe-common--breakpoint-xsmall"),l=document.getElementsByClassName("tribe-events-view--shortcode"),a=document.getElementsByClassName("tribe-blocks-editor"),r=document.getElementsByClassName("tribe-events-single"),o=document.getElementsByTagName("body")[0].className.split(" "),c=(document.getElementsByTagName("script"),document.getElementsByTagName("link")),i=["WordPress","TEC V1","TEC V2","ECP","Filter Bar","ET","ET+","WooCommerce"],m=["wp-block-library-css","tribe-events-calendar-style-css","tribe-events-views-v2-skeleton-css","tribe-events-calendar-pro-style-css","tribe-filterbar-styles-css","event-tickets-tickets-css-css","event-tickets-plus-tickets-css-css","woocommerce-general-css"],d=["WP-Super-Cache","WP Fastest Cache","W3 Total Cache","Hummingbird","WP Rocket","Endurance Page Cache","LiteSpeed Cache","WP Super Minify"],u=["wpacu-combined-css-body-1","wpacu-combined-js-body-group-1"],g=document.lastChild.previousSibling.nodeValue,h=document.lastChild.nodeValue,b="not found",f="",y=document.getElementsByClassName("ecs-events"),E=document.getElementById("ect-events-list-content"),p=document.getElementsByTagName("meta");for(n="Single event view: ",r.length>0?(n+="YES\nEditor: ",a.length>0?n+="Block":n+="Classic"):(n+="NO\nDesign: ",s.length>0?n+="V2":n+="V1"),n+="\nShortcode: ",l.length>0?n+="YES":y.length>0?n+="Yes, by 3rd party plugin:\n - The Events Calendar Shortcode & Block":null!=E&&E.innerHTML.length>0?n+="Yes, by 3rd party plugin:\n - The Events Calendar Shortcode and Templates Addon":n+="NO",e=0;e<c.length;e++)if(null!=(t=c[e].getAttribute("href"))&&t.search("autoptimize")>0){console.log(t.substr(t.indexOf("=")+1)),n+="AUTOPTIMIZE FOUND!",n+="\n------------------\n";break}for(n+="\nTheme: ",e=0;e<o.length;e++){if(o[e].startsWith("avada-")){f="Avada";break}if(o[e].startsWith("tribe-theme-")){f=o[e].substr(12);break}if(o[e].startsWith("theme-")){f=o[e].substr(6);break}}if(""==f)for(e=0;e<c.length;e++){var v=c[e].href.match(/(themes\/).{2,}?(\/)/);if(null!=c[e].href&&null!=v){f=v[0].slice(7,-1);break}}for(""==f&&(f="couldn't identify"),n+=f,n+="\n------\nVERSIONS:",e=0;e<m.length;e++){var C=document.getElementById(m[e]);null!=C&&(C=C.getAttribute("href")),n+="\n"+i[e]+": ",null!=C&&C.search("=")>=0?n+=C.substr(C.indexOf("=")+1):n+="not found"}for(e=0;e<p.length;e++)"generator"==p[e].name&&(p[e].content.search("WooCommerce")>=0&&(n+="\n"+p[e].content),p[e].content.search("WPML")>=0&&(n+="\n"+p[e].content));if(n+="\n------\nCaching / Minification:\n",null!=g)for(e=0;e<d.length;e++)g.search(d[e])>0&&(b=d[e]);if(null!=h)for(e=0;e<d.length;e++)h.search(d[e])>0&&(b=d[e]);for(e=0;e<u.length;e++)if(null!=document.getElementById(u[e])){b="Asset CleanUp: Page Speed Booster";break}n+=b,alert(n)})();