WP Rocket's one-click-exclusion for Pro theme "Delay JavaScript execution" may be outdated - help please

Hi,

I am using Pro (and X) and WP Rocket for many years now and I am well aware of problems between WP Rocket’s Delay JavaScript execution feature and burger menus and accordions from Pro (and X). Some time ago WP Rocket build a one-click-exclusion-feature solution for popular third party themes and plugins to help users easily fix this problems by auto excluding the neccessary JS-files. So did they with your Pro theme. The one-click-exclusion is called “Pro Theme - Fix menu and accordions”.

It worked for some time but now I am getting problems with accordions on many of my clients installations even with the one-click-exclusion active. Only safe way is to completly disable Delay JavaScript execution. So I do think that something’s may have changed on Themeco’s side.

So I talked to WP Rocket to get to know what the one-click-exclusion does to pass is over to you for you to may check and maybe you say “ah yes, one file changed, you may have to exclude this and that” :slight_smile: so here we go, it’s currently excluding these:

/jquery(-migrate)?-?([0-9.]+)?(.min|.slim|.slim.min)?.js(?(.*))?( |'|"|>)
/pro/cornerstone/assets/js/site/cs-classic.(.*).js 

Would be great if we can figure it out together. I would pass the information back to WP Rocket for them to update their exclusion list. Thank you!

Hi Daniel,

Thank you for reaching out.
We are not aware of a one-click-exclusion option available with WP Rocket; however, the files you listed for exclusion are correct.
Although this question related to theme files and falls outside the scope of our Theme Support, I will still check with our development team and let you know if we find anything relevant.

Thanks

Thanks @tristup. Now you know :slight_smile: WP Rocket is trying to take as many common third party themes and plugins into account to make it easy for the userbase.

I was hoping that the excluded files are just not correct anymore.

Hi,

I did try to put /jquery(-migrate)?-?([0-9.]+)?(.min|.slim|.slim.min)?.js(?(.*))?( |’|"|>) but when I save there is error message Invalid pattern and it’s removed.

Just wanted to check if that exclusion is correct?

WP Rocket told me that

/jquery(-migrate)?-?([0-9.]+)?(.min|.slim|.slim.min)?.js(?(.*))?( |'|"|>)

is correct. Themeco said so too (see above)
It’s too complex for me to understand.

Hey Daniel,

For One Click Exclusion, try using jquery*.js. This should cover all jquery file.

You use /jquery(-migrate)?-?([0-9.]+)?(.min|.slim|.slim.min)?.js(?(.*))?( |'|"|>) if you super strict matching excluding jquery.slim.min.js file only.

In addition to other theme JS files, the following can be excluded too:

/wp-content/themes/pro/pro/cornerstone/assets/js/site/cs-classic.(.*).js 
/wp-content/themes/pro/framework/dist/js/site/stack.(.*).js 
/wp-content/themes/pro/framework/dist/js/site/x.(.*).js 

Or just this when you want ALL the JS files in the site folder.

/framework/dist/js/site/.*\.js

Hope this helps.

1 Like

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