# searchpro/4.0.19/api/update_configs.php

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

- Page: https://pluginprobe.com/plugins/searchpro/4.0.19/code/api/update_configs.php
- Raw: https://pluginprobe.com/plugins/searchpro/4.0.19/raw/api/update_configs.php
- Modified: 2026-05-20T05:06:54+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.19/code/api/update_configs.php#L10-L20`.

```php
<?php

if (!defined('ABSPATH')) exit;

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

    if (defined('DOING_CRON') && DOING_CRON) {
        return;
    }

    if (defined('DOING_AJAX') && DOING_AJAX) {
        return;
    }

    if (defined('REST_REQUEST') && REST_REQUEST) {
        return;
    }

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

    if ($data == null) {
        return;
    }

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

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

    if (empty($settings)) {
        return;
    }

    // Sanitize
    $valid_setting_names = [
        'berqwp_fluid_images',
        'berqwp_can_use_fluid_images',
        'berqwp_license_key',
    ];

    foreach ($settings as $setting_name => $setting_value) {
    
        // skip invalid name
        if (!in_array($setting_name, $valid_setting_names)) {
            continue;
        }

        switch ($setting_name) {

            case 'berqwp_can_use_fluid_images':
                update_option($setting_name, $setting_value);
                update_option('bwp_require_flush_cache', 1);
                break;

            case 'berqwp_license_key':
                update_option($setting_name, $setting_value);
                break;

        }


    }

    
    exit;
}
```
