/** * Static wrapper for _store() * @see _store() * * @since 1.0.0 */ static function store() { $instance = WP_Fragment_Cache::get_instance(); if ($instance->is_enabled) { $instance->_store(); } }
/** * Fired when the plugin settings page is loaded and check if it need to purge the cache. * * @since 1.0.0 * */ public function on_load_plugin_admin_page() { if (isset($_GET['wp_fragment_cache_nonce']) && isset($_GET['action'])) { if (wp_verify_nonce($_GET['wp_fragment_cache_nonce'], 'purge')) { switch ($_GET['action']) { case 'purge': WP_Fragment_Cache::purge(); $redirect_url = remove_query_arg('settings-updated'); $redirect_url = add_query_arg(array('action' => 'done'), $redirect_url); wp_redirect($redirect_url); break; case 'done': if (!isset($_GET['settings-updated'])) { add_action('admin_notices', array($this, 'purge_done_notice')); } break; } } } }