<?php

namespace W3TC;

if (!defined('W3TC')) {
    die;
}
Util_Ui::postbox_header(__('<acronym title="Content Delivery Network">CDN</acronym>', 'w3-total-cache'), '', 'cdn');
Util_Ui::config_overloading_button(array('key' => 'cdn.configuration_overloaded'));
?>
<p><?php 
_e('Host static files with your content delivery network provider to reduce page load time.', 'w3-total-cache');
if (!$cdn_enabled) {
    printf(__('If you do not have a <acronym title="Content Delivery Network">CDN</acronym> provider try MaxCDN. <a href="%s" target="_blank">Sign up and save 25&#37;</a>.', 'w3-total-cache'), wp_nonce_url(Util_Ui::admin_url('admin.php?page=w3tc_dashboard&w3tc_cdn_maxcdn_signup'), 'w3tc'));
}
?>
</p>
<table class="form-table">
    <?php 
Util_Ui::config_item(array('key' => 'cdn.enabled', 'control' => 'checkbox', 'checkbox_label' => __('Enable', 'w3-total-cache'), 'description' => __('Theme files, media library attachments, <acronym title="Cascading Style Sheet">CSS</acronym>, <acronym title="JavaScript">JS</acronym> files etc will appear to load instantly for site visitors.', 'w3-total-cache')));
Util_Ui::config_item(array('key' => 'cdn.engine', 'control' => 'selectbox', 'selectbox_values' => $engine_values, 'selectbox_optgroups' => $engine_optgroups, 'description' => __('Select the <acronym title="Content Delivery Network">CDN</acronym> type you wish to use.', 'w3-total-cache') . $cdn_engine_extra_description));
?>
</table>

<?php 
Util_Ui::button_config_save('general_cdn', '<input id="cdn_purge" type="button" value="' . __('Empty cache', 'w3-total-cache') . '" ' . ($cdn_enabled && Cdn_Util::can_purge_all($config->get_string('cdn.engine')) ? '' : ' disabled="disabled" ') . ' class="button {nonce: \'' . wp_create_nonce('w3tc') . '\'}" />');
Util_Ui::postbox_footer();
            <?php 
Util_Ui::sealing_disabled($module);
?>
            value="<?php 
echo esc_attr(implode(',', $config->get_array(array($module, 'memcached.servers'))));
?>
" size="80" />
        <input id="memcached_test" class="button {nonce: '<?php 
echo wp_create_nonce('w3tc');
?>
'}"
            <?php 
Util_Ui::sealing_disabled($module);
?>
            type="button" value="<?php 
esc_attr_e('Test', 'w3-total-cache');
?>
" />
        <span id="memcached_test_status" class="w3tc-status w3tc-process"></span>
        <br /><span class="description"><?php 
_e('Multiple servers may be used and seperated by a comma; e.g. 192.168.1.100:11211, domain.com:22122', 'w3-total-cache');
?>
</span>
    </td>
</tr>
<?php 
Util_Ui::config_item(array('key' => array($module, 'memcached.persistent'), 'label' => __('Use persistent connection:', 'w3-total-cache'), 'control' => 'checkbox', 'checkbox_label' => Util_ConfigLabel::get('memcached.persistent'), 'description' => 'Using persistent connection doesn\'t reinitialize memcached driver on each request'));
Util_Ui::config_item(array('key' => array($module, 'memcached.aws_autodiscovery'), 'label' => __('Node Auto Discovery:', 'w3-total-cache'), 'control' => 'checkbox', 'checkbox_label' => 'Amazon Node Auto Discovery', 'disabled' => Util_Installed::memcached_aws() ? null : true, 'description' => !Util_Installed::memcached_aws() ? __('ElastiCache PHP module not found', 'w3-total-cache') : __('When Amazon ElastiCache used, specify configuration endpoint as Memecached host', 'w3-total-cache')));
Util_Ui::config_item(array('key' => array($module, 'memcached.username'), 'label' => Util_ConfigLabel::get('memcached.username'), 'control' => 'textbox', 'disabled' => Util_Installed::memcache_auth() ? null : true, 'description' => __('Specify memcached username, when SASL authentication used', 'w3-total-cache') . (Util_Installed::memcache_auth() ? '' : __('<br>Available when memcached extension installed, built with SASL, and memcached.use_sasl = 1 option is set in php.ini', 'w3-total-cache'))));
Util_Ui::config_item(array('key' => array($module, 'memcached.password'), 'label' => Util_ConfigLabel::get('memcached.password'), 'control' => 'textbox', 'disabled' => Util_Installed::memcache_auth() ? null : true, 'description' => __('Specify memcached password, when SASL authentication used', 'w3-total-cache')));
		</table>

		<?php 
