Upfront uncaught error popup.html 404

Upfront will not load due to the following error:
Uncaught Error: https://swds.biz/sassnetec/wp-content/themes/upfront/scripts/upfront/templates/popup.html?ufver=1.0.5 HTTP status: 404

I have tried in chrome, firefox and MS Edge. The file does exist at the appropriate location. Support access is enabled. I appreciate any help.

  • Sajid

    Hi @james216,
    Hope you are doing good today :slight_smile:

    It appears to be issue with mod security that is blocking the request to load popup.html file that is required to launch editor.

    Please add following code in .htaccess file of your website and then check again.

    <IfModule mod_security.c>
    SecFilterRemove 00318
    </IfModule>

    Hope that helps! Feel free to post a reply if you need further assistance :slight_smile:
    Cheers, Sajid

  • James Reader

    As the users in this thread: https://premium.wpmudev.org/forums/topic/cant-edit-upfront-please-hold-on-for-just-a-little-bit-more have experienced this issue on siteground. My site is on siteground. The SecFilterRemove did fix the issue with the editor not trying to load. It now at least reaches the loading page again. However it never loads, and there are several other errors in the console now. Here is a copy of the console log as it is now:

    unreachable code after return statement upfront-application.js:27:1604
    unreachable code after return statement upfront-views-editor.js:71:117
    unreachable code after return statement upfront-media.js:9:98
    unreachable code after return statement uimage.js:36:389
    unreachable code after return statement plugins.js:6:145
    SyntaxError: expected expression, got '?'
     underscore.min.js:72:16
    "Google Maps API warning: SensorNotRequired https://developers.google.com/maps/documentation/javascript/error-messages#sensor-not-required&quot; util.js:23:322
  • Nastia

    Hello @james216

    My apologies for the delay here.

    I've logged in to your site and indeed the Upfront is not loading.

    There us a JS error in the developer console:
    Uncaught SyntaxError: Unexpected token ? in ../wp-includes/js/underscore.min.js?ufver=1.0.5:1

    It looks like you have pagespeed module enabled that prevent some javascript files from loading. These core WordPress files are really necessary to load the Upfront editor.

    Please paste the following code to the .htaccess file too:

    <IfModule pagespeed_module>
        ModPagespeed off
    </IfModule>

    Please keep an original copy of the .htaccess file. In case something goes wrong, you can always restore it.

    I hope this helps! Let us know if you continue having this issue!

    Cheers,
    Nastia

  • Nastia

    Hello @james216

    Personally, I use Upfront on Siteground too. The only Upfront requirement on Sitground hosting is to disable the security_mod.

    Would you please deactivate the theme on your installation and try to reinstall it.

    - Access the wp-contect/themes directory via FTP or using cPanel's File Manager
    - Delete the upfront and uf-spirit folders from the directory
    - Reinstall the theme using WPMU DEV Dashboard

    Let us know how it went!

    Cheers,
    Nastia

  • Nastia

    Hello @james216

    Would you please send to us your credentials so we can have a look up close?

    You can send credentials by using our secure contact form https://premium.wpmudev.org/contact/

    Please include the following information

    - Mark to my attention, the subject line should contain only: ATTN: Nastia
    - WordPress admin username
    - WordPress admin password
    - Login url
    - FTP credentials (host/username/password)
    - Link back to this thread for reference
    - Any other relevant urls

    Select “I have a different question” for your topic

    We are waiting for your email.

    Kind Regards,
    Nastia

  • Nastia

    Hello @james216

    The developer checked the Upfront files and found out that the pagespeed is running on the Upfront template files. The pagespeed references injected inside the element's templates.

    In this case, the rule to disable the pagespeed that is added to .htaccess file is not working. Would you please contact your hosting provider and ask to disable the pagespeed that is running on the Upfront's files.

    Let us know how it went!

    Kind Regards,
    Nastia

  • Ivan

    Hello @james216,

    Some technical details. This line from upfront image template:
    <img src="<?php echo $src ?>" alt="<?php echo $alternative_text ?>" title="<?php echo $image_title ?>" <?php if($imgWidth) { ?>style="width:<?php echo $imgWidth ?>;"<?php } ?>/>

    becomes:
    <script pagespeed_no_defer="" type="text/javascript">(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;c++)a[c]=b[c];return a}return[]};var m=function(b){var d=window;if(d.addEventListener)d.addEventListener("load",b,!1);else if(d.attachEvent)d.attachEvent("onload",b);else{var a=d.onload;d.onload=function(){b.call(this);a&&a.call(this)}}};var n,p=function(b,d,a,c,e){this.f=b;this.h=d;this.i=a;this.c=e;this.e={height:window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,width:window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth};this.g=c;this.b={};this.a=[];this.d={}},q=function(b,d){var a,c,e=d.getAttribute("pagespeed_url_hash");if(a=e&&!(e in b.d))if(0>=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<b.a.length;++c){var e=","+encodeURIComponent(b.a[c]);131072>=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<a.naturalHeight||e in b&&a.width>=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('/ngx_pagespeed_beacon','https://swds.biz/sassnetec/wp-content/themes/upfront/elements/upfront-image/tpl/image.html?ufver=1.0.5','bo2-KzT6SQ',true,false,'Po-d2fYIyIs');</script><img src="<?php echo $src ?>" alt="<?php echo $alternative_text ?>" title="<?php echo $image_title ?>" <?php if($imgWidth) { ? pagespeed_url_hash="500015258" onload="pagespeed.CriticalImages.checkImageForCriticality(this);">style="width:<?php echo $imgWidth ?>;"<?php } ?>/>

    so JavaScript template parser breaks when it runs into such instances. You can reference this info to hosting support it might help them to get to the solution easier.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.