I would change the block:
public function doTest()
{
$this->_recaptcha = new ReCaptcha($this->_secret_key);
if ($_POST["g-recaptcha-response"]) {
$resp = $this->_recaptcha->verifyResponse (
$_SERVER["REMOTE_ADDR"],
$_POST["g-recaptcha-response"]
);
}
if (!$resp->success)
return 'wrong_verification_code';
return true;
}
to:
public function doTest()
{
$this->_recaptcha = new ReCaptcha($this->_secret_key);
if ($_POST["g-recaptcha-response"]) {
$resp = $this->_recaptcha->verifyResponse (
$_SERVER["REMOTE_ADDR"],
$_POST["g-recaptcha-response"]
);
if (!$resp->success)
return 'wrong_verification_code';
}
else
return 'wrong_verification_code';
return true;
}