/** * Load action * * @return void */ function load() { $this->add_help_tabs(); $this->_page = Util_Admin::get_current_page(); // run plugin action $action = false; foreach ($_REQUEST as $key => $value) { if (substr($key, 0, 5) == 'w3tc_') { $action = $key; break; } } $executor = new Root_AdminActions(); if ($action && $executor->exists($action)) { if (!wp_verify_nonce(Util_Request::get_string('_wpnonce'), 'w3tc')) { wp_nonce_ays('w3tc'); } try { $executor->execute($action); } catch (\Exception $e) { $key = 'admin_action_failed_' . $action; Util_Admin::redirect_with_custom_messages(array(), array($key => $e->getMessage())); } exit; } }
function __construct() { $this->_config = Dispatcher::config(); $this->_config_master = Dispatcher::config_master(); $this->_page = Util_Admin::get_current_page(); }
<?php namespace W3TC; if (!defined('W3TC')) { die; } $config = Dispatcher::config(); $page = Util_Admin::get_current_page(); $licensing_visible = (!Util_Environment::is_wpmu() || is_network_admin()) && !ini_get('w3tc.license_key') && get_transient('w3tc_license_status') != 'host_valid'; ?> <?php do_action('w3tc-dashboard-head'); ?> <div class="wrap" id="w3tc"> <h2 class="logo"><?php _e('W3 Total Cache <span>by W3 EDGE <sup>®</sup></span>', 'w3-total-cache'); ?> </h2> <?php if (!Util_Environment::is_w3tc_pro($config)) { ?> <?php include W3TC_INC_OPTIONS_DIR . '/edd/buy.php'; } ?> <?php switch ($page) { case 'w3tc_general': $anchors = array(array('id' => 'general', 'text' => __('General', 'w3-total-cache')), array('id' => 'page_cache', 'text' => __('Page Cache', 'w3-total-cache')), array('id' => 'minify', 'text' => 'Minify'), array('id' => 'system_opcache', 'text' => __('Opcode Cache', 'w3-total-cache')), array('id' => 'database_cache', 'text' => __('Database Cache', 'w3-total-cache')), array('id' => 'object_cache', 'text' => __('Object Cache', 'w3-total-cache')));