Does Microthemer works with WP Rockets

Tagged: 

Author Posts

Fafa24

Hello,

I’m new to Microthemer. I bought it yesterday. I use WP Rocket and I have to deactivate it otherwise Microthemer won’t work. I cannot select any object and when I activate WP Rocket again my changes disappear


Sebastian

Hey,

Thanks for your purchase! It should be possible to use WP Rocket with Microthemer, I use WP Rocket myself. But, you might need to tweak some settings. I suspect that the targeting does not work because WP Rocket is doing something to the JavaScript file Microthemer needs to run in order to select elements.

For your Microthemer changes to display, you will need to clear your WP Rocket cache.

(And there is a publish button in Microthemer that you can use when you are ready for regular site visitors to see your new styling).

Would you mind providing temporary access details for the site via our secure contact form so I can troubleshoot this for you? You can use this handy plugin to provide temporary access easily. Or, just a clone of the site perhaps.
I may need to experiment with the settings a bit to see exactly what’s causing the conflict. If you prefer not to provide access, you could try adjusting the concatenation / minification settings yourself, and let me know how you get on.

Cheers,
Sebastian


Fafa24

Thanks Sebastian,

I sent the access link. It is a staging site. We probably need to exclude the Javascript file.


Fafa24

By the way I understand that I need to hit the publish button 🙂 . The changes were also present on the frontend when WP Rocket was disabled. However when I enabled WP Rocket again, the changes disappeared. I bet you will figure it out. Thanks!! Edy


Sebastian

Thanks for providing access!

There was actually two issues here. There was some invalid JavaScript code added using a code snippets plugin. That prevented subsequent JS scripts from executing, including Microthemer’s.

There was also a compatibility issue with WP Rocket’s “Delay JavaScript execution” feature. To fix the conflict with Microthemer, you can add the following line to the exclusions field below that setting in WP Rocket:

/jquery(/ui/|-migrate)

This will ensure that jQuery and related scripts load without delay, and that allows other scripts to respond to it’s onload event.

However, I’m also questioning if it’s wise to have that feature enabled in general. The reason being, it seems to cause issues with lots of plugins. Here is a list of exclusions that need to be applied for known plugins:

https://docs.wp-rocket.me/article/1560-delay-javascript-execution-compatibility-exclusions

There are bound to be many more than this list, Microthemer will just be one example of an undocumented conflict. It feels risky enabling that feature if you are not in strict control of the JavaScript. In other words, if you make use of various WordPress plugins. It won’t always be obvious if something isn’t working 100%. Some scripts will just silently fail to load, without any error message.

Just my thoughts after spending a few minutes thinking about it. You, or others, may have a different perspective.

Cheers,
Sebastian


Fafa24

Thanks for Sebastian for troubleshooting it. I added the exclusion to WP Rockets


Sebastian

You’re welcome!

You must login or register to reply to this topic.