✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ premium290.web-hosting.com ​🇻​♯➤ 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2025

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 63.250.38.37 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.217.6
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/tdhomesa/public_html/wp-content/plugins/forminator/library//class-captcha-verification.php
<?php
/**
 * Forminator Captcha Verification
 *
 * @package Forminator
 */

if ( ! defined( 'ABSPATH' ) ) {
	die();
}

/**
 * Class Forminator_Captcha_Verification
 *
 * Handle Captcha verification
 *
 * @since 1.15.5
 */
class Forminator_Captcha_Verification {

	/**
	 * Secred Key
	 *
	 * @var string
	 * @since 1.5.3
	 */
	private $secret_key = '';

	/**
	 * Provider
	 *
	 * @var string
	 * @since 1.15.5
	 */
	private $provider = '';

	/**
	 * Forminator_Captcha_Verification constructor.
	 *
	 * @since 1.5.3
	 *
	 * @param string $secret_key Secret Key.
	 * @param string $provider Provider - Added since 1.15.5.
	 */
	public function __construct( $secret_key, $provider ) {
		$this->secret_key = $secret_key;
		$this->provider   = $provider;
	}

	/**
	 * Verify captcha
	 *
	 * @since 1.5.3
	 *
	 * @param string      $user_response User response.
	 * @param null|string $remote_ip Remote IP.
	 * @param string      $score Score.
	 *
	 * @return bool|WP_Error (true on success, WP_Error on fail)
	 */
	public function verify( $user_response, $remote_ip = null, $score = '' ) {

		$provider = $this->provider;
		$url      = $this->get_verify_endpoint();

		$args = array(
			'method' => 'POST',
			'body'   => array(
				'secret'   => $this->secret_key,
				'response' => $user_response,
				'remoteip' => $remote_ip ? $remote_ip : Forminator_Geo::get_user_ip(),
			),
		);

		$res = wp_remote_request( $url, $args );

		if ( is_wp_error( $res ) ) {
			forminator_maybe_log( __METHOD__, $res );

			return $res;
		}

		$body = wp_remote_retrieve_body( $res );
		if ( empty( $body ) ) {
			$error = new WP_Error( $provider . '_empty_response', 'Empty response', array( $res ) );
			forminator_maybe_log( __METHOD__, $error );

			return $error;
		}

		$json = json_decode( $body, true );
		if ( empty( $json ) ) {
			$error = new WP_Error( $provider . '_failed_decode', 'Fail to decode', array( $body ) );
			forminator_maybe_log( __METHOD__, $error );

			return $error;
		}

		if ( 'recaptcha' === $provider ) {

			if ( ! empty( $score ) && ! empty( $json['score'] ) && floatval( $json['score'] ) < floatval( $score ) ) {
				$error = new WP_Error( 'recaptcha_failed_score', 'Score is lower than expected.', array( $body ) );
				forminator_maybe_log( __METHOD__, $error );

				return $error;
			}
		} elseif ( ! empty( $score ) && ! empty( $json['score'] ) && floatval( $json['score'] ) >= floatval( $score ) ) {

				$error = new WP_Error( 'hcaptcha_failed_score', 'Score is higher than expected.', array( $body ) );
				forminator_maybe_log( __METHOD__, $error );

				return $error;
		}

		// success verify.
		if ( isset( $json['success'] ) && true === $json['success'] ) {
			return true;
		}

		// read error.
		$error = new WP_Error( $provider . '_failed_verify', 'Fail to verify', array( $json ) );

		return $error;
	}

	/**
	 * Get Recaptcha endpoint to verify user response
	 *
	 * @since 1.5.3
	 * @since 1.15.5    Added hcaptcha endpoint
	 *
	 * @return string
	 */
	private function get_verify_endpoint() {
		$provider = $this->provider;

		if ( 'recaptcha' === $provider ) {
			$endpoint = 'https://www.google.com/recaptcha/api/siteverify';
		} elseif ( 'turnstile' === $provider ) {
			$endpoint = 'https://challenges.cloudflare.com/turnstile/v0/siteverify';
		} else {
			$endpoint = 'https://hcaptcha.com/siteverify';
		}

		/**
		 * Filter endpoint to be used for verify captcha
		 *
		 * @since 1.5.3     forminator_recaptcha_verify_endpoint
		 * @since 1.15.5    Added filter for hcaptcha: forminator_hcaptcha_verify_endpoint
		 *
		 * @param string $endpoint
		 *
		 * @return string
		 */
		$endpoint = apply_filters( 'forminator_' . $provider . '_verify_endpoint', $endpoint );

		return $endpoint;
	}
}


