WordPress.org

Ready to get started?Download WordPress

Forums

Better WordPress Minify
[resolved] wp 3.6 jquery enqueued but wrong script written after. (12 posts)

  1. veke
    Member
    Posted 11 months ago #

    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/

  2. veke
    Member
    Posted 11 months ago #

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

  3. veke
    Member
    Posted 11 months ago #

    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);
                            }
                    }
            }
  4. Prasanna SP
    Member
    Posted 11 months ago #

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

  5. veke
    Member
    Posted 11 months ago #

    Hello Presanna, i'm glad it helped. :)

  6. Khang Minh
    Member
    Plugin Author

    Posted 10 months ago #

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

  7. JibsouX
    Member
    Posted 10 months ago #

    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 !!

  8. sireneweb
    Member
    Posted 10 months ago #

    yes, we're waiting new version for minification.

    Thanks for this good news and for your work OddOneOut.

  9. Halex Productions
    Member
    Posted 9 months ago #

    Yes, new version please compatible with WP3.6+

  10. theenvoygroup
    Member
    Posted 9 months ago #

    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

  11. JibsouX
    Member
    Posted 9 months ago #

  12. Khang Minh
    Member
    Plugin Author

    Posted 8 months ago #

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

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.