• It’s very long time that autoptimize haven’t bring very important and new feature which will help any wordpress sites a lot. I love how this plugin works, very neat and clean plugin.

    Try to add this time “Remove Unused CSS” feature by including this library https://github.com/sabberworm/PHP-CSS-Parser, i saw some plugin doing this, so i hope you will able to implement here instead of “Inline all CSS” feature

    I hope you will consider.
    Thanks
    Nabil

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

    (@optimizingmatters)

    never say never, but ..

    Sabberworm indeed allows one to handle CSS in PHP (I had seen it already), but it has no logic to determine if CSS is needed on a given page so that would have to be written too. When done in PHP one could probably do something by extracting all node id’s and classes from the HTML and only extract CSS from Sabberworm of those id’s/ classes, but this would *certainly* result in CSS being removed that is actually needed (simple example; classes/ id’s added/ removed by JavaScript would be invisible to the PHP).

    reliable implementations of “unused CSS” (such as the premium Rapidload, see “optimize more”-tab in AO) are SAAS solutions that use a headless browser to more accurately know what is used and what is not.

    inlining all CSS is generally discouraged and does not *really* impact “unused CSS” (even if Pagespeed Insights might not mention it, the CSS is still there and identical to the CSS when not inlined).

    hope this clarifies,
    frank

    Thread Starter Nabil Sikder

    (@mdnabilsikder)

    I understand what you wroted.

    – the missing thing can covered by safelist, this is what done by all premium plugins. without safelist no unused css plugin is accurate.

    I know Autoptimize promotes rapidload, but in case if you ever think to change this and adapt onfly used css.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    I’ll keep it in mind, thanks for the tips! 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Feature Request: Remove Unused CSS’ is closed to new replies.