Support » Plugin: Better WordPress Minify » Reference to non existing script appearing on site?

  • Resolved Strictly Software


    I have a hardcoded home page (for speed, plus I don’t want to load in all the WP files as they are not needed etc). Therefore your plugin doesn’t work on it >

    However on all other pages for some reason there is a SCRIPT reference to my homepage as a JS script (which doesn’t exist)

    <script type=’text/javascript’ src=’′></script>

    Which causes a JS error as its obviously NOT a JS script e.g

    Uncaught SyntaxError: Unexpected token <

    If I turn OFF your plugin the error goes away.

    However as I need your plugin and really don’t want to write my own as WP minify causes me problems on the Home Page but not everywhere else I need a fix.

    a) Where is it getting the list of JS SCRIPTS from?
    b) Why is it putting it on it’s own line anyway and not combining them with others?
    c) How can I stop this script from being outtputed?

    Any help would be appreciated



Viewing 11 replies - 1 through 11 (of 11 total)
  • Sadly I can confirm this. Freezes page in Opera for ~10sec.

    I have been just looking through the code.

    Do you know where the function/method is that outputs all the SCRIPTS then I can ignore any script that matches the homepage or / or whatever it checks for?


    Nope, but I found it on GitHub so maybe I’ll take a look later (10% chance that I have the time).

    It’s really anoying as WP Minify + WP Super Cache was performing faster than another WP site behind Cloudflare with W3 Total Cache. However both these minify plugins have issues.

    This one on all pages APART from the homepage.

    The WP Minify one on the homepage (most important page) but not on all the other pages due to me not being able to choose to “ignore minification” on the homepage.

    See this, you might be able to help >

    I shouldn’t have put that last comment as I was just looking at the homepage. The problem is on all other pages with a script going back to the homepage for some reason.

    Tried some debugging but it’s hit n miss at the mo as I don’t know the structure of the system.

    I can’t use W3 Total Cache as it caches too well (e.g I cannot ignore cached pages with a querystring ?r=1, which I need to do so members get the most up to date content)


    Any help would be much appreciated.

    I sorted it by downloading the latest version from the most recent thread. Why it wasn’t on WP plugin directory I don’t know! The Github verson seemed to work fine as one function was different e.g

    function print_dynamic_scripts($type = 'header')
    	global $wp_scripts;
    	$scripts = ('header' == $type) ? $this->header_dynamic : $this->footer_dynamic;
    	foreach ($scripts as $handle) {
    		if ( $wp_scripts->registered[$handle]->src !== false ) {

    Which seemed to sort the issue of a script refering to the homepage.

    However I still get another error related to the plugin and the main admin bar.

    Uncaught ReferenceError: _ is not defined admin-bar-v2.js?ver=2.5-201341:2
    (anonymous function) admin-bar-v2.js?ver=2.5-201341:2
    Resource interpreted as Script but transferred with MIME type text/plain: “…3D1&guid=yu4i6BB52skH&type=pidget&callback=PIN_1381684641265.f.callback[0]]”. [VM] pinit.js (16031):1

    This was NOT fixed with the new plugin. Not as important but still an error. Cheers!

    Haven’t tried the GitHub version yet. Just cloned it locally to inspect later.

    Regarding your error:

    Uncaught ReferenceError: _ is not defined admin-bar-v2.js?ver=2.5-201341:2
    (anonymous function) admin-bar-v2.js?ver=2.5-201341:2
    Resource interpreted as Script but transferred with MIME type text/plain: "…3D1&guid=yu4i6BB52skH&type=pidget&callback=PIN_1381684641265.f.callback[0]]". [VM] pinit.js (16031):1

    The problem is _, which is the underscore script – by default used for the media library only. And it shouldn’t be called in the admin bar. But it seems like your pinterest plugin(?) is doing so. Try turning it off.

    I am just using the standard Jetpack plugin with the sharing buttons dragged into “more” button.

    However the code still works. E.G when I click the Pintrest icon in that popup it opens up the right window.

    Check here >

    I was using “AddThis” but moved to JetPack recently.

    Hi, have the same problem :

    <script type='text/javascript' src=''></script>

    Is there an update to avoid this issue ?

    EDIT : Solved it via

    Plugin Author Khang Minh


    This is an incompatibility issue with WordPress 3.6.x and I have resolved it locally as well.

    Since WordPress 3.7 is going to be released soon I will have to test the plugin with 3.7 also before releasing an update.

    Thank you guys,

    Yes we have released a new version here :

    if you want to join us OddOneOut ?

    Plugin Author Khang Minh


    Fixed as of 1.2.3, which will be released tomorrow (WP 3.7 compatible).

    I will take a look at the deferred JS implementation you have done. Thanks a lot 🙂

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Reference to non existing script appearing on site?’ is closed to new replies.