W3 Total Cache Minify prevents drop down menus!

General questions pertaining to how certain issues can be resolved
Forum rules
1. No offensive language and no mocking
2. Please do a thorough search before you post something. Trust us, there is a high probability that the question you are asking has been asked previously.
3. No soliciting. You cannot post here soliciting bids for people offer you quotes, or even offer money to people for some work. You will be moderated if you do so. If you are looking for help, please post your request on http://jobs.wordpress.net or http://codepoet.com
4. Please be reasonable. You are getting software and support. For free. Complicated requests from a general purpose theme are not welcome and some volunteers might lose patience with you.
5. Please do your due diligence. If you posted a query and we answered with a link, take the trouble to go through the link contents.
6. Please post with complete information. Requests for help MUST be accompanied with your URL, particularly if you are asking something like "Why am I seeing a blank space?"

W3 Total Cache Minify prevents drop down menus!

Postby pilot911 » 23 Apr 2012, 19:35

I have noticed recently that the drop down menus, say for categories are not working. I disabled all the plugins and they worked fine, by a process of elimination I identified the W3 Total Cache as the problem. So delved a little further.

By disabling the minify under the W3 Total Cache general settings the dropdown menus are working again, however, i am obviously losing the benefit of minification.

Can you help me to resolve this issue:
WordPress 3.3.2
W3 Total Cache Version 0.9.2.4
Suffusion 4.0.7

Thank you for a great theme it is one of the most versatile and a definite favourite of mine.

I hope we can get this resolved.

Thanks in advance

Chris
pilot911
 
Posts: 16
Joined: 18 Jan 2012, 21:21

Re: W3 Total Cache Minify prevents drop down menus!

Postby sayontan » 23 Apr 2012, 20:33

pilot911 wrote: i am obviously losing the benefit of minification.

You will have a hard time quantifying that. Most of the scripts bundled in Suffusion are minified. If you are trying to minify something that is already minified, you will run into issues. Maybe you should consider excluding the Suffusion scripts from your minification.
Sayontan Sinha | http://mynethome.net/blog | http://www.aquoid.com/news
I don't do freelance work (for Suffusion or otherwise), so please don't contact me for quotes or offers.
sayontan
Site Admin
 
Posts: 10159
Joined: 15 Sep 2009, 16:39
Location: Houston, Texas

Re: W3 Total Cache Minify prevents drop down menus!

Postby coteesh » 17 May 2012, 09:19

I have the exact same problem, and I was able to fix it by disabling just the java script (JS) minification checkbox in the W3 Total Cache minify settings. I figure that disabling just java script minification is a very minor adjustment and should not greatly affect overall performance.
coteesh
 
Posts: 1
Joined: 17 May 2012, 09:17

Re: W3 Total Cache Minify prevents drop down menus!

Postby tzdk » 17 May 2012, 13:19

That section of W3TC is not really an on/off switch so the right tactic is to exclude what does not seem to work.

Or if too many problems disable minification all together but still bundle scripts. I dont remember the right word as I got tired of W3TC long ago but there is a tick box for this.

Biggest benefit it not really minification but fewer HTTP requests so can be worth it to suffer some boring testing clicks. Just because site loads up does not mean JS bundle works, or CSS bundle for that matter. Be sure to check every possible link/feature and also in all browsers. Fun :)
tzdk
 
Posts: 42
Joined: 17 May 2012, 13:12

Re: W3 Total Cache Minify prevents drop down menus!

Postby pilot911 » 17 May 2012, 16:34

thanks for your responses on this. I will play about with the settings to see which is the best option.

Regards

Chris
pilot911
 
Posts: 16
Joined: 18 Jan 2012, 21:21

Re: W3 Total Cache Minify prevents drop down menus!

Postby tzdk » 23 May 2012, 11:52

Now I have also played with it a bit more I have found it is possible to minify 100% (as of right now that is my opinion)

