PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.6.5
JetFormBuilder — Dynamic Blocks Form Builder v3.6.5
3.6.5.1 3.6.5 3.6.4.2 3.6.4.1 3.6.4 3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / modules / captcha / hcaptcha / verify-token-action.php
jetformbuilder / modules / captcha / hcaptcha Last commit date
hcaptcha.php 1 week ago verify-token-action.php 1 week ago
verify-token-action.php
57 lines
1 <?php
2
3
4 namespace JFB_Modules\Captcha\Hcaptcha;
5
6 use Jet_Form_Builder\Exceptions\Gateway_Exception;
7 use JFB_Modules\Captcha\Module;
8 use JFB_Modules\Captcha\Re_Captcha_V3\Verify_Token_Action as BaseVerify;
9
10 class Verify_Token_Action extends BaseVerify {
11
12 private $site_key;
13
14 public function base_url(): string {
15 return 'https://hcaptcha.com/';
16 }
17
18 public function before_make_request() {
19 parent::before_make_request();
20
21 if ( $this->site_key ) {
22 return;
23 }
24
25 // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
26 throw new Gateway_Exception( Module::SPAM_EXCEPTION, 'Empty site key. Spammer detected' );
27 }
28
29 public function send_request() {
30 $this->request();
31 $this->response_body_as_array();
32
33 $response = $this->get_response_body();
34
35 if ( ! empty( $response['success'] ) ) {
36 return $response;
37 }
38
39 // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
40 throw new Gateway_Exception( Module::SPAM_EXCEPTION );
41 }
42
43 public function set_site_key( string $site_key ): Verify_Token_Action {
44 $this->site_key = $site_key;
45
46 return $this;
47 }
48
49 public function action_body() {
50 return array_merge(
51 parent::action_body(),
52 array( 'sitekey' => $this->site_key )
53 );
54 }
55
56 }
57