Is there a bug in the Ajax implementation?
-
I’ve been getting reports of hidden 500 errors when people try to sign up using the widget on a client’s site.
On investigation the response from the Ajax submission is the “Cheating huh?” page.
Looking into the code, I suspect there are a couple of problems:
The JS variable ajax_url is being set to
trailingslashit(home_url())
and “caught” with an init action, when it should really use the standard Ajax API (admin_url( 'admin-ajax.php' )
).But that aside, that ajax url is set in an object called “mailchimpSF_main_js” but then the Javascript code (in mailchimp.js) tries to reference “mailchimpSF.ajax_url”
Also, there is at least one other plugin on the site that outputs a correct ajax url, I don’t know whether that interferes or not.
For now, I have disabled JavaScript in the plugin and the 500 errors have stopped.
Mike
- The topic ‘Is there a bug in the Ajax implementation?’ is closed to new replies.