echo Util_Ui::button_config_save('pagecache_general');
?>
		<?php 
Util_Ui::postbox_footer();
?>

		<?php 
Util_Ui::postbox_header(__('Aliases', 'w3-total-cache'), '', 'mirrors');
?>
		<table class="form-table">
			<?php 
Util_Ui::config_item(array('key' => 'pgcache.mirrors.enabled', 'control' => 'checkbox', 'label' => __('Cache Alias Hostnames:', 'w3-total-cache'), 'checkbox_label' => __('Enable', 'w3-total-cache'), 'enabled' => !Util_Environment::is_wpmu_subdomain(), 'description' => __('If the same Wordpress content is accessed from different domains', 'w3-total-cache')));
Util_Ui::config_item(array('key' => 'pgcache.mirrors.home_urls', 'control' => 'textarea', 'label' => __('Additional Home URLs:', 'w3-total-cache'), 'enabled' => !Util_Environment::is_wpmu_subdomain(), 'description' => __('Specify full home URLs of your mirrors so that plugin will flush it\'s cache when content is changed. For example:<br /> http://my-site.com<br />http://www.my-site.com<br />https://my-site.com', 'w3-total-cache')));
?>
		</table>
		<?php 
echo Util_Ui::button_config_save('pagecache_aliases');
?>
		<?php 
Util_Ui::postbox_footer();
?>

		<?php 
Util_Ui::postbox_header(__('Cache Preload', 'w3-total-cache'), '', 'cache_preload');
?>
		<table class="form-table">
			<tr>
				<th colspan="2">
Exemplo n.º 4
0
            <?php 
Util_Ui::sealing_disabled($module);
?>
            value="<?php 
echo esc_attr(implode(',', $config->get_array(array($module, 'redis.servers'))));
?>
"
            size="100" />
        <input class="w3tc_common_redis_test button {nonce: '<?php 
echo wp_create_nonce('w3tc');
?>
'}"
            <?php 
Util_Ui::sealing_disabled($module);
?>
            type="button" value="<?php 
esc_attr_e('Test', 'w3-total-cache');
?>
" />
        <span class="w3tc_common_redis_test_result w3tc-status w3tc-process"></span>
        <br /><span class="description"><?php 
_e('Multiple servers may be used and seperated by a comma; e.g. 192.168.1.100:11211, domain.com:22122', 'w3-total-cache');
?>
</span>
    </td>
</tr>
<?php 
Util_Ui::config_item(array('key' => array($module, 'redis.persistent'), 'label' => __('Use persistent connection:', 'w3-total-cache'), 'control' => 'checkbox', 'checkbox_label' => Util_ConfigLabel::get('redis.persistent'), 'description' => 'Using persistent connection doesn\'t reinitialize memcached driver on each request'));
Util_Ui::config_item(array('key' => array($module, 'redis.dbid'), 'label' => Util_ConfigLabel::get('redis.dbid'), 'control' => 'textbox', 'description' => __('Database ID to use', 'w3-total-cache')));
Util_Ui::config_item(array('key' => array($module, 'redis.password'), 'label' => Util_ConfigLabel::get('redis.password'), 'control' => 'textbox', 'description' => __('Specify redis password', 'w3-total-cache')));
Exemplo n.º 5
0
                <th colspan="2">
                    <?php 
$this->checkbox('minify.reject.logged');
?>
 <?php 
Util_Ui::e_config_label('minify.reject.logged');
?>
</label><br />
                    <span class="description"><?php 
_e('Authenticated users will not receive minified pages if this option is enabled.', 'w3-total-cache');
?>
</span>
                </th>
            </tr>
            <?php 
Util_Ui::config_item(array('key' => 'minify.error.notification', 'control' => 'selectbox', 'selectbox_values' => array('' => __('Disabled', 'w3-total-cache'), 'admin' => __('Admin Notification', 'w3-total-cache'), 'email' => __('Email Notification', 'w3-total-cache'), 'admin,email' => __('Both Admin &amp; Email Notification', 'w3-total-cache')), 'description' => __('Notify when minify cache creation errors occur.', 'w3-total-cache')));
?>
        </table>

        <?php 
Util_Ui::button_config_save('minify_general');
?>
        <?php 
Util_Ui::postbox_footer();
?>

        <?php 
Util_Ui::postbox_header(__('<acronym title="Hypertext Markup Language">HTML</acronym> &amp; <acronym title="eXtensible Markup Language">XML</acronym>', 'w3-total-cache'), '', 'html_xml');
?>
        <table class="form-table">
            <tr>
                        <?php 
