• Ramanan

    (@superpoincare)


    I am facing a strange issue with minification.

    When I activate this plugin with w3tc css minification turned on, the plugin loads the w3tc minified css on top and the theme css in the bottom.

    But if I disable css minification, the plugin seems fine with theme css at the bottom.

    Another issue is that if I use query strings feature for w3tc, it stops working with the plugin turned on.

    https://ww.wp.xz.cn/plugins/above-the-fold-optimization/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Ramanan

    (@superpoincare)

    I think the ideal solution is for the plugin to do the minification itself.

    Thread Starter Ramanan

    (@superpoincare)

    I think you have an issue.

    Your current version runs before W3TC. So what happens is that your plugin inserts inline CSS and enqueues unminified theme CSS files. After your plugin runs, W3TC with CSS minification on puts the minified CSS on top.

    But if you run your plugin after W3TC, it is unable to do create static HTML files. I believe your first version had this problem.

    Do you have a demo site, where I can see CSS minification created by W3TC plus inlining done via your plugin running successfully?

    Plugin Author optimalisatie

    (@optimalisatie)

    Hi Superoincare,

    The plugin inserts the ob_callback from the WordPress init-hook with priority 99999.

    W3 Total Cache starts the ob_callback instantly when it is included.

    I will further test the issue.

    Best Regards,
    Jan Jaap

    Thread Starter Ramanan

    (@superpoincare)

    Thanks for your reply Jan.

    I can get all minify plugins to work with your plugin. All of their CSS outputs are loaded by your code as you designed. But not W3TC minify.

    Thread Starter Ramanan

    (@superpoincare)

    The issue with W3TC is this:

    Let’s say the unminified CSS files are css1 and css2.

    Without your plugin

    W3TC – either in the automatic mode or manual mode – takes the two css files and produces a minified file, let’s call it mincss.

    With your plugin

    Your plugin runs. It inserts code such as

    var CRITICALCSS=[[[“all”],”css1″], [[“all”],”css2″]].

    In the automatic mode, W3TC finds no CSS file and doesn’t do anything.
    The result is that css1 and css2 are loaded by the final user.

    In the manual mode, W3TC minifies css1 and css2 and produces mincss.
    The result is that three files mincss, css1 and css2 are loaded.

    With other minifier with W3TC minification turned off

    Other minifier runs and produces mincss. Your plugin will output something like

    var CRITICALCSS=[[[“all”],”mincss”].

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

The topic ‘Minify Issues’ is closed to new replies.