| @@ -6,9 +6,9 @@ | ||
| 6 | 6 | $jsonData = file_get_contents('php://input'); |
| 7 | 7 | $data = json_decode($jsonData, true); |
| 8 | 8 | |
| 9 | 9 | if ($data === null) { |
| 10 | - echo json_encode(['status' => 'error', 'msg' => 'Invalid request body']); | |
| 10 | + echo wp_json_encode(['status' => 'error', 'msg' => 'Invalid request body']); | |
| 11 | 11 | exit; |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | $license_key = berqwp_get_license_key(); |
| @@ -14,19 +14,19 @@ | ||
| 14 | 14 | $license_key = berqwp_get_license_key(); |
| 15 | 15 | $license_key_hash = sanitize_text_field($data['license_key_hash'] ?? ''); |
| 16 | 16 | |
| 17 | 17 | if (empty($license_key)) { |
| 18 | - echo json_encode(['status' => 'inactive']); | |
| 18 | + echo wp_json_encode(['status' => 'inactive']); | |
| 19 | 19 | exit; |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | if (empty($license_key_hash) || $license_key_hash !== md5($license_key)) { |
| 23 | - echo json_encode(['status' => 'error', 'msg' => 'Request authentication failed']); | |
| 23 | + echo wp_json_encode(['status' => 'error', 'msg' => 'Request authentication failed']); | |
| 24 | 24 | http_response_code(403); |
| 25 | 25 | exit; |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - echo json_encode([ | |
| 28 | + echo wp_json_encode([ | |
| 29 | 29 | 'status' => 'active', |
| 30 | 30 | 'version' => BERQWP_VERSION, |
| 31 | 31 | 'site_url' => home_url(), |
| 32 | 32 | ]); |