This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

Code displaying in the header

Resolved 8 replies premiumthemetheme-vantage
10 years ago · Last reply by Andrew Misplon 10 years ago

Hi, I’m not 100% sure if this is an issue with the vantage theme, but I switched to other themes and I don’t notice the problem.

It seems that there is a script that’s being inserted between the html tag for the logo in the header.

This is the script.

//<![CDATA[
(function(){var g=this,h=function(b,d){var a=b.split("."),c=g;a[0]in c||!c.execScript||c.execScript("var "+a[0]);for(var e;a.length&&(e=a.shift());)a.length||void 0===d?c[e]?c=c[e]:c=c[e]={}:c[e]=d};var l=function(b){var d=b.length;if(0<d){for(var a=Array(d),c=0;c=d.offsetWidth&&0>=d.offsetHeight)a=!1;else{c=d.getBoundingClientRect();var f=document.body;a=c.top+(“pageYOffset”in window?window.pageYOffset:(document.documentElement||f.parentNode||f).scrollTop);c=c.left+(“pageXOffset”in window?window.pageXOffset:(document.documentElement||f.parentNode||f).scrollLeft);f=a.toString()+”,”+c;b.b.hasOwnProperty(f)?a=!1:(b.b[f]=!0,a=a<=b.e.height&&c<=b.e.width)}a&&(b.a.push(e),b.d[e]=!0)};p.prototype.checkImageForCriticality=function(b){b.getBoundingClientRect&&q(this,b)};h("pagespeed.CriticalImages.checkImageForCriticality",function(b){n.checkImageForCriticality(b)});h("pagespeed.CriticalImages.checkCriticalImages",function(){r(n)});var r=function(b){b.b={};for(var d=["IMG","INPUT"],a=[],c=0;c<d.length;++c)a=a.concat(l(document.getElementsByTagName(d[c])));if(0!=a.length&&a[0].getBoundingClientRect){for(c=0;d=a[c];++c)q(b,d);a="oh="+b.i;b.c&&(a+="&n="+b.c);if(d=0!=b.a.length)for(a+="&ci="+encodeURIComponent(b.a[0]),c=1;c=a.length+e.length&&(a+=e)}b.g&&(e=”&rd=”+encodeURIComponent(JSON.stringify(s())),131072>=a.length+e.length&&(a+=e),d=!0);t=a;if(d){c=b.f;b=b.h;var f;if(window.XMLHttpRequest)f=new XMLHttpRequest;else if(window.ActiveXObject)try{f=new ActiveXObject(“Msxml2.XMLHTTP”)}catch(k){try{f=new ActiveXObject(“Microsoft.XMLHTTP”)}catch(u){}}f&&(f.open(“POST”,c+(-1==c.indexOf(“?”)?”?”:”&”)+”url=”+encodeURIComponent(b)),f.setRequestHeader(“Content-Type”,”application/x-www-form-urlencoded”),f.send(a))}}},s=function(){var b={},d=document.getElementsByTagName(“IMG”);if(0==d.length)return{};var a=d[0];if(!(“naturalWidth”in a&&”naturalHeight”in a))return{};for(var c=0;a=d[c];++c){var e=a.getAttribute(“pagespeed_url_hash”);e&&(!(e in b)&&0<a.width&&0<a.height&&0<a.naturalWidth&&0=b[e].k&&a.height>=b[e].j)&&(b[e]={rw:a.width,rh:a.height,ow:a.naturalWidth,oh:a.naturalHeight})}return b},t=””;h(“pagespeed.CriticalImages.getBeaconData”,function(){return t});h(“pagespeed.CriticalImages.Run”,function(b,d,a,c,e,f){var k=new p(b,d,a,e,f);n=k;c&&m(function(){window.setTimeout(function(){r(k)},0)})});})();pagespeed.CriticalImages.Run(‘/mod_pagespeed_beacon’,’http://www.jacobwilliamsondesign.com/blog/’,’l8PuqRhht8′,true,false,’FNn9dX2Uw_A’);
//]]>

URL: http://www.jacobwilliamsondesign.com/

This is our free support forum. Replies can take several days.

Need fast email support? Get SiteOrigin Premium

Replies

8
  1. Daniel Staff 10 years, 11 months ago

    Hi Jacob

    I have just looked at your site and the error you are highlighting is no longer visible. Did you have it solved?

    Kindly let me know.

  2. Jacob Williamson 10 years, 11 months ago

    hi, sometimes it goes away and comes back, check other pages. It’s showing up randomly. I think I need to move the script into the footer but I don’t know how to do this. The script is displaying between the image tag in the header where the logo is located.

  3. Daniel Staff 10 years, 11 months ago

    Hi Jacob

    I have finally managed to capture when this is appearing. Try this plugin

    Link : https://wordpress.org/plugins/header-and-footer-scripts/

    Let me know if that works out for you

    Cheers

  4. Jacob Williamson 10 years, 11 months ago

    Unfortunately, no. This didn’t seem to work.

  5. Daniel Staff 10 years, 10 months ago

    Hi Jacob,

    Can you try disabling all non-SiteOrigin plugins and see if this fixes the issue? If it does fix the issue, then try re-enabling your plugins one by one until the issue comes back. This procedure will help diagnose if a plugin is causing the issue.

    Let me know the outcome after this.

  6. Andrew Misplon Staff 10 years, 10 months ago

    Hi Jacob

    If you’re not inserting that script manually then you can de-activate and remove the Header and Footer Scripts plugin, no need for that.

    If you’re not doing this yourself it means a plugin is. So running through the steps Addo suggested above, would be the way forward.

  7. Jacob Williamson 10 years, 10 months ago

    Hi, the problem has been resolved, Sorry for not updating. I had someone else take a look and this is what they said.

    Looks like the Vantage theme you have was generating the header through a PHP script. Something in that script was triggering an error with PageSpeed that wouldn’t let it parse the data properly. I’ve made some tweaks and it seems to be working fine now.

  8. Andrew Misplon Staff 10 years, 10 months ago

    Super, glad you were able to resolve and find the problem. Thanks for updating us.

    All the best.

Replies on this thread are closed.

Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Have a different question or issue?

Start New Thread