Ejemplo n.º 1
0
 public static function ajax_clearPageCache_callback()
 {
     $stats = wfCache::clearPageCache();
     if ($stats['error']) {
         $body = "A total of " . $stats['totalErrors'] . " errors occurred while trying to clear your cache. The last error was: " . $stats['error'];
         return array('ok' => 1, 'heading' => 'Error occurred while clearing cache', 'body' => $body);
     }
     $body = "A total of " . $stats['filesDeleted'] . ' files were deleted and ' . $stats['dirsDeleted'] . ' directories were removed. We cleared a total of ' . $stats['totalData'] . 'KB of data in the cache.';
     if ($stats['totalErrors'] > 0) {
         $body .= ' A total of ' . $stats['totalErrors'] . ' errors were encountered. This probably means that we could not remove some of the files or directories in the cache. Please use your CPanel or file manager to remove the rest of the files in the directory: ' . WP_CONTENT_DIR . '/wfcache/';
     }
     return array('ok' => 1, 'heading' => 'Page Cache Cleared', 'body' => $body);
 }
function wordfence_clean_falcon_cache()
{
    if (class_exists('wfCache') && method_exists('wfCache', 'clearPageCache') && is_callable(array('wfCache', 'clearPageCache'))) {
        wfCache::clearPageCache();
    }
}