| 1 |
<?php |
| 2 |
if (!defined('ABSPATH')) |
| 3 |
exit; |
| 4 |
|
| 5 |
if (class_exists('HMWP_Models_Compatibility_Abstract')) { |
| 6 |
class HideMyWPGhost extends HMWP_Models_Compatibility_Abstract |
| 7 |
{ |
| 8 |
function __construct() |
| 9 |
{ |
| 10 |
add_filter('template_redirect', [$this, 'disable_plugin']); |
| 11 |
add_filter('berqwp_cache_buffer', [$this, 'findReplaceCache'], PHP_INT_MAX); |
| 12 |
} |
| 13 |
|
| 14 |
function disable_plugin() |
| 15 |
{ |
| 16 |
$bypass_cache = apply_filters( 'berqwp_bypass_cache', false ); |
| 17 |
|
| 18 |
if ($bypass_cache) { |
| 19 |
add_filter('hmwp_process_buffer', '__return_false'); |
| 20 |
add_filter('hmwp_process_find_replace', '__return_false'); |
| 21 |
} |
| 22 |
} |
| 23 |
|
| 24 |
function findReplaceCache($content) { |
| 25 |
return HMWP_Classes_ObjController::getClass('HMWP_Models_Rewrite')->getBuffer($content);; |
| 26 |
} |
| 27 |
|
| 28 |
|
| 29 |
} |
| 30 |
new HideMyWPGhost(); |
| 31 |
} |