3.0.2 Header dropdown & JS minification

I’ve noticed since the RCs and still now on 3.0.2 that my dropdown menus don’t work if I’ve got JS minification switched on in WP Rocket.

Cleared all the caches, and no luck but as soon as I disable it, works fine - weird because I’ve not changed anything in the header and it was working perfectly in 2.5.5 - but not since using Beta/RC/3.0…

Noticed on 2 sites now, too.

Hi @RubberDuckers,

I’ve seen several reports of WP Rocket minification issues. I emailed them earlier today about it. Waiting to hear back. I’m not really sure at the moment if there’s something we can do on our end. Asset minification systems should be able to take an arbitrary code and produce an optimized version without breaking the original code. It’s likely something on their end that is triggered by some combination of the code in our update.

That being said, all the assets in Pro (and X) are already minified, so you could try adding exclusions for the theme folder for now.

Oh awesome, wasn’t sure how minified they were as to whether I could just exclude that entirely.
I just thought it odd that all 2.5.5 sites works with the minification on but after updating they don’t - both dropdowns and hover over but only in the header - even using the same version of WP Rocket.

Be good to hear what they say!

I had to turn-off minification in SG Optimizer for Siteground. It was preventing the right-click in the builder.

I knew Pro was pre-minified, but I wasn’t excluding its CSS files because minification should just rearrange the code, not remove parts of it or something.

Great idea on excluding the whole Theme, instead of chasing individual parts. :slight_smile:

Just another point on this - I noticed it knocked out section background videos too.
Turning off minification does fix it, although oddly with WP Rocket, telling it to ignore theme files didn’t seem to work so just switched it off.

I’m still waiting for WP Rocket to help me get an account setup so I can play around with the minification.

Something we changed with this update I should have mentioned before is that we added asset fingerprinting. This could invalidate any exceptions you’ve added to minifier systems if you used an exact URL. On each update, the file names of all assets in the /cornerstone path will have a unique filename. This eliminates most browser caching issues because they are brand new files.

1 Like

Update: This should be resolved in the next release. I was able to reproduce it with WP Rocket. Their minified was choking on one of our dependencies that had some complicated regular expressions. I’ve refactored our code to simply avoid needing that code path. I’ve tested with WP Rocket and it’s working nicely again.

1 Like

Awesome, thank you!

Good to know I wasn’t going crazy :relieved:

You’re welcome!

Just updated WP Rocket and Pro and can confirm it’s fixed :slight_smile:

Awesome! Thanks for confirming.