Ninja forms conflict Autoptimize
-
Hello!
Ninja forms are blocked when basic settings of Autoptimize are activated.(seal.js, js/jquery/jquery.js is excluded by default)
Please help! Thank you!
P.S. I note previous thread on Ninja forms – Autoptimize, but it does nto help solve this issue…
-
afternoon @awphelpt;
the basic settings are just that really, basic settings. in case of problems you should have a look at the troubleshooting tips in the FAQ and change those settings.specifically have a look at any JS error on the browser console and try excluding JS that is referenced by those errors. alternatively you could try excluding the ninja forms JS.
if you have done so and are still not able to fix, then provide me the URL to your site and describe what troubleshooting-steps you took and I’ll try to help you based on that info.
hope this clarifies,
frankFrank – Thank you for reply!
I have to qualify my problem: I run multisite install, and on primary domain the ninja form works fine: https://diagnosticdetectives.com/contact/
On domain-mapped installs (and with identical Ninja form settings and Autoptimize settings, sites differ only in language) no forms are seen:
https://diagnosticdetectives.de/contact/
https://diagnosticdetective.ru/contact/In FF web debug console I do not see any Ninja js or errors…
Thank you!
and have you tried excluding the ninja-forms JS from optimization?
I just don’t see those ninja forms JS in web console. Also, for Primary site (which is, in my case, diagnosticdetectives.com) settings work fine, it is for domain-mapped sites that no forms show up…
Excluding what I see in ninja forms js folder in SFTP-accessed WP folders (e.g., all-forms.js) did not work, but there are 48 files in js folder in ninja forms…
well, you can exclude by folder-name, e.g.
plugins/your-pluginoryour-plugin/js…I tried excluding this, not sure if syntax is correct:
/wp-content/plugins/ninja-forms
and then this: /wp-content/plugins/ninja-forms/assets/jsDid not work… What I don’t get is why Primary site works OK with default settings… could there be a wrong syntax in default exclusions of “seal.js, js/jquery/jquery.js”? If so, what could be the right syntax? Maybe that’s where the solution lies…
Thank you!
could there be a wrong syntax in default exclusions of โseal.js, js/jquery/jquery.jsโ
no, the problem is probably that AO isn’t aggregating in the same manner for the non-default sites. are you using WPML?
no, no! There are no language plugins! Never! I run standard multisite install hosted by WP Engine. Primary site is in English. Other sites are “domain-mapped”, but each site is native and there is absolutely no connection between those sites! No posts are linked. No plugins! Those are bad (I tried them years ago…) So issue that sites are in different languages are just incidental… I can clone my primary site in English and I am sure issue will replicate…
Thank you!The issue seems to be related to domain mapping: I cloned the main site to /test1/ folder, so contact form is here: https://diagnosticdetectives.com/test1/contact/
In this configuration the form shows up with basic settings of the autoptimize plugin.I am using WP Engine-recommended WordPress MU Domain Mapping plugin for domain mapping…
But on all domain-mapped sites the form disappears… Do you have any suggestions how I could fix that? Thank you!
so, in browser console I do see errors after all;
20:48:59.625 TypeError: t is undefined 1 front-end-deps.js:20:349
20:49:00.802 ReferenceError: Marionette is not defined 1 front-end.js:1:8243the problem is that on the non-default sites (e.g. diagnosticdetectives.de) some CSS/ JS files are on diagnosticdetectives.com and autoptimize doesn’t optimize CSS/JS on another domain.
you can tell AO that those domains should be treated the same with this code snippet (quick example, untested!!);
add_filter('autoptimize_filter_cssjs_multidomain','awphelpt_domains'); function awphelpt_domains($in) { return array_merge($in, array("diagnosticdetectives.de","diagnosticdetectives.ru")); }Do I put this code in function.php or where? Willing to test the code, no probs!
Thank you!functions.php is a possibility, but the code snippets plugin is clearner and safer alternative ๐
Added code directly to active theme functions.php file, does not work, unfortunately (I did remove one letter “s” to correct for .ru url)… ๐
Could I write to you via http://autoptimize.com/ ? I have taken enough of your time already! Thank you
The topic ‘Ninja forms conflict Autoptimize’ is closed to new replies.