# searchpro/4.0.22/inc/thirdparty/hosting/Pressable.php

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

- Page: https://pluginprobe.com/plugins/searchpro/4.0.22/code/inc/thirdparty/hosting/Pressable.php
- Raw: https://pluginprobe.com/plugins/searchpro/4.0.22/raw/inc/thirdparty/hosting/Pressable.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/inc/thirdparty/hosting/Pressable.php#L10-L20`.

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

class Pressable extends berqIntegrations {

    function __construct() {
        add_action('berqwp_flush_all_cache', [$this, 'flush_cache']);
        add_action('berqwp_stored_page_cache', [$this, 'flush_page_cache']);
        add_action('berqwp_flush_page_cache', [$this, 'flush_cache']);
        add_action('init', [$this, 'bypass_cache']);
    }

    function bypass_cache() {
        if (!$this->is_pressable()) {
            return;
        }

        $bypass_cache = apply_filters( 'berqwp_bypass_cache', false );

        if ($bypass_cache) {
            berqReverseProxyCache::bypass();
        }
    }

    function is_pressable() {
        return isset($_SERVER["PRESSABLE_PROXIED_REQUEST"]) || strpos(gethostname(), "atomicsites.net") !== false;
    }

    function flush_cache() {

        if (!$this->is_pressable()) {
            return;
        }

        wp_cache_flush();
        berqReverseProxyCache::flush_all();
    }

    function flush_page_cache($slug) {

        if (!$this->is_pressable()) {
            return;
        }

        if (empty($slug)) {
            $slug = '/';
        }

        berqReverseProxyCache::purge_cache(home_url($slug));
    }

}

new Pressable();
```
