PluginProbe
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript / 4.0.17
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript v4.0.17
4.1.16 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 All 170 releases
searchpro / api / check_status.php

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

35 lines 985 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 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 json_encode(['status' => 'inactive']);
19 exit;
20 }
21
22 if (empty($license_key_hash) || $license_key_hash !== md5($license_key)) {
23 echo json_encode(['status' => 'error', 'msg' => 'Request authentication failed']);
24 http_response_code(403);
25 exit;
26 }
27
28 echo json_encode([
29 'status' => 'active',
30 'version' => BERQWP_VERSION,
31 'site_url' => home_url(),
32 ]);
33 exit;
34 }
35