# searchpro/4.1.13/inc/thirdparty/plugin/HideMyWPGhost.php

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

- Page: https://pluginprobe.com/plugins/searchpro/4.1.13/code/inc/thirdparty/plugin/HideMyWPGhost.php
- Raw: https://pluginprobe.com/plugins/searchpro/4.1.13/raw/inc/thirdparty/plugin/HideMyWPGhost.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.13/code/inc/thirdparty/plugin/HideMyWPGhost.php#L10-L20`.

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

if (class_exists('HMWP_Models_Compatibility_Abstract')) {
    class HideMyWPGhost extends HMWP_Models_Compatibility_Abstract
    {
        function __construct()
        {
            add_filter('template_redirect', [$this, 'disable_plugin']);
            add_filter('berqwp_cache_buffer', [$this, 'findReplaceCache'], PHP_INT_MAX);
        }

        function disable_plugin()
        {
            $bypass_cache = apply_filters( 'berqwp_bypass_cache', false );

            if ($bypass_cache) {
                add_filter('hmwp_process_buffer', '__return_false');
                add_filter('hmwp_process_find_replace', '__return_false');
            }
        }

        function findReplaceCache($content) {
            return HMWP_Classes_ObjController::getClass('HMWP_Models_Rewrite')->getBuffer($content);;
        }


    }
    new HideMyWPGhost();
}
```
