/**
  * Print JS required by the support nag.
  */
 function admin_head()
 {
     $state = Dispatcher::config_state_master();
     // support us
     $support_reminder = $state->get_integer('common.support_us_invitations') < 3 && $state->get_integer('common.install') < time() - W3TC_SUPPORT_US_TIMEOUT && $state->get_integer('common.next_support_us_invitation') < time() && $this->_config->get_string('common.support') == '' && !$this->_config->get_boolean('common.tweeted');
     if ($support_reminder) {
         $state->set('common.next_support_us_invitation', time() + W3TC_SUPPORT_US_TIMEOUT);
         $state->set('common.support_us_invitations', $state->get_integer('common.support_us_invitations') + 1);
         $state->save();
         do_action('w3tc_message_action_generic_support_us');
     }
     // edge mode
     $edge_reminder = !$support_reminder && !Util_Environment::is_w3tc_edge($this->_config) && $state->get_integer('common.edge_invitations') < 3 && $state->get_integer('common.install') < time() - W3TC_EDGE_TIMEOUT && $state->get_integer('common.next_edge_invitation') < time();
     if ($edge_reminder) {
         if ($state->get_integer('common.edge_invitations') > 1) {
             $next = time() + 30 * 24 * 60 * 60;
         } else {
             $next = time() + W3TC_EDGE_TIMEOUT;
         }
         $state->set('common.next_edge_invitation', $next);
         $state->set('common.edge_invitations', $state->get_integer('common.edge_invitations') + 1);
         $state->save();
         do_action('w3tc_message_action_generic_edge');
     }
 }
 public function admin_print_scripts_w3tc_general()
 {
     $state = Dispatcher::config_state();
     if (!$state->get_boolean('minify.hide_minify_help') && !Util_Environment::is_w3tc_edge($this->_config) && !Util_Environment::is_w3tc_enterprise($this->_config)) {
         wp_enqueue_script('w3tc-minify-help', plugins_url('Minify_GeneralPage_View_ShowHelp.js', W3TC_FILE), array(), W3TC_VERSION);
     }
 }
 public function admin_init()
 {
     $config = Dispatcher::config();
     $groups = $config->get_array('mobile.rgroups');
     if (Util_Environment::is_w3tc_edge($config) && isset($groups['google']) && sizeof($groups['google']['agents']) == 1 && $groups['google']['agents'][0] == 'googlebot') {
         w3tc_delete_user_agent_group('google');
     }
 }
Beispiel #4
0
 /**
  * Parses FAQ XML file into array
  *
  * @return array
  */
 public static function parse()
 {
     $config = Dispatcher::config();
     $faq = array();
     self::parse_file($faq, 'faq', '', '');
     if (Util_Environment::is_w3tc_edge($config)) {
         self::parse_file($faq, 'faq-edge', 'edge', '<b>Edge:</b> ');
     }
     if (Util_Environment::is_w3tc_pro($config)) {
         self::parse_file($faq, 'faq-pro', 'pro', '<b>Pro:</b> ');
     }
     return $faq;
 }
                </th>
            </tr>
            <?php 
Util_Ui::config_item(array('key' => 'common.track_usage', 'control' => 'checkbox', 'checkbox_label' => __('Anonymously track usage to improve product quality', 'w3-total-cache'), 'style' => '2'));
?>

            <?php 
do_action('w3tc_settings_general_boxarea_miscellaneous_content');
?>
            <?php 
if (is_network_admin() || !Util_Environment::is_wpmu()) {
    ?>
            <tr id="edge_mode">
                <th colspan="2">
                    <?php 
    if (!Util_Environment::is_w3tc_edge($this->_config)) {
        echo '<a href="' . Util_Ui::url(array('w3tc_edge_mode_enable' => 'y')) . '"><strong>' . __('Enable Edge mode', 'w3-total-cache') . '</strong></a>';
    } else {
        echo '<a href="' . Util_Ui::url(array('w3tc_edge_mode_disable' => 'y')) . '"><strong>' . __('Disable Edge mode', 'w3-total-cache') . '</strong></a>';
    }
    ?>
                    <br /><span class="description"><?php 
    _e('Enable this to try out new functionality under development. Might cause issues on some sites.', 'w3-total-cache');
    ?>
</span>
                </th>
            </tr>
            <?php 
}
?>
        </table>
Beispiel #6
0
<?php

namespace W3TC;

if (!defined('W3TC')) {
    die;
}
include W3TC_INC_DIR . '/options/common/header.php';
?>

<p>
    <?php 
echo sprintf(__('The plugin is currently <span class="w3tc-%s">%s</span> in <strong>%s%s</strong> mode.', 'w3-total-cache'), $enabled ? "enabled" : "disabled", $enabled ? __('enabled', 'w3-total-cache') : __('disabled', 'w3-total-cache'), Util_Environment::w3tc_edition($this->_config), Util_Environment::is_w3tc_edge($this->_config) ? __(' edge', 'w3-total-cache') : '');
?>
</p>
<form id="w3tc_dashboard" action="admin.php?page=<?php 
echo $this->_page;
?>
" method="post">
    <p>
        Perform a
        <input type="button" class="button button-self-test {nonce: '<?php 
echo wp_create_nonce('w3tc');
?>
'}" value="<?php 
_e('compatibility check', 'w3-total-cache');
?>
" />,
        <?php 
echo Util_Ui::nonce_field('w3tc');
?>