• Hello everyone,

    I’m having an issue with Autoptimize. The whole website HTML code is minified, except for the Crelly Slider part. If you look on the image, you can see that the rest of the code is optimized, but that particular portion of the code isn’t. What can I do to fix this? Unfortunately, the Crelly Slider support is dead.

    https://ibb.co/z6DBLfb

    Thank you!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    hmm … hard to say why this happens, but if you insist (the performance benefit is pretty close to non-existent) you could hook into AO’s API (the autoptimize_html_after_minify filter) to try to remove those linebreaks I guess. do you have any experience with PHP code/ WordPress filters?

    Thread Starter rexviber

    (@rexviber)

    Thank you for your answer! My experience with PHP/WP filters is like search, copy and paste where it should be, so I’m not very experienced in writing/debugging codes.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    well, you could try this code snippet (no guarantees though, it *might* work but it *could* also break things);

    add_filter( 'autoptimize_html_after_minify', function( $html ) {
       return str_replace( array( '"\n', '"\r', ';\n', ';\r' ), '', $html );
    });
    Thread Starter rexviber

    (@rexviber)

    I appreciate your effort! Unfortunately, the code snippet isn’t doing anything. That Crelly Slider HTML is still the same.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    well, if it’s any comfort; the 10 or so newlines that leaves in the HTML has no measurable performance impact ??

    Thread Starter rexviber

    (@rexviber)

    Yea, if there were only 10 lines… ??</img>

    https://ibb.co/8KdF3d2

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    even if you have 50 linebreaks the impact will be negligible as the HTML output is (or should be) compressed (deflate/ gzip or brotli) in transit at webserver level, so the difference likely is below 0.01KB ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘AO can’t minify an HTML code’ is closed to new replies.