• Resolved magestyx

    (@magestyx)


    We’ve done extensive testing today on an issue that has been driving us just about insane. Apparently W3 simply skips, ignores, or unintentionally removes entire CSS files during the minify/combine process.
    We’re using WP6.2 and W3 2.3.1 free – the latest as of this posting.

    Minify works fine, but there’s like 30+ CSS files. Combine doesn’t work as not all the CSS is included, and same with Combine & Minify. The CSS just isn’t there in the final output. We’ve tried everything we can think of, but full searches of all downloaded files if Combine is on in any way has files-worth of CSS missing and so far there’s no pattern why. Plugins like GiveWP will have their CSS files’s code included, along with the template CSS files and custom CSS. However plugins like AIOSEO and Strong Testimonials (a file called grid.css, for instance, with only about 30 lines of code) won’t have any. It’s the same files skipped each time, too – that’s the only discernable pattern at all so far. There’s no htaccess or other directives we can find anywhere that’d affect any of this. We’ve cleared the cache and adjusted settings probably 75 times or more today alone trying to get it to work.

    We thought maybe there a possibility that a regex in W3 is grabbing too much and deleting it, but that wouldn’t explain the issue with only Combine turned on and no Minify. Since even the Combine process is missing files’-worth of CSS data it seems to be more of an issue with the Combine process itself – it’s leaving out entire files.

    Someone in this forum had a similar-ish issue 2 years ago, but there wasn’t really a viable solution. Manually adding every CSS file to the combine/minify process and adding more every time a plugin is added isn’t practical on this site much less any larger ones.

    Any ideas?

    Thanks,
    Magestyx

    • This topic was modified 1 year, 7 months ago by magestyx.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @magestyx

    Thank you for reaching out.

    I am not quite sure I understand the problem because W3TC does not remove any files. This being said, I’ve tried to replicate this behavior and everything worked just fine.

    Can you please share the website URL with CSS minify enabled, and also let me know which CSS?minifier you are using and what is the Minify caching method?

    Thanks!

    Thread Starter magestyx

    (@magestyx)

    Hi, Marko. Thanks for responding quickly.

    I understand W3TC doesn’t remove actual files, I’m just saying that during the Combining process maybe some are being removed from the ‘gathering up’ process or something to that effect. We updated additional sites today that seem to have this same issue – removing any combining solved the problems right away.

    One of the main pages we’ve been troubleshooting is: https://www.blackcommunitydevelopersgroup.org/testimonials/

    Currently combining is off so it looks correct – also see here for reference: https://imgur.com/MsVmm0e

    As soon as we turn on Combine in any way for CSS, we get this: https://imgur.com/a3iUeCs
    The plugin displaying the testimonials is called Strong Testimonials. There doesn’t seem to be anything unusual about the plugin, but W3 is leaving out its files like /wp-content/plugins/strong-testimonials/public/css/grid.css if we have Combine on. With only Minify on, it works and gives a file like: https://www.blackcommunitydevelopersgroup.org/wp-content/cache/minify/f0e9f.css

    With Combine on, it leaves out 100% of that grid.css file’s content. As mentioned, this is just one specific example. We also found where it leaves out CSS files from AIO SEO. But many other plugins like GiveWP it includes the CSS files in the combine process just fine.

    We’re stumped, but we’re getting the feeling why Combine has been a volatile setting on many sites we manage. This whole time we thought maybe files were combined in different orderings or something like that which broke the pages or functions, but perhaps really the issue is that Combine is leaving out entire files.

    Magestyx


    Thread Starter magestyx

    (@magestyx)

    Oh – I forgot to answer two of your questions:

    Minify Cache Method: Disk
    CSS minifier: Minify (default)

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @magestyx

    Thank you for your feedback. So as I can see, currently CSS minify is enabled, and can you please confirm that you are using the Minify-only method for CSS minify?

    Thread Starter magestyx

    (@magestyx)

    Correct – on the live/current site with the page you displayed, only minify is on for CSS. The testimonials display correctly on the page as 40% wide flexbox elements because grid.css code from Strong Testimonials is included. As soon as we change the minify method to Combine, or to Combine & Minify, certain files like grid.css have all their content inexplicably missing from the final output CSS, so the testimonials display as default 100%-width columns like https://imgur.com/a3iUeCs

    Again, that’s just a single specific example. There’s others like with AIOSEO – other plugins like that also suddenly have their CSS left out using any form of W3 CSS Combine.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @magestyx

    Thank you for your feedback.

    This means that the file you are mentioning is not agreeing with being combined/minified. This can mean that either that file is dependent, or was not written properly.

    What you can do is to try the CSS Tidy minifier for CSS Minify, or to exclude a specific css file form being minified in Performance>Minify>Advanced>”Never Minify following CSS files”

    I hope this helps!

    Thread Starter magestyx

    (@magestyx)

    Hi, Marko.

    We tried the other minifiers and the situation remains (only if Combine is set in the CSS minify settings).

    After more testing we’ve found one other peculiarity.
    Apparently it’s making a big difference exactly WHERE the Combine is adding back the new css files in the page code. If we use the Chrome inspector, it looks like the combined css files from Strong Testimonials (for instance) are missing. However, we can find the combined Strong Testimonials css file (2 small css files – content.css and grid.css) added somehow inside the html code for the search popup. So if we look in the raw page output code (Ctrl+U) we can find that css file. (All other css files on the site are combined into 3 other combo files) But in the inspector, it only shows if we click on the search icon in the displayed page, which display the search popup. Seriously this is one of the strangest issues we’ve ever seen.

    So, the testimonials all load into the page without formatting as three 100%-wide-rows. Then clicking the search icon, the search popup/form shows, and through the transparent page overlay behind it you can see the three testimonials suddenly format perfectly as they should be (and that missing css combo file now can be found in the inspector). Closing the search box does the opposite – the css file disappears from the inspector and the testimonials lose their formatting, going back to 3 default 100%-wide stacked rows.

    The question then is – what controls where the combined css files are re-added into the overall page structure? If we could specify that then they wouldn’t be added into problematic places.

    That’s all the more info I have at the moment. What a strange situation.

    Magestyx

    Thread Starter magestyx

    (@magestyx)

    The code loading the css files in the plugin is as below. In the html output the files are back to back, so I guess that’s why they’re combined together.
    Excluding the content.css and grid.css for Strong Testimonials does do the trick – the files are recognized and in the right location – but we’re only talking one plugin on one site here. To go through every site and find every css file not combining correctly wouldn’t be practical.

    wp_register_style( ‘wpmtst-grid-style’,
    WPMTST_PUBLIC_URL . ‘css/grid.css’,
    array(),
    $plugin_version );

    Thread Starter magestyx

    (@magestyx)

    FYI – we tried using the Plugin Organizer plugin to change the order plugins are loaded, but it didn’t help. The combined css files are still loading in the html of the hidden search form popup.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘W3 missing CSS files in combination/minify process’ is closed to new replies.