mosparo / wordpress-plugin

This WordPress plugins adds the required functionality to use mosparo in your WordPress form.
MIT License
9 stars 2 forks source link

When using Autoptimize javascript optimizer plugin on site, mosparo fails to load #14

Open Sapper-Morton opened 3 months ago

Sapper-Morton commented 3 months ago

This might be more of a notice when installing mosparo plugin.

When Autoptimize is active, load a page with a form with mosparo in incognito/private mode. You will see error: Uncaught ReferenceError: mosparo is not defined

This can be avoided by adding mosparo-frontend.js to Autoptimize script exclusions.

zepich commented 2 months ago

Hi @Sapper-Morton

Thank you very much for your report.

I'm a bit confused, to be honest. Can you share the plugin's settings so I can test it myself?

Technically, I would not advise optimizing the mosparo JavaScript file with Autoptimize because if you update mosparo, you have to remember to flush the Autoptimize cache; otherwise, you would use the old JavaScript code of mosparo.

Kind regards,

zepich

Sapper-Morton commented 2 months ago

I'm a bit confused, to be honest. Can you share the plugin's settings so I can test it myself?

image This is the main cause. If I don't exclude mosparo script, It won't load.

Technically, I would not advise optimizing the mosparo JavaScript file with Autoptimize because if you update mosparo, you have to remember to flush the Autoptimize cache; otherwise, you would use the old JavaScript code of mosparo.

Yes, this is why I made the remark. Maybe add a note to the mosparo settings view that they need to add an exception for mosparo script if their sites uses any kind of JS-optimizers?

zepich commented 2 months ago

Hi @Sapper-Morton

Thank you very much for your response. I've tested it with your settings and have the same problem. I usually use the "Aggregate JS-files" option, which should not do anything with external JavaScript files. That's the reason why I was confused.

I will consider how and where to add a hint about this, probably when adding a new connection.

Kind regards,

zepich