Util_Ui::sealing_disabled('browsercache.');
?>
                        name="browsercache__no404wp__exceptions" cols="40" rows="5"><?php 
echo esc_textarea(implode("\r\n", $this->_config->get_array('browsercache.no404wp.exceptions')));
?>
</textarea><br />
                    <span class="description"><?php 
_e('Never process 404 (not found) events for the specified URIs.', 'w3-total-cache');
?>
</span>
                </td>
            </tr>
            <?php 
Util_Ui::config_item(array('key' => 'browsercache.rewrite', 'disabled' => Util_Ui::sealing_disabled('browsercache.'), 'control' => 'checkbox', 'checkbox_label' => __('Rewrite URL structure of objects', 'w3-total-cache'), 'description' => __('Generate unique URI for each file protected from caching by browser.', 'w3-total-cache'), 'style' => '2'));
Util_Ui::config_item(array('key' => 'browsercache.hsts', 'disabled' => Util_Ui::sealing_disabled('browsercache.') || !Util_Environment::is_https(), 'value' => Util_Environment::is_https() ? null : false, 'control' => 'checkbox', 'checkbox_label' => __('Apply <acronym title="Hypertext Transfer Protocol">HTTP</acronym> Strict Transport Security policy', 'w3-total-cache'), 'description' => __('Set the <acronym title="HTTP Strict Transport Security">HSTS</acronym> header to maximize <acronym title="Secure Sockets Layer">SSL</acronym> security.', 'w3-total-cache'), 'style' => '2'));
?>
        </table>

        <?php 
Util_Ui::button_config_save('browsercache_general');
?>
        <?php 
Util_Ui::postbox_footer();
?>

        <?php 
Util_Ui::postbox_header(__('<acronym title="Cascading Style Sheet">CSS</acronym> &amp; <acronym title="JavaScript">JS</acronym>', 'w3-total-cache'), '', 'css_js');
?>
        <p><?php 
_e('Specify browser cache policy for Cascading Style Sheets and JavaScript files.', 'w3-total-cache');
                    <label><input type="checkbox" name="file_nfs" value="1"<?php 
checked($file_nfs, true);
Util_Ui::sealing_disabled('common.');
?>
 /> <?php 
_e('Optimize disk enhanced page and minify disk caching for <acronym title="Network File System">NFS</acronym>', 'w3-total-cache');
?>
</label>
                    <br /><span class="description"><?php 
_e('Try this option if your hosting environment uses a network based file system for a possible performance improvement.', 'w3-total-cache');
?>
</span>
                </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>';
    ?>
</td></tr>
</table>
<?php 
}
?>


<?php 
if ($state == 'available') {
    ?>
<table class="form-table">
<?php 
    Util_Ui::config_item(array('key' => array('cloudflare', 'widget_interval'), 'label' => __('Widget statistics interval:', 'w3-total-cache'), 'control' => 'selectbox', 'selectbox_values' => array('-30' => 'Last 30 minutes', '-360' => 'Last 6 hours', '-720' => 'Last 12 hours', '-1440' => 'Last 24 hours', '-10080' => 'Last week', '-43200' => 'Last month')));
    Util_Ui::config_item(array('key' => array('cloudflare', 'widget_cache_mins'), 'label' => __('Cache time:', 'w3-total-cache'), 'control' => 'textbox', 'description' => 'How many minutes data retrieved from CloudFlare ' . 'should be stored. Minimum is 1 minute.'));
    Util_Ui::config_item(array('key' => array('cloudflare', 'pagecache'), 'label' => __('Page Caching:', 'w3-total-cache'), 'control' => 'checkbox', 'checkbox_label' => 'Flush CloudFlare on Post Modifications', 'description' => 'Enable when you have html pages cached on CloudFlare level.'));
    ?>
</table>
<?php 
}
?>


<?php 
Util_Ui::button_config_save('extension_cloudflare_general');
Util_Ui::postbox_footer();
?>


