# searchpro/4.0.22/api/check_status.php

BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS &amp; JavaScript, version 4.0.22. 35 lines.

- Page: https://pluginprobe.com/plugins/searchpro/4.0.22/code/api/check_status.php
- Raw: https://pluginprobe.com/plugins/searchpro/4.0.22/raw/api/check_status.php
- Modified: 2026-05-23T17:51:10+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/searchpro/4.0.22/code/api/check_status.php#L10-L20`.

```php
<?php
if (!defined('ABSPATH')) exit;

if ($_SERVER['REQUEST_METHOD'] === 'POST' && !empty($_GET['berqwp_webhook']) && $_GET['berqwp_webhook'] == 'check_status') {

    $jsonData = file_get_contents('php://input');
    $data = json_decode($jsonData, true);

    if ($data === null) {
        echo json_encode(['status' => 'error', 'msg' => 'Invalid request body']);
        exit;
    }

    $license_key = berqwp_get_license_key();
    $license_key_hash = sanitize_text_field($data['license_key_hash'] ?? '');

    if (empty($license_key)) {
        echo json_encode(['status' => 'inactive']);
        exit;
    }

    if (empty($license_key_hash) || $license_key_hash !== md5($license_key)) {
        echo json_encode(['status' => 'error', 'msg' => 'Request authentication failed']);
        http_response_code(403);
        exit;
    }

    echo json_encode([
        'status'   => 'active',
        'version'  => BERQWP_VERSION,
        'site_url' => home_url(),
    ]);
    exit;
}

```
