Support » Plugin: Minify HTML » Skip the code

  • Resolved alexman87

    (@alexman87)


    Thx, is great work !!!
    It would be great if you could skip the minify code in html, css, js, framed by certain comments. For example:
    <!–minifi-hml–>
    <!– not minify js –>
    <script>

    </script>
    <!–/minifi-html–>
    This would be very useful for rel cannonical, when it is allowed to delete the relative domain from internal URLs, as well as for some of js codes, for which change is prohibited.

Viewing 10 replies - 1 through 10 (of 10 total)
  • for example as here: https://lyncd.com/wpscmin/#install
    see section MARK SECTIONS OF HTML SO THAT THEY WILL NOT BE MINIFIED

    Plugin Author Tim Eckel

    (@teckel)

    There’s a switch in the plugin to not minify inline JavaScript. Just turn this off and all JavaScript code won’t be minified.

    Hi, Tim
    Yes, there is such a switch, but it does not allow to turn off just what is needed.
    For example, to have a minimization for all js codes, except js ads.

    • This reply was modified 2 years, 9 months ago by alexman87.
    • This reply was modified 2 years, 9 months ago by alexman87.
    Plugin Author Tim Eckel

    (@teckel)

    What’s the problem with minifying JS ads?

    Prohibition on code changes, including prohibition on deleting comments in the code.

    By this link https://wordpress.org/support/topic/your-code-breaks-the-canonical-link/ there is a request to skip minify for rel canonical link
    (and this request is correct for seo optimization)
    and you write that: The plugin can not solve every unique situation.
    Which, in principle, is also quite true. Since tomorrow someone will ask you to skip the minify for another of your problems. In this case, the option of skipping arbitrary code through comments, just allows you to make a universal opportunity in your plugin. And everyone can skip what he needs if he can change the template code.

    Plugin Author Tim Eckel

    (@teckel)

    There’s already options in Minify HTML that address both this issue and the issue you linked to. Further, just because Minify HTML is changing your advertisement JS doesn’t mean it’s not working. Sounds like “black hat” advertising if they’re worried about you removing comments/whitespace.

    In any case, use the switch to disable inline JS minification if this is something you can’t allow to happen.

    Hi Tim,

    This problem is for example for google adsense js code.
    Switches do not solve the complete problem, since they do not allow you to disable only certain parts. And this applies not only to js, ​​but as previously written and other options.

    Your plugin perfectly solves the minimization problem, doing everything without errors and forming the minimum html, js, css code (I made comparisons with almost all other minifi plugins for wp), but the ability to skip a certain html, js, css code would be an excellent addition to working opportunities.

    Plugin Author Tim Eckel

    (@teckel)

    The switch solves the problem, it may not compress inline JS as a result, but it does fix the problem. Keep in mind that this isn’t a bug, it’s doing exactly what it should be doing. You’re suggesting a feature enhancement, which I don’t have the ability to do at this time. Your suggestion is a good one, and if I had the time to spend on doing it I probably would. But, that’s out of the question at this time. But thanks again for your very good suggestion!

    Hi Tim,
    In any case, this is a great plug in!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Skip the code’ is closed to new replies.