I've successfully integrated your plugin on my staging environment, but on production (shared hosting service), I've always received a "invalid-json" error response when POSTing the form.
I've changed the following CaptchaMiddleware.php file by using CurlPost as the request method instead POST, as suggested here
$recaptcha = new ReCaptcha( Settings::get('secret_key'), new \ReCaptcha\RequestMethod\CurlPost() );
Now it works.
Can you please add a "method selection" to the plugin's settings page?
Thank you.
Last updated
Hi, sure that would be possible, but it adds extra complexity to the plugin that is not necessarily needed.
Regarding the SO thread you linked, the correct answer proposes to set allow_url_fopen
to 1
in your php.ini
. This is of course a problem if your haster does not allow you to. But please try it first and then we can make further steps.
Please also note that this is an open source plugin, so you contribution on github is highly encouraged :)
Last updated
Hi,
The allow_url_fopen wasn't the issue and it's set to 1 on my hosting service. The only thing that worked is the change I've made to the CaptchaMiddleware.php file. BTW, now it doesn't work on my staging environment, but at least I can post forms on production.
I suggest to create an advanced setting to control the method being used.
I would've changed it myself on GitHub, but I'm new to OC and Laravel...
It is super weird only one approach is working on each server. I dont like the approach of having both methods in place and wonder, why the cURL approach isnt working on your local enviroment, as cURL clearly is an october dependency, it should be installed and working.
1-4 of 4