formtools / core

The Form Tools Core.
https://formtools.org
207 stars 78 forks source link

Recaptcha and Wordpress #665

Open jgold723 opened 4 years ago

jgold723 commented 4 years ago

I'm trying to enable recaptcha on my external form which is on a Wordpress site. It's a standard HTML form (not a contact form 7 or other plugin).

I'm inserting the PHP commands as directed in the instructions. Because Wordpress doesn't allow native PHP on pages, I'm using a plugin which somehow encapsulates/enables the PHP code. It's worked with other scripts that I've posted on the site.

However, I'm getting a fatal error when I try to post the error display string:

An error of type E_ERROR was caused in line 1 of the file /home/points/public_html/wp-content/plugins/insert-php-code-snippet/shortcode-handler.php(65) : eval()'d code. Error message: Uncaught Error: Call to a member function displayPostFormCaptchaError() on null in /home/points/public_html/wp-content/plugins/insert-php-code-snippet/shortcode-handler.php(65) : eval()'d code:1

This error, by the way, is generated when I attempt to save the page in Wordpress. I don't even get to the point where I can test the form.

Can anyone provide some insight into what this might mean?

Thanks!

jgold723 commented 4 years ago

I sort of solved this. I still can't find out why the recaptcha API calls are causing an error. But I was able to find a Wordpress plugin that does the same thing (generates a recaptcha challenge for any custom form). So, problem solved.