# contact-forms/2.2.4/classes/Validation/Captcha.php

Contact Forms by Cimatti, version 2.2.4. 22 lines.

- Page: https://pluginprobe.com/plugins/contact-forms/2.2.4/code/classes/Validation/Captcha.php
- Raw: https://pluginprobe.com/plugins/contact-forms/2.2.4/raw/classes/Validation/Captcha.php
- Modified: 2026-04-08T09:49:58+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/contact-forms/2.2.4/code/classes/Validation/Captcha.php#L10-L20`.

```php
<?php
/**
 * reCAPTCHA v1 Validation (legacy)
 * @package Contact Forms
 */

// phpcs:disable WordPress.Security.NonceVerification, WordPress.Security.ValidatedSanitizedInput -- Server-side CAPTCHA validation requires POST data

class AccuaForm_Validation_Captcha extends Validation {
	protected $message = "Error: The reCAPTCHA response provided was incorrect. Please retry.";
	protected $privateKey;

	public function isValid($value) {
		require_once(dirname(__FILE__) . "/../../PFBC/Resources/recaptchalib.php");
		$resp = recaptcha_check_answer ($this->privateKey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
		if($resp->is_valid)
			return true;
		else
			return false;
	}
}

```
