WordPress.org

Ready to get started?Download WordPress

Forums

Better WordPress Minify
[resolved] Reference to non existing script appearing on site? (12 posts)

  1. Strictly Software
    Member
    Posted 10 months ago #

    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 > http://www.ukhorseracingtipster.com

    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='http://www.ukhorseracingtipster.com?ver=1.10.2'></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

    Thanks

    Rob

    http://wordpress.org/plugins/bwp-minify/

  2. Franz Josef Kaiser
    Member
    Posted 10 months ago #

    Sadly I can confirm this. Freezes page in Opera for ~10sec.

  3. Strictly Software
    Member
    Posted 10 months ago #

    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?

    Thanks

  4. Franz Josef Kaiser
    Member
    Posted 10 months ago #

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

  5. Strictly Software
    Member
    Posted 10 months ago #

    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 > http://wordpress.org/support/topic/doesnt-seem-to-work-13?replies=4

    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)

    Pain!

    Any help would be much appreciated.

  6. Strictly Software
    Member
    Posted 10 months ago #

    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 ) {
    				$wp_scripts->do_item($handle);
    		}
    	}
    }

    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: "http://log.pinterest.com/?via=http%3A%2F%2Fwww.ukhorseracingtipster.com%2Ft…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!

  7. Franz Josef Kaiser
    Member
    Posted 10 months ago #

    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: "http://log.pinterest.com/?via=http%3A%2F%2Fwww.ukhorseracingtipster.com%2Ft…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.

  8. Strictly Software
    Member
    Posted 10 months ago #

    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 > http://www.ukhorseracingtipster.com/2013/10/sevens-the-magic-number/

    I was using "AddThis" but moved to JetPack recently.

  9. Sybio
    Member
    Posted 10 months ago #

    Hi, have the same problem :

    <script type='text/javascript' src='http://mydomain.net?ver=1.10.2'></script>

    Is there an update to avoid this issue ?

    EDIT : Solved it via http://wordpress.org/support/topic/wp-36-jquery-enqueued-but-wrong-script-written-after?replies=7#post-4510692

  10. Khang Minh
    Member
    Plugin Author

    Posted 10 months ago #

    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,

  11. JibsouX
    Member
    Posted 10 months ago #

    Yes we have released a new version here :
    https://github.com/sireneweb/bwp-minify

    https://github.com/sireneweb/bwp-minify#136

    if you want to join us OddOneOut ?

  12. Khang Minh
    Member
    Plugin Author

    Posted 10 months ago #

    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 :)

Reply

You must log in to post.

About this Plugin

About this Topic