Current_dir [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
22 Jun 2026 6.38 AM
tdhomesa / tdhomesa
0755
abstracts
--
20 Aug 2025 10.03 AM
tdhomesa / tdhomesa
0755
addon
--
20 Aug 2025 10.03 AM
tdhomesa / tdhomesa
0755
calculator
--
20 Aug 2025 10.03 AM
tdhomesa / tdhomesa
0755
external
--
20 Aug 2025 10.03 AM
tdhomesa / tdhomesa
0755
field-autofill-providers
--
20 Aug 2025 10.03 AM
tdhomesa / tdhomesa
0755
fields
--
20 Aug 2025 10.03 AM
tdhomesa / tdhomesa
0755
gateways
--
20 Aug 2025 10.03 AM
tdhomesa / tdhomesa
0755
helpers
--
20 Aug 2025 10.03 AM
tdhomesa / tdhomesa
0755
lib
--
20 Aug 2025 10.03 AM
tdhomesa / tdhomesa
0755
mixpanel
--
20 Aug 2025 10.03 AM
tdhomesa / tdhomesa
0755
model
--
20 Aug 2025 10.03 AM
tdhomesa / tdhomesa
0755
modules
--
20 Aug 2025 10.03 AM
tdhomesa / tdhomesa
0755
protection
--
20 Aug 2025 10.03 AM
tdhomesa / tdhomesa
0755
render
--
20 Aug 2025 10.03 AM
tdhomesa / tdhomesa
0755
class-api.php
54.263 KB
3 Mar 2025 4.08 PM
tdhomesa / tdhomesa
0644
class-autofill-loader.php
6.81 KB
2 Sep 2024 3.32 PM
tdhomesa / tdhomesa
0644
class-captcha-verification.php
3.651 KB
14 Apr 2025 2.55 PM
tdhomesa / tdhomesa
0644
class-core.php
23.687 KB
18 Aug 2025 3.48 PM
tdhomesa / tdhomesa
0644
class-database-tables.php
5.178 KB
2 Sep 2024 3.32 PM
tdhomesa / tdhomesa
0644
class-export-result.php
2.566 KB
2 Sep 2024 3.32 PM
tdhomesa / tdhomesa
0644
class-export.php
60.804 KB
17 Mar 2025 5.29 PM
tdhomesa / tdhomesa
0644
class-form-fields.php
4.995 KB
3 Feb 2025 5.11 PM
tdhomesa / tdhomesa
0644
class-forminator-hub-connector.php
9.266 KB
14 Jul 2025 3.42 PM
tdhomesa / tdhomesa
0644
class-geo.php
4.382 KB
2 Sep 2024 3.32 PM
tdhomesa / tdhomesa
0644
class-integration-loader.php
19.328 KB
3 Feb 2025 5.11 PM
tdhomesa / tdhomesa
0644
class-loader.php
2.536 KB
3 Feb 2025 5.11 PM
tdhomesa / tdhomesa
0644
class-migration.php
28.507 KB
24 Dec 2024 8.31 PM
tdhomesa / tdhomesa
0644
class-modules.php
1.98 KB
2 Sep 2024 3.32 PM
tdhomesa / tdhomesa
0644
class-page-cache.php
8.049 KB
2 Sep 2024 3.32 PM
tdhomesa / tdhomesa
0644
class-protection.php
1.034 KB
2 Sep 2024 3.32 PM
tdhomesa / tdhomesa
0644
class-reports.php
7.193 KB
3 Feb 2025 5.11 PM
tdhomesa / tdhomesa
0644
class-shortcode-generator.php
16.426 KB
25 Nov 2024 9.22 PM
tdhomesa / tdhomesa
0644
class-template-api.php
7.535 KB
3 Mar 2025 4.08 PM
tdhomesa / tdhomesa
0644
class-upgrade.php
1.499 KB
3 Feb 2025 5.11 PM
tdhomesa / tdhomesa
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF