Wp rocket hamburger mobile menu

A recent update from either Pro/X or WP Rocket has now caused the Delay Javascript Execution to completely break the mobile hamburger menu on all my websites. Some I am able to get back to working by building a custom header with a Navigation Off Canvas menu and others not. What are the JS scripts for Pro and X that are linked to the mobile device hamburger menus?

I cannot find any code errors because when scaling window size on computer the menus work fine making this very troublesome to figure out. This happened within the past month or so, not sure what exactly changed but the only solution that works 100% right now is to turn off the Delay JS Execution which kills pagespeed scores. Both pro and X worked wonderfully before, please fix/help!

Hi @powersnw,

Thanks for reaching out.
It is not very clear what exact problem you are having. If you have found that WP Rocket is the reason, can you please check by deactivating the plugin? Also, please check by disabling the minification of CSS and JS in the specific plugins. If that does not solve the issue, please provide any video that helps us recognize the problem.
We may also require your website login credentials to examine them further. Please provide them in a secure note, including:

– WordPress Site URL & Login URL
– WordPress Admin username/password

To create a secure note, click the key icon underneath any of your posts.

Thanks

I have troubleshooted all of that. The only cause is the delay javascript execution. In other posts you have listed the associated JS files for the mobile hamburger menu. Again, it only happens on mobile devices, resizing the screen to view the mobile version the menu works fine on a computer, so its very weird why this is happening. I have added the login credentials. Turn on the delay JS execution and load the page on a phone and tapping the menu will result in nothing happening. Turn it off then reload and the menu works fine.

Hey @powersnw,

You could try to exclude this JS file /wp-content/themes/pro/cornerstone/assets/js/site/*.js but our developer told us that they don’t advise us to use the Delay Javascript Execution.

Hope that helps.

This doesnt work. The mobile menu on mobile devices still breaks. Why is the developer now not allowing this to be used? For years it worked fine. Not being able to delay JS kills mobile site load times and pagespeed scores. This is something that is very important due to the fact that WP and the theme load so many files.

Can this be put back to how it was? Put priority on speed and the ability to delay JS with excluding important theme files to allow the menu to work? There has to be another file that works.

Hey @powersnw,

You can experiment and use the absolute path instead:
https://example.com/wp-content/themes/pro/cornerstone/assets/js/site/*.js

Do not forget to insert the correct domain name of your site.

Thanks.

That does not make any difference.

Hey @powersnw,

You can ask WP Rocket support and tell them that you need to exclude everything from our assets. Don’t worry our JS files are fully minified and work out of the box.

Thank you.

I am having an issue not unlike this one.

The bug is completely inconsistent.

We have tested this on a clone setup and disabled ALL the plugins. When logged in the mobile menu will work - IE you are logged in as admin - when you logout and try the same menu it will not work…sometimes…

If you load in a Incogito window it MAY work sometimes and then stop working.

Thanks for your feedback.

Hey Jason,

We highly suggest that you create your own thread to avoid any confusion from the poster. Please note that I deleted your secure note because the poster can see it.

Thank you.

This works fine out of the box with your competitors themes. You telling me to reach out to them when YOU made the change that caused the issue is extremely bad customer service. Please have one of your devs contact me about this as it is an extremely important issue that will end up causing me and others to drop this theme if you refuse to correct the problem.

ok so no reply, makes sense. Here is a screenshot that WP Rocket has added a fix but only for the PRO theme. If you are a user of X theme you do not have the option for the fix. Just more information that the devs changed and caused this issue. Your customer service has really degraded over the past few years which is very concerning. Sorry to all X Theme users with no fix or offer of a fix from the theme devs. Switch to Pro I guess if you want to use something that works with everything else…

To end this issue of the Delay JS execution we will eventually just add in a filter to manage this on our end. I’ve already investigated how other themes handle this. We’re a small theme and team at the end of the day and we can’t rely on every last plugin integrating with us properly. Especially as we split our JS files to get better performance on our pages. I’ll update this thread with progress.

Regarding it not working on X, the Cornerstone JS files would also need to ignored. These would all be in wp-content/plugins/cornerstone/assets/js/site/(.*)

I would also recommend not using the Delay JS execution feature. With Googles INP changes, when you interact with anything on the page you are going to get a lower page speed score using this feature as it starts loading js files and slows down user interaction time on first input.

Have a great day

I appreciate the reply and the information about Googles INP that launched this month. It will be curious to see if the delay execution causes issue because without that mobile load times are horrific due to all the different scripts needed for wordpress and the themes. Sometimes getting a mobile site to load under 5 seconds is practically impossible even following all the recomended CDN usages and preloading etc etc. The issue that this topic was written for was the change on X/Pros end that caused the breaking to happen with the navigation on mobile devices. I appreciate you saying you will add a filter to manage this, that is the correct response not what was given before. I am sure I am not the only one who has spent a lot of money on these themes for many different clients and the reason was because the themes worked fast and had great customer service. I hope this doesn’t start to deteriorate faster. There have been a few topics I have come across and posted myself that support was lackluster at best and in the end resulting in myself or another user finding a bandaid to fix the issue. It seems WP Rocket has added the fix for Pro, maybe they will add one for X too but I hope that doesn’t break again in the future.

1 Like

If your concerned about page speed I encourage you to try SVG mode for Font Awesome. It’s going to be one of the biggest speed improvement our theme will have for a while. https://theme.co/docs/font-awesome-pro#svg-support

Just to clarify the mobile menu point. Does the menu work after switching to Pro or when Rocket is disabled? As in this was related to the JS delay execution. If we manage the rocket side of the equation it’ll be more solid in the future. Appreciate your thoughts.

I will look at the SVG, thank you.

For the menu it worked on both Pro and X with WP-Rocket disabled. The issue now is Rocket has a fix for Pro, not X with Delay JS Execution. Currently Pro runs perfect with Delay JS Execution and the new option in WP-Rocket titled “Pro Them - Fix Menu and Accordions”. The workaround currently for X with the Delay JS Execution is to exclude the following:

\/jquery(-migrate)?-?([0-9.]+)?(.min|.slim|.slim.min)?.js(\?(.*))?( |'|"|>)js-(before|after)(?:/wp-content/|/wp-includes/)(.*)

Trying to only exclude the X theme files or scripts does not work.

1 Like

Hey @powersnw,

Thanks for your tips, it is really helpful with someday else who was working with WP rocket and delay JS execution.

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.