| 1 |
<?php |
| 2 |
namespace JFB_Modules\Validation\Handlers; |
| 3 |
|
| 4 |
use JFB_Modules\Validation\Handlers\Validation_Handler; |
| 5 |
|
| 6 |
// If this file is called directly, abort. |
| 7 |
if ( ! defined( 'WPINC' ) ) { |
| 8 |
die; |
| 9 |
} |
| 10 |
|
| 11 |
class Self_Validation_Handler { |
| 12 |
public function __construct() { |
| 13 |
add_action( 'init', array( $this, 'jet_fb_ssr_self_validation' ) ); |
| 14 |
} |
| 15 |
public function jet_fb_ssr_self_validation() { |
| 16 |
if ( isset( $_GET['jet_fb_ssr_self_validation'] ) && '1' === $_GET['jet_fb_ssr_self_validation'] ) { |
| 17 |
nocache_headers(); |
| 18 |
$body = $_GET; |
| 19 |
$result = Validation_Handler::validate( $body ); |
| 20 |
wp_send_json( $result ); |
| 21 |
} |
| 22 |
} |
| 23 |
} |
| 24 |
|