if (is_dir($cache_dir) && ($dh = opendir($cache_dir))) { while (($dir = readdir($dh)) !== false) { if (!in_array($dir, array('.', '..', 'scripts', 'styles', "{$post_id}"))) { self::removeDirectory($cache_dir . '/' . $dir); } } closedir($dh); } } public static function check_version() { return version_compare(PHP_VERSION, '5.4', '>='); } } if (TFCache::check_version() && themify_get('setting-page_builder_is_active') == 'enable') { if (!is_admin() && !TFCache::is_ajax()) { TFCache::$turnoff_cache = TFCache::is_cache_activate(); if (!TFCache::$turnoff_cache) { $dirname = dirname(__FILE__); require_once $dirname . '/minify/minify.php'; require_once $dirname . '/minify/css.php'; require_once $dirname . '/minify/html.php'; require_once $dirname . '/minify/converter.php'; TFCache::wp_enque_scripts(); } } elseif (is_admin()) { add_action('save_post', array('TFCache', 'cache_update'), 10, 3); } } else { TFCache::$turnoff_cache = true; }