# searchpro/4.1.20/inc/thirdparty/hosting/GoDaddy.php

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

- Page: https://pluginprobe.com/plugins/searchpro/4.1.20/code/inc/thirdparty/hosting/GoDaddy.php
- Raw: https://pluginprobe.com/plugins/searchpro/4.1.20/raw/inc/thirdparty/hosting/GoDaddy.php
- Modified: 2026-10-06T13:24:46+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.20/code/inc/thirdparty/hosting/GoDaddy.php#L10-L20`.

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

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

    function flush_cache() {
        $vip_url = $this->get_vip_url();
        if (empty($vip_url)) {
            return;
        }
        $this->purge_request($vip_url, 'BAN', berqwp_home_url());
    }

    function flush_page_cache($slug) {
        $vip_url = $this->get_vip_url();
        if (empty($vip_url)) {
            return;
        }
        if (empty($slug)) {
            $slug = '/';
        }
        $this->purge_request($vip_url, 'BAN', berqwp_home_url() . $slug);
    }

    private function get_vip_url(): string {
        if (!method_exists('\WPaas\Plugin', 'vip')) {
            return '';
        }
        return (string) \WPaas\Plugin::vip();
    }

    private function purge_request(string $vip_url, string $method, string $url) {
        $host    = wp_parse_url($url, PHP_URL_HOST);
        $request = untrailingslashit(set_url_scheme(str_replace($host, $vip_url, $url), 'http'));

        wp_cache_flush();
        update_option('gd_system_last_cache_flush', time());

        wp_remote_request(esc_url_raw($request), [
            'method'   => $method,
            'blocking' => false,
            'headers'  => ['Host' => $host],
        ]);
    }
}

new GoDaddy();

```
