Hi,
I’m using the latest version of WPRocket, and it disables the functioning of your menus on mobile.
I have the following enabled:
Minify Css
Optimize Css (remove unused css)
Minify Javascript files
Load Javascript deferred
Delay Javascript execution
Strangely it works on the homepage, but what do I need to do to get it working elsewhere?
NB: You can disable WPRocket by adding “?nowprocket” to the url.
Thanks
Paul
OnPoint Plugins
Hi Paul,
We have seen issues with WP Rocket before because it mashes all the JavaScript on the site into one big .js file. The idea is probably to reduce the number of requests on the site. The downside to putting everything in one file is if there is a JS error in any file then anything which loads after the error will also fail.
I took a look at you page you provided and so far have been unable to recreate the issue. The page appears to be redirecting to the
?nowprocket=1
on mobile which is likely disabling WP Rocket.Is there a way I can see the error so I might be able to offer suggestions?
Paul Swindell
Hi,
The url I gave should be fine and shows the problem on my mobile device. There is no obvious UI glitch, the menu just doesn’t respond when clicking on it.
What are the CSS files that I can exclude from WPRocket?
Thanks
Paul
OnPoint Plugins
Hi Paul,
This is the only resource being loaded in the page by the Advanced Sidebar Menu plugin.
wp-content/plugins/advanced-sidebar-menu-pro/js/dist/advanced-sidebar-menu-pro-accordions.min.js
Otherwise the JS and CSS which handles the menu is embedded inline via 2 tags
<style name="accordion"></style>
<script name="add-accordion"></script>
Paul Swindell
Hi,
I excluded your js file, but it still didn’t work.
I then found that changing the “Optimize CSS delivery” option to “Load CSS asynchronously” worked.
WPRocket states that the “Remove Unused CSS” is preferred, but this seems to mess things up.
Any ideas?
OnPoint Plugins
Hi Paul,
It sounds like the WPRocket “Remove Unused CSS” mode is actually stripping out CSS which is used by the menu. This is not that surprising because the accordions icons are generated via JavaScript so I don’t know how WPRocket would know which CSS is or isn’t being used.
Generally I would say that letting another plugin decide which CSS is used by everything on the site is likely always going to lead to issues. In this case, it sounds like the “Remove Unused CSS” mode is not compatible with the menus and should not be used.
I’m glad you were able to find a combination of settings that works.
Have a great day!