Not Aggregating CSS files on Multisite
-
I have a multisite and no mater what the settings are it is not combining CSS files on all of the sites. Perplexed.
-
And does combining JS work?
It is combining CSS and JS on all site. It is only combining JS on the main site. All using same theme and plugins. It is only the CSS on site 1 that is not being combined.
I tried it on another site that is set up for multisite and it’s working.
I have tried deactivating plugins and this did not help so I am assuming that there is something in the theme. There are slight differences in the main site from the sub sites, but not many.
Can you point me in the direction in the code of this plugin where the decision to combine/not combine the CSS is made so I can attempt to debug where this theme is interfering?
More information.
The plugin Classic Editor Addon causes this.
Specifically the act of dequeuing an enqueued style sheet or JS file causes none of the stylesheets after that point to be combined.
This only seems to happen on this multisite for some reason.
I have no idea and I feel like I’m banging my head on a wall. I cannot get this site to combine all CSS and all JS, but only on the main site. All sub sites it works fine.
In the end I’m sure it has to do with the site and not this plugin. Too much going on and the site is old. Needs to be rebuilt
wow, that indeed is weird John … does this also happen when you use https://ww.wp.xz.cn/plugins/classic-editor/ ?
Thanks for replying again.
The symptoms of the problem are confusing. Some CSS and JS files are combined, others are not and which ones change depending on what I have activated. I’ve tested it on another multisite install and it’s working as expected.
With classic editor active on the site it works, mostly, but there are files that are not combined. If I activate the classic editor add on then none of the css is combined but some of JS is.
Results of my testing so far are inconsistent, it’s like herding cats.
I’m also noticing that the HTML is not optimized with that setting on.
In the end I am sure that it is something to do with this site and not with your plugin.
At this point I do not know how to debug because there are so many things that cannot be deactivated and keep the site working. I will need to sleep on it a couple days and see what I can come up with.
One question you can answer for me, does Autoptimize work by capturing the scripts and CSS files as they are enqueued or does it use an output buffer to alter the page’s code?
AO uses output buffering and “harvests” from the almost-ready HTML 🙂
With that knowledge my guess right now is that something is happening that is prematurely killing the output buffer. Looking at the HTML I can see where part of it has been compressed by removing the white space but then after a certain point the compression stops. This at least gives me a place to start looking.
Are you using Nextend Galleries by any chance? If not; any info in the PHP errorlog?
I found the root of the problem. This site has a setting in the wp-config.php file
define('WP_CONTENT_URL', '/wp-content');This removes
https?://www.domain.comfrom all of the site’s URLsNow I just need to figure out what will break if I remove that from statement.
try installing autoptimize 2.9 beta from github while also setting this in wp-config.php to avoid AO getting lost;
define('AUTOPTIMIZE_WP_CONTENT_URL', 'http://domain.com/wp-content');Yes, that solved the issue.
great! feel free to leave a review of the plugin and support here! 🙂
The topic ‘Not Aggregating CSS files on Multisite’ is closed to new replies.