WordPress.org

Ready to get started?Download WordPress

Forums

Better WordPress Minify
Asynchro loading for script (12 posts)

  1. JibsouX
    Member
    Posted 1 year ago #

    Hello nice plugin !!!
    i wondering do you can make THE improvement : add a box like the options but this time one for : make script asynchrone : like : <script async>

    Thanks a lot it will be the best : Minification + contatenage + asynchro loading

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

  2. Khang Minh
    Member
    Plugin Author

    Posted 1 year ago #

    That's an advanced feature and can cause a lot of things to break, but sure I will take a look at it when there's spare time :).

  3. JibsouX
    Member
    Posted 1 year ago #

    yep it will be like an advance option ;)

    by the way many peoples want to easily change the expiration date of the cache so it will be simple to make a box like for indicate how many minutes the cache will expire (manual setting)

    me i change it dirrectly in the config.php

    and in the same file you can improve the compression level like :

    // try to disable output_compression (may not have an effect)
    ini_set('zlib.output_compression', '8');

    ;)

  4. JibsouX
    Member
    Posted 1 year ago #

    and an other thing, it is normal that some script put in the box (put script in footer) still are in the header.. ? do you have an idea to force them ? or what is blocking them ?

    thanks a lot !

  5. Khang Minh
    Member
    Plugin Author

    Posted 1 year ago #

    Currently you have to use script handles, not script filename. So instead of jquery.js you will probably have to put in something like 'jquery'. To look for script handles you can check a plugin's codes.

  6. JibsouX
    Member
    Posted 1 year ago #

    ^^thanks i know that the thing is it work for :

    superfish
    useronline
    jqueryc00kie
    quickchatload
    jqueryprettyPhoto
    topbutton
    custom
    jqueryjplayermin
    jqueryuicoremin
    jqueryuiwidgetmin
    jqueryuitabsmin
    comment-reply

    But not for :
    js (js.js of the plugin kk star rating)
    jqueryeasingmin (jquery.easing.min.js)
    nivosliderpack (nivo.slider.pack.js)
    mousewheel (mousewheel.js)
    jquerygridnav (jquery.gridnav.js)

    Do you have an idea of why ?

  7. JibsouX
    Member
    Posted 1 year ago #

    mmm.. if the script are in base 64 ?

    i will reconvert in normal js the script and test it

  8. JibsouX
    Member
    Posted 1 year ago #

    Nop it change nothing.. damn i dont understand why some scrip dont want to move in the footer.. :p

  9. JibsouX
    Member
    Posted 1 year ago #

    it's because some script have a part print dirrectly in the head with

    add_action('wp_head',
    or
    add_action('wp_enqueue_scripts',

    so i change to : add_action('wp_footer'

    i look if there is no break

    then i put the handles in the option box and MAGIC it work !

  10. JibsouX
    Member
    Posted 1 year ago #

    One more thing how can y make a combo like isolated minification + put in footer..

    because it does not work when i put the same handles in the 2 box option.

  11. Jaime
    Member
    Posted 7 months ago #

    I made a hack to add async to all of the HTML script insertions. Note that this will add async to ALL of them, which may break your page.

    • Deactivate Better WP Minify Plugin. Otherwise the file may be flagged as "inactive" and the update will not take effect.
    • Find file class-bwp-minify.php in the editor
    • Find function function get_minify_tag($string, $type, $media = '')
    • Find line $return = "<script type='text/javascript' src='" . $this->get_minify_src($string) . "'></script>\n";
    • Add "async" to that line: $return = "<script async type='text/javascript' src='" . $this->get_minify_src($string) . "'></script>\n";
    • Reactivate the plugin.
    • Make sure your site didn't break.
  12. JibsouX
    Member
    Posted 7 months ago #

    thanks a lot ;) but a have made a custom version of the plugin that include the deferring of the minify script ;)

    and y have add a setting to exclude a script of the deferring function ;)

    and updated the library to by the way the plugin creator is working on a new version that include the deferring capabilitie

    http://wordpress.org/support/topic/working-version-for-wp36x-update-minify-library-to-217-and-deferred-beta

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.