Support » Plugin: Better WordPress Minify » wp 3.6 jquery enqueued but wrong script written after.

  • Resolved veke

    (@veke)


    Hello ,

    We’ve an issue. Bwp minify just worked fine but in the source code we also get a wrong script:

    <script type='text/javascript' src='http://www.example.com/wp-content/plugins/bwp-minify/min/?f=wp-includes/js/jquery/jquery.js,wp-includes/js/jquery/jquery-migrate.min.js,wp-content/themes/examplev2/js/inc/socialite.min.js,wp-content/plugins/smart-youtube/javascripts/jquery.colorbox-min.js,wp-content/plugins/lightbox-gallery/js/jquery.tooltip.js,wp-content/plugins/lightbox-gallery/lightbox-gallery.js&ver=1'></script>
    <script type='text/javascript' src='http://www.example.com?ver=1.10.2'></script>

    As you can see the last script is wrong cause it’s doing some quirks with jquery ( figured out cause jquery version on last wordpress is 1.10.2 ).

    This is causing, users with IE8 to not show our website.

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

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter veke

    (@veke)

    I just found out that the last line is being printed cause
    print_dynamic_header_scripts gets called and $this->header_dynamic contains jquery`

    Thread Starter veke

    (@veke)

    The issue is caused because in wordpress 3.6 jquery is a virtual script with src set to false and 2 dependencies:

    1. jquery-core
    2. jquery-migrate

    The print_dynamic_scripts (and probably print_dynamic_style) should be aware of this kind of scripts/styles.

    I fixed our issue by changing the print_dynamic_scripts with the following:

    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);
                            }
                    }
            }

    I had the same issue. Changing print_dynamic_scripts function resolved it. Thanks for the fix!

    Thread Starter veke

    (@veke)

    Hello Presanna, i’m glad it helped. 🙂

    Plugin Author Khang Minh

    (@oddoneout)

    Thank you for the fix, I will release a new version that is compatible with WordPress 3.6 soon. Actually I’m waiting for more bugs like this 🙂

    Hello OddOneOut !

    have some issue since the new jquery :

    min css is good 😉
    min js bug :
    TypeError: $(…).prettyPhoto is not a function
    TypeError: f.easing[i.animatedProperties[this.prop]] is not a function

    when it’s no js minification it’s ok.

    ps : the bug does not apear with older browser (just before the las version of ff & chrome.

    ps 2 : you can make a other implementation in the plugin with the plugin db cache reloaded fix (to cache the query)
    http://wordpress.org/plugins/db-cache-reloaded-fix/

    and add in the ‘how install’ :
    # BEGIN Expire headers
    <IfModule mod_expires.c>
    ExpiresActive On
    <FilesMatch “\.(ico|jpe?g|png|gif|swf|css|js|gz|html|htm|xml)$”>
    ExpiresDefault “access plus 1 month”
    </FilesMatch>
    # Force no caching for dynamic files
    <FilesMatch “\.(pl|php|cgi|spl|scgi|fcgi)$”>
    ExpiresActive Off
    </FilesMatch>
    </IfModule>

    to put the gz in cache and leave it for 1 month

    I’M SOOOOO WAITING FOT THE NEW RELEASE DUDE THIS PLUGIN IS THE BEST FOR MINIFICATION !!!!!!
    THANNNKS !!

    yes, we’re waiting new version for minification.

    Thanks for this good news and for your work OddOneOut.

    Yes, new version please compatible with WP3.6+

    Yes please, we use BWP minify on most of our client sites and we’d like to get this updated for 3.6 before we migrate all of them from 3.5

    Plugin Author Khang Minh

    (@oddoneout)

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

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘wp 3.6 jquery enqueued but wrong script written after.’ is closed to new replies.