Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Frank Goossens

    (@futtta)

    I would use autoptimize_html_after_minify for that (which has the full optimized HTML) and do a str_replace on those?

    Plugin Author Frank Goossens

    (@futtta)

    oh, Gulshan, quick question/ favor; have you already marked AO 2.0.2 as working with WP 4.6? ??

    Thread Starter Gulshan Kumar

    (@thegulshankumar)

    add_filter(‘autoptimize_html_after_minify’,’remove_tags’,10,1);
    function remove_tags($htmlIn) {
    $htmlOut=preg_replace(‘type=”text/javascript”/’, ‘ type=”text/css”‘, $htmlIn);
    return $htmlOut;
    }

    I tried this code by looking this example, don’t know why my HTML code went BLANK ??
    So, I deactivated the code from snippet plugin…

    Thread Starter Gulshan Kumar

    (@thegulshankumar)

    Since, I were using AO beta version. I just tested Version 2.0.2 for first time. Working fine for me. So, I have marked as ‘Working’.

    Anyway, I’m addicted to beta version. So, I’ll be continue with it.
    Any update? how much time it will take to be live directly?

    Plugin Author Frank Goossens

    (@futtta)

    your preg_replace is wrong; first argument should be a regular expression, 2nd the replacement, third the source.

    this one seems to work;

    add_filter('autoptimize_html_after_minify','remove_tags',10,1);
    function remove_tags($htmlIn) {
        $htmlOut=preg_replace('/\stype=["\']?text\/(?:javascript|css)["\']?/i', '', $htmlIn);
        return $htmlOut;
    }

    2.1 will be released … later this month. I’m considering changing the default JS settings; someone proposed to change the default to NOT to force JS in head and to automatically exclude jquery.js. I wasn’t enthusiastic at first, but it might not be a bad idea after all …

    Thread Starter Gulshan Kumar

    (@thegulshankumar)

    Thanks for providing me this snippet. [PROBLEM RESOLVED]

    It did magic, perhaps more than my expectation. ?? Not bad! It did better than what other plugin was doing for me..

    I have some suggestion regarding 2.1, if you don’t mind can I share with you on email?

    Plugin Author Frank Goossens

    (@futtta)

    if you don’t mind can I share with you on email?

    off course I don’t mind, you know the address ??

    Thread Starter Gulshan Kumar

    (@thegulshankumar)

    Thank you so much for your valuable time ??
    Much appreciated.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Cleaning Up tags of Script & Style’ is closed to new replies.