PluginProbe
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript / trunk
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript vtrunk
4.1.15 4.1.14 4.1.13 4.1.12 4.1.11 4.1.10 4.0.30 4.0.29 4.0.28 4.0.27 4.0.26 4.0.24 4.0.25 4.0.23 4.0.22 4.0.21 4.0.19 4.0.18 4.0.17 4.0.16 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 All 169 releases
searchpro / api / check_status.php

check_status.php in BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript trunk, at api/check_status.php

35 lines 997 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if (!defined('ABSPATH')) exit;
3
4 if ($_SERVER['REQUEST_METHOD'] === 'POST' && !empty($_GET['berqwp_webhook']) && $_GET['berqwp_webhook'] == 'check_status') {
5
6 $jsonData = file_get_contents('php://input');
7 $data = json_decode($jsonData, true);
8
9 if ($data === null) {
10 echo wp_json_encode(['status' => 'error', 'msg' => 'Invalid request body']);
11 exit;
12 }
13
14 $license_key = berqwp_get_license_key();
15 $license_key_hash = sanitize_text_field($data['license_key_hash'] ?? '');
16
17 if (empty($license_key)) {
18 echo wp_json_encode(['status' => 'inactive']);
19 exit;
20 }
21
22 if (empty($license_key_hash) || $license_key_hash !== md5($license_key)) {
23 echo wp_json_encode(['status' => 'error', 'msg' => 'Request authentication failed']);
24 http_response_code(403);
25 exit;
26 }
27
28 echo wp_json_encode([
29 'status' => 'active',
30 'version' => BERQWP_VERSION,
31 'site_url' => home_url(),
32 ]);
33 exit;
34 }
35