Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Raul P.

    (@alignak)

    Done in 1.3.7, please test.

    Thread Starter cwfaraday

    (@cwfaraday)

    I only see version 1.3.6 available?

    Plugin Author Raul P.

    (@alignak)

    should be up now, thanks.

    Thread Starter cwfaraday

    (@cwfaraday)

    It seems to be working fine. But is it right that inline JS and CSS aren’t minified, even if they aren’t disabled?

    Plugin Author Raul P.

    (@alignak)

    Inline CSS and inline JS works differently, depends how it’s enqueued into the theme.

    If it’s enqueued as a child of some css or js file, it will be minified but if it’s printed directly on the header it won’t be (impossible to hook into those).

    If your inline css is a child of some other css file, it will be minified.

    Inline JS is never minified because “line breaks matters” in javascript and not all white space can be trimmed… for that reason inline js is always disabled, but it doesn’t matter because this doesn’t affect your score and the savings is probably a few bytes only.

    That’s also the reason why minifying twice the same js file usually breaks it, most notably the jquery.js file shipped with wordpress (it cannot be minified again or breaks).

    The option to disable minification also exists because of this… sometimes it works when merging but not after merging + minification. Some times authors don’t ship minified versions properly renamed to min.js and those end up minified again thus breaking things.

    It would be perfect if all authors follow the standard wordpress api usage, it would avoid a lot of workarounds I’ve been adding to cater to all of them (in your case, html comments should not be used on html for javascript things… but those are ok inside script tags)

    Thread Starter cwfaraday

    (@cwfaraday)

    Thanks for all your work Raul!

    hi Paul, thank you for your work.

    is the removal a non-checkboxed feature?
    I still can see comments in my code. static from the template files or dynamically written by other plugins.
    and it would be nice to be able to choose witch part of the site would be comment-cleaned. let’s say including <head> or not, or to choose to keep plugin’s html.

    kind regards,
    rolf

    Plugin Author Raul P.

    (@alignak)

    @irolfpro this topic is for the exact opposite.

    It seems that some plugins rely on comments to work properly so I stopped removing them on recent versions of the html minification. This however, is by default so compatibility is enforced.

    The main purpose of most changes is to improve compatibility while keeping performance. HTML comments is not going to affect your speed.

    As for comments inside javascript and css files, sometimes we cannot remove those due to license restrictions by those plugins. Also comments sometimes are needed like I explained.

    I wouldn’t mind adding extra options like the ones you specify, but then more people would not know how to use them, break things and come back here complaining that my plugin sucks. Compatibility is higher priority for me, so this doesn’t look feasible right now.

    okay, that sounds reasonable.
    thank you.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘HTML comments removal’ is closed to new replies.