X7ROOT File Manager
Current Path:
/home/oakwood/public_html/wp-content/plugins/powerpack-elements/classes
home
/
oakwood
/
public_html
/
wp-content
/
plugins
/
powerpack-elements
/
classes
/
ðŸ“
..
📄
class-pp-admin-settings.php
(26.72 KB)
📄
class-pp-attachment.php
(1.53 KB)
📄
class-pp-config.php
(56.45 KB)
📄
class-pp-faq-schema.php
(3.64 KB)
📄
class-pp-header-footer.php
(13.9 KB)
📄
class-pp-helper.php
(20.15 KB)
📄
class-pp-login-register.php
(5.67 KB)
📄
class-pp-magic-wand.php
(10.45 KB)
📄
class-pp-posts-helper.php
(5.06 KB)
📄
class-pp-recaptcha.php
(2.19 KB)
📄
class-pp-taxonomy-thumbnail.php
(8.31 KB)
📄
class-pp-templates-lib.php
(21.52 KB)
📄
class-pp-woo-builder-preview.php
(7.63 KB)
📄
class-pp-woo-builder.php
(17.8 KB)
📄
class-pp-woo-helper.php
(10.65 KB)
📄
class-pp-wpml.php
(67.69 KB)
ðŸ“
theme-support
ðŸ“
wpml
Editing: class-pp-recaptcha.php
<?php /** * Handles logic for reCAPTCHA. */ class PP_ReCaptcha { /** * Google reCAPTCHA Secret Key * * @var $secret_key */ private $secret_key; /** * Validate Type * * @var $validate_type */ private $validate_type; /** * Response * * @var $response */ private $response; /** * Is Success * * @var $is_success */ protected $is_success = false; /** * Error * * @var $error */ protected $error = false; /** * __construct * * @param mixed $secret_key Secret key. * @param mixed $validate_type validation type. * @param mixed $response response. */ public function __construct( $secret_key, $validate_type, $response ) { $this->secret_key = $secret_key; $this->validate_type = $validate_type; $this->response = $response; // Do recaptcha validation here so we can only load for php 5.3 and above. require_once POWERPACK_ELEMENTS_PATH . 'includes/vendor/recaptcha/autoload.php'; $this->verify_recaptcha(); } /** * Verify Recaptcha */ private function verify_recaptcha() { if ( function_exists( 'curl_exec' ) ) { $recaptcha = new \ReCaptcha\ReCaptcha( $this->secret_key, new \ReCaptcha\RequestMethod\CurlPost() ); } else { $recaptcha = new \ReCaptcha\ReCaptcha( $this->secret_key ); } if ( 'invisible_v3' === $this->validate_type ) { // @codingStandardsIgnoreStart // V3 $response = $recaptcha->setExpectedHostname( $_SERVER['SERVER_NAME'] ) ->setExpectedAction( 'Form' ) ->setScoreThreshold( 0.5 ) ->verify( $this->response, $_SERVER['REMOTE_ADDR'] ); // @codingStandardsIgnoreEnd } else { // V2. $response = $recaptcha->verify( $this->response, $_SERVER['REMOTE_ADDR'] ); } if ( ! $response->isSuccess() ) { $this->is_success = false; $error_codes = array(); foreach ( $response->getErrorCodes() as $code ) { $error_codes[] = $code; } $this->error = implode( ' | ', $error_codes ); } else { $this->is_success = true; $this->error = false; } } /** * Check if success */ public function is_success() { return $this->is_success; } /** * Get error message */ public function get_error_message() { return $this->error; } }
Upload File
Create Folder