But I dont use W3TC and had to fiddle - so not an out of the box fix but possible. I used BWP Minify http://betterwp.net/wordpress-plugins/bwp-minify/ Very flexible for a reason = minify can blow!

Since developers typically dont want to hear this announced as a fantastic tip because then those who want to speed up site or save server powers (99%) start to give invalid bug reports and such I just give headlines. Based on a child theme with no load of extra skin.

In style.css of child themes remove line with import of main style.css
Deregister main style.css AND style.css from child theme (not 100% sure this is needed, should not with same handles I think but no harm done)
Enqueue same 2 style.css files (and again if handles are the originals no need to deregister)
Done.

Custom-styles file seem to work fine being stuffed in the mix more or less randomly. But one to keep eye on if things break.

Best way to deal with minify is to read that page from BWP. Hooks and code snippets. Coming version will be a bit more user friendly but if everything is ??? then dont minify. The way certain other tools present this is just wrong. Also remember than even if all functions/features/links on a site is tested and nothing can possible break you have to redo all testing everything a change has been made, like update to CSS and plugins. Not so sensitive once proven to work but in theory this must be done to be sure.

One of the weird changes I had to deal with show how crazy can be. I use a sliding panel (not from Suffusion) and it work ok with or without minify - with one exception. It has its own CSS file which I override in child themes style.css. Problem is when minified order of code/file load is apparently changed (or what ever) and I now have to be more specific with CSS declarations or use !important. 3-4 necessary lines are ignored when minified (sliding panel CSS come out on top), not an issue when not minifed.

I also expected problems with Suffusion bundle of JS code in suffusion.js and may be there are some. Drop down code works. Again, nothing has been proven to work with no testing so ALL features based on code in suffusion.js must be tested.

I think that plugin by far is the best, also dev!, but it would be cool if it could bundle with NO minification, like W3TC can. So instead of having to exclude each and every CSS and JS file when there is a problem, or 10, one can just go BAH and bundle instead. Biggest advantage of this is less HTTP requests anyway. Server can gzip and perhaps PHP cache plugin can help as well.
tzdk
 
Posts: 42
Joined: 17 May 2012, 13:12

Re: W3 Total Cache Minify prevents drop down menus!

Postby sayontan » 23 May 2012, 13:20

tzdk wrote:In style.css of child themes remove line with import of main style.css
Deregister main style.css AND style.css from child theme (not 100% sure this is needed, should not with same handles I think but no harm done)
Enqueue same 2 style.css files (and again if handles are the originals no need to deregister)
Done.

This is generally unnecessary. For point #1, the theme's recommendation is that you don't import - that is why there are specific options (under Suffusion Options -> Back-end -> Child Themes -> Inherit Styles), and the starter pack's style.css gives you instructions on what you should and shouldn't do. Of course, if you don't follow the instructions, then you are inviting a troublesome route for yourself...

The theme also takes care of enqueueing appropriately if you have a child theme (hence there is no need for the @import above), so points #2 and #3 above are also not necessary.

Lastly, minification issues pertain to JS (which is pre-minified in some cases) and not to CSS. To date I haven't had a user report an issue to do CSS minification for the core stylesheets.
Sayontan Sinha | http://mynethome.net/blog | http://www.aquoid.com/news
I don't do freelance work (for Suffusion or otherwise), so please don't contact me for quotes or offers.
sayontan
Site Admin
 
Posts: 10159
Joined: 15 Sep 2009, 16:39
Location: Houston, Texas

Re: W3 Total Cache Minify prevents drop down menus!

Postby tzdk » 23 May 2012, 13:36

I am aware of that - also that if not done this way - (for this setup, with no interest in inheriting anything) - CSS or rather the bundle breaks. Feel free to try. Might get other result with another tool and of course with different Suffusion setup. My point is you cant assume it works BUT in most cases it can be made to work. This is where devs. often say NOOO, like someone just did :) You also say "Otherwise import as follows." in starters kit so lets just say what ever is possible/optional right. But if you are sure just any Suffusion setup will work with X minify tool then just say there is no reason to do anything than tick some buttons. Good luck with that. You can only make sure it, all combinations of Suffusion options, works out of the box but adding minify tool on top is not out of the box. Good thing Suffusion does not mess up with bad coding/loading but still no guarantee everything will be fine. All those more or less hidden settings in BWP minify is not just fluff. Lightbox stuff, probably those in Suffusion, have long history of being hopeless. Typically use several CSS files, init code, may be both in head/footer and what not. But there are other options than excluding if persistent enough...

CSS can break as well, real breakage from minifying process, but mostly a JS issue. However order of files can break things. If tool get confused about when to load this or that and in which order it is best to manually take control. You have to.
tzdk
 
Posts: 42
Joined: 17 May 2012, 13:12

Re: W3 Total Cache Minify prevents drop down menus!

Postby sayontan » 23 May 2012, 14:01

tzdk wrote:Feel free to try.

I have tried, hence the recommendation. What you have suggested is exactly the same as what is implemented in the theme's "Do not inherit" option. You can give it a try.

tzdk wrote:However order of files can break things. If tool get confused about when to load this or that and in which order it is best to manually take control.

Order is taken care of by the dependency parameter of wp_enqueue_script / wp_enqueue_style and inbuilt code in Suffusion makes extensive use of wp_enqueue_script / wp_enqueue_style (that is the only way scripts are loaded into Suffusion). If your minification plugin cannot understand wp_enqueue_script, then that is a bug with the minification plugin.

Also note that I am not suggesting "Don't use a minification plugin". My suggestion is merely that the steps you have outlined don't need any code.

The point is, the theme makes such things easy for you - why reinvent the wheel?
Sayontan Sinha | http://mynethome.net/blog | http://www.aquoid.com/news
I don't do freelance work (for Suffusion or otherwise), so please don't contact me for quotes or offers.
sayontan
Site Admin
 
Posts: 10159
Joined: 15 Sep 2009, 16:39
Location: Houston, Texas

Re: W3 Total Cache Minify prevents drop down menus!

Postby tzdk » 23 May 2012, 14:23

No you have not tried as you dont have my bundle :) Add about 10 JS and 10 CSS files from other plugins.

The whole point of BWP is just that it ONLY work with properly loaded files - rest is up to you and options. You need to understand that because Suffusion does not to anything wrong technically it is not the same as just any setup will work for man kind. Or just because I dont seem to have problems with drop down code does not mean the guy who have problems are wrong. Conditions are not the same so not possible to compare directly. There is NO universal recipe for this which is what I am trying to say.

And I can go back and forth with doing this manually and not. One sort of breaks, some CSS is not applied, the other works. Output from BWP is similar, 2 large CSS files with everything bundled. IF I wanted I could probably do a comparison and possible fix stuff so I could just go click, click but fact is if I manually enqueue those files nothing breaks. Different output is not result of Suffusion or BWP doing anything wrong as such. Just a bad combo. I could also start excluding until I found the 1 file causing issues. I am more interested in direct differences between the 2 sets though. There is a reason one works and other does not and from what I can tell manually enqueue´ing those 2 Suffusion files is NOT the same as leaving them be - though it should be. Possible BWP mess up order or something (regardless of what good BWP intentions have, as you can see on its page dev is fully aware of everything WP internals), does not warrant Suffusion way of loading stuff. Does include so no worries with enqueue code, not the same as it does not change order of code! Forcing it to match Suffusion could be fix. I will guess that is issue.

Try check why so many dislike or at least have run in to problems with W3TC (support forum), high percentage of problems comes from its minify section. It even encourage you do change how each script is loaded, drag&drop! Almost begs for problems as default/native load order and ways must be fiddled with in a controlled manor. The way BWP go about it is much better but also not as easy to sell.
tzdk
 
Posts: 42
Joined: 17 May 2012, 13:12

Next

Return to Support Requests

Who is online

Users browsing this forum: Google [Bot], kqpaffto, SpritHansi, uvebzidtrgg and 4 guests