<?php 
if ($state == 'available') {
Exemplo n.º 9
0
 /**
  * Displays config item - caching engine selectbox
  */
 public static function config_item_engine($a)
 {
     if (isset($a['empty_value']) && $a['empty_value']) {
         $values[''] = array('label' => 'Please select a method');
     }
     $values['file'] = array('label' => __('Disk', 'w3-total-cache'), 'optgroup' => 0);
     $values['apc'] = array('disabled' => !Util_Installed::apc(), 'label' => __('Opcode: Alternative PHP Cache (APC / APCu)', 'w3-total-cache'), 'optgroup' => 1);
     $values['eaccelerator'] = array('disabled' => !Util_Installed::eaccelerator(), 'label' => __('Opcode: eAccelerator', 'w3-total-cache'), 'optgroup' => 1);
     $values['xcache'] = array('disabled' => !Util_Installed::xcache(), 'label' => __('Opcode: XCache', 'w3-total-cache'), 'optgroup' => 1);
     $values['wincache'] = array('disabled' => !Util_Installed::wincache(), 'label' => __('Opcode: WinCache', 'w3-total-cache'), 'optgroup' => 1);
     $values['memcached'] = array('disabled' => !Util_Installed::memcached(), 'label' => __('Memcached', 'w3-total-cache'), 'optgroup' => 2);
     $values['redis'] = array('disabled' => !Util_Installed::redis(), 'label' => __('Redis', 'w3-total-cache'), 'optgroup' => 2);
     Util_Ui::config_item(array('key' => $a['key'], 'label' => isset($a['label']) ? $a['label'] : null, 'disabled' => isset($a['disabled']) ? $a['disabled'] : null, 'control' => 'selectbox', 'selectbox_values' => $values, 'selectbox_optgroups' => array(__('Shared Server:', 'w3-total-cache'), __('Dedicated / Virtual Server:', 'w3-total-cache'), __('Multiple Servers:', 'w3-total-cache'))));
 }
<?php

namespace W3TC;

if (!defined('W3TC')) {
    die;
}
Util_Ui::postbox_header(__('Opcode Cache', 'w3-total-cache'), '', 'system_opcache');
?>

<table class="form-table">
    <?php 
Util_Ui::config_item(array('key' => 'opcache.engine', 'label' => 'Opcode Cache', 'control' => 'selectbox', 'value' => $opcode_engine, 'selectbox_values' => array('Not Available' => array('disabled' => $opcode_engine !== 'Not Available', 'label' => __('Not Available', 'w3-total-cache')), 'OPcache' => array('disabled' => $opcode_engine !== 'OPcache', 'label' => __('Opcode: Zend Opcache', 'w3-total-cache')), 'APC' => array('disabled' => $opcode_engine !== 'APC', 'label' => __('Opcode: Alternative PHP Cache (APC / APCu)', 'w3-total-cache')))));
Util_Ui::config_item(array('key' => 'opcache.validate_timestamps', 'label' => 'Validate Timestamps', 'control' => 'checkbox', 'disabled' => true, 'value' => $validate_timestamps, 'checkbox_label' => __('Enable', 'w3-total-cache'), 'description' => __('Once enabled, each file request will update the cache with the latest version.' . 'When this setting is off, the Opcode Cache will not check, instead PHP must be restarted in order for setting changes to be reflected.', 'w3-total-cache')));
?>

</table>
<?php 
Util_Ui::button_config_save('general_opcache', '<input type="submit" name="w3tc_opcache_flush" value="' . __('Empty cache', 'w3-total-cache') . '"' . ($opcode_engine !== 'Not Available' ? '' : ' disabled="disabled" ') . ' class="button" />');
?>

<?php 
Util_Ui::postbox_footer();
Exemplo n.º 11
0
_e('<acronym title="Application Programming Interface">API</acronym> key:', 'w3-total-cache');
?>
</label></th>
	<td>
		<input id="cdn_rscf_key" class="w3tc-ignore-change" type="password"
                   <?php 
Util_Ui::sealing_disabled('cdn.');
?>
 name="cdn__rscf__key" value="<?php 
echo esc_attr($this->_config->get_string('cdn.rscf.key'));
?>
" size="60" />
	</td>
</tr>
<?php 
Util_Ui::config_item(array('key' => 'cdn.rscf.location', 'control' => 'selectbox', 'selectbox_values' => array('us' => 'US', 'uk' => 'uk')));
?>
<tr>
	<th><label for="cdn_rscf_container"><?php 
_e('Container:', 'w3-total-cache');
?>
</label></th>
	<td>
		<input id="cdn_rscf_container" type="text" name="cdn__rscf__container"
                    <?php 
Util_Ui::sealing_disabled('cdn.');
?>
 value="<?php 
echo esc_attr($this->_config->get_string('cdn.rscf.container'));
?>
" size="30" />
?>
</a>
</p>
<p>
    FeedBurner extension is currently <?php 
if ($config->is_extension_active_frontend('feedburner')) {
    echo '<span class="w3tc-enabled">enabled</span>';
} else {
    echo '<span class="w3tc-disabled">disabled</span>';
}
?>
.
<p>

<div class="metabox-holder">
    <?php 
Util_Ui::postbox_header(__('Google FeedBurner', 'w3-total-cache'));
?>
    <table class="form-table">
        <?php 
Util_Ui::config_item(array('key' => array('feedburner', 'urls'), 'control' => 'textarea', 'label' => __('Additional URLs:', 'w3-total-cache'), 'description' => __('Specify any additional feed URLs to ping on FeedBurner.', 'w3-total-cache')));
?>
    </table>
    <?php 
Util_Ui::button_config_save('extension_feedburner');
?>
    <?php 
Util_Ui::postbox_footer();
?>
</div>
<?php 
Util_Ui::button_config_save('extension_genesis_sidebar');
?>
    <?php 
Util_Ui::postbox_footer();
?>



    <?php 
Util_Ui::postbox_header(__('Footer', 'w3-total-cache'));
?>
    <table class="form-table">
        <?php 
Util_Ui::config_item(array('key' => array('genesis.theme', 'genesis_footer'), 'control' => 'checkbox', 'checkbox_label' => __('Enable', 'w3-total-cache'), 'label' => __('Cache genesis footer:', 'w3-total-cache'), 'description' => __('Caches footer loop.', 'w3-total-cache')));
Util_Ui::config_item(array('key' => array('genesis.theme', 'wp_footer'), 'control' => 'checkbox', 'checkbox_label' => __('Enable', 'w3-total-cache'), 'label' => __('Cache footer:', 'w3-total-cache'), 'description' => __('Caches wp_footer loop.', 'w3-total-cache')));
Util_Ui::config_item(array('key' => array('genesis.theme', 'reject_logged_roles'), 'control' => 'checkbox', 'checkbox_label' => __('Enable', 'w3-total-cache'), 'label' => __('Disable fragment cache:', 'w3-total-cache'), 'description' => 'Don\'t use fragment cache with the following hooks and for the specified user roles.'));
?>
    </table>
    <?php 
Util_Ui::button_config_save('extension_genesis_footer');
?>
    <?php 
Util_Ui::postbox_footer();
?>


    <?php 
Util_Ui::postbox_header(__('Exclusions', 'w3-total-cache'), '', 'exclusions');
?>
    <table class="form-table">
        <tr>
?>
</a>
</p>
<p>
    FeedBurner extension is currently <?php 
if ($config->is_extension_active_frontend('feedburner')) {
    echo '<span class="w3tc-enabled">enabled</span>';
} else {
    echo '<span class="w3tc-disabled">disabled</span>';
}
?>
.
<p>

<div class="metabox-holder">
    <?php 
Util_Ui::postbox_header(__('Google FeedBurner', 'w3-total-cache'));
?>
    <table class="form-table">
        <?php 
Util_Ui::config_item(array('key' => array('feedburner', 'urls'), 'control' => 'textarea', 'label' => __('Additional <acronym title="Uniform Resource Locator">URL</acronym>s:', 'w3-total-cache'), 'description' => __('Specify any additional feed <acronym title="Uniform Resource Locator">URL</acronym>s to ping on FeedBurner.', 'w3-total-cache')));
?>
    </table>
    <?php 
Util_Ui::button_config_save('extension_feedburner');
?>
    <?php 
Util_Ui::postbox_footer();
?>
</div>
<?php 
Exemplo n.º 15
0
<?php

namespace W3TC;

if (!defined('W3TC')) {
    die;
}
Util_Ui::config_item(array('key' => 'cdn.s3_compatible.api_host', 'label' => __('API host:', 'w3-total-cache'), 'control' => 'textbox', 'textbox_size' => 30, 'description' => __('Host of API endpoint, comptabile with Amazon S3 API', 'w3-total-cache')));
Util_Ui::config_item(array('key' => 'cdn.s3.key', 'label' => __('Access key ID:', 'w3-total-cache'), 'control' => 'textbox', 'textbox_size' => 30, 'description' => __('Theme files, media library attachments, <acronym title="Cascading Style Sheet">CSS</acronym>, <acronym title="JavaScript">JS</acronym> files etc will appear to load instantly for site visitors.', 'w3-total-cache')));
?>
<tr>
	<th><label for="cdn_s3_secret"><?php 
_e('Secret key:', 'w3-total-cache');
?>
</label></th>
	<td>
		<input id="cdn_s3_secret" class="w3tc-ignore-change"
                   <?php 
Util_Ui::sealing_disabled('cdn.');
?>
 type="password" name="cdn__s3__secret" value="<?php 
echo esc_attr($this->_config->get_string('cdn.s3.secret'));
?>
" size="60" />
	</td>
</tr>
<tr>
	<th><label for="cdn_s3_bucket"><?php 
_e('Bucket:', 'w3-total-cache');
?>
</label></th>