public static function deactivate()
 {
     do_action("ws_plugin__qcache_before_deactivation", get_defined_vars());
     /**/
     c_ws_plugin__qcache_wp_cache::delete_wp_cache();
     c_ws_plugin__qcache_advanced_cache::delete_advanced();
     c_ws_plugin__qcache_garbage_collection::delete_garbage_collector();
     c_ws_plugin__qcache_auto_cache::delete_auto_cache_engine();
     /**/
     if ($GLOBALS["WS_PLUGIN__"]["qcache"]["o"]["run_deactivation_routines"]) {
         delete_option("ws_plugin__qcache_activated_version");
         delete_option("ws_plugin__qcache_configured");
         delete_option("ws_plugin__qcache_notices");
         delete_option("ws_plugin__qcache_options");
     }
     /**/
     c_ws_plugin__qcache_purging_routines::purge_cache_dir(false, false, false);
     /**/
     do_action("ws_plugin__qcache_after_deactivation", get_defined_vars());
     /**/
     return;
     /* Return for uniformity. */
 }
 public static function update_all_options($new_options = FALSE, $verified = FALSE, $update_other = TRUE, $display_notices = TRUE, $enqueue_notices = FALSE, $request_refresh = FALSE)
 {
     do_action("ws_plugin__qcache_before_update_all_options", get_defined_vars());
     /* If you use this Hook, be sure to use `wp_verify_nonce()`. */
     /**/
     if ($verified || ($nonce = $_POST["ws_plugin__qcache_options_save"]) && wp_verify_nonce($nonce, "ws-plugin--qcache-options-save")) {
         if (!is_multisite() || is_main_site() && is_super_admin()) {
             $options = $GLOBALS["WS_PLUGIN__"]["qcache"]["o"];
             /* Here we get all of the existing options. */
             $new_options = is_array($new_options) ? $new_options : (array) $_POST;
             /* Force array. */
             $new_options = c_ws_plugin__qcache_utils_strings::trim_deep(stripslashes_deep($new_options));
             /**/
             foreach ((array) $new_options as $key => $value) {
                 /* Looking for relevant keys. */
                 if (preg_match("/^" . preg_quote("ws_plugin__qcache_", "/") . "/", $key)) {
                     /**/
                     if ($key === "ws_plugin__qcache_configured") {
                         update_option("ws_plugin__qcache_configured", $value);
                         $GLOBALS["WS_PLUGIN__"]["qcache"]["c"]["configured"] = $value;
                     } else {
                         is_array($value) ? array_shift($value) : null;
                         /* Arrays should be padded. */
                         $key = preg_replace("/^" . preg_quote("ws_plugin__qcache_", "/") . "/", "", $key);
                         $options[$key] = $value;
                         /* Overriding a possible existing option. */
                     }
                 }
             }
             /**/
             $options["options_version"] = (string) ($options["options_version"] + 0.001);
             $options = ws_plugin__qcache_configure_options_and_their_defaults($options);
             /**/
             eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
             do_action("ws_plugin__qcache_during_update_all_options", get_defined_vars());
             unset($__refs, $__v);
             /* Unset defined __refs, __v. */
             /**/
             update_option("ws_plugin__qcache_options", $options);
             /**/
             $updated_all_options = true;
             /* Flag/indication. */
             /**/
             if ($update_other && $options["enabled"]) {
                 if (c_ws_plugin__qcache_wp_cache::add_wp_cache()) {
                     /* Add WP_CACHE to the config file. */
                     if (c_ws_plugin__qcache_advanced_cache::add_advanced()) {
                         /* Add the advanced-cache.php file. */
                         if (c_ws_plugin__qcache_garbage_collection::add_garbage_collector()) {
                             /* Add the garbage collector. */
                             if (c_ws_plugin__qcache_purging_routines::schedule_cache_dir_purge()) {
                                 $enabled = true;
                                 /* Mark this variable as enabled successfully. */
                                 $options["auto_cache_enabled"] ? c_ws_plugin__qcache_auto_cache::add_auto_cache_engine() : c_ws_plugin__qcache_auto_cache::delete_auto_cache_engine();
                                 if (($display_notices === true || in_array("success", (array) $display_notices)) && ($notice = '<strong>Options saved</strong>, and the cache was reset to avoid conflicts.' . ($request_refresh ? ' Please <a href="' . esc_attr($_SERVER["REQUEST_URI"]) . '">refresh</a>.' : '') . '')) {
                                     $enqueue_notices === true || in_array("success", (array) $enqueue_notices) ? c_ws_plugin__qcache_admin_notices::enqueue_admin_notice($notice, "*:*") : c_ws_plugin__qcache_admin_notices::display_admin_notice($notice);
                                 }
                             }
                         }
                     }
                 }
                 /**/
                 if (!$enabled) {
                     if (!function_exists("wp_cron")) {
                         if (($display_notices === true || in_array("success", (array) $display_notices)) && ($notice = '<strong>Error:</strong> Could NOT enable Quick Cache. Your installation of WordPress® is missing the <code>wp_cron</code> function. Some web hosts disable this intentionally. Please contact your web host for assistance.')) {
                             $enqueue_notices === true || in_array("success", (array) $enqueue_notices) ? c_ws_plugin__qcache_admin_notices::enqueue_admin_notice($notice, "*:*", true) : c_ws_plugin__qcache_admin_notices::display_admin_notice($notice, true);
                         }
                     } else {
                         if (($display_notices === true || in_array("success", (array) $display_notices)) && ($notice = '<strong>Error:</strong> Could NOT enable Quick Cache. Please check permissions on <code>/wp-config.php</code>, <code>/wp-content/</code> and <code>/wp-content/cache/</code>. Permissions need to be <code>755</code> or higher.')) {
                             $enqueue_notices === true || in_array("success", (array) $enqueue_notices) ? c_ws_plugin__qcache_admin_notices::enqueue_admin_notice($notice, "*:*", true) : c_ws_plugin__qcache_admin_notices::display_admin_notice($notice, true);
                         }
                     }
                 }
             } else {
                 if ($update_other && !$options["enabled"]) {
                     if (c_ws_plugin__qcache_wp_cache::delete_wp_cache()) {
                         /* Delete WP_CACHE from the config file. */
                         if (c_ws_plugin__qcache_advanced_cache::delete_advanced()) {
                             /* Delete the advanced-cache.php file. */
                             if (c_ws_plugin__qcache_garbage_collection::delete_garbage_collector()) {
                                 /* Delete the garbage collector. */
                                 if (c_ws_plugin__qcache_purging_routines::schedule_cache_dir_purge()) {
                                     $disabled = true;
                                     /* Mark this variable as disabled successfully. */
                                     c_ws_plugin__qcache_auto_cache::delete_auto_cache_engine();
                                     /* Delete Auto-Cache. */
                                     if (($display_notices === true || in_array("success", (array) $display_notices)) && ($notice = '<strong>Options saved.</strong> Quick Cache disabled.' . ($request_refresh ? ' Please <a href="' . esc_attr($_SERVER["REQUEST_URI"]) . '">refresh</a>.' : '') . '')) {
                                         $enqueue_notices === true || in_array("success", (array) $enqueue_notices) ? c_ws_plugin__qcache_admin_notices::enqueue_admin_notice($notice, "*:*") : c_ws_plugin__qcache_admin_notices::display_admin_notice($notice);
                                     }
                                 }
                             }
                         }
                     }
                     /**/
                     if (!$disabled) {
                         if (!function_exists("wp_cron")) {
                             if (($display_notices === true || in_array("success", (array) $display_notices)) && ($notice = '<strong>Error:</strong> Could NOT disable Quick Cache. Your installation of WordPress® is missing the <code>wp_cron</code> function. Some web hosts disable this intentionally. Please contact your web host for assistance.')) {
                                 $enqueue_notices === true || in_array("success", (array) $enqueue_notices) ? c_ws_plugin__qcache_admin_notices::enqueue_admin_notice($notice, "*:*", true) : c_ws_plugin__qcache_admin_notices::display_admin_notice($notice, true);
                             }
                         } else {
                             if (($display_notices === true || in_array("success", (array) $display_notices)) && ($notice = '<strong>Error:</strong> Could NOT disable Quick Cache. Please check permissions on <code>/wp-config.php</code>, <code>/wp-content/</code> and <code>/wp-content/cache/</code>. Permissions need to be <code>755</code> or higher.')) {
                                 $enqueue_notices === true || in_array("success", (array) $enqueue_notices) ? c_ws_plugin__qcache_admin_notices::enqueue_admin_notice($notice, "*:*", true) : c_ws_plugin__qcache_admin_notices::display_admin_notice($notice, true);
                             }
                         }
                     }
                 } else {
                     if (!$update_other) {
                         if (($display_notices === true || in_array("success", (array) $display_notices)) && ($notice = '<strong>Options saved.' . ($request_refresh ? ' Please <a href="' . esc_attr($_SERVER["REQUEST_URI"]) . '">refresh</a>.' : '') . '</strong>')) {
                             $enqueue_notices === true || in_array("success", (array) $enqueue_notices) ? c_ws_plugin__qcache_admin_notices::enqueue_admin_notice($notice, "*:*") : c_ws_plugin__qcache_admin_notices::display_admin_notice($notice);
                         }
                     }
                 }
             }
         } else {
             if (($display_notices === true || in_array("success", (array) $display_notices)) && ($notice = 'Quick Cache can ONLY be modified by a Super Administrator, while operating on the Main Site.')) {
                 $enqueue_notices === true || in_array("success", (array) $enqueue_notices) ? c_ws_plugin__qcache_admin_notices::enqueue_admin_notice($notice, "*:*", true) : c_ws_plugin__qcache_admin_notices::display_admin_notice($notice, true);
             }
         }
     }
     /**/
     do_action("ws_plugin__qcache_after_update_all_options", get_defined_vars());
     /**/
     return $updated_all_options;
     /* Return status update. */
 }
 public static function add_advanced()
 {
     do_action("ws_plugin__qcache_before_add_advanced", get_defined_vars());
     /**/
     if (!c_ws_plugin__qcache_advanced_cache::delete_advanced()) {
         return apply_filters("ws_plugin__qcache_add_advanced", false, get_defined_vars());
     } else {
         if (is_writable(WP_CONTENT_DIR) && (!file_exists(WP_CONTENT_DIR . "/advanced-cache.php") || is_writable(WP_CONTENT_DIR . "/advanced-cache.php")) && ($handler = file_get_contents(dirname(dirname(__FILE__)) . "/templates/handler.tpl.php"))) {
             $handler = preg_replace("/\"%%QUICK_CACHE_ENABLED%%\"/", $GLOBALS["WS_PLUGIN__"]["qcache"]["o"]["enabled"], $handler);
             $handler = preg_replace("/\"%%QUICK_CACHE_ENABLE_DEBUGGING%%\"/", $GLOBALS["WS_PLUGIN__"]["qcache"]["o"]["enable_debugging"], $handler);
             $handler = preg_replace("/\"%%QUICK_CACHE_DONT_CACHE_WHEN_LOGGED_IN%%\"/", $GLOBALS["WS_PLUGIN__"]["qcache"]["o"]["dont_cache_when_logged_in"], $handler);
             $handler = preg_replace("/\"%%QUICK_CACHE_DONT_CACHE_QUERY_STRING_REQUESTS%%\"/", $GLOBALS["WS_PLUGIN__"]["qcache"]["o"]["dont_cache_query_string_requests"], $handler);
             $handler = preg_replace("/\"%%QUICK_CACHE_EXPIRATION%%\"/", $GLOBALS["WS_PLUGIN__"]["qcache"]["o"]["expiration"], $handler);
             $handler = preg_replace("/\"%%QUICK_CACHE_ALLOW_BROWSER_CACHE%%\"/", $GLOBALS["WS_PLUGIN__"]["qcache"]["o"]["allow_browser_cache"], $handler);
             /**/
             $handler = preg_replace("/%%QUICK_CACHE_USE_FLOCK_OR_SEM%%/", $GLOBALS["WS_PLUGIN__"]["qcache"]["o"]["use_flock_or_sem"], $handler);
             /**/
             foreach (preg_split("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["qcache"]["o"]["dont_cache_these_uris"]) as $uri) {
                 if ($uri = trim($uri)) {
                     $uris .= "|" . preg_quote($uri, "/");
                 }
             }
             if ($uris = trim($uris, " \r\n\t\v|")) {
                 $uris = "/" . c_ws_plugin__qcache_utils_strings::esc_dq($uris) . "/";
             }
             $handler = preg_replace("/%%QUICK_CACHE_DONT_CACHE_THESE_URIS%%/", $uris, $handler);
             /**/
             foreach (preg_split("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["qcache"]["o"]["dont_cache_these_refs"]) as $ref) {
                 if ($ref = trim($ref)) {
                     $refs .= "|" . preg_quote($ref, "/");
                 }
             }
             if ($refs = trim($refs, " \r\n\t\v|")) {
                 $refs = "/" . c_ws_plugin__qcache_utils_strings::esc_dq($refs) . "/i";
             }
             $handler = preg_replace("/%%QUICK_CACHE_DONT_CACHE_THESE_REFS%%/", $refs, $handler);
             /**/
             foreach (preg_split("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["qcache"]["o"]["dont_cache_these_agents"]) as $agent) {
                 if ($agent = trim($agent)) {
                     $agents .= "|" . preg_quote($agent, "/");
                 }
             }
             if ($agents = trim($agents, " \r\n\t\v|")) {
                 $agents = "/" . c_ws_plugin__qcache_utils_strings::esc_dq($agents) . "/i";
             }
             $handler = preg_replace("/%%QUICK_CACHE_DONT_CACHE_THESE_AGENTS%%/", $agents, $handler);
             /**/
             if (strlen($GLOBALS["WS_PLUGIN__"]["qcache"]["o"]["version_salt"])) {
                 if (file_put_contents(WP_CONTENT_DIR . "/qcache-salt-ok.php", '<?php error_reporting(0); $v = ' . $GLOBALS["WS_PLUGIN__"]["qcache"]["o"]["version_salt"] . '; echo "ok"; ?>')) {
                     $salt_ok = ($syntax_check = c_ws_plugin__qcache_utils_urls::remote(WP_CONTENT_URL . "/qcache-salt-ok.php")) === "ok" ? true : false;
                     if (!$salt_ok) {
                         /* If we could not validate the syntax of their salt, we need to notify them that it will not be used. */
                         c_ws_plugin__qcache_admin_notices::enqueue_admin_notice("<strong>Quick Cache:</strong> Your MD5 Version Salt may contain syntax errors. Please check it and try again. Otherwise, if you are unable to correct the problem, your Salt will simply be ignored. Quick Cache will continue to function properly using its default setting.", "blog|network:ws-plugin--qcache-options", true);
                     }
                     unlink(WP_CONTENT_DIR . "/qcache-salt-ok.php");
                 }
             }
             $handler = preg_replace("/\"%%QUICK_CACHE_VERSION_SALT%%\"/", $salt_ok ? $GLOBALS["WS_PLUGIN__"]["qcache"]["o"]["version_salt"] : '""', $handler);
             /**/
             eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
             do_action("ws_plugin__qcache_during_add_advanced", get_defined_vars());
             unset($__refs, $__v);
             /* Unset defined __refs, __v. */
             /**/
             file_put_contents(WP_CONTENT_DIR . "/advanced-cache.php", trim($handler));
             /**/
             return apply_filters("ws_plugin__qcache_add_advanced", true, get_defined_vars());
         } else {
             return apply_filters("ws_plugin__qcache_add_advanced", false, get_defined_vars());
         }
     }
 }