PluginProbe
Age Gate / 3.7.3
Age Gate v3.7.3
3.7.3 trunk 1.0.0 1.0.1 1.1.0 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 All 113 releases
age-gate / src / Legacy / Check.php

Check.php in Age Gate 3.7.3, at src/Legacy/Check.php

32 lines 759 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace AgeGate\Legacy;
4
5 use AgeGate\Common\Settings;
6 use AgeGate\Common\Form\Submit;
7
8
9 class Check
10 {
11 private $settings;
12
13 public function __construct()
14 {
15 add_action('init', function() {
16 $this->settings = Settings::getInstance();
17
18 if (!$this->settings->disableAjaxFallback) {
19 add_action('wp_ajax_ag_check', [$this, 'check']);
20 add_action('wp_ajax_nopriv_ag_check', [$this, 'check']);
21 }
22 });
23 }
24
25 public function check()
26 {
27 // Nonce verification is not viable with caching plugins
28 wp_send_json((new Submit($_POST, $this->settings))->validate()); // phpcs:ignore WordPress.Security.NonceVerification.Missing
29 wp_die();
30 }
31 }
32