# searchpro/4.1.12/inc/thirdparty/hosting/Pantheon.php

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

- Page: https://pluginprobe.com/plugins/searchpro/4.1.12/code/inc/thirdparty/hosting/Pantheon.php
- Raw: https://pluginprobe.com/plugins/searchpro/4.1.12/raw/inc/thirdparty/hosting/Pantheon.php
- Modified: 2024-08-20T18:00:30+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.1.12/code/inc/thirdparty/hosting/Pantheon.php#L10-L20`.

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

class Pantheon extends berqIntegrations {
    public $page_url = null;

    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_page_cache']);
    }

    function flush_cache() {
        if (class_exists('Pantheon_Cache')) {
            $Pantheon_Cache = new Pantheon_Cache();
            $Pantheon_Cache->flush_site();
        }
    }

    function flush_page_cache($slug) {

        if (!class_exists('Pantheon_Cache')) {
            return;
        }

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

        $this->page_url = home_url() . $slug;

        add_filter('pantheon_final_clean_urls', [$this, 'add_page_flush_queue']);
    }

    function add_page_flush_queue($paths) {
        $paths[] = $this->page_url;

        return $paths;
    }
}

new Pantheon();
```
