Commit 9c27fab0 by felix

添加cache插件

parent 13405815
<?php
/**
* W3 ObjectCache plugin
*/
if (!defined('W3TC')) {
die();
}
define('W3TC_MARKER_BEGIN_CLOUDFLARE', '# BEGIN W3TC CloudFlare');
define('W3TC_MARKER_END_CLOUDFLARE', '# END W3TC CloudFlare');
w3_require_once(W3TC_LIB_W3_DIR . '/Plugin.php');
/**
* Class W3_Plugin_CloudFlare
*/
class W3_Plugin_CloudFlare extends W3_Plugin{
/**
* @var CloudFlareAPI $cf
*/
private $cf;
/**
* Runs plugin
*/
function run() {
w3_require_once(W3TC_CORE_EXTENSION_DIR. '/CloudFlare/CloudFlareAPI.php');
$this->cf = new CloudFlareAPI();
add_action('wp_set_comment_status', array($this, 'set_comment_status'), 1, 2);
add_action('w3tc_flush_all', array($this, 'flush_all'));
$this->cf->fix_remote_addr();
}
public function flush_all() {
$this->flush_cloudflare();
}
/**
* @param $id
* @param $status
*/
function set_comment_status($id, $status) {
$this->cf->report_if_spam($id, $status);
}
/**
* @param $state
* @return bool
*/
public function send_minify_headers($state) {
/**
* @var W3_Config $config
*/
$config = w3_instance('W3_Config');
return ($config->get_boolean('cloudflare.enabled') && !$this->cf->minify_enabled());
}
/**
* Purge the CloudFlare cache
* @return void
*/
function flush_cloudflare() {
$response = null;
w3_require_once(W3TC_LIB_W3_DIR . '/Request.php');
$email = $this->_config->get_string('email');
$key = $this->_config->get_string('key');
$zone = $this->_config->get_string('zone');
if ($email && $key && $zone) {
$config = array(
'email' => $email,
'key' => $key,
'zone' => $zone
);
w3_require_once(W3TC_CORE_EXTENSION_DIR . '/CloudFlare/CloudFlareAPI.php');
@$cloudflareAPI = new CloudFlareAPI($config);
$cloudflareAPI->purge();
}
}
public function menu_bar($menu_items) {
$menu_items = array_merge($menu_items, array(
array(
'id' => 'cloudflare',
'title' => __('CloudFlare', 'w3-total-cache'),
'href' => 'https://www.cloudflare.com'
),
array(
'id' => 'cloudflare-my-websites',
'parent' => 'cloudflare',
'title' => __('My Websites', 'w3-total-cache'),
'href' => 'https://www.cloudflare.com/my-websites.html'
),
array(
'id' => 'cloudflare-analytics',
'parent' => 'cloudflare',
'title' => __('Analytics', 'w3-total-cache'),
'href' => 'https://www.cloudflare.com/analytics.html'
),
array(
'id' => 'cloudflare-account',
'parent' => 'cloudflare',
'title' => __('Account', 'w3-total-cache'),
'href' => 'https://www.cloudflare.com/my-account.html'
)
));
return $menu_items;
}
}
<?php
if (!defined('W3TC')) { die(); }
class CloudFlareSettings extends W3_UI_Settings_SettingsBase{
protected function strings() {
return array(
'general' => array(
'cloudflare.enabled' => __('CloudFlare:', 'w3-total-cache'),
'cloudflare.email' => __('CloudFlare account email:', 'w3-total-cache'),
'cloudflare.key' => __('<abbr title="Application Programming Interface">API</abbr> key:', 'w3-total-cache'),
'cloudflare.zone' => __('Domain:', 'w3-total-cache'),
),
'settings' => array(
'cloudflare.ips.ip4' => __('Cloudflare <abbr title="Internet Protocol">IPs</abbr> <abbr title="Internet Protocol version 4">IP4</abbr> addresses', 'w3-total-cache'),
'cloudflare.ips.ip6' => __('Cloudflare <abbr title="Internet Protocol">IPs</abbr> <abbr title="Internet Protocol version 6">IP6</abbr> addresses', 'w3-total-cache')
)
);
}
}
<?php echo w3tc_postbox_header(__('Network Performance &amp; Security powered by CloudFlare', 'w3-total-cache'), '', 'cloudflare'); ?>
<p>
<?php _e('CloudFlare protects and accelerates websites.', 'w3-total-cache') ?>
</p>
<table class="form-table">
<tr>
<th><?php w3_e_config_label('cloudflare.enabled', 'general') ?></th>
<td>
<label>
<?php
list($name, $id) = w3tc_get_name_and_id('cloudflare', 'enabled');
w3_ui_element('checkbox', 'cloudflare.enabled', $name, w3tc_get_extension_config('cloudflare', 'enabled'), w3_extension_is_sealed('cloudflare')); ?>
&nbsp;<strong><?php _e('Enable', 'w3-total-cache'); ?></strong></label>
</td>
</tr>
<tr>
<?php
list($name, $id) = w3tc_get_name_and_id('cloudflare', 'email'); ?>
<th><label for="cloudflare_email"><?php w3_e_config_label('cloudflare.email', 'general') ?></label></th>
<td>
<?php w3_ui_element('textbox', 'cloudflare.email', $name, w3tc_get_extension_config('cloudflare', 'email'), w3_extension_is_sealed('cloudflare')); ?>
</td>
</tr>
<tr>
<?php
list($name, $id) = w3tc_get_name_and_id('cloudflare', 'key'); ?>
<th><label for="cloudflare_key"><?php w3_e_config_label('cloudflare.key', 'general') ?></label></th>
<td>
<?php w3_ui_element('password', 'cloudflare.key', $name, w3tc_get_extension_config('cloudflare', 'key'), w3_extension_is_sealed('cloudflare')); ?>
(<a href="https://www.cloudflare.com/my-account.html"><?php _e('find it here', 'w3-total-cache'); ?></a>)
</td>
</tr>
<tr>
<?php
list($name, $id) = w3tc_get_name_and_id('cloudflare', 'zone'); ?>
<th><?php w3_e_config_label('cloudflare.zone', 'general') ?></th>
<td>
<?php w3_ui_element('textbox', 'cloudflare.zone', $name, w3tc_get_extension_config('cloudflare', 'zone'), w3_extension_is_sealed('cloudflare')); ?>
</td>
</tr>
<tr>
<th><?php _e('Security level:', 'w3-total-cache'); ?></th>
<td>
<input type="hidden" name="cloudflare_sec_lvl_old" value="<?php echo $cloudflare_seclvl; ?>" />
<select name="cloudflare_sec_lvl_new"
class="w3tc-ignore-change"
<?php w3tc_sealing_disabled('cloudflare'); ?>>
<?php foreach ($cloudflare_seclvls as $cloudflare_seclvl_key => $cloudflare_seclvl_label): ?>
<option value="<?php echo esc_attr($cloudflare_seclvl_key); ?>"<?php selected($cloudflare_seclvl, $cloudflare_seclvl_key); ?>><?php echo $cloudflare_seclvl_label; ?></option>
<?php endforeach; ?>
</select>
</td>
</tr>
<tr>
<th><?php _e('Rocket Loader:', 'w3-total-cache'); ?></th>
<td>
<input type="hidden" name="cloudflare_async_old" value="<?php echo $cloudflare_rocket_loader; ?>" />
<select name="cloudflare_async_new"
class="w3tc-ignore-change"
<?php w3tc_sealing_disabled('cloudflare'); ?>>
<?php foreach ($cloudflare_rocket_loaders as $cloudflare_rocket_loader_key => $cloudflare_rocket_loader_label): ?>
<option value="<?php echo $cloudflare_rocket_loader_key; ?>"<?php selected($cloudflare_rocket_loader, $cloudflare_rocket_loader_key); ?>><?php echo $cloudflare_rocket_loader_label; ?></option>
<?php endforeach; ?>
</select>
</td>
</tr>
<tr>
<th><?php _e('Minification:', 'w3-total-cache'); ?></th>
<td>
<input type="hidden" name="cloudflare_minify_old" value="<?php echo $cloudflare_minify; ?>" />
<select name="cloudflare_minify_new"
class="w3tc-ignore-change"
<?php w3tc_sealing_disabled('cloudflare'); ?>>
<?php foreach ($cloudflare_minifications as $cloudflare_minify_key => $cloudflare_minify_label): ?>
<option value="<?php echo esc_attr($cloudflare_minify_key); ?>"<?php selected($cloudflare_minify, $cloudflare_minify_key); ?>><?php echo $cloudflare_minify_label; ?></option>
<?php endforeach; ?>
</select>
</td>
</tr>
<tr>
<th><?php _e('Development mode:', 'w3-total-cache'); ?></th>
<td>
<input type="hidden" name="cloudflare_devmode_old" value="<?php echo $cloudflare_devmode; ?>" />
<select name="cloudflare_devmode_new"
class="w3tc-ignore-change"
<?php w3tc_sealing_disabled('cloudflare'); ?>>
<?php foreach ($cloudflare_devmodes as $cloudflare_devmode_key => $cloudflare_devmode_label): ?>
<option value="<?php echo esc_attr($cloudflare_devmode_key); ?>"<?php selected($cloudflare_devmode, $cloudflare_devmode_key); ?>><?php echo $cloudflare_devmode_label; ?></option>
<?php endforeach; ?>
</select>
<?php if ($cloudflare_devmode_expire): ?>
<?php echo sprintf( __('Will automatically turn off at %s', 'w3-total-cache'), date('m/d/Y H:i:s', $cloudflare_devmode_expire) ); ?>>
<?php endif; ?>
</td>
</tr>
<?php if (is_network_admin() && !w3_force_master()): ?>
<tr>
<th><?php _e('Network policy:', 'w3-total-cache'); ?></th>
<td>
<?php w3tc_checkbox_admin('cloudflare.configuration_sealed'); ?> <?php _e('Apply the settings above to the entire network.', 'w3-total-cache'); ?></label>
</td>
</tr>
<?php endif; ?>
</table>
<p class="submit">
<?php echo w3tc_nonce_field('w3tc'); ?>
<input type="submit" name="w3tc_save_options" class="w3tc-button-save button-primary" value="<?php _e('Save all settings', 'w3-total-cache'); ?>" />
<input id="cloudflare_purge_cache" class="button {nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" type="button" value="<?php _e('Purge cache', 'w3-total-cache'); ?>"<?php if (! $cloudflare_enabled): ?> disabled="disabled"<?php endif; ?> />
</p>
<?php echo w3tc_postbox_footer(); ?>
<?php
/*
* ip_in_range.php - Function to determine if an IP is located in a
* specific range as specified via several alternative
* formats.
*
* Network ranges can be specified as:
* 1. Wildcard format: 1.2.3.*
* 2. CIDR format: 1.2.3/24 OR 1.2.3.4/255.255.255.0
* 3. Start-End IP format: 1.2.3.0-1.2.3.255
*
* Return value BOOLEAN : ip_in_range($ip, $range);
*
* Copyright 2008: Paul Gregg <pgregg@pgregg.com>
* 10 January 2008
* Version: 1.2
*
* Source website: http://www.pgregg.com/projects/php/ip_in_range/
* Version 1.2
*
* This software is Donationware - if you feel you have benefited from
* the use of this tool then please consider a donation. The value of
* which is entirely left up to your discretion.
* http://www.pgregg.com/donate/
*
* Please do not remove this header, or source attibution from this file.
*/
/*
* Modified by James Greene <james@cloudflare.com> to include IPV6 support
* (original version only supported IPV4).
* 21 May 2012
*/
// decbin32
// In order to simplify working with IP addresses (in binary) and their
// netmasks, it is easier to ensure that the binary strings are padded
// with zeros out to 32 characters - IP addresses are 32 bit numbers
function w3_decbin32 ($dec) {
return str_pad(decbin($dec), 32, '0', STR_PAD_LEFT);
}
// ipv4_in_range
// This function takes 2 arguments, an IP address and a "range" in several
// different formats.
// Network ranges can be specified as:
// 1. Wildcard format: 1.2.3.*
// 2. CIDR format: 1.2.3/24 OR 1.2.3.4/255.255.255.0
// 3. Start-End IP format: 1.2.3.0-1.2.3.255
// The function will return true if the supplied IP is within the range.
// Note little validation is done on the range inputs - it expects you to
// use one of the above 3 formats.
function w3_ipv4_in_range($ip, $range) {
if (strpos($range, '/') !== false) {
// $range is in IP/NETMASK format
list($range, $netmask) = explode('/', $range, 2);
if (strpos($netmask, '.') !== false) {
// $netmask is a 255.255.0.0 format
$netmask = str_replace('*', '0', $netmask);
$netmask_dec = ip2long($netmask);
return ( (ip2long($ip) & $netmask_dec) == (ip2long($range) & $netmask_dec) );
} else {
// $netmask is a CIDR size block
// fix the range argument
$x = explode('.', $range);
while(count($x)<4) $x[] = '0';
list($a,$b,$c,$d) = $x;
$range = sprintf("%u.%u.%u.%u", empty($a)?'0':$a, empty($b)?'0':$b,empty($c)?'0':$c,empty($d)?'0':$d);
$range_dec = ip2long($range);
$ip_dec = ip2long($ip);
# Strategy 1 - Create the netmask with 'netmask' 1s and then fill it to 32 with 0s
#$netmask_dec = bindec(str_pad('', $netmask, '1') . str_pad('', 32-$netmask, '0'));
# Strategy 2 - Use math to create it
$wildcard_dec = pow(2, (32-$netmask)) - 1;
$netmask_dec = ~ $wildcard_dec;
return (($ip_dec & $netmask_dec) == ($range_dec & $netmask_dec));
}
} else {
// range might be 255.255.*.* or 1.2.3.0-1.2.3.255
if (strpos($range, '*') !==false) { // a.b.*.* format
// Just convert to A-B format by setting * to 0 for A and 255 for B
$lower = str_replace('*', '0', $range);
$upper = str_replace('*', '255', $range);
$range = "$lower-$upper";
}
if (strpos($range, '-')!==false) { // A-B format
list($lower, $upper) = explode('-', $range, 2);
$lower_dec = (float)sprintf("%u",ip2long($lower));
$upper_dec = (float)sprintf("%u",ip2long($upper));
$ip_dec = (float)sprintf("%u",ip2long($ip));
return ( ($ip_dec>=$lower_dec) && ($ip_dec<=$upper_dec) );
}
return false;
}
}
function w3_ip2long6($ip) {
if (substr_count($ip, '::')) {
$ip = str_replace('::', str_repeat(':0000', 8 - substr_count($ip, ':')) . ':', $ip);
}
$ip = explode(':', $ip);
$r_ip = '';
foreach ($ip as $v) {
$r_ip .= str_pad(base_convert($v, 16, 2), 16, 0, STR_PAD_LEFT);
}
return base_convert($r_ip, 2, 10);
}
// Get the ipv6 full format and return it as a decimal value.
function w3_get_ipv6_full($ip)
{
$pieces = explode ("/", $ip, 2);
$left_piece = $pieces[0];
$right_piece = $pieces[1];
// Extract out the main IP pieces
$ip_pieces = explode("::", $left_piece, 2);
$main_ip_piece = $ip_pieces[0];
$last_ip_piece = $ip_pieces[1];
// Pad out the shorthand entries.
$main_ip_pieces = explode(":", $main_ip_piece);
foreach($main_ip_pieces as $key=>$val) {
$main_ip_pieces[$key] = str_pad($main_ip_pieces[$key], 4, "0", STR_PAD_LEFT);
}
// Check to see if the last IP block (part after ::) is set
$last_piece = "";
$size = count($main_ip_pieces);
if (trim($last_ip_piece) != "") {
$last_piece = str_pad($last_ip_piece, 4, "0", STR_PAD_LEFT);
// Build the full form of the IPV6 address considering the last IP block set
for ($i = $size; $i < 7; $i++) {
$main_ip_pieces[$i] = "0000";
}
$main_ip_pieces[7] = $last_piece;
}
else {
// Build the full form of the IPV6 address
for ($i = $size; $i < 8; $i++) {
$main_ip_pieces[$i] = "0000";
}
}
// Rebuild the final long form IPV6 address
$final_ip = implode(":", $main_ip_pieces);
return w3_ip2long6($final_ip);
}
// Determine whether the IPV6 address is within range.
// $ip is the IPV6 address in decimal format to check if its within the IP range created by the cloudflare IPV6 address, $range_ip.
// $ip and $range_ip are converted to full IPV6 format.
// Returns true if the IPV6 address, $ip, is within the range from $range_ip. False otherwise.
function w3_ipv6_in_range($ip, $range_ip)
{
$pieces = explode ("/", $range_ip, 2);
$left_piece = $pieces[0];
$right_piece = $pieces[1];
// Extract out the main IP pieces
$ip_pieces = explode("::", $left_piece, 2);
$main_ip_piece = $ip_pieces[0];
$last_ip_piece = $ip_pieces[1];
// Pad out the shorthand entries.
$main_ip_pieces = explode(":", $main_ip_piece);
foreach($main_ip_pieces as $key=>$val) {
$main_ip_pieces[$key] = str_pad($main_ip_pieces[$key], 4, "0", STR_PAD_LEFT);
}
// Create the first and last pieces that will denote the IPV6 range.
$first = $main_ip_pieces;
$last = $main_ip_pieces;
// Check to see if the last IP block (part after ::) is set
$last_piece = "";
$size = count($main_ip_pieces);
if (trim($last_ip_piece) != "") {
$last_piece = str_pad($last_ip_piece, 4, "0", STR_PAD_LEFT);
// Build the full form of the IPV6 address considering the last IP block set
for ($i = $size; $i < 7; $i++) {
$first[$i] = "0000";
$last[$i] = "ffff";
}
$main_ip_pieces[7] = $last_piece;
}
else {
// Build the full form of the IPV6 address
for ($i = $size; $i < 8; $i++) {
$first[$i] = "0000";
$last[$i] = "ffff";
}
}
// Rebuild the final long form IPV6 address
$first = w3_ip2long6(implode(":", $first));
$last = w3_ip2long6(implode(":", $last));
$in_range = ($ip >= $first && $ip <= $last);
return $in_range;
}
\ No newline at end of file
<?php
class W3_FeedBurner {
/**
* @var W3_Config $_config
*/
private $_config;
function run() {
$this->_config = w3_instance('W3_Config');
add_action('publish_post', array(
&$this,
'flush_feedburner'
), 100, 1);
}
/**
* If FeedBurner is enabled flush the registered FB feeds
*/
function flush_feedburner($post_id) {
if (!w3_is_flushable_post($post_id, 'pgcache', $this->_config)) {
return;
}
$fb_urls = w3tc_get_extension_config('feedburner','urls');
if ($fb_urls)
$fb_urls = explode("\n", $fb_urls);
$fb_urls[] = home_url();
foreach($fb_urls as $url) {
wp_remote_get('http://feedburner.google.com/fb/a/pingSubmit?bloglink=' . urlencode($url));
}
}
}
$ext = new W3_FeedBurner();
$ext->run();
\ No newline at end of file
<?php
/**
* W3 FeedBurner module
*/
if (!defined('W3TC')) {
die();
}
class W3_FeedBurnerAdmin {
function run() {
add_action('admin_init', array($this, 'admin_init'));
add_filter('w3tc_extensions', array($this, 'extension'), 10, 2);
add_action('w3tc_extensions_page-feedburner', array($this, 'extension_header'));
}
/**
* Setups sections
*/
function admin_init() {
w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/extensions.php');
// Register our settings field group
w3tc_add_settings_section(
'ping', // Unique identifier for the settings section
'Ping FeedBurner', // Section title
'__return_false', // Section callback (we don't want anything)
'feedburner' // extension id, used to uniquely identify the extension;
);
$settings = $this->settings();
foreach($settings as $setting => $meta) {
/**
* @var $label
* @var $description
* @var $section
* @var $type
*/
extract($meta);
w3tc_add_settings_field($setting, $label,
array($this, 'print_setting'), 'feedburner', $section,
array('label_for'=>$setting, 'type'=>$type,
'description' => $description));
}
}
/**
* Display if caching or not.
*/
function extension_header() {
$config = w3_instance('W3_Config');
echo '<p>';
printf(__('The FeedBurner extension is currently %s ', 'w3-total-cache'),
'<span class="w3tc-enabled">' . __('enabled', 'w3-total-cache') . '</span>');
echo '.</p>';
}
/**
*
* @param $setting
* @param $args
*/
function print_setting($setting, $args) {
w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/extensions.php');
list($name, $id) = w3tc_get_name_and_id('feedburner', $setting);
w3_ui_element($args['type'], $setting, $name, w3tc_get_extension_config('feedburner', $setting), w3_extension_is_sealed('feedburner'));
}
/**
* @param $extensions
* @param W3_Config $config
* @return mixed
*/
function extension($extensions, $config) {
$message = array();
$message[] = 'FeedBurner';
$extensions['feedburner'] = array (
'name' => 'FeedBurner',
'author' => 'W3 EDGE',
'description' => sprintf(__('Automatically ping (purge) FeedBurner feeds when pages / posts are modified. Default URL: %s', 'w3-total-cache'),
!is_network_admin() ? home_url() : __('Network Admin has no main URL.', 'w3-total-cache')),
'author uri' => 'http://www.w3-edge.com/',
'extension uri' => 'http://www.w3-edge.com/',
'extension id' => 'feedburner',
'version' => '0.1',
'enabled' => true,
'requirements' => implode(', ', $message),
'path' => 'w3-total-cache/extensions/FeedBurner.php'
);
return $extensions;
}
/**
* @return array
*/
function settings() {
return
array(
'urls' =>
array(
'type' => 'textarea',
'section' => 'ping',
'label' => __('Additional URLs:', 'w3-total-cache'),
'description' => __('Specify any additional feed URLs to ping on FeedBurner.', 'w3-total-cache')
),
);
}
}
$ext = new W3_FeedBurnerAdmin();
$ext->run();
\ No newline at end of file
<?php
class W3_WordPressSEO {
/**
* @var W3_Config
*/
private $_config;
public function run() {
$this->_config = w3_instance('W3_Config');
if ($this->_config->get_boolean('cdn.enabled')) {
add_filter( 'wpseo_xml_sitemap_img_src', array($this, 'wpseo_cdn_filter' ));
}
}
/**
* Hook into WordPress SEO sitemap image filter.
* @param $uri
* @return string
*/
public function wpseo_cdn_filter($uri) {
/**
* @var W3_Plugin_CdnCommon $w3_plugin_cdncommon
*/
$w3_plugin_cdncommon = w3_instance('W3_Plugin_CdnCommon');
$cdn = $w3_plugin_cdncommon->get_cdn();
$parsed = parse_url($uri);
$path = $parsed['path'];
$remote_path = $w3_plugin_cdncommon->uri_to_cdn_uri($path);
$new_url = $cdn->format_url($remote_path);
return $new_url;
}
}
$ext = new W3_WordPressSEO();
$ext->run();
<?php
/**
* W3 WordPressSEOAdmin module
*/
if (!defined('W3TC')) {
die();
}
class W3_WordPressSEOAdmin {
function run() {
add_action('admin_init', array($this, 'admin_init'));
add_filter('w3tc_extensions', array($this, 'extension'), 10, 2);
add_filter('w3tc_extension_plugin_links-wordpress-seo', array($this, 'remove_settings'));
add_action('w3tc_extensions_page-wordpress-seo', array($this, 'extension_header'));
add_action('w3tc_activate_extension-wordpress-seo', array($this, 'activate'));
add_action('w3tc_deactivate_extension-wordpress-seo', array($this, 'deactivate'));
}
public function admin_init() {
if (w3tc_show_extension_notification('wordpress-seo', $this->criteria_match()))
add_action('admin_notices', array($this, 'admin_notices'));
$config = w3_instance('W3_Config');
$groups = $config->get_array('mobile.rgroups');
if (w3tc_edge_mode() && isset($groups['google']) && sizeof($groups['google']['agents']) == 1 && $groups['google']['agents'][0] == 'googlebot') {
w3tc_delete_user_agent_group('google');
}
}
/**
*
*/
public function admin_notices() {
w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/extensions.php');
w3_e_extension_activation_notification('WordPress SEO', 'wordpress-seo');
}
/**
* @param $links
* @return mixed
*/
public function remove_settings($links) {
array_pop($links);
return $links;
}
/**
* Display if caching or not.
*/
function extension_header() {
echo '<p>';
printf(__('The WordPress SEO extension is currently %s ', 'w3-total-cache'),
'<span class="w3tc-enabled">' . __('enabled', 'w3-total-cache') . '</span>');
echo '.</p>';
}
/**
* @param $extensions
* @param W3_Config $config
* @return mixed
*/
function extension($extensions, $config) {
$message = array();
$message[] = 'WordPress SEO by Yoast';
$extensions['wordpress-seo'] = array (
'name' => 'WordPress SEO by Yoast',
'author' => 'W3 EDGE',
'description' => __('Configures W3 Total Cache to comply with WordPress SEO requirements automatically.', 'w3-total-cache'),
'author uri' => 'http://www.w3-edge.com/',
'extension uri' => 'http://www.w3-edge.com/',
'extension id' => 'wordpress-seo',
'version' => '1.0',
'enabled' => $this->criteria_match(),
'requirements' => implode(', ', $message),
'path' => 'w3-total-cache/extensions/WordPressSEO.php'
);
return $extensions;
}
private function criteria_match() {
return defined('WPSEO_VERSION');
}
public function activate() {
try {
$config = w3_instance('W3_Config');
$config->set('pgcache.prime.enabled', true);
$config->set('pgcache.prime.sitemap', '/sitemap_index.xml');
$config->save();
} catch (Exception $ex) {}
}
public function deactivate() {
try {
$config = w3_instance('W3_Config');
$config->set('pgcache.prime.enabled', false);
$config->save();
} catch (Exception $ex) {}
}
}
$ext = new W3_WordPressSEOAdmin();
$ext->run();
<html>
<head></head>
<body>
<p>Unfortunately, an error occurred while creating the minify cache. Please check your settings to ensure your site is working as intended.</p>
<p>Thanks for using W3 Total Cache.</p>
</body>
</html>
<html>
<head></head>
<body>
<p>Unfortunately, an error occurred while creating the minify cache. Please check your settings to ensure your site is working as intended.</p>
<p>Thanks for using W3 Total Cache.</p>
</body>
</html>
<?php if (!defined('W3TC')) die(); ?>
<html>
<head></head>
<body>
<p>
Date: <?php echo date('m/d/Y H:i:s'); ?><br />
Version: <?php echo W3TC_VERSION; ?><br />
URL: <a href="<?php echo esc_attr($url); ?>"><?php echo htmlspecialchars($url); ?></a><br />
Name: <?php echo htmlspecialchars($name); ?><br />
E-Mail: <a href="mailto:<?php echo esc_attr($email); ?>"><?php echo htmlspecialchars($email); ?></a><br />
<?php if ($twitter): ?>
Twitter: <a href="http://twitter.com/<?php echo esc_attr($twitter); ?>"><?php echo htmlspecialchars($twitter); ?></a><br />
<?php endif; ?>
<?php if ($phone): ?>
Phone: <?php echo htmlspecialchars($phone); ?><br />
<?php endif; ?>
<?php if ($forum_url): ?>
Forum Topic URL: <a href="<?php echo esc_attr($forum_url); ?>"><?php echo htmlspecialchars($forum_url); ?></a><br />
<?php endif; ?>
<?php if ($request_data_url): ?>
Request data: <a href="<?php echo esc_attr($request_data_url); ?>"><?php echo htmlspecialchars($request_data_url); ?></a><br />
<?php endif; ?>
Subject: <?php echo htmlspecialchars($subject); ?>
</p>
<p>
<?php echo nl2br(htmlspecialchars($description)); ?>
</p>
<hr />
<font size="-1" color="#ccc">
E-mail sent from IP: <?php echo htmlspecialchars($_SERVER['REMOTE_ADDR']); ?><br />
User Agent: <?php echo htmlspecialchars($_SERVER['HTTP_USER_AGENT']); ?>
</font>
</body>
</html>
<?php if (!defined('W3TC')) die(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
<head>
<link rel="stylesheet" type="text/css" href="<?php echo plugins_url('pub/css/error.css?ver=' . W3TC_VERSION, W3TC_FILE); ?>" />
<title>Error</title>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
</head>
<body>
<p>
<?php echo $error; ?>
</p>
</body>
</html>
\ No newline at end of file
<?php
if (!function_exists('file_put_contents')) {
if (!defined('FILE_APPEND')) {
define('FILE_APPEND', 8);
}
function file_put_contents($filename, $data, $flags = 0) {
$fp = fopen($filename, ($flags & FILE_APPEND ? 'a' : 'w'));
if ($fp) {
fputs($fp, $data);
fclose($fp);
return true;
}
return false;
}
}
if (!function_exists('fnmatch')) {
define('FNM_PATHNAME', 1);
define('FNM_NOESCAPE', 2);
define('FNM_PERIOD', 4);
define('FNM_CASEFOLD', 16);
function fnmatch($pattern, $string, $flags = 0) {
$modifiers = null;
$transforms = array(
'\*' => '.*',
'\?' => '.',
'\[\!' => '[^',
'\[' => '[',
'\]' => ']',
'\.' => '\.',
'\\' => '\\\\'
);
// Forward slash in string must be in pattern:
if ($flags & FNM_PATHNAME) {
$transforms['\*'] = '[^/]*';
}
// Back slash should not be escaped:
if ($flags & FNM_NOESCAPE) {
unset($transforms['\\']);
}
// Perform case insensitive match:
if ($flags & FNM_CASEFOLD) {
$modifiers .= 'i';
}
// Period at start must be the same as pattern:
if ($flags & FNM_PERIOD) {
if (strpos($string, '.') === 0 && strpos($pattern, '.') !== 0) return false;
}
$pattern = '~^' . strtr(preg_quote($pattern, '~'), $transforms) . '$~' . $modifiers;
return (boolean) preg_match($pattern, $string);
}
}
function w3tc_get_theme($themename) {
global $wp_version;
if (version_compare($wp_version,'3.4', '<'))
return get_theme($themename);
$wp_themes = w3tc_get_themes();
if ( is_array( $wp_themes ) && array_key_exists( $themename, $wp_themes ) )
return $wp_themes[ $themename ];
return array();
}
function w3tc_get_current_theme_name() {
global $wp_version;
if (version_compare($wp_version,'3.4', '>='))
return wp_get_theme()->get('Name');
return get_current_theme();
}
function w3tc_get_current_theme() {
global $wp_version;
if (version_compare($wp_version,'3.4', '>='))
return wp_get_theme();
return get_theme(get_current_theme());
}
function w3tc_get_themes() {
global $wp_version;
if (version_compare($wp_version,'3.4', '<'))
return get_themes();
global $wp_themes;
if ( isset( $wp_themes ) )
return $wp_themes;
$themes = wp_get_themes();
$wp_themes = array();
foreach ( $themes as $theme ) {
$name = $theme->get('Name');
if ( isset( $wp_themes[ $name ] ) )
$wp_themes[ $name . '/' . $theme->get_stylesheet() ] = $theme;
else
$wp_themes[ $name ] = $theme;
}
return $wp_themes;
}
\ No newline at end of file
<?php
/**
* Extracts JS files from content
*
* @param string $content
* @return array
*/
function w3_extract_js($content) {
$matches = null;
$files = array();
$content = preg_replace('~<!--.*?-->~s', '', $content);
if (preg_match_all('~<script\s+[^<>]*src=["\']?([^"\']+)["\']?[^<>]*>\s*</script>~is', $content, $matches)) {
$files = $matches[1];
}
$files = array_values(array_unique($files));
return $files;
}
/**
* Extract CSS files from content
*
* @param string $content
* @return array
*/
function w3_extract_css($content) {
$matches = null;
$files = array();
$content = preg_replace('~<!--.*?-->~s', '', $content);
if (preg_match_all('~<link\s+([^>]+)/?>(.*</link>)?~Uis', $content, $matches, PREG_SET_ORDER)) {
foreach ($matches as $match) {
$attrs = array();
$attr_matches = null;
if (preg_match_all('~(\w+)=["\']([^"\']*)["\']~', $match[1], $attr_matches, PREG_SET_ORDER)) {
foreach ($attr_matches as $attr_match) {
$attrs[$attr_match[1]] = trim($attr_match[2]);
}
}
if (isset($attrs['href']) && isset($attrs['rel']) && stristr($attrs['rel'], 'stylesheet') !== false && (!isset($attrs['media']) || stristr($attrs['media'], 'print') === false)) {
$files[] = $attrs['href'];
}
}
}
if (preg_match_all('~@import\s+(url\s*)?\(?["\']?\s*([^"\'\)\s]+)\s*["\']?\)?[^;]*;?~is', $content, $matches)) {
$files = array_merge($files, $matches[2]);
}
$files = array_values(array_unique($files));
return $files;
}
function w3_extract_css2($content) {
$matches = null;
$files = array();
$content = preg_replace('~<!--.*?-->~s', '', $content);
if (preg_match_all('~<link\s+([^>]+)/?>(.*</link>)?~Uis', $content, $matches, PREG_SET_ORDER)) {
foreach ($matches as $match) {
$attrs = array();
$attr_matches = null;
if (preg_match_all('~(\w+)=["\']([^"\']*)["\']~', $match[1], $attr_matches, PREG_SET_ORDER)) {
foreach ($attr_matches as $attr_match) {
$attrs[$attr_match[1]] = trim($attr_match[2]);
}
}
if (isset($attrs['href']) && isset($attrs['rel']) && stristr($attrs['rel'], 'stylesheet') !== false && (!isset($attrs['media']) || stristr($attrs['media'], 'print') === false)) {
$files[] = array($match[0], $attrs['href']);
}
}
}
if (preg_match_all('~@import\s+(url\s*)?\(?["\']?\s*([^"\'\)\s]+)\s*["\']?\)?[^;]*;?~is', $content, $matches, PREG_SET_ORDER)) {
foreach($matches as $match)
$files[] = array($match[0],$match[2]);
}
return $files;
}
\ No newline at end of file
<?php
/**
* Filter handler for use_curl_transport.
* Workaround to not use curl for extra http methods
*
* @param $result boolean
* @param $args array
* @return boolean
*/
function w3_use_curl_transport($result, $args) {
if (isset($args['method']) && $args['method'] != 'GET' && $args['method'] != 'POST')
return false;
return $result;
}
/**
* Sends HTTP request
*
* @param $url string
* @param $args array
* @return WP_Error|array
*/
function w3_http_request($url, $args = array()) {
static $filter_set = false;
if (!$filter_set) {
add_filter('use_curl_transport', 'w3_use_curl_transport', 10, 2);
$filter_set = true;
}
$args = array_merge(array(
'user-agent' => W3TC_POWERED_BY
), $args);
return wp_remote_request($url, $args);
}
/**
* Sends HTTP GET request
*
* @param string $url
* @param array $args
* @return array|WP_Error
*/
function w3_http_get($url, $args = array()) {
$args = array_merge($args, array(
'method' => 'GET'
));
return w3_http_request($url, $args);
}
/**
* Downloads URL into a file
*
* @param string $url
* @param string $file
* @return boolean
*/
function w3_download($url, $file) {
if (strpos($url, '//') === 0) {
$url = (w3_is_https() ? 'https:' : 'http:') . $url;
}
$response = w3_http_get($url);
if (!is_wp_error($response) && $response['response']['code'] == 200) {
return @file_put_contents($file, $response['body']);
}
return false;
}
/**
* Returns upload info
*
* @return array
*/
function w3_upload_info() {
static $upload_info = null;
if ($upload_info === null) {
$upload_info = @wp_upload_dir();
if (empty($upload_info['error'])) {
$parse_url = @parse_url($upload_info['baseurl']);
if ($parse_url) {
$baseurlpath = (!empty($parse_url['path']) ? trim($parse_url['path'], '/') : '');
} else {
$baseurlpath = 'wp-content/uploads';
}
$upload_info['baseurlpath'] = '/' . $baseurlpath . '/';
} else {
$upload_info = false;
}
}
return $upload_info;
}
<?php
/**
* Returns file mime type
*
* @param string $file
* @return string
*/
function w3_get_mime_type($file) {
static $cache = array();
if (!isset($cache[$file])) {
$mime_type = false;
/**
* Try to detect by extension (fast)
*/
$mime_types = include W3TC_INC_DIR . '/mime/all.php';
foreach ($mime_types as $extension => $type) {
if (preg_match('~\.(' . $extension . ')$~i', $file)) {
if (is_array($type))
$mime_type = array_pop($type);
else
$mime_type = $type;
break;
}
}
/**
* Try to detect using file info function
*/
if (!$mime_type && function_exists('finfo_open')) {
$finfo = @finfo_open(FILEINFO_MIME);
if (!$finfo) {
$finfo = @finfo_open(FILEINFO_MIME);
}
if ($finfo) {
$mime_type = @finfo_file($finfo, $file);
if ($mime_type) {
$extra_mime_type_info = strpos($mime_type, "; ");
if ($extra_mime_type_info) {
$mime_type = substr($mime_type, 0, $extra_mime_type_info);
}
if ($mime_type == 'application/octet-stream') {
$mime_type = false;
}
}
@finfo_close($finfo);
}
}
/**
* Try to detect using mime type function
*/
if (!$mime_type && function_exists('mime_content_type')) {
$mime_type = @mime_content_type($file);
}
/**
* If detection failed use default mime type
*/
if (!$mime_type) {
$mime_type = 'application/octet-stream';
}
$cache[$file] = $mime_type;
}
return $cache[$file];
}
<?php
w3_require_once(W3TC_INC_DIR . '/functions/file.php');
/**
* Registers new blog url in url=>blog mapfile
*/
function w3_blogmap_register_new_item($blog_home_url, $config) {
if (!isset($GLOBALS['current_blog']))
return false;
$filename = w3_blogmap_filename($blog_home_url);
if (!@file_exists($filename))
$blog_ids = array();
else {
$data = @file_get_contents($filename);
$blog_ids = @eval($data);
if (!is_array($blog_ids))
$blog_ids = array();
}
if (isset($blog_ids[$blog_home_url]))
return false;
$data = $config->get_boolean('common.force_master') ? 'm' : 'c';
$blog_id = $GLOBALS['current_blog']->blog_id;
$blog_home_url = preg_replace('/[^a-zA-Z0-9\+\.%~!()\/\-\_]/', '', $blog_home_url);
$blog_ids_strings[] = "'" . $blog_home_url . "' => '" . $data.$blog_id . "'";
foreach ($blog_ids as $key => $value)
$blog_ids_strings[] = "'" . $key . "' => '" . $value . "'";
$data = sprintf('return array(%s);', implode(', ', $blog_ids_strings));
try {
w3_file_put_contents_atomic($filename, $data);
} catch (Exception $ex) {
return false;
}
return true;
}
<?php
/**
* Parses FAQ XML file into array
*
* @return array
*/
function w3_parse_faq() {
$faq = array();
$file = W3TC_LANGUAGES_DIR . '/faq-' . get_locale() . '.xml';
if (!file_exists($file)) {
$file = W3TC_LANGUAGES_DIR . '/faq-en_US.xml';
}
$xml = @file_get_contents($file);
$file2 = W3TC_LANGUAGES_DIR . '/faq-pro-' . get_locale() . '.xml';
if (!file_exists($file)) {
$file2 = W3TC_LANGUAGES_DIR . '/faq-pro-en_US.xml';
}
$xml2 = @file_get_contents($file2);
$xmls = array('standard' => $xml, 'pro' => $xml2);
foreach ($xmls as $state => $xml) {
if (function_exists('xml_parser_create')) {
$parser = @xml_parser_create('UTF-8');
xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, 'UTF-8');
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
$values = null;
$result = xml_parse_into_struct($parser, $xml, $values);
xml_parser_free($parser);
if ($result) {
$index = 0;
$root_section = $current_section = '';
$current_entry = array();
$lvl = 0;
foreach ($values as $value) {
switch ($value['type']) {
case 'open':
if ($value['tag'] === 'section') {
$current_section = $value['attributes']['name'];
if ($root_section == '' || $lvl == 0)
$root_section = $current_section;
$lvl++;
}
break;
case 'complete':
switch ($value['tag']) {
case 'question':
$current_entry['question'] = ($state == 'pro' ? '<strong style="color:#000">PRO version: </strong>': '' ) . $value['value'];
break;
case 'answer':
$current_entry['answer'] = $value['value'];
break;
}
break;
case 'close':
if ($value['tag'] == 'entry') {
$current_entry['index'] = ++$index;
if ($root_section != $current_section)
$faq[$root_section][$current_section][] = $current_entry;
else
$faq[$root_section][] = $current_entry;
}else if ($value['tag'] == 'section') {
$lvl--;
}
break;
}
}
}
}
}
return $faq;
}
/**
* Returns button link html
*
* @param string $text
* @param string $url
* @param boolean $new_window
* @return string
*/
function w3tc_button_link($text, $url, $new_window = false) {
$url = str_replace('&amp;', '&', $url);
if ($new_window) {
$onclick = sprintf('window.open(\'%s\');', addslashes($url));
} else {
$onclick = sprintf('document.location.href=\'%s\';', addslashes($url));
}
return w3tc_button($text, $onclick);
}
/**
* Returns hide note button html
*
* @param string $text
* @param string $note
* @param string $redirect
* @param boolean $admin if to use config admin
* @param string $page
* @return string
*/
function w3tc_button_hide_note($text, $note, $redirect = '', $admin = false, $page ='') {
if (!$page) {
w3_require_once(W3TC_LIB_W3_DIR . '/Request.php');
$page = W3_Request::get_string('page');
}
$url = sprintf('admin.php?page=%s&w3tc_hide_note&note=%s', $page, $note);
if ($admin)
$url .= '&admin=1';
if ($redirect != '') {
$url .= '&redirect=' . urlencode($redirect);
}
$url = wp_nonce_url($url, 'w3tc');
return w3tc_button_link($text, $url);
}
/**
* Returns button html
*
* @param string $text
* @param string $onclick
* @param string $class
* @return string
*/
function w3tc_button($text, $onclick = '', $class = '') {
return sprintf('<input type="button" class="button %s" value="%s" onclick="%s" />', htmlspecialchars($class), htmlspecialchars($text), htmlspecialchars($onclick));
}
<?php
/**
* Returns path of pgcache cache rules file
* Moved to separate file to not load rule.php for each disk enhanced request
*
* @return string
*/
function w3_get_pgcache_rules_cache_path() {
switch (true) {
case w3_is_apache():
case w3_is_litespeed():
if (w3_is_network()) {
$url = w3_get_home_url();
$match = null;
if (preg_match('~http(s)?://(.+?)(/)?$~', $url, $match)) {
$home_path = $match[2];
return W3TC_CACHE_PAGE_ENHANCED_DIR . '/' .
$home_path . '/.htaccess';
}
}
return W3TC_CACHE_PAGE_ENHANCED_DIR . '/.htaccess';
case w3_is_nginx():
return w3_get_nginx_rules_path();
}
return false;
}
<?php
/**
* Returns themes array
*
* @return array
*/
function w3_get_themes() {
$themes = array();
$wp_themes = w3tc_get_themes();
foreach ($wp_themes as $wp_theme) {
$theme_key = w3_get_theme_key($wp_theme['Theme Root'], $wp_theme['Template'], $wp_theme['Stylesheet']);
$themes[$theme_key] = $wp_theme['Name'];
}
return $themes;
}
/**
* Returns minify groups
*
* @param string $theme_name
* @return array
*/
function w3_get_theme_templates($theme_name) {
$groups = array(
'default' => __('All Templates', 'w3-total-cache')
);
$templates = w3_get_theme_files($theme_name);
foreach ($templates as $template) {
$basename = basename($template, '.php');
$groups[$basename] = ucfirst($basename);
}
return $groups;
}
/**
* Returns array of theme groups
*
* @param string $theme_name
* @return array
*/
function w3_get_theme_files($theme_name) {
$patterns = array(
'404',
'search',
'taxonomy(-.*)?',
'front-page',
'home',
'index',
'(image|video|text|audio|application).*',
'attachment',
'single(-.*)?',
'page(-.*)?',
'category(-.*)?',
'tag(-.*)?',
'author(-.*)?',
'date',
'archive',
'comments-popup',
'paged'
);
$templates = array();
$theme = w3tc_get_theme($theme_name);
if ($theme && isset($theme['Template Files'])) {
$template_files = (array) $theme['Template Files'];
foreach ($template_files as $template_file) {
/**
* Check file name
*/
$template = basename($template_file, '.php');
foreach ($patterns as $pattern) {
$regexp = '~^' . $pattern . '$~';
if (preg_match($regexp, $template)) {
$templates[] = $template_file;
continue 2;
}
}
/**
* Check get_header function call
*/
$template_content = @file_get_contents($template_file);
if ($template_content && preg_match('~\s*get_header[0-9_]*\s*\(~', $template_content)) {
$templates[] = $template_file;
}
}
sort($templates);
reset($templates);
}
return $templates;
}
<?php
/**
* Returns an notification box
* @param string $message
* @param string $id adds an id to the notification box
* @return string
*/
function w3_get_notification_box($message, $id = '') {
if (!isset($_GET['page']) || (isset($_GET['page']) && substr($_GET['page'], 0, 5) != 'w3tc_'))
$logo = sprintf('<img src="%s" alt="W3 Total Cache" style="height:30px" />"', plugins_url('/pub/img/W3TC_dashboard_logo_title.png', W3TC_FILE) . '');
else
$logo = '';
return sprintf('<div %s class="updated fade">%s</div>', $id? "id=\"$id\"" : '' ,$logo . $message);
}
/**
* Echos an notification box
* @param string $message
* @param string $id adds an id to the notification box
*/
function w3_e_notification_box($message, $id = '') {
echo w3_get_notification_box($message, $id);
}
/**
* Returns an error box
* @param $message
* @param string $id
* @return string
*/
function w3_get_error_box($message, $id = '') {
if (!isset($_GET['page']) || (isset($_GET['page']) && substr($_GET['page'], 0, 5) != 'w3tc_'))
$logo = sprintf('<img src="%s" alt="W3 Total Cache" style="height:30px" />', plugins_url('/pub/img/W3TC_dashboard_logo_title.png', W3TC_FILE) . '');
else
$logo = '';
return sprintf('<div %s class="error">%s</div>', $id? "id=\"$id\"" : '' ,$logo . $message);
}
/**
* Echos an error box
* @param $message
* @param string $id
*/
function w3_e_error_box($message, $id = '') {
echo w3_get_error_box($message);
}
/**
* Format bytes into B, KB, MB, GB and TB
* @param $bytes
* @param int $precision
* @return string
*/
function w3_format_bytes($bytes, $precision = 2) {
$units = array('B', 'KB', 'MB', 'GB', 'TB');
$bytes = max($bytes, 0);
$pow = floor(($bytes ? log($bytes) : 0) / log(1024));
$pow = min($pow, count($units) - 1);
// Uncomment one of the following alternatives
$bytes /= pow(1024, $pow);
// $bytes /= (1 << (10 * $pow));
return round($bytes, $precision) . ' ' . $units[$pow];
}
/**
* Echos an input text element
*
* @param string $id
* @param string $name
* @param string $value
* @param bool $disabled
* @param int $size
*/
function w3_ui_textbox($id, $name, $value, $disabled = false, $size = 40) {?>
<input class="enabled" type="text" id="<?php echo esc_attr($id)?>" name="<?php echo esc_attr($name)?>" value="<?php echo esc_attr($value)?>" <?php disabled($disabled) ?> size="<?php esc_attr_e($size)?>">
<?php
}
/**
* Echos an input password element
*
* @param string $id
* @param string $name
* @param string $value
* @param bool $disabled
* @param int $size
*/
function w3_ui_passwordbox($id, $name, $value, $disabled = false, $size = 40) {?>
<input class="enabled" type="password" id="<?php echo esc_attr($id)?>" name="<?php echo esc_attr($name)?>" value="<?php echo esc_attr($value)?>" <?php disabled($disabled) ?> size="<?php esc_attr_e($size)?>">
<?php
}
/**
* Echos an input text element
* @param string $id
* @param string $name
* @param string $value
* @param bool $disabled
*/
function w3_ui_textarea($id, $name, $value, $disabled = false) {?>
<textarea class="enabled" id="<?php echo esc_attr($id)?>" name="<?php echo esc_attr($name)?>" rows="5" cols=25 <?php disabled($disabled) ?>><?php echo esc_textarea($value)?></textarea>
<?php
}
/**
* Echos an input checkbox element
* @param string $id
* @param string $name
* @param bool $state whether checked or not
* @param bool $disabled
*/
function w3_ui_checkbox($id, $name, $state, $disabled = false) {?>
<input type="hidden" name="<?php echo esc_attr($name)?>" value="0">
<input class="enabled" type="checkbox" id="<?php echo esc_attr($id)?>" name="<?php echo esc_attr($name)?>" value="1" <?php checked($state)?> <?php disabled($disabled) ?>>
<?php
}
/**
* Echos an element
* @param string $type
* @param string $id
* @param string $name
* @param mixed $value
* @param bool $disabled
*/
function w3_ui_element($type, $id, $name, $value, $disabled = false) {
switch ($type) {
case 'textbox':
w3_ui_textbox($id, $name, $value, $disabled);
break;
case 'password':
w3_ui_passwordbox($id, $name, $value, $disabled);
break;
case 'textarea':
w3_ui_textarea($id, $name, $value, $disabled);
break;
case 'checkbox':
default:
w3_ui_checkbox($id, $name, $value, $disabled);
break;
}
}
/**
* @param string $path
* @return string|void
*/
function w3_admin_url($path) {
if (is_network_admin()) {
return network_admin_url($path);
}
return admin_url($path);
}
<?php
w3_require_once(W3TC_INC_DIR . '/functions/file.php');
/**
* Removes old legacy folders. User gets a note about manual removal if the function can't delete all in 20 seconds.
*/
function w3_remove_old_folders() {
$config_admin = w3_instance('W3_ConfigAdmin');
$old_folders = w3_find_old_folders();
if ($old_folders) {
$config_admin->set('notes.remove_w3tc',true);
$config_admin->save();
@set_time_limit(20);
foreach ($old_folders as $old_folder)
w3_rmdir($old_folder);
$config_admin->set('notes.remove_w3tc',false);
$config_admin->save();
}
}
/**
* Finds and returns a list of old legacy folders.
* @return array
*/
function w3_find_old_folders(){
$dir = @opendir(WP_CONTENT_DIR);
$include = 'w3tc*';
$exclude = 'w3tc-config';
$folders = array();
if ($dir) {
while (($entry = @readdir($dir)) !== false) {
if ($entry == '.' || $entry == '..') {
continue;
}
if (fnmatch($exclude, basename($entry))) {
continue;
}
if (fnmatch($include, basename($entry))) {
@closedir($dir);
$folders[] = WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $entry;
}
}
@closedir($dir);
}
return $folders;
}
<?php
/**
* Formats URL
*
* @param string $url
* @param array $params
* @param boolean $skip_empty
* @param string $separator
* @return string
*/
function w3_url_format($url = '', $params = array(), $skip_empty = false, $separator = '&') {
if ($url != '') {
$parse_url = @parse_url($url);
$url = '';
if (!empty($parse_url['scheme'])) {
$url .= $parse_url['scheme'] . '://';
if (!empty($parse_url['user'])) {
$url .= $parse_url['user'];
if (!empty($parse_url['pass'])) {
$url .= ':' . $parse_url['pass'];
}
}
if (!empty($parse_url['host'])) {
$url .= $parse_url['host'];
}
if (!empty($parse_url['port']) && $parse_url['port'] != 80) {
$url .= ':' . (int) $parse_url['port'];
}
}
if (!empty($parse_url['path'])) {
$url .= $parse_url['path'];
}
if (!empty($parse_url['query'])) {
$old_params = array();
parse_str($parse_url['query'], $old_params);
$params = array_merge($old_params, $params);
}
$query = w3_url_query($params);
if ($query != '') {
$url .= '?' . $query;
}
if (!empty($parse_url['fragment'])) {
$url .= '#' . $parse_url['fragment'];
}
} else {
$query = w3_url_query($params, $skip_empty, $separator);
if ($query != '') {
$url = '?' . $query;
}
}
return $url;
}
/**
* Formats query string
*
* @param array $params
* @param boolean $skip_empty
* @param string $separator
* @return string
*/
function w3_url_query($params = array(), $skip_empty = false, $separator = '&') {
$str = '';
static $stack = array();
foreach ((array) $params as $key => $value) {
if ($skip_empty === true && empty($value)) {
continue;
}
array_push($stack, $key);
if (is_array($value)) {
if (count($value)) {
$str .= ($str != '' ? '&' : '') . w3_url_query($value, $skip_empty, $key);
}
} else {
$name = '';
foreach ($stack as $key) {
$name .= ($name != '' ? '[' . $key . ']' : $key);
}
$str .= ($str != '' ? $separator : '') . $name . '=' . rawurlencode($value);
}
array_pop($stack);
}
return $str;
}
\ No newline at end of file
<?php
/**
* Registers dashboard widgets.
*
* Handles POST data, sets up filters.
*
* @since 0.9.2.6
*/
function w3tc_dashboard_setup() {
global $w3tc_registered_widgets, $w3tc_registered_widget_controls, $w3tc_dashboard_control_callbacks;
$w3tc_dashboard_control_callbacks = array();
$screen = get_current_screen();
$update = false;
$widget_options = get_option( 'w3tc_dashboard_widget_options' );
if ( !$widget_options || !is_array($widget_options) )
$widget_options = array();
// Hook to register new widgets
// Filter widget order
if ( is_network_admin() ) {
do_action( 'w3tc_network_dashboard_setup' );
$dashboard_widgets = apply_filters( 'w3tc_network_dashboard_widgets', array() );
} else {
do_action( 'w3tc_dashboard_setup' );
$dashboard_widgets = apply_filters( 'w3tc_dashboard_widgets', array() );
}
foreach ( $dashboard_widgets as $widget_id ) {
$name = empty( $w3tc_registered_widgets[$widget_id]['all_link'] ) ? $w3tc_registered_widgets[$widget_id]['name'] : $w3tc_registered_widgets[$widget_id]['name'] . " <a href='{$w3tc_registered_widgets[$widget_id]['all_link']}' class='edit-box open-box'>" . __('View all') . '</a>';
w3tc_add_dashboard_widget( $widget_id, $name, $w3tc_registered_widgets[$widget_id]['callback'], $w3tc_registered_widget_controls[$widget_id]['callback'] );
}
if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget_id']) ) {
check_admin_referer( 'edit-dashboard-widget_' . $_POST['widget_id'], 'dashboard-widget-nonce' );
ob_start(); // hack - but the same hack wp-admin/widgets.php uses
w3tc_dashboard_trigger_widget_control( $_POST['widget_id'] );
ob_end_clean();
}
if ( $update )
update_option( 'w3tc_dashboard_widget_options', $widget_options );
do_action('do_meta_boxes', $screen->id, 'normal', '');
do_action('do_meta_boxes', $screen->id, 'side', '');
}
function w3tc_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_callback = null,$location = 'normal' , $title_image = '' ) {
$screen = get_current_screen();
global $w3tc_dashboard_control_callbacks;
if ($title_image && $title_image != 'div')
$widget_name = '<img class="' . $widget_id . '" src="' . esc_attr($title_image) . '" />'.$widget_name;
else if ($title_image == 'div')
$widget_name = '<div class="w3_widget_logo"></div>' . $widget_name;
if ( $control_callback && current_user_can( 'edit_dashboard' ) && is_callable( $control_callback ) ) {
$w3tc_dashboard_control_callbacks[$widget_id] = $control_callback;
if ( isset( $_GET['edit'] ) && $widget_id == $_GET['edit'] ) {
list($url) = explode( '#', add_query_arg( 'edit', false ), 2 );
$widget_name .= ' <span class="postbox-title-action"><a href="' . esc_url( $url ) . '">' . __( 'Cancel' ) . '</a></span>';
$callback = '_w3tc_dashboard_control_callback';
} else {
list($url) = explode( '#', add_query_arg( 'edit', $widget_id ), 2 );
$widget_name .= ' <span class="postbox-title-action"><a href="' . esc_url( "$url#$widget_id" ) . '" class="edit-box open-box">' . __( 'Configure' ) . '</a></span>';
}
}
$side_widgets = array();
$priority = 'core';
add_meta_box( $widget_id, $widget_name, $callback, $screen, $location, $priority );
}
/* Dashboard Widgets Controls */
function _w3tc_dashboard_control_callback( $dashboard, $meta_box ) {
echo '<form action="" method="post" class="dashboard-widget-control-form">';
w3tc_dashboard_trigger_widget_control( $meta_box['id'] );
wp_nonce_field( 'edit-dashboard-widget_' . $meta_box['id'], 'dashboard-widget-nonce' );
echo '<input type="hidden" name="widget_id" value="' . esc_attr($meta_box['id']) . '" />';
submit_button( __('Submit') );
echo '</form>';
}
/**
* Calls widget control callback.
*
* @since 0.9.2.6
*
* @param int|bool $widget_control_id Registered Widget ID.
*/
function w3tc_dashboard_trigger_widget_control( $widget_control_id = false ) {
global $w3tc_dashboard_control_callbacks;
if ( is_scalar($widget_control_id) && $widget_control_id && isset($w3tc_dashboard_control_callbacks[$widget_control_id]) && is_callable($w3tc_dashboard_control_callbacks[$widget_control_id]) ) {
call_user_func( $w3tc_dashboard_control_callbacks[$widget_control_id], '', array( 'id' => $widget_control_id, 'callback' => $w3tc_dashboard_control_callbacks[$widget_control_id] ) );
}
}
\ No newline at end of file
<?php if (!defined('W3TC')) die(); ?>
<h3>Select bucket location:</h3>
<p>
<label>Location:
<select id="cdn_<?php echo $type; ?>_bucket_location">
<?php foreach ($locations as $location => $name): ?>
<option value="<?php echo esc_attr($location); ?>"><?php echo $name; ?></option>
<?php endforeach; ?>
</select>
</label>
</p>
<p>
<input id="cdn_create_container" class="button-primary {type: '<?php echo $type; ?>', nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" type="button" value="<?php _e('Create bucket', 'w3-total-cache'); ?>" />
<span id="cdn_create_container_status" class="w3tc-status w3tc-process"></span>
</p>
<p style="text-align: center;">
<input class="button" type="button" value="<?php _e('Close', 'w3-total-cache'); ?>" />
</p>
<?php if (!defined('W3TC')) die(); ?>
<h3><?php _e('Create Pull Zone', 'w3-total-cache')?></h3>
<style type="text/css">.form-table th {width:auto}</style>
<div class="netdna-maxcdn-form">
<div class="create-error w3tc-error"></div>
<table class="form-table">
<tr>
<th><label for="name"><?php _e('Name:', 'w3-total-cache') ?></label></th>
<td><input type="text" id="name" name="name"/><div class="name_message w3tc-error inline"></div>
<p><span class="description"><?php _e('Pull Zone Name. Length: 3-32 chars; only letters, digits, and dash (-) accepted', 'w3-total-cache')?></span></p>
</td>
</tr>
<tr>
<th><label for="url"><?php _e('Origin <acronym title="Uniform Resource Indicator">URL</acronym>:', 'w3-total-cache') ?></label></th>
<td><?php echo w3_get_home_url() ?>
<p><span class="description"><?php _e('Your server\'s hostname or domain', 'w3-total-cache') ?></span></p>
</td>
</tr>
<tr>
<th><label for="label"><?php _e('Description:', 'w3-total-cache') ?></label></th>
<td><textarea id="label" name="label" cols="40"></textarea><div class="label_message w3tc-error inline"></div>
<p><span class="description"><?php _e('Something that describes your zone. Length: 1-255 chars', 'w3-total-cache')?></span></p>
</td>
</tr>
<tr>
<th></th>
<td>
<input type="hidden" name="type" id="type" value="<?php echo $type ?>" />
<?php wp_nonce_field('w3tc') ?>
<input id="create_pull_zone" id="create_pull_zone" type="button" value="<?php _e('Create Pull Zone', 'w3-total-cache')?>" class="button-primary" />
<div id="pull-zone-loading" style="display:inline-block;"></div>
</td>
</tr>
</table>
</div>
\ No newline at end of file
<?php if (!defined('W3TC')) die(); ?>
<div id="w3tc-edge-mode">
<div class="w3tc-overlay-logo"></div>
<header>
</header>
<div class="content">
<p><strong><?php _e('You can now keep up-to-date on all of the web performance optimization (WPO) techniques that will make your website as fast as possible without having to worry about new features breaking your website when you update!', 'w3-total-cache') ?></strong></p>
<p><?php _e('Enable "edge mode" to opt-in to pre-release features or simply close this window to opt-in to bug fixes, security fixes and settings updates only.', 'w3-total-cache') ?></p>
</div>
<div class="footer">
<?php
$wp_url = w3_admin_url('admin.php?page='. $page .'&w3tc_edge_mode_enable');
echo w3tc_action_button(__('Enable Edge Mode', 'w3-total-cache'), $wp_url, "btn w3tc-size image btn-default palette-turquoise") ?>
<?php wp_nonce_field('w3tc') ?>
<input type="button" class="button-cancel btn w3tc-size btn-default outset palette-light-grey" value="<?php _e('Cancel', 'w3-total-cache') ?>">
</div>
</div>
<?php if (!defined('W3TC')) die(); ?>
<h3>Minify: Help Wizard</h3>
<p>
<?php _e('To get started with minify, we\'ve identified the following external CSS and JS objects in the', 'w3-total-cache'); ?>
<select id="recom_theme">
<?php foreach ($themes as $_theme_key => $_theme_name): ?>
<option value="<?php echo htmlspecialchars($_theme_key); ?>"<?php selected($_theme_key, $theme_key); ?>><?php echo htmlspecialchars($_theme_name); ?><?php if ($_theme_key == $theme_key): ?> (active)<?php endif; ?></option>
<?php endforeach; ?>
</select>
<?php _e('theme. Select "add" the files you wish to minify, then click "apply &amp; close" to save the settings.', 'w3-total-cache'); ?>
</p>
<div id="recom_container">
<h4 style="margin-top: 0;">JavaScript:</h4>
<?php if (count($js_groups)) :?>
<ul id="recom_js_files" class="minify-files">
<?php $index = 0; foreach ($js_groups as $js_group => $js_files): ?>
<?php foreach ($js_files as $js_file): $index++; ?>
<li>
<table>
<tr>
<th class="minify-files-add"><?php _e('Add:', 'w3-total-cache'); ?></th>
<th>&nbsp;</th>
<th><?php _e('File URI:', 'w3-total-cache'); ?></th>
<th><?php _e('Template:', 'w3-total-cache'); ?></th>
<th colspan="2"><?php _e('Embed Location:', 'w3-total-cache'); ?></th>
</tr>
<tr>
<td class="minify-files-add">
<input type="checkbox" name="recom_js_useit" value="1"<?php checked(isset($checked_js[$js_group][$js_file]), true); ?> />
</td>
<td><?php echo $index; ?>.</td>
<td>
<input type="text" name="recom_js_file" value="<?php echo esc_attr($js_file); ?>" size="70" />
</td>
<td>
<select name="recom_js_template">
<?php foreach ($templates as $template_key => $template_name): ?>
<option value="<?php echo esc_attr($template_key); ?>"<?php selected($template_key, $js_group); ?>><?php echo htmlspecialchars($template_name); ?></option>
<?php endforeach; ?>
</select>
</td>
<td>
<?php $selected = (isset($locations_js[$js_group][$js_file]) ? $locations_js[$js_group][$js_file] : ''); ?>
<select name="recom_js_location">
<option value="include"<?php selected($selected, 'include'); ?>><?php _e('Embed in &lt;head&gt;', 'w3-total-cache'); ?></option>
<option value="include-body"<?php selected($selected, 'include-body'); ?>><?php _e('Embed after &lt;body&gt;', 'w3-total-cache'); ?></option>
<option value="include-footer"<?php selected($selected, 'include-footer'); ?>><?php _e('Embed before &lt;/body&gt;', 'w3-total-cache'); ?></option>
</select>
</td>
<td>
<input class="js_file_verify button" type="button" value="<?php _e('Verify URI', 'w3-total-cache'); ?>" />
</td>
</tr>
</table>
</li>
<?php endforeach; ?>
<?php endforeach; ?>
</ul>
<p>
<a href="#" id="recom_js_check"><?php _e('Check / Uncheck All', 'w3-total-cache'); ?></a>
</p>
<?php else:?>
<p><?php _e('No files found.', 'w3-total-cache'); ?></p>
<?php endif;?>
<h4><?php _e('Cascading Style Sheets:', 'w3-total-cache'); ?></h4>
<?php if (count($css_groups)) :?>
<ul id="recom_css_files" class="minify-files">
<?php $index = 0; foreach ($css_groups as $css_group => $css_files): ?>
<?php foreach ($css_files as $css_file): $index++; ?>
<li>
<table>
<tr>
<th class="minify-files-add"><?php _e('Add:', 'w3-total-cache'); ?></th>
<th>&nbsp;</th>
<th><?php _e('File URI:', 'w3-total-cache'); ?></th>
<th colspan="2"><?php _e('Template:', 'w3-total-cache'); ?></th>
</tr>
<tr>
<td class="minify-files-add">
<input type="checkbox" name="recom_css_useit" value="1"<?php checked(isset($checked_css[$css_group][$css_file]), true); ?> />
</td>
<td><?php echo $index; ?>.</td>
<td>
<input type="text" name="recom_css_file" value="<?php echo esc_attr($css_file); ?>" size="70" />
</td>
<td>
<select name="recom_css_template">
<?php foreach ($templates as $template_key => $template_name): ?>
<option value="<?php echo esc_attr($template_key); ?>"<?php selected($template_key, $css_group); ?>><?php echo htmlspecialchars($template_name); ?></option>
<?php endforeach; ?>
</select>
</td>
<td>
<input class="css_file_verify button" type="button" value="<?php _e('Verify URI', 'w3-total-cache'); ?>" />
</td>
</tr>
</table>
</li>
<?php endforeach; ?>
<?php endforeach; ?>
</ul>
<p>
<a href="#" id="recom_css_check"><?php _e('Check / Uncheck All', 'w3-total-cache'); ?></a>
</p>
<?php else:?>
<p>No files found.</p>
<?php endif;?>
</div>
<div id="recom_container_bottom">
<p>
<input class="recom_apply button-primary" type="button" value="<?php _e('Apply &amp; close', 'w3-total-cache'); ?>" />
</p>
<fieldset>
<legend><?php _e('Notes', 'w3-total-cache'); ?></legend>
<ul>
<li><?php _e('Typically minification of advertiser code, analytics/statistics or any other types of tracking code is not recommended.', 'w3-total-cache'); ?></li>
<li><?php _e('Scripts that were not already detected above may require <a href="admin.php?page=w3tc_support&amp;request_type=plugin_config">professional consultation</a> to implement.', 'w3-total-cache'); ?></li>
</ul>
</fieldset>
</div>
\ No newline at end of file
<div style="min-height:400px;height:100%;margin-top:15px;">
<iframe id="buy_frame" src="<?php echo EDD_W3EDGE_STORE_URL_PLUGIN ?>" style="height:90%;width:100%" scrolling="auto">
</iframe>
</div>
\ No newline at end of file
<?php if (!defined('W3TC')) die(); ?>
<div id="w3tc-support-us">
<div class="w3tc-overlay-logo"></div>
<header>
<div class="left" style="float:left">
<h2>Frederick Townes</h2>
<h3>CEO, W3 EDGE</h3>
</div>
<div class="right" style="float:right">
<div style="display: inline-block">
<iframe height="21" width="100" src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2FW3EDGE&amp;width=100&amp;height=21&amp;colorscheme=light&amp;layout=button_count&amp;action=like&amp;show_faces=true&amp;send=false&amp;appId=53494339074" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe>
</div>
<div style="display: inline-block; margin-left: 10px;">
<a href="https://twitter.com/w3edge" class="twitter-follow-button" data-show-count="true" data-show-screen-name="false">Follow @w3edge</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
</div>
<div style="display: inline-block; margin-left: 10px;">
<!-- Place this tag where you want the widget to render. -->
<div class="g-follow" data-annotation="bubble" data-height="20" data-href="https://plus.google.com/106009620651385224281" data-rel="author"></div>
<!-- Place this tag after the last widget tag. -->
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
</div>
</div>
</header>
<form action="<?php echo w3_admin_url('admin.php?page=' . $this->_page); ?>&amp;w3tc_config_save_support_us" method="post">
<div class="content">
<h3 class="font-palette-dark-skies"><?php _e('Support Us, It\'s Free!', 'w3-total-cache'); ?></h3>
<p><?php _e('We noticed you\'ve been using W3 Total cache for at least 30 days, please help us improve WordPress:', 'w3-total-cache'); ?></p>
<ul>
<li>
<label>
Link to us: <br />
<div class="styled-select">
<select name="support" class="w3tc-size select">
<option value=""><?php esc_attr_e('select location', 'w3-total-cache'); ?></option>
<?php foreach ($supports as $support_id => $support_name): ?>
<option value="<?php echo esc_attr($support_id); ?>"<?php echo selected($this->_config->get_string('common.support'), $support_id); ?>><?php echo htmlspecialchars($support_name); ?></option>
<?php endforeach; ?>
</select>
</div>
</label>
</li>
<li>
<label>Send a tweet:<br />
<?php
$tweet_url = 'http://twitter.com/home/?status=I use W3 Total Cache you should too, via @w3edge';
echo w3tc_action_button(__('Tell Your Friends', 'w3-total-cache'), $tweet_url, "btn w3tc-size image btn-default palette-twitter") ?>
</label>
</li>
<li>
<label>
Login to wordpress.org to give us a great rating:<br>
<?php
$wp_url = 'http://wordpress.org/support/view/plugin-reviews/w3-total-cache';
echo w3tc_action_button(__('Login & Rate Us', 'w3-total-cache'), $wp_url, "btn w3tc-size image btn-default palette-wordpress") ?>
</label>
</li>
</ul>
<p>
<label class="w3tc_signup_email" for="email">You can also sign up for our newsletter:<br />
<input id="email" name="email" type="text" class="form-control w3tc-size" value="<?php esc_attr_e($email) ?>"></label><br />
<input type="checkbox" name="signmeup" id="signmeup" class="css-checkbox" value="1" checked="checked" /><label for="signmeup" class="css-label"> <?php _e('Yes, sign me up.', 'w3-total-cache') ?> </label>
</p>
</div>
<div class="footer">
<p>
<?php wp_nonce_field('w3tc') ?>
<input type="submit" class="btn w3tc-size image btn-primary outset save palette-turquoise " value="Save &amp; close">
<?php
echo w3tc_cancel_button('support_us', 'btn w3tc-size btn-default outset palette-light-grey')
?>
</p>
</div>
</form>
</div>
<?php if (!defined('W3TC')) die(); ?>
<div id="w3tc-upgrade">
<div class="w3tc-overlay-logo"></div>
<header>
<div>
<div class="left" style="float:left">
<h2>W3 Total Cache Pro unlocks more performance options for any website:</h2>
</div>
<div class="right" style="float:right">
<h2>only $99 <span>/year</span></h2>
</div>
</div>
<div class="description">
<img src="<?php echo plugins_url('pub/img/overlay/w3-meteor.png', W3TC_FILE) ?>" />
<ul>
<li><strong>Fragment Caching Module</strong><br>
Unlocking the fragment caching module delivered enhanced performance for plugins and themes that use the WordPress Transient API. It also provides a framework for increasing for developers that specifically use it like StudioPress' Genesis Framework.</li>
<li>
<strong>Exclusive Extensions</strong><br>
Unlock up to 60% performance improvement in the Genesis Theme Framework by StudioPress using the extension for W3TC's Fragment Caching Module. </li>
<li>
<strong>Full Site Content Delivery Network (CDN) Mirroring</strong><br>
Upcoming: Provide the best user experience possible by enhancing by hosting HTML pages and RSS feeds with (supported CDNs) high performance global networks. </li>
</ul>
</div>
</header>
<div class="content">
</div>
<div class="footer">
<input id="w3tc-purchase" type="button" class="btn w3tc-size image btn-default palette-turquoise secure" value="<?php _e('Subscribe to Go Faster Now', 'w3-total-cache') ?> " />
</div>
</div>
<?php
/**
* CSS and JS mime types
*/
return array(
'css' => 'text/css',
'htc' => 'text/x-component',
'less' => 'text/css',
//JS - varieties
'js' => 'application/x-javascript',
'js2' => 'application/javascript',
'js3' => 'text/javascript',
'js4' => 'text/x-js',
);
<?php
/**
* HTML mime types
*/
return array(
'html|htm' => 'text/html',
'rtf|rtx' => 'text/richtext',
'svg|svgz' => 'image/svg+xml',
'txt' => 'text/plain',
'xsd' => 'text/xsd',
'xsl' => 'text/xsl',
'xml' => 'text/xml'
);
<?php
/**
* Other mime types
*/
return array(
'asf|asx|wax|wmv|wmx' => 'video/asf',
'avi' => 'video/avi',
'bmp' => 'image/bmp',
'class' => 'application/java',
'divx' => 'video/divx',
'doc|docx' => 'application/msword',
'eot' => 'application/vnd.ms-fontobject',
'exe' => 'application/x-msdownload',
'gif' => 'image/gif',
'gz|gzip' => 'application/x-gzip',
'ico' => 'image/x-icon',
'jpg|jpeg|jpe' => 'image/jpeg',
'json' => 'application/json',
'mdb' => 'application/vnd.ms-access',
'mid|midi' => 'audio/midi',
'mov|qt' => 'video/quicktime',
'mp3|m4a' => 'audio/mpeg',
'mp4|m4v' => 'video/mp4',
'mpeg|mpg|mpe' => 'video/mpeg',
'mpp' => 'application/vnd.ms-project',
'otf' => array('application/x-font-otf', 'application/vnd.ms-opentype'),
'odb' => 'application/vnd.oasis.opendocument.database',
'odc' => 'application/vnd.oasis.opendocument.chart',
'odf' => 'application/vnd.oasis.opendocument.formula',
'odg' => 'application/vnd.oasis.opendocument.graphics',
'odp' => 'application/vnd.oasis.opendocument.presentation',
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
'odt' => 'application/vnd.oasis.opendocument.text',
'ogg' => 'audio/ogg',
'pdf' => 'application/pdf',
'png' => 'image/png',
'pot|pps|ppt|pptx' => 'application/vnd.ms-powerpoint',
'ra|ram' => 'audio/x-realaudio',
'svg|svgz' => 'image/svg+xml',
'swf' => 'application/x-shockwave-flash',
'tar' => 'application/x-tar',
'tif|tiff' => 'image/tiff',
'ttf|ttc' => array('application/x-font-ttf', 'application/vnd.ms-opentype'),
'wav' => 'audio/wav',
'wma' => 'audio/wma',
'wri' => 'application/vnd.ms-write',
'woff' => 'application/font-woff',
'xla|xls|xlsx|xlt|xlw' => 'application/vnd.ms-excel',
'zip' => 'application/zip'
);
<?php if (!defined('W3TC')) die(); ?>
<?php include W3TC_INC_DIR . '/options/common/header.php'; ?>
<div id="about">
<p><?php _e('User experience is an important aspect of every web site and all web sites can benefit from effective caching and file size reduction. We have applied web site optimization methods typically used with high traffic sites and simplified their implementation. Coupling these methods either <a href="http://memcached.org/" target="_blank">memcached</a> and/or opcode caching and the <acronym title="Content Delivery Network">CDN</acronym> of your choosing to provide the following features and benefits:') ?></p>
<ul>
<li><?php _e('Improved Google search engine ranking', 'w3-total-cache'); ?></li>
<li><?php _e('Increased visitor time on site', 'w3-total-cache'); ?></li>
<li><?php _e('Optimized progressive render (pages start rendering immediately)', 'w3-total-cache'); ?></li>
<li><?php _e('Reduced <acronym title="Hypertext Transfer Protocol">HTTP</acronym> Transactions, <acronym title="Domain Name System">DNS</acronym> lookups and reduced document load time', 'w3-total-cache'); ?></li>
<li><?php _e('Bandwidth savings via Minify and <acronym title="Hypertext Transfer Protocol">HTTP</acronym> compression of <acronym title="Hypertext Markup Language">HTML</acronym>, <acronym title="Cascading Style Sheet">CSS</acronym>, JavaScript and feeds', 'w3-total-cache'); ?></li>
<li><?php _e('Increased web server concurrency and increased scale (easily sustain high traffic spikes)', 'w3-total-cache'); ?></li>
<li><?php _e('Transparent content delivery network (<acronym title="Content Delivery Network">CDN</acronym>) integration with Media Library, theme files and WordPress core', 'w3-total-cache'); ?></li>
<li><?php _e('Caching of pages / posts in memory or on disk or on CDN (mirror only)', 'w3-total-cache'); ?></li>
<li><?php _e('Caching of (minified) <acronym title="Cascading Style Sheet">CSS</acronym> and JavaScript in memory, on disk or on <acronym title="Content Delivery Network">CDN</acronym>', 'w3-total-cache'); ?></li>
<li><?php _e('Caching of database objects in memory or on disk', 'w3-total-cache'); ?></li>
<li><?php _e('Caching of objects in memory or on disk', 'w3-total-cache'); ?></li>
<li><?php _e('Caching of feeds (site, categories, tags, comments, search results) in memory or on disk', 'w3-total-cache'); ?></li>
<li><?php _e('Caching of search results pages (i.e. <acronym title="Uniform Resource Identifier">URI</acronym>s with query string variables) in memory or on disk', 'w3-total-cache'); ?></li>
<li><?php _e('Minification of posts / pages and feeds', 'w3-total-cache'); ?></li>
<li><?php _e('Minification (concatenation and white space removal) of inline, external or 3rd party JavaScript / <acronym title="Cascading Style Sheet">CSS</acronym> with automated updates', 'w3-total-cache'); ?></li>
<li><?php _e('Complete header management including <a href="http://en.wikipedia.org/wiki/HTTP_ETag">Etags</a>', 'w3-total-cache'); ?></li>
<li><?php _e('JavaScript embedding group and location management', 'w3-total-cache'); ?></li>
<li><?php _e('Import post attachments directly into the Media Library (and <acronym title="Content Delivery Network">CDN</acronym>)', 'w3-total-cache'); ?></li>
</ul>
<p><?php _e('Your users have less data to download, you can now serve more visitors at once without upgrading your hardware and you don\'t have to change how you do anything; just set it and forget it.', 'w3-total-cache'); ?></p>
<h4><?php _e('Who do I thank for all of this?', 'w3-total-cache'); ?></h4>
<p><?php _e('It\'s quite difficult to recall all of the innovators that have shared their thoughts, code and experiences in the blogosphere over the years, but here are some names to get you started:', 'w3-total-cache'); ?></p>
<ul>
<li><a href="http://stevesouders.com/" target="_blank">Steve Souders</a></li>
<li><a href="http://mrclay.org/" target="_blank">Steve Clay</a></li>
<li><a href="http://wonko.com/" target="_blank">Ryan Grove</a></li>
<li><a href="http://www.nczonline.net/blog/2009/06/23/loading-javascript-without-blocking/" target="_blank">Nicholas Zakas</a> </li>
<li><a href="http://rtdean.livejournal.com/" target="_blank">Ryan Dean</a></li>
<li><a href="http://gravitonic.com/" target="_blank">Andrei Zmievski</a></li>
<li>George Schlossnagle</li>
<li>Daniel Cowgill</li>
<li><a href="http://toys.lerdorf.com/" target="_blank">Rasmus Lerdorf</a></li>
<li><a href="http://notmysock.org/" target="_blank">Gopal Vijayaraghavan</a></li>
<li><a href="http://eaccelerator.net/" target="_blank">Bart Vanbraban</a></li>
<li><a href="http://xcache.lighttpd.net/" target="_blank">mOo</a></li>
</ul>
<p><?php _e('Please reach out to all of these people and support their projects if you\'re so inclined.', 'w3-total-cache'); ?></p>
</div>
<?php include W3TC_INC_DIR . '/options/common/footer.php'; ?>
<?php if (!defined('W3TC')) die(); ?>
<tr>
<th style="width: 300px;"><label for="cdn_akamai_username"><?php _e('Username:', 'w3-total-cache'); ?></label></th>
<td>
<input id="cdn_akamai_username" class="w3tc-ignore-change" type="text"
<?php $this->sealing_disabled('cdn') ?> name="cdn.akamai.username" value="<?php echo esc_attr($this->_config->get_string('cdn.akamai.username')); ?>" size="60" />
</td>
</tr>
<tr>
<th><label for="cdn_akamai_password"><?php _e('Password:', 'w3-total-cache'); ?></label></th>
<td>
<input id="cdn_akamai_password" class="w3tc-ignore-change"
<?php $this->sealing_disabled('cdn') ?> type="password" name="cdn.akamai.password" value="<?php echo esc_attr($this->_config->get_string('cdn.akamai.password')); ?>" size="60" />
</td>
</tr>
<tr>
<th><label for="cdn_akamai_email_notification"><?php _e('Email notification:', 'w3-total-cache'); ?></label></th>
<td>
<textarea id="cdn_akamai_email_notification" name="cdn.akamai.email_notification"
<?php $this->sealing_disabled('cdn') ?> cols="40" rows="5"><?php echo esc_textarea(implode("\r\n", $this->_config->get_array('cdn.akamai.email_notification'))); ?></textarea>
<br />
<span class="description"><?php _e('Specify email addresses for completed removal notifications. One email per line.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th><label for="cdn_akamai_zone"><?php _e('Domain to purge:', 'w3-total-cache'); ?></label></th>
<td>
<select id="cdn_akamai_zone" name="cdn.akamai.zone">
<option value="production" <?php selected($this->_config->get_string('cdn.akamai.zone'), 'production'); ?>>Production</option>
<option value="staging" <?php selected($this->_config->get_string('cdn.akamai.zone'), 'staging'); ?>>Staging</option>
</select>
</td>
</tr>
<tr>
<th><label for="cdn_akamai_action"><?php _e('Purge action:', 'w3-total-cache'); ?></label></th>
<td>
<select id="cdn_akamai_action" name="cdn.akamai.action">
<option value="invalidate" <?php selected($this->_config->get_string('cdn.akamai.action'), 'invalidate'); ?>>Invalidate</option>
<option value="remove" <?php selected($this->_config->get_string('cdn.akamai.action'), 'remove'); ?>>Remove</option>
</select>
</td>
</tr>
<tr>
<th><label for="cdn_akamai_ssl"><?php _e('<acronym title="Secure Sockets Layer">SSL</acronym> support:</label>', 'w3-total-cache'); ?></th>
<td>
<select id="cdn_akamai_ssl" name="cdn.akamai.ssl" <?php $this->sealing_disabled('cdn') ?>>
<option value="auto"<?php selected($this->_config->get_string('cdn.akamai.ssl'), 'auto'); ?>><?php _e('Auto (determine connection type automatically)', 'w3-total-cache'); ?></option>
<option value="enabled"<?php selected($this->_config->get_string('cdn.akamai.ssl'), 'enabled'); ?>><?php _e('Enabled (always use SSL)', 'w3-total-cache'); ?></option>
<option value="disabled"<?php selected($this->_config->get_string('cdn.akamai.ssl'), 'disabled'); ?>><?php _e('Disabled (always use HTTP)', 'w3-total-cache'); ?></option>
</select>
<br /><span class="description"><?php _e('Some <acronym>CDN</acronym> providers may or may not support <acronym title="Secure Sockets Layer">SSL</acronym>, contact your vendor for more information.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th><?php _e('Replace site\'s hostname with:', 'w3-total-cache'); ?></th>
<td>
<?php $cnames = $this->_config->get_array('cdn.akamai.domain'); include W3TC_INC_DIR . '/options/cdn/common/cnames.php'; ?>
<br /><span class="description"><?php _e('Enter the hostname provided by your <acronym>CDN</acronym> provider, this value will replace your site\'s hostname in the <acronym title="Hypertext Markup Language">HTML</acronym>.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th colspan="2">
<input id="cdn_test" class="button {type: 'akamai', nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" type="button" value="<?php _e('Test akamai', 'w3-total-cache'); ?>" /> <span id="cdn_test_status" class="w3tc-status w3tc-process"></span>
</th>
</tr>
<?php if (!defined('W3TC')) die(); ?>
<tr>
<th style="width: 300px;"><label for="cdn_att_account"><?php _e('Account #:', 'w3-total-cache'); ?></label></th>
<td>
<input id="cdn_att_account" class="w3tc-ignore-change" type="text"
<?php $this->sealing_disabled('cdn') ?> name="cdn.att.account" value="<?php echo esc_attr($this->_config->get_string('cdn.att.account')); ?>" size="60" />
</td>
</tr>
<tr>
<th><label for="cdn_att_token"><?php _e('Token:', 'w3-total-cache'); ?></th>
<td>
<input id="cdn_att_token" class="w3tc-ignore-change" type="password"
<?php $this->sealing_disabled('cdn') ?> name="cdn.att.token" value="<?php echo esc_attr($this->_config->get_string('cdn.att.token')); ?>" size="60" />
</td>
</tr>
<tr>
<th><label for="cdn_att_ssl"><?php _e('<acronym title="Secure Sockets Layer">SSL</acronym> support:', 'w3-total-cache'); ?></label></th>
<td>
<select id="cdn_att_ssl" name="cdn.att.ssl" <?php $this->sealing_disabled('cdn') ?>>
<option value="auto"<?php selected($this->_config->get_string('cdn.att.ssl'), 'auto'); ?>><?php _e('Auto (determine connection type automatically)', 'w3-total-cache'); ?></option>
<option value="enabled"<?php selected($this->_config->get_string('cdn.att.ssl'), 'enabled'); ?>><?php _e('Enabled (always use SSL)', 'w3-total-cache'); ?></option>
<option value="disabled"<?php selected($this->_config->get_string('cdn.att.ssl'), 'disabled'); ?>><?php _e('Disabled (always use HTTP)', 'w3-total-cache'); ?></option>
</select>
<br /><span class="description"><?php _e('Some <acronym>CDN</acronym> providers may or may not support <acronym title="Secure Sockets Layer">SSL</acronym>, contact your vendor for more information.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th><?php _e('Replace site\'s hostname with:', 'w3-total-cache'); ?></th>
<td>
<?php $cnames = $this->_config->get_array('cdn.att.domain'); include W3TC_INC_DIR . '/options/cdn/common/cnames.php'; ?>
<br /><span class="description"><?php _e('Enter the hostname provided by your <acronym>CDN</acronym> provider, this value will replace your site\'s hostname in the <acronym title="Hypertext Markup Language">HTML</acronym>.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th colspan="2">
<input id="cdn_test" class="button {type: 'att', nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" type="button" value="Test AT&T" /> <span id="cdn_test_status" class="w3tc-status w3tc-process"></span>
</th>
</tr>
<?php if (!defined('W3TC')) die(); ?>
<tr>
<th style="width: 300px;"><label for="cdn_azure_user"><?php _e('Account name:', 'w3-total-cache'); ?></label></th>
<td>
<input id="cdn_azure_user" class="w3tc-ignore-change" type="text"
<?php $this->sealing_disabled('cdn') ?> name="cdn.azure.user" value="<?php echo esc_attr($this->_config->get_string('cdn.azure.user')); ?>" size="30" />
</td>
</tr>
<tr>
<th><label for="cdn_azure_key"><?php _e('Account key:', 'w3-total-cache'); ?></label></th>
<td>
<input id="cdn_azure_key" class="w3tc-ignore-change"
<?php $this->sealing_disabled('cdn') ?> type="password" name="cdn.azure.key" value="<?php echo esc_attr($this->_config->get_string('cdn.azure.key')); ?>" size="60" />
</td>
</tr>
<tr>
<th><label for="cdn_azure_container"><?php _e('Container:', 'w3-total-cache'); ?></label></th>
<td>
<input id="cdn_azure_container" type="text"
<?php $this->sealing_disabled('cdn') ?> name="cdn.azure.container" value="<?php echo esc_attr($this->_config->get_string('cdn.azure.container')); ?>" size="30" />
<input id="cdn_create_container" <?php $this->sealing_disabled('cdn') ?> class="button {type: 'azure', nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" type="button" value="<?php _e('Create container', 'w3-total-cache'); ?>" />
<span id="cdn_create_container_status" class="w3tc-status w3tc-process"></span>
</td>
</tr>
<tr>
<th><label for="cdn_s3_ssl"><?php _e('<acronym title="Secure Sockets Layer">SSL</acronym> support:', 'w3-total-cache'); ?></label></th>
<td>
<select id="cdn_s3_ssl" name="cdn.s3.ssl" <?php $this->sealing_disabled('cdn') ?>>
<option value="auto"<?php selected($this->_config->get_string('cdn.azure.ssl'), 'auto'); ?>><?php _e('Auto (determine connection type automatically)', 'w3-total-cache'); ?></option>
<option value="enabled"<?php selected($this->_config->get_string('cdn.azure.ssl'), 'enabled'); ?>><?php _e('Enabled (always use SSL)', 'w3-total-cache'); ?></option>
<option value="disabled"<?php selected($this->_config->get_string('cdn.azure.ssl'), 'disabled'); ?>><?php _e('Disabled (always use HTTP)', 'w3-total-cache'); ?></option>
</select>
<br /><span class="description"><?php _e('Some <acronym>CDN</acronym> providers may or may not support <acronym title="Secure Sockets Layer">SSL</acronym>, contact your vendor for more information.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th><?php _e('Replace site\'s hostname with:', 'w3-total-cache'); ?></th>
<td>
<?php if (($cdn_azure_user = $this->_config->get_string('cdn.azure.user')) != ''): ?>
<?php echo esc_attr($cdn_azure_user); ?>.blob.core.windows.net
<?php else: ?>
&lt;account name&gt;.blob.core.windows.net
<?php endif; ?> <?php _e('or CNAME:', 'w3-total-cache'); ?>
<?php $cnames = $this->_config->get_array('cdn.azure.cname'); include W3TC_INC_DIR . '/options/cdn/common/cnames.php'; ?>
</td>
</tr>
<tr>
<th colspan="2">
<input id="cdn_test" class="button {type: 'azure', nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" type="button" value="<?php _e('Test Microsoft Azure Storage upload', 'w3-total-cache'); ?>" /> <span id="cdn_test_status" class="w3tc-status w3tc-process"></span>
</th>
</tr>
<?php if (!defined('W3TC')) die(); ?>
<tr>
<th colspan="2">
<span class="description"><?php _e('We recommend that you use <a href="http://docs.amazonwebservices.com/IAM/latest/UserGuide/AccessPolicyLanguage_KeyConcepts.html" target="_blank"><acronym title="AWS Identity and Access Management">IAM</acronym></a> to create a new policy for <acronym title="Amazon Web Services">AWS</acronym> services that have limited permissions. A helpful tool: <a href="http://awspolicygen.s3.amazonaws.com/policygen.html" target="_blank"><acronym title="Amazon Web Services">AWS</acronym> Policy Generator</a>', 'w3-total-cache'); ?></span>
</th>
</tr>
<tr>
<th style="width: 300px;"><label for="cdn_cf_key"><?php _e('Access key ID:', 'w3-total-cache'); ?></label></th>
<td>
<input id="cdn_cf_key" class="w3tc-ignore-change" type="text"
<?php $this->sealing_disabled('cdn') ?> name="cdn.cf.key" value="<?php echo esc_attr($this->_config->get_string('cdn.cf.key')); ?>" size="30" />
</td>
</tr>
<tr>
<th><label for="cdn_cf_secret"><?php _e('Secret key:', 'w3-total-cache'); ?></label></th>
<td>
<input id="cdn_cf_secret" class="w3tc-ignore-change" type="password"
<?php $this->sealing_disabled('cdn') ?> name="cdn.cf.secret" value="<?php echo esc_attr($this->_config->get_string('cdn.cf.secret')); ?>" size="60" />
</td>
</tr>
<tr>
<th><label for="cdn_cf_bucket"><?php _e('Bucket:', 'w3-total-cache'); ?></label></th>
<td>
<input id="cdn_cf_bucket" type="text" name="cdn.cf.bucket"
<?php $this->sealing_disabled('cdn') ?> value="<?php echo esc_attr($this->_config->get_string('cdn.cf.bucket')); ?>" size="30" />
<input class="button button-cdn-cf-bucket-location cdn_cf {nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}"
<?php $this->sealing_disabled('cdn') ?> type="button" value="<?php _e('Create bucket &amp; distribution', 'w3-total-cache'); ?>" />
</td>
</tr>
<tr>
<th><label for="cdn_cf_ssl"><?php _e('<acronym title="Secure Sockets Layer">SSL</acronym> support:', 'w3-total-cache'); ?></label></th>
<td>
<select id="cdn_cf_ssl" name="cdn.cf.ssl" <?php $this->sealing_disabled('cdn') ?>>
<option value="auto"<?php selected($this->_config->get_string('cdn.cf.ssl'), 'auto'); ?>><?php _e('Auto (determine connection type automatically)', 'w3-total-cache'); ?></option>
<option value="enabled"<?php selected($this->_config->get_string('cdn.cf.ssl'), 'enabled'); ?>><?php _e('Enabled (always use SSL)', 'w3-total-cache'); ?></option>
<option value="disabled"<?php selected($this->_config->get_string('cdn.cf.ssl'), 'disabled'); ?>><?php _e('Disabled (always use HTTP)', 'w3-total-cache'); ?></option>
</select>
<br /><span class="description"><?php _e('Some <acronym>CDN</acronym> providers may or may not support <acronym title="Secure Sockets Layer">SSL</acronym>, contact your vendor for more information.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th><label for="cdn_cf_id"><?php _e('Replace site\'s hostname with:', 'w3-total-cache'); ?></label></th>
<td>
<input id="cdn_cf_id" type="text" name="cdn.cf.id"
<?php $this->sealing_disabled('cdn') ?> value="<?php echo esc_attr($this->_config->get_string('cdn.cf.id')); ?>" size="18" style="text-align: right;" />.cloudfront.net or CNAME:
<?php $cnames = $this->_config->get_array('cdn.cf.cname'); include W3TC_INC_DIR . '/options/cdn/common/cnames.php'; ?>
<br /><span class="description"><?php _e('If you have already added a <a href="http://docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide/index.html?CNAMEs.html" target="_blank">CNAME</a> to your <acronym title="Domain Name System">DNS</acronym> Zone, enter it here.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th colspan="2">
<input id="cdn_test" class="button {type: 'cf', nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" type="button" value="<?php _e('Test S3 upload &amp; CloudFront distribution', 'w3-total-cache'); ?>" /> <span id="cdn_test_status" class="w3tc-status w3tc-process"></span>
</th>
</tr>
<?php if (!defined('W3TC')) die(); ?>
<tr>
<th colspan="2">
<span class="description"><?php _e('We recommend that you use <a href="http://docs.amazonwebservices.com/IAM/latest/UserGuide/AccessPolicyLanguage_KeyConcepts.html" target="_blank"><acronym title="AWS Identity and Access Management">IAM</acronym></a> to create a new policy for <acronym title="Amazon Web Services">AWS</acronym> services that have limited permissions. A helpful tool: <a href="http://awspolicygen.s3.amazonaws.com/policygen.html" target="_blank"><acronym title="Amazon Web Services">AWS</acronym> Policy Generator</a>', 'w3-total-cache'); ?></span>
</th>
</tr>
<tr>
<th style="width: 300px;"><label for="cdn_cf2_key"><?php _e('Access key ID:', 'w3-total-cache'); ?></label></th>
<td>
<input id="cdn_cf2_key" class="w3tc-ignore-change" type="text"
<?php $this->sealing_disabled('cdn') ?> name="cdn.cf2.key" value="<?php echo esc_attr($this->_config->get_string('cdn.cf2.key')); ?>" size="30" />
</td>
</tr>
<tr>
<th><label for="cdn_cf2_secret"><?php _e('Secret key:', 'w3-total-cache'); ?></label></th>
<td>
<input id="cdn_cf2_secret" class="w3tc-ignore-change"
<?php $this->sealing_disabled('cdn') ?> type="password" name="cdn.cf2.secret" value="<?php echo esc_attr($this->_config->get_string('cdn.cf2.secret')); ?>" size="60" />
</td>
</tr>
<tr>
<th><?php _e('Origin:', 'w3-total-cache'); ?></th>
<td>
<?php echo w3_get_host(); ?>
<input id="cdn_create_container"
<?php $this->sealing_disabled('cdn') ?> class="button {type: 'cf2', nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" type="button" value="<?php _e('Create distribution', 'w3-total-cache'); ?>" />
<span id="cdn_create_container_status" class="w3tc-status w3tc-process"></span>
</td>
</tr>
<tr>
<th><label for="cdn_cf2_ssl"><?php _e('<acronym title="Secure Sockets Layer">SSL</acronym> support:', 'w3-total-cache'); ?></label></th>
<td>
<select id="cdn_cf2_ssl" name="cdn.cf2.ssl" <?php $this->sealing_disabled('cdn') ?>>
<option value="auto"<?php selected($this->_config->get_string('cdn.cf2.ssl'), 'auto'); ?>><?php _e('Auto (determine connection type automatically)', 'w3-total-cache'); ?></option>
<option value="enabled"<?php selected($this->_config->get_string('cdn.cf2.ssl'), 'enabled'); ?>><?php _e('Enabled (always use SSL)', 'w3-total-cache'); ?></option>
<option value="disabled"<?php selected($this->_config->get_string('cdn.cf2.ssl'), 'disabled'); ?>><?php _e('Disabled (always use HTTP)', 'w3-total-cache'); ?></option>
</select>
<br /><span class="description"><?php _e('Some <acronym>CDN</acronym> providers may or may not support <acronym title="Secure Sockets Layer">SSL</acronym>, contact your vendor for more information.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th><label for="cdn_cf2_id"><?php _e('Replace site\'s hostname with:', 'w3-total-cache'); ?></label></th>
<td>
<input id="cdn_cf2_id" type="text" name="cdn.cf2.id"
<?php $this->sealing_disabled('cdn') ?> value="<?php echo esc_attr($this->_config->get_string('cdn.cf2.id')); ?>" size="18" style="text-align: right;" />.cloudfront.net or CNAME:
<?php $cnames = $this->_config->get_array('cdn.cf2.cname'); include W3TC_INC_DIR . '/options/cdn/common/cnames.php'; ?>
<br /><span class="description"><?php _e('If you have already added a <a href="http://docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide/index.html?CNAMEs.html" target="_blank">CNAME</a> to your <acronym title="Domain Name System">DNS</acronym> Zone, enter it here.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th colspan="2">
<input id="cdn_test" class="button {type: 'cf2', nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" type="button" value="<?php _e('Test CloudFront distribution', 'w3-total-cache'); ?>" /> <span id="cdn_test_status" class="w3tc-status w3tc-process"></span>
</th>
</tr>
<?php if (!defined('W3TC')) die(); ?>
<ol id="cdn_cnames">
<?php
if (! count($cnames)) {
$cnames = array('');
}
$count = count($cnames);
foreach ($cnames as $index => $cname):
$label = '';
if ($count > 1):
switch ($index):
case 0:
$label = __('(reserved for CSS)', 'w3-total-cache');
break;
case 1:
$label = __('(reserved for JS in <head>)', 'w3-total-cache');
break;
case 2:
$label = __('(reserved for JS after <body>)', 'w3-total-cache');
break;
case 3:
$label = __('(reserved for JS before </body>)', 'w3-total-cache');
break;
default:
$label = '';
break;
endswitch;
endif;
?>
<li>
<input type="text" name="cdn_cnames[]"
<?php $this->sealing_disabled('cdn') ?> value="<?php echo esc_attr($cname); ?>" size="60" />
<input class="button cdn_cname_delete" type="button"
<?php $this->sealing_disabled('cdn') ?> value="<?php _e('Delete', 'w3-total-cache'); ?>"<?php if (!$index): ?> style="display: none;"<?php endif; ?> />
<span><?php echo htmlspecialchars($label); ?></span>
</li>
<?php endforeach; ?>
</ol>
<input id="cdn_cname_add" class="button" type="button" value="<?php _e('Add CNAME', 'w3-total-cache'); ?>"
<?php $this->sealing_disabled('cdn') ?> />
<?php if (!defined('W3TC')) die(); ?>
<tr>
<th style="width: 300px;"><label for="cdn_cotendo_username"><?php _e('Username:', 'w3-total-cache'); ?></label></th>
<td>
<input id="cdn_cotendo_username" class="w3tc-ignore-change" type="text"
<?php $this->sealing_disabled('cdn') ?> name="cdn.cotendo.username" value="<?php echo esc_attr($this->_config->get_string('cdn.cotendo.username')); ?>" size="60" />
</td>
</tr>
<tr>
<th><label for="cdn_cotendo_password"><?php _e('Password:', 'w3-total-cache'); ?></label></th>
<td>
<input id="cdn_cotendo_password" class="w3tc-ignore-change"
<?php $this->sealing_disabled('cdn') ?> type="password" name="cdn.cotendo.password" value="<?php echo esc_attr($this->_config->get_string('cdn.cotendo.password')); ?>" size="60" />
</td>
</tr>
<tr>
<th><label for="cdn_cotendo_zones"><?php _e('Zones to purge:', 'w3-total-cache'); ?></label></th>
<td>
<textarea id="cdn_cotendo_zones" name="cdn.cotendo.zones"
<?php $this->sealing_disabled('cdn') ?> cols="40" rows="5"><?php echo esc_textarea(implode("\r\n", $this->_config->get_array('cdn.cotendo.zones'))); ?></textarea>
</td>
</tr>
<tr>
<th><label for="cdn_cotendo_ssl"><?php _e('<acronym title="Secure Sockets Layer">SSL</acronym> support:', 'w3-total-cache'); ?></label></th>
<td>
<select id="cdn_cotendo_ssl" name="cdn.cotendo.ssl" <?php $this->sealing_disabled('cdn') ?>>
<option value="auto"<?php selected($this->_config->get_string('cdn.cotendo.ssl'), 'auto'); ?>><?php _e('Auto (determine connection type automatically)', 'w3-total-cache'); ?></option>
<option value="enabled"<?php selected($this->_config->get_string('cdn.cotendo.ssl'), 'enabled'); ?>><?php _e('Enabled (always use SSL)', 'w3-total-cache'); ?></option>
<option value="disabled"<?php selected($this->_config->get_string('cdn.cotendo.ssl'), 'disabled'); ?>><?php _e('Disabled (always use HTTP)', 'w3-total-cache'); ?></option>
</select>
<br /><span class="description"><?php _e('Some <acronym>CDN</acronym> providers may or may not support <acronym title="Secure Sockets Layer">SSL</acronym>, contact your vendor for more information.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th><?php _e('Replace site\'s hostname with:', 'w3-total-cache'); ?></th>
<td>
<?php $cnames = $this->_config->get_array('cdn.cotendo.domain'); include W3TC_INC_DIR . '/options/cdn/common/cnames.php'; ?>
<br /><span class="description"><?php _e('Enter the hostname provided by your <acronym>CDN</acronym> provider, this value will replace your site\'s hostname in the <acronym title="Hypertext Markup Language">HTML</acronym>.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th colspan="2">
<input id="cdn_test" class="button {type: 'cotendo', nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" type="button" value="<?php _e('Test Cotendo', 'w3-total-cache'); ?>" /> <span id="cdn_test_status" class="w3tc-status w3tc-process"></span>
</th>
</tr>
<?php if (!defined('W3TC')) die(); ?>
<tr>
<th style="width: 300px;"><label for="cdn_edgecast_account"><?php _e('Account #:', 'w3-total-cache'); ?></label></th>
<td>
<input id="cdn_edgecast_account" class="w3tc-ignore-change" type="text"
<?php $this->sealing_disabled('cdn') ?> name="cdn.edgecast.account" value="<?php echo esc_attr($this->_config->get_string('cdn.edgecast.account')); ?>" size="60" />
</td>
</tr>
<tr>
<th><label for="cdn_edgecast_token"><?php _e('Token:', 'w3-total-cache'); ?></th>
<td>
<input id="cdn_edgecast_token" class="w3tc-ignore-change" type="password"
<?php $this->sealing_disabled('cdn') ?> name="cdn.edgecast.token" value="<?php echo esc_attr($this->_config->get_string('cdn.edgecast.token')); ?>" size="60" />
</td>
</tr>
<tr>
<th><label for="cdn_edgecast_ssl"><?php _e('<acronym title="Secure Sockets Layer">SSL</acronym> support:', 'w3-total-cache'); ?></label></th>
<td>
<select id="cdn_edgecast_ssl" name="cdn.edgecast.ssl" <?php $this->sealing_disabled('cdn') ?>>
<option value="auto"<?php selected($this->_config->get_string('cdn.edgecast.ssl'), 'auto'); ?>><?php _e('Auto (determine connection type automatically)', 'w3-total-cache'); ?></option>
<option value="enabled"<?php selected($this->_config->get_string('cdn.edgecast.ssl'), 'enabled'); ?>><?php _e('Enabled (always use SSL)', 'w3-total-cache'); ?></option>
<option value="disabled"<?php selected($this->_config->get_string('cdn.edgecast.ssl'), 'disabled'); ?>><?php _e('Disabled (always use HTTP)', 'w3-total-cache'); ?></option>
</select>
<br /><span class="description"><?php _e('Some <acronym>CDN</acronym> providers may or may not support <acronym title="Secure Sockets Layer">SSL</acronym>, contact your vendor for more information.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th><?php _e('Replace site\'s hostname with:', 'w3-total-cache'); ?></th>
<td>
<?php $cnames = $this->_config->get_array('cdn.edgecast.domain'); include W3TC_INC_DIR . '/options/cdn/common/cnames.php'; ?>
<br /><span class="description"><?php _e('Enter the hostname provided by your <acronym>CDN</acronym> provider, this value will replace your site\'s hostname in the <acronym title="Hypertext Markup Language">HTML</acronym>.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th colspan="2">
<input id="cdn_test" class="button {type: 'edgecast', nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" type="button" value="<?php _e('Test EdgeCast', 'w3-total-cache'); ?>" /> <span id="cdn_test_status" class="w3tc-status w3tc-process"></span>
</th>
</tr>
<?php if (!defined('W3TC')) die(); ?>
<tr>
<th colspan="2">
<?php $this->checkbox('cdn.ftp.pasv') ?> <?php _e('Use passive <acronym title="File Transfer Protocol">FTP</acronym> mode', 'w3-total-cache'); ?></label><br />
<span class="description"><?php _e('Enable this option only if there are connectivity issues, otherwise it\'s not recommended.', 'w3-total-cache'); ?></span>
</th>
</tr>
<tr>
<th style="width: 300px;"><label for="cdn_ftp_host"><?php _e('<acronym title="File Transfer Protocol">FTP</acronym> hostname:', 'w3-total-cache'); ?></label></th>
<td>
<input id="cdn_ftp_host" type="text" name="cdn.ftp.host"
<?php $this->sealing_disabled('cdn') ?> value="<?php echo esc_attr($this->_config->get_string('cdn.ftp.host')); ?>" size="30" /><br />
<span class="description"><?php _e('Specify the server\'s address, e.g.: "ftp.domain.com". Try "127.0.0.1" if using a sub-domain on the same server as your site.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th><label for="cdn_ftp_user"><?php _e('<acronym title="File Transfer Protocol">FTP</acronym> username:', 'w3-total-cache'); ?></label></th>
<td>
<input id="cdn_ftp_user" class="w3tc-ignore-change" type="text"
<?php $this->sealing_disabled('cdn') ?> name="cdn.ftp.user" value="<?php echo esc_attr($this->_config->get_string('cdn.ftp.user')); ?>" size="30" />
</td>
</tr>
<tr>
<th><label for="cdn_ftp_pass"><?php _e('<acronym title="File Transfer Protocol">FTP</acronym> password:', 'w3-total-cache'); ?></label></th>
<td>
<input id="cdn_ftp_pass" class="w3tc-ignore-change"
<?php $this->sealing_disabled('cdn') ?> type="password" name="cdn.ftp.pass" value="<?php echo esc_attr($this->_config->get_string('cdn.ftp.pass')); ?>" size="30" />
</td>
</tr>
<tr>
<th><label for="cdn_ftp_path"><?php _e('<acronym title="File Transfer Protocol">FTP</acronym> path:', 'w3-total-cache'); ?></label></th>
<td>
<input id="cdn_ftp_path" type="text" name="cdn.ftp.path"
<?php $this->sealing_disabled('cdn') ?> value="<?php echo esc_attr($this->_config->get_string('cdn.ftp.path')); ?>" size="30" /><br />
<span class="description"><?php _e('Specify the directory where files must be uploaded to be accessible in a web browser (the document root).', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th><label for="cdn_ftp_ssl"><?php _e('<acronym title="Secure Sockets Layer">SSL</acronym> support:', 'w3-total-cache'); ?></label></th>
<td>
<select id="cdn_ftp_ssl" name="cdn.ftp.ssl" <?php $this->sealing_disabled('cdn') ?>>
<option value="auto"<?php selected($this->_config->get_string('cdn.ftp.ssl'), 'auto'); ?>><?php _e('Auto (determine connection type automatically)', 'w3-total-cache'); ?></option>
<option value="enabled"<?php selected($this->_config->get_string('cdn.ftp.ssl'), 'enabled'); ?>><?php _e('Enabled (always use SSL)', 'w3-total-cache'); ?></option>
<option value="disabled"<?php selected($this->_config->get_string('cdn.ftp.ssl'), 'disabled'); ?>><?php _e('Disabled (always use HTTP)', 'w3-total-cache'); ?></option>
</select>
<br /><span class="description"><?php _e('Some <acronym>CDN</acronym> providers may or may not support <acronym title="Secure Sockets Layer">SSL</acronym>, contact your vendor for more information.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th><?php _e('Replace site\'s hostname with:', 'w3-total-cache'); ?></th>
<td>
<?php $cnames = $this->_config->get_array('cdn.ftp.domain'); include W3TC_INC_DIR . '/options/cdn/common/cnames.php'; ?>
<br /><span class="description"><?php _e('Enter the hostname or CNAME(s) of your <acronym title="File Transfer Protocol">FTP</acronym> server configured above, these values will replace your site\'s hostname in the <acronym title="Hypertext Markup Language">HTML</acronym>.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th colspan="2">
<input id="cdn_test" class="button {type: 'ftp', nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" type="button" value="<?php _e('Test FTP server', 'w3-total-cache'); ?>" /> <span id="cdn_test_status" class="w3tc-status w3tc-process"></span>
</th>
</tr>
<?php
/**
* @var bool $authorized
* @var array $pull_zones
*/
?>
<?php if (!defined('W3TC')) die(); ?>
<?php if (!$authorized): ?>
<tr>
<th style="width: 300px;"><label><?php _e('Create account:', 'w3-total-cache')?></label></th>
<td>
<a href="<?php esc_attr_e(wp_nonce_url(w3_admin_url('admin.php?page=w3tc_dashboard&w3tc_cdn_maxcdn_signup'), 'w3tc'))?>" target="_blank" id="netdna-maxcdn-create-account" class="button-primary"><?php _e('Sign Up Now and Save 25%', 'w3-total-cache') ?></a>
<br />
<span class="description"><?php _e('MaxCDN is a service that lets you speed up your site even more with W3 Total Cache. 100% Money Back Guarantee (30 Days)!', 'w3-total-cache')?></span>
</td>
</tr>
<?php endif ?>
<?php if ($authorized): ?>
<tr>
<th style="width: 300px;"><label><?php !$pull_zones ? _e('Create pull zone:', 'w3-total-cache') : _e('Create new pull zone:', 'w3-total-cache')?></label></th>
<td>
<button id="netdna-maxcdn-create-pull-zone" <?php $this->sealing_disabled('cdn') ?> class="button-primary {type: 'maxcdn', nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}"><?php !$pull_zones ? _e('Create pull zone', 'w3-total-cache') : _e('Create new pull zone', 'w3-total-cache')?></button>
<br />
<span class="description"><?php _e('Click the Create Pull Zone button above and create a pull zone manually for this site.', 'w3-total-cache')?></span>
</td>
</tr>
<?php elseif(!$authorized): ?>
<tr>
<th style="width: 300px;"><label><?php _e('Specify account credentials:', 'w3-total-cache')?></label></th>
<td>
<a id="cdn_maxcdn_oauth" class="button-primary" href="<?php echo wp_nonce_url(w3_admin_url('admin.php?page=w3tc_dashboard&w3tc_cdn_maxcdn_authorize'), 'w3tc')?>" target="_blank"><?php _e('Authorize', 'w3-total-cache')?></a>
<br />
<span class="description"><?php _e('Click the Authorize button above, log in, paste the key below and save settings.', 'w3-total-cache')?></span>
</td>
</tr>
<?php endif ?>
<tr>
<th style="width: 300px;"><label for="cdn_maxcdn_authorization_key"><?php _e('Authorization key', 'w3-total-cache')?>:</label></th>
<td id="authorization_area">
<input id="cdn_maxcdn_authorization_key" class="w3tc-ignore-change" type="text"
<?php $this->sealing_disabled('cdn') ?> name="cdn.maxcdn.authorization_key" value="<?php echo esc_attr($this->_config->get_string('cdn.maxcdn.authorization_key')); ?>" size="60" onblur="w3tc_validate_cdn_key_result('maxcdn','<?php echo wp_create_nonce('w3tc'); ?>')" />
<input id="validate_cdn_key" type="button" class="button {type: 'maxcdn', nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" value="<?php _e('Validate', 'w3-total-cache') ?>" /><span id="validate_cdn_key_result" style="margin-left:5px;padding:3px 8px 3px 20px;"></span>
<br /><span class="description"><?php _e('Consists of alias+key+secret . Example: bluewidgets+asd897asd98a7sd+798a7sd9 . If you use "Authorize" its already formatted correctly.', 'w3-total-cache')?></span>
</td>
</tr>
<tr id="create_zone_area" style="<?php echo $authorized && (!$have_zone || is_null($zone_info)) ? '' : 'display: none' ?>">
<th><?php _e('Create zone:', 'w3-total-cache') ?></th>
<td><input type="button" class="button" onclick="w3tc_create_zone('maxcdn','<?php echo wp_create_nonce('w3tc'); ?>')" value="<?php _e('Create Default Zone', 'w3-total-cache') ?>" id="create_default_zone" />
<span id="create_pull_zone_result" style="padding:3px 0 3px 20px;"></span>
<br /><span class="description"><?php _e('You have no zone connected with this site. Click button to create a default zone automatically.', 'w3-total-cache') ?></span>
</td>
</tr>
<tr id="select_pull_zone" style="<?php echo !($authorized && $pull_zones) ? 'display:none' : '' ?>">
<th><label for="cdn_maxcdn_zone_id"><?php _e('Select pull zone:', 'w3-total-cache')?></label></th>
<td>
<select id="cdn_maxcdn_zone_id" name="cdn.maxcdn.zone_id" <?php $this->sealing_disabled('cdn') ?>>
<?php foreach($pull_zones as $zone):?>
<option value="<?php echo $zone['id'] ?>" <?php selected($zone['id'], $this->_config->get_integer('cdn.maxcdn.zone_id'))?>><?php echo $zone['name']?></option>
<?php endforeach; ?>
</select> <input id="use_poll_zone" type="button" class="button {type: 'maxcdn', nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" value="<?php _e('Use Zone', 'w3-total-cache') ?>" /><span id="use_pull_zone_result" style="margin-left:15px;padding:3px 8px 3px 8px;"></span>
<br />
<span class="description"><?php _e('Select the pull zone to use with this site.', 'w3-total-cache')?></span>
</td>
</tr>
<tr>
<th><label for="cdn_maxcdn_ssl"><?php _e('<acronym title="Secure Sockets Layer">SSL</acronym> support', 'w3-total-cache')?>:</label></th>
<td>
<select id="cdn_maxcdn_ssl" name="cdn.maxcdn.ssl" <?php $this->sealing_disabled('cdn') ?>>
<option value="auto"<?php selected($this->_config->get_string('cdn.maxcdn.ssl'), 'auto'); ?>><?php _e('Auto (determine connection type automatically)', 'w3-total-cache')?></option>
<option value="enabled"<?php selected($this->_config->get_string('cdn.maxcdn.ssl'), 'enabled'); ?>><?php _e('Enabled (always use SSL)', 'w3-total-cache')?></option>
<option value="disabled"<?php selected($this->_config->get_string('cdn.maxcdn.ssl'), 'disabled'); ?>><?php _e('Disabled (always use HTTP)', 'w3-total-cache')?></option>
</select>
<br /><span class="description"><?php _e('Some <acronym>CDN</acronym> providers may or may not support <acronym title="Secure Sockets Layer">SSL</acronym>, contact your vendor for more information.', 'w3-total-cache')?></span>
</td>
</tr>
<tr>
<th><?php _e('Replace site\'s hostname with:', 'w3-total-cache')?></th>
<td>
<?php $cnames = $this->_config->get_array('cdn.maxcdn.domain'); include W3TC_INC_DIR . '/options/cdn/common/cnames.php'; ?>
<br /><span class="description"><?php _e('Enter the hostname provided by your <acronym>CDN</acronym> provider, this value will replace your site\'s hostname in the <acronym title="Hypertext Markup Language">HTML</acronym>.', 'w3-total-cache')?></span>
</td>
</tr>
<tr>
<th colspan="2">
<input id="cdn_test" class="button {type: 'maxcdn', nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" type="button" value="<?php _e('Test MaxCDN', 'w3-total-cache')?>" /> <span id="cdn_test_status" class="w3tc-status w3tc-process"></span>
</th>
</tr>
<?php if (!defined('W3TC')) die(); ?>
<tr>
<th><label for="cdn_mirror_ssl"><?php _e('<acronym title="Secure Sockets Layer">SSL</acronym> support:', 'w3-total-cache'); ?></label></th>
<td>
<select id="cdn_mirror_ssl" name="cdn.mirror.ssl" <?php $this->sealing_disabled('cdn') ?>>
<option value="auto"<?php selected($this->_config->get_string('cdn.mirror.ssl'), 'auto'); ?>><?php _e('Auto (determine connection type automatically)', 'w3-total-cache'); ?></option>
<option value="enabled"<?php selected($this->_config->get_string('cdn.mirror.ssl'), 'enabled'); ?>><?php _e('Enabled (always use SSL)', 'w3-total-cache'); ?></option>
<option value="disabled"<?php selected($this->_config->get_string('cdn.mirror.ssl'), 'disabled'); ?>><?php _e('Disabled (always use HTTP)', 'w3-total-cache'); ?></option>
</select>
<br /><span class="description"><?php _e('Some <acronym>CDN</acronym> providers may or may not support <acronym title="Secure Sockets Layer">SSL</acronym>, contact your vendor for more information.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th><?php _e('Replace site\'s hostname with:', 'w3-total-cache'); ?></th>
<td>
<?php $cnames = $this->_config->get_array('cdn.mirror.domain'); include W3TC_INC_DIR . '/options/cdn/common/cnames.php'; ?>
<br /><span class="description"><?php _e('Enter the hostname provided by your <acronym>CDN</acronym> provider, this value will replace your site\'s hostname in the <acronym title="Hypertext Markup Language">HTML</acronym>.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th colspan="2">
<input id="cdn_test" class="button {type: 'mirror', nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" type="button" value="<?php _e('Test Mirror', 'w3-total-cache'); ?>" /> <span id="cdn_test_status" class="w3tc-status w3tc-process"></span>
</th>
</tr>
<?php
/**
* @var bool $authorized
* @var array $pull_zones
*/
?>
<?php if (!defined('W3TC')) die(); ?>
<?php if (!$authorized): ?>
<tr>
<th style="width: 300px;"><label><?php _e('Create account:', 'w3-total-cache')?></label></th>
<td>
<a href="<?php esc_attr_e(wp_nonce_url(w3_admin_url('admin.php?page=w3tc_dashboard&w3tc_cdn_maxcdn_signup'), 'w3tc'))?>" target="_blank" id="netdna-maxcdn-create-account" class="button-primary"><?php _e('Create Account', 'w3-total-cache') ?></a>
<br />
<span class="description"><?php _e('Are you a new customer? Click the Create Account button to receive a discount on a new MaxCDN account.', 'w3-total-cache')?></span>
</td>
</tr>
<?php endif ?>
<?php if ($authorized): ?>
<tr>
<th style="width: 300px;"><label><?php !$pull_zones ? _e('Create pull zone:', 'w3-total-cache') : _e('Create new pull zone:', 'w3-total-cache')?></label></th>
<td>
<button id="netdna-maxcdn-create-pull-zone" <?php $this->sealing_disabled('cdn') ?> class="button-primary {type: 'netdna', nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}"><?php !$pull_zones ? _e('Create pull zone', 'w3-total-cache') : _e('Create new pull zone', 'w3-total-cache')?></button>
<br />
<span class="description"><?php _e('Click the Create Pull Zone button above and create a pull zone manually for this site.', 'w3-total-cache')?></span>
</td>
</tr>
<?php elseif(!$authorized): ?>
<tr>
<th style="width: 300px;"><label><?php _e('Specify account credentials:', 'w3-total-cache')?></label></th>
<td>
<a id="cdn_netdna_oauth" class="button-primary" href="<?php echo wp_nonce_url(w3_admin_url('admin.php?page=w3tc_dashboard&w3tc_cdn_netdna_authorize'), 'w3tc')?>" target="_blank"><?php _e('Authorize', 'w3-total-cache')?></a>
<br />
<span class="description"><?php _e('Click the Authorize button above, log in, paste the key below and save settings.', 'w3-total-cache')?></span>
</td>
</tr>
<?php endif ?>
<tr>
<th style="width: 300px;"><label for="cdn_netdna_authorization_key"><?php _e('Authorization key', 'w3-total-cache')?>:</label></th>
<td id="authorization_area">
<input id="cdn_netdna_authorization_key" class="w3tc-ignore-change" type="text"
<?php $this->sealing_disabled('cdn') ?> name="cdn.netdna.authorization_key" value="<?php echo esc_attr($this->_config->get_string('cdn.netdna.authorization_key')); ?>" size="60" onblur="w3tc_validate_cdn_key_result('netdna','<?php echo wp_create_nonce('w3tc'); ?>')" />
<input id="validate_cdn_key" type="button" class="button {type: 'netdna', nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" value="<?php _e('Validate', 'w3-total-cache') ?>" /><span id="validate_cdn_key_result" style="margin-left:15px;padding:3px 8px 3px 8px;"></span>
<br /><span class="description"><?php _e('Consists of alias+key+secret . Example: bluewidgets+asd897asd98a7sd+798a7sd9 . If you use "Authorize" its already formatted correctly.', 'w3-total-cache')?></span>
</td>
</tr>
<tr id="create_zone_area" style="<?php echo $authorized && (!$have_zone || is_null($zone_info)) ? '' : 'display: none' ?>">
<th><?php _e('Create zone:', 'w3-total-cache') ?></th>
<td><input type="button" class="button" onclick="w3tc_create_zone('netdna','<?php echo wp_create_nonce('w3tc'); ?>')" value="<?php _e('Create Default Zone', 'w3-total-cache') ?>" id="create_default_zone" />
<span id="create_pull_zone_result" style="padding:3px 0 3px 20px;"></span>
<br /><span class="description"><?php _e('You have no zone connected with this site. Click button to create a default zone automatically.', 'w3-total-cache') ?></span>
</td>
</tr>
<tr id="select_pull_zone" style="<?php echo !($authorized && $pull_zones) ? 'display:none' : '' ?>">
<th><label for="cdn_netdna_zone_id"><?php _e('Select pull zone:', 'w3-total-cache')?></label></th>
<td>
<select id="cdn_netdna_zone_id" name="cdn.netdna.zone_id" <?php $this->sealing_disabled('cdn') ?>>
<?php foreach($pull_zones as $zone):?>
<option value="<?php echo $zone['id'] ?>" <?php selected($zone['id'], $this->_config->get_integer('cdn.netdna.zone_id'))?>><?php echo $zone['name']?></option>
<?php endforeach; ?>
</select> <input id="use_poll_zone" type="button" class="button {type: 'netdna', nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" value="<?php _e('Use Zone', 'w3-total-cache') ?>" /><span id="use_pull_zone_result" style="margin-left:15px;padding:3px 8px 3px 8px;"></span>
<br />
<span class="description"><?php _e('Select the pull zone to use with this site.', 'w3-total-cache')?></span>
</td>
</tr>
<tr>
<th><label for="cdn_netdna_ssl"><?php _e('<acronym title="Secure Sockets Layer">SSL</acronym> support', 'w3-total-cache')?>:</label></th>
<td>
<select id="cdn_netdna_ssl" name="cdn.netdna.ssl" <?php $this->sealing_disabled('cdn') ?>>
<option value="auto"<?php selected($this->_config->get_string('cdn.netdna.ssl'), 'auto'); ?>><?php _e('Auto (determine connection type automatically)', 'w3-total-cache')?></option>
<option value="enabled"<?php selected($this->_config->get_string('cdn.netdna.ssl'), 'enabled'); ?>><?php _e('Enabled (always use SSL)', 'w3-total-cache')?></option>
<option value="disabled"<?php selected($this->_config->get_string('cdn.netdna.ssl'), 'disabled'); ?>><?php _e('Disabled (always use HTTP)', 'w3-total-cache')?></option>
</select>
<br /><span class="description"><?php _e('Some <acronym>CDN</acronym> providers may or may not support <acronym title="Secure Sockets Layer">SSL</acronym>, contact your vendor for more information.', 'w3-total-cache')?></span>
</td>
</tr>
<tr>
<th><?php _e('Replace site\'s hostname with:', 'w3-total-cache')?></th>
<td>
<?php $cnames = $this->_config->get_array('cdn.netdna.domain'); include W3TC_INC_DIR . '/options/cdn/common/cnames.php'; ?>
<br /><span class="description"><?php _e('Enter the hostname provided by your <acronym>CDN</acronym> provider, this value will replace your site\'s hostname in the <acronym title="Hypertext Markup Language">HTML</acronym>.', 'w3-total-cache')?></span>
</td>
</tr>
<tr>
<th colspan="2">
<input id="cdn_test" class="button {type: 'netdna', nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" type="button" value="<?php _e('Test NetDNA', 'w3-total-cache')?>" /> <span id="cdn_test_status" class="w3tc-status w3tc-process"></span>
</th>
</tr>
<?php if (!defined('W3TC')) die(); ?>
<tr>
<th style="width: 300px;"><label for="cdn_rscf_user"><?php _e('Username:', 'w3-total-cache'); ?></label></th>
<td>
<input id="cdn_rscf_user" class="w3tc-ignore-change" type="text"
<?php $this->sealing_disabled('cdn') ?> name="cdn.rscf.user" value="<?php echo esc_attr($this->_config->get_string('cdn.rscf.user')); ?>" size="30" />
</td>
</tr>
<tr>
<th><label for="cdn_rscf_key"><?php _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 $this->sealing_disabled('cdn') ?> name="cdn.rscf.key" value="<?php echo esc_attr($this->_config->get_string('cdn.rscf.key')); ?>" size="60" />
</td>
</tr>
<tr>
<th><label for="cdn_rscf_location"><?php _e('Location:', 'w3-total-cache'); ?></label></th>
<td>
<select id="cdn_rscf_location" name="cdn.rscf.location" <?php $this->sealing_disabled('cdn') ?>>
<option value="us"<?php echo selected($this->_config->get_string('cdn.rscf.location'), 'us'); ?>>US</option>
<option value="uk"<?php echo selected($this->_config->get_string('cdn.rscf.location'), 'uk'); ?>>UK</option>
</select>
</td>
</tr>
<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 $this->sealing_disabled('cdn') ?> value="<?php echo esc_attr($this->_config->get_string('cdn.rscf.container')); ?>" size="30" />
<input id="cdn_create_container"
<?php $this->sealing_disabled('cdn') ?> class="button {type: 'rscf', nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" type="button" value="<?php _e('Create container', 'w3-total-cache'); ?>" />
<span id="cdn_create_container_status" class="w3tc-status w3tc-process"></span>
</td>
</tr>
<tr>
<th><label for="cdn_rscf_ssl"><?php _e('<acronym title="Secure Sockets Layer">SSL</acronym> support:', 'w3-total-cache'); ?></label></th>
<td>
<select id="cdn_rscf_ssl" name="cdn.rscf.ssl" <?php $this->sealing_disabled('cdn') ?>>
<option value="auto"<?php selected($this->_config->get_string('cdn.rscf.ssl'), 'auto'); ?>><?php _e('Auto (determine connection type automatically)', 'w3-total-cache'); ?></option>
<option value="enabled"<?php selected($this->_config->get_string('cdn.rscf.ssl'), 'enabled'); ?>><?php _e('Enabled (always use SSL)', 'w3-total-cache'); ?></option>
<option value="disabled"<?php selected($this->_config->get_string('cdn.rscf.ssl'), 'disabled'); ?>><?php _e('Disabled (always use HTTP)', 'w3-total-cache'); ?></option>
</select>
<br /><span class="description"><?php _e('Some <acronym>CDN</acronym> providers may or may not support <acronym title="Secure Sockets Layer">SSL</acronym>, contact your vendor for more information.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th><?php _e('Replace site\'s hostname with:', 'w3-total-cache'); ?></th>
<td>
<?php $cnames = $this->_config->get_array('cdn.rscf.cname'); include W3TC_INC_DIR . '/options/cdn/common/cnames.php'; ?>
<br /><span class="description"><?php _e('Enter the hostname provided by Rackspace Cloud Files, this value will replace your site\'s hostname in the <acronym title="Hypertext Markup Language">HTML</acronym>.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th colspan="2">
<input id="cdn_test" class="button {type: 'rscf', nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" type="button" value="<?php _e('Test Cloud Files upload', 'w3-total-cache'); ?>" /> <span id="cdn_test_status" class="w3tc-status w3tc-process"></span>
</th>
</tr>
<?php if (!defined('W3TC')) die(); ?>
<tr>
<th colspan="2">
<span class="description"><?php _e('We recommend that you use <a href="http://docs.amazonwebservices.com/IAM/latest/UserGuide/AccessPolicyLanguage_KeyConcepts.html" target="_blank"><acronym title="AWS Identity and Access Management">IAM</acronym></a> to create a new policy for <acronym title="Amazon Web Services">AWS</acronym> services that have limited permissions. A helpful tool: <a href="http://awspolicygen.s3.amazonaws.com/policygen.html" target="_blank"><acronym title="Amazon Web Services">AWS</acronym> Policy Generator</a>', 'w3-total-cache'); ?></span>
</th>
</tr>
<tr>
<th style="width: 300px;"><label for="cdn_s3_key"><?php _e('Access key ID:', 'w3-total-cache'); ?></label></th>
<td>
<input id="cdn_s3_key" class="w3tc-ignore-change" type="text"
<?php $this->sealing_disabled('cdn') ?> name="cdn.s3.key" value="<?php echo esc_attr($this->_config->get_string('cdn.s3.key')); ?>" size="30" />
</td>
</tr>
<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 $this->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>
<td>
<input id="cdn_s3_bucket" type="text" name="cdn.s3.bucket"
<?php $this->sealing_disabled('cdn') ?> value="<?php echo esc_attr($this->_config->get_string('cdn.s3.bucket')); ?>" size="30" />
<input class="button button-cdn-s3-bucket-location cdn_s3 {nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" type="button" value="<?php _e('Create bucket', 'w3-total-cache'); ?>" />
</td>
</tr>
<tr>
<th><label for="cdn_s3_ssl"><?php _e('<acronym title="Secure Sockets Layer">SSL</acronym> support:', 'w3-total-cache'); ?></label></th>
<td>
<select id="cdn_s3_ssl" name="cdn.s3.ssl" <?php $this->sealing_disabled('cdn') ?>>
<option value="auto"<?php selected($this->_config->get_string('cdn.s3.ssl'), 'auto'); ?>><?php _e('Auto (determine connection type automatically)', 'w3-total-cache'); ?></option>
<option value="enabled"<?php selected($this->_config->get_string('cdn.s3.ssl'), 'enabled'); ?>><?php _e('Enabled (always use SSL)', 'w3-total-cache'); ?></option>
<option value="disabled"<?php selected($this->_config->get_string('cdn.s3.ssl'), 'disabled'); ?>><?php _e('Disabled (always use HTTP)', 'w3-total-cache'); ?></option>
</select>
<br /><span class="description"><?php _e('Some <acronym>CDN</acronym> providers may or may not support <acronym title="Secure Sockets Layer">SSL</acronym>, contact your vendor for more information.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th><?php _e('Replace site\'s hostname with:', 'w3-total-cache'); ?></th>
<td>
<?php if (($cdn_s3_bucket = $this->_config->get_string('cdn.s3.bucket')) != ''): ?>
<?php echo htmlspecialchars($cdn_s3_bucket); ?>.s3.amazonaws.com
<?php else: ?>
&lt;bucket&gt;.s3.amazonaws.com
<?php endif; ?> <?php _e('or CNAME:', 'w3-total-cache'); ?>
<?php $cnames = $this->_config->get_array('cdn.s3.cname'); include W3TC_INC_DIR . '/options/cdn/common/cnames.php'; ?>
<br /><span class="description"><?php _e('If you have already added a <a href="http://docs.amazonwebservices.com/AmazonS3/latest/DeveloperGuide/VirtualHosting.html#VirtualHostingCustomURLs" target="_blank">CNAME</a> to your <acronym title="Domain Name System">DNS</acronym> Zone, enter it here.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th colspan="2">
<input id="cdn_test" class="button {type: 's3', nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" type="button" value="<?php _e('Test S3 upload', 'w3-total-cache'); ?>" /> <span id="cdn_test_status" class="w3tc-status w3tc-process"></span>
</th>
</tr>
<?php if (!defined('W3TC')) die(); ?>
<div id="w3tc-help">
<p><?php _e('Request professional <a href="admin.php?page=w3tc_support" style="color: red;"><strong>support</strong></a> or troubleshoot issues using the common questions below:', 'w3-total-cache'); ?></p>
<?php foreach ($columns as $entries): ?>
<ul>
<?php foreach ($entries as $entry): ?>
<?php if(is_array($entry)): ?>
<?php foreach ($entry as $entry2): ?>
<li>
<a href="admin.php?page=w3tc_faq#q<?php echo $entry2['index']; ?>"><?php echo $entry2['question']; ?></a>
</li>
<?php endforeach; ?>
<?php else: ?>
<li>
<a href="admin.php?page=w3tc_faq#q<?php echo $entry['index']; ?>"><?php echo $entry['question']; ?></a>
</li>
<?php endif ?>
<?php endforeach; ?>
</ul>
<?php endforeach; ?>
<div style="clear: left;"></div>
</div>
<?php if (!defined('W3TC')) die(); ?>
<?php 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')
, w3_w3tc_release_version($this->_config), (w3tc_edge_mode() ? __(' 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 $this->nonce_field('w3tc'); ?>
<input id="flush_all" class="button" type="submit" name="w3tc_flush_all" value="<?php _e('empty all caches', 'w3-total-cache') ?>"<?php if (! $can_empty_memcache && ! $can_empty_opcode && ! $can_empty_file && ! $can_empty_varnish): ?> disabled="disabled"<?php endif; ?> /> <?php _e('at once or', 'w3-total-cache') ?>
<input class="button" type="submit" name="w3tc_flush_memcached" value="<?php _e('empty only the memcached cache(s)', 'w3-total-cache') ?>"<?php if (! $can_empty_memcache): ?> disabled="disabled"<?php endif; ?> /> <?php _e('or', 'w3-total-cache') ?>
<input class="button" type="submit" name="w3tc_flush_opcode" value="<?php _e('empty only the opcode cache', 'w3-total-cache') ?>"<?php if (! $can_empty_opcode): ?> disabled="disabled"<?php endif; ?> /> <?php _e('or', 'w3-total-cache') ?>
<?php if ($can_empty_apc_system): ?>
<input class="button" type="submit" name="w3tc_flush_apc_system" value="<?php _e('empty only the APC system cache', 'w3-total-cache') ?>"<?php if (! $can_empty_apc_system): ?> disabled="disabled"<?php endif; ?> /> <?php _e('or', 'w3-total-cache') ?>
<?php endif ?>
<input class="button" type="submit" name="w3tc_flush_file" value="<?php _e('empty only the disk cache(s)', 'w3-total-cache') ?>"<?php if (! $can_empty_file): ?> disabled="disabled"<?php endif; ?> /> <?php _e('or', 'w3-total-cache') ?>
<?php if ($cdn_mirror_purge && $cdn_enabled): ?>
<input class="button" type="submit" name="w3tc_flush_cdn" value="<?php _e('purge CDN completely', 'w3-total-cache') ?>" /> <?php _e('or', 'w3-total-cache') ?>
<?php endif; ?>
<input type="submit" name="w3tc_flush_browser_cache" value="<?php _e('update Media Query String', 'w3-total-cache') ?>" <?php disabled(! ($browsercache_enabled && $browsercache_update_media_qs)) ?> class="button" />
<?php
$string = __('or', 'w3-total-cache');
echo implode(" $string ", apply_filters('w3tc_dashboard_actions', array())) ?>.
</p>
</form>
<div id="w3tc-dashboard-widgets" class="clearfix widefat metabox-holder">
<?php $screen = get_current_screen();
?>
<div id="postbox-container-left" style="float: left;">
<div class="content">
<div id="dashboard-text" style="display:inline-block;">
<h1><?php _e('Dashboard', 'w3-total-cache')?></h1>
<p>Thanks for choosing W3TC as your Web Performance Optimization (<acronym title="Web Performance Optimization">WPO</acronym>) framework. Eventually, the dashboard will provide at-a-glance insight into key performance indicators for this WordPress installation. Please share <a href="admin.php?page=w3tc_support&amp;request_type=new_feature">your suggestions</a> about the statistics and reporting you would like to see here!</p>
</div>
<div id="widgets-container">
<?php do_meta_boxes( $screen->id, 'normal', '' ); ?>
</div>
</div>
</div>
<div id="postbox-container-right">
<div id='postbox-container-3' class='postbox-container' style="width: 100%;">
<?php do_meta_boxes( $screen->id, 'side', '' ); ?>
</div>
</div>
<div style="clear:both"></div>
<?php
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
?>
</div>
<?php include W3TC_INC_DIR . '/options/common/footer.php'; ?>
<?php if (!defined('W3TC')) die(); ?>
<?php include W3TC_INC_DIR . '/options/common/header.php'; ?>
<form action="admin.php?page=<?php echo $this->_page; ?>" method="post">
<p>
<?php echo sprintf(__('Database caching via %s is currently %s.', 'w3-total-cache'), w3_get_engine_name($this->_config->get_string('dbcache.engine')) ,'<span class="w3tc-' . ($dbcache_enabled ? 'enabled">' . __('enabled', 'w3-total-cache') : 'disabled">' . __('disabled', 'w3-total-cache')) . '</span>'); ?>
</p>
<p>
<?php _e('To rebuild the database cache use the', 'w3-total-cache') ?>
<?php echo $this->nonce_field('w3tc'); ?>
<input type="submit" name="w3tc_flush_dbcache" value="<?php _e('empty cache', 'w3-total-cache'); ?>"<?php if (! $dbcache_enabled): ?> disabled="disabled"<?php endif; ?> class="button" />
<?php _e('operation.', 'w3-total-cache'); ?>
</p>
</form>
<form action="admin.php?page=<?php echo $this->_page; ?>" method="post">
<div class="metabox-holder">
<?php echo $this->postbox_header(__('General', 'w3-total-cache'), '', 'general'); ?>
<table class="form-table">
<tr>
<th>
<?php $this->checkbox('dbcache.reject.logged') ?> <?php w3_e_config_label('dbcache.reject.logged') ?></label>
<br /><span class="description"><?php _e('Enabling this option is recommended to maintain default WordPress behavior.', 'w3-total-cache'); ?></span>
</th>
</tr>
</table>
<p class="submit">
<?php echo $this->nonce_field('w3tc'); ?>
<input type="submit" name="w3tc_save_options" class="w3tc-button-save button-primary" value="<?php _e('Save all settings', 'w3-total-cache'); ?>" />
</p>
<?php echo $this->postbox_footer(); ?>
<?php echo $this->postbox_header(__('Advanced', 'w3-total-cache'), '', 'advanced'); ?>
<table class="form-table">
<?php if ($this->_config->get_string('dbcache.engine') == 'memcached'): ?>
<tr>
<th><label for="memcached_servers"><?php w3_e_config_label('dbcache.memcached.servers') ?></label></th>
<td>
<input id="memcached_servers" type="text"
<?php $this->sealing_disabled('dbcache') ?> name="dbcache.memcached.servers" value="<?php echo esc_attr(implode(',', $this->_config->get_array('dbcache.memcached.servers'))); ?>" size="100" />
<input id="memcached_test" class="button {nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" type="button" value="<?php _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 endif; ?>
<tr>
<th style="width: 250px;"><label for="dbcache_lifetime"><?php w3_e_config_label('dbcache.lifetime') ?></label></th>
<td>
<input id="dbcache_lifetime" type="text" name="dbcache.lifetime"
<?php $this->sealing_disabled('dbcache') ?>
value="<?php echo esc_attr($this->_config->get_integer('dbcache.lifetime')); ?>" size="8" /> <?php _e('seconds', 'w3-total-cache'); ?>
<br /><span class="description"><?php _e('Determines the natural expiration time of unchanged cache items. The higher the value, the larger the cache.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th><label for="dbcache_file_gc"><?php w3_e_config_label('dbcache.file.gc') ?></label></th>
<td>
<input id="dbcache_file_gc" type="text" name="dbcache.file.gc"
<?php $this->sealing_disabled('dbcache') ?> value="<?php echo esc_attr($this->_config->get_integer('dbcache.file.gc')); ?>" size="8" /> <?php _e('seconds', 'w3-total-cache'); ?>
<br /><span class="description"><?php _e('If caching to disk, specify how frequently expired cache data is removed. For busy sites, a lower value is best.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th><label for="dbcache_reject_uri"><?php w3_e_config_label('dbcache.reject.uri') ?></label></th>
<td>
<textarea id="dbcache_reject_uri" name="dbcache.reject.uri"
<?php $this->sealing_disabled('dbcache') ?> cols="40" rows="5"><?php echo esc_textarea(implode("\r\n", $this->_config->get_array('dbcache.reject.uri'))); ?></textarea><br />
<span class="description">
<?php echo sprintf( __('Always ignore the specified pages / directories. Supports regular expressions (See <a href="%s">FAQ</a>).', 'w3-total-cache'), network_admin_url('admin.php?page=w3tc_faq#q82') ); ?>
</span>
</td>
</tr>
<tr>
<th><label for="dbcache_reject_sql"><?php w3_e_config_label('dbcache.reject.sql') ?></label></th>
<td>
<textarea id="dbcache_reject_sql" name="dbcache.reject.sql"
<?php $this->sealing_disabled('dbcache') ?> cols="40" rows="5"><?php echo esc_textarea(implode("\r\n", $this->_config->get_array('dbcache.reject.sql'))); ?></textarea><br />
<span class="description"><?php _e('Do not cache queries that contain these terms. Any entered prefix (set in wp-config.php) will be replaced with current database prefix (default: wp_). Query stems can be identified using debug mode.', 'w3-total-cache'); ?></span>
</td>
</tr>
<tr>
<th><label for="dbcache_reject_words"><?php w3_e_config_label('dbcache.reject.words') ?></label></th>
<td>
<textarea id="dbcache_reject_words" name="dbcache.reject.words"
<?php $this->sealing_disabled('dbcache') ?> cols="40" rows="5"><?php echo esc_textarea(implode("\r\n", $this->_config->get_array('dbcache.reject.words'))); ?></textarea><br />
<span class="description"><?php _e('Do not cache queries that contain these words or regular expressions.', 'w3-total-cache'); ?></span>
</td>
</tr>
</table>
<p class="submit">
<?php echo $this->nonce_field('w3tc'); ?>
<input type="submit" name="w3tc_save_options" class="w3tc-button-save button-primary" value="<?php _e('Save all settings', 'w3-total-cache'); ?>" />
</p>
<?php echo $this->postbox_footer(); ?>
</div>
</form>
<?php include W3TC_INC_DIR . '/options/common/footer.php'; ?>
<div>
Unlock more speed, <input type="button" class="button-primary button-buy-plugin {nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" value="<?php _e('upgrade', 'w3-total-cache') ?>" /> now!
<div id="w3tc-license-instruction" style="display: none;">
<span class="description"><?php printf(__('Please enter the license key you received after successful checkout %s.', 'w3-total-cache'),
'<a href="' . (is_network_admin() ?
network_admin_url('admin.php?page=w3tc_general#licensing') :
admin_url('admin.php?page=w3tc_general#licensing')) .'">' . __('here', 'w3-total-cache') . '</a>')
?></span>
</div>
</div>
<?php if (!defined('W3TC')) die(); ?>
<?php include W3TC_INC_DIR . '/options/common/header.php'; ?>
<form action="admin.php?page=<?php echo $this->_page; ?>" method="post">
<div class="metabox-holder">
<?php echo $this->postbox_header(__('Database Cluster Configuration File', 'w3-total-cache')); ?>
<table class="form-table">
<tr>
<th>
<textarea cols="70" rows="25" style="width: 100%"
name="newcontent" id="newcontent"
tabindex="1"><?php echo esc_textarea($content); ?></textarea><br />
<br />
<span class="description">
<?php _e('Note: Changes will have immediate effect on your database configuration. If the application stops working creating the settings file, edit or remove this configuration file manually at <strong>/wp-content/db-cluster-config.php</strong>.', 'w3-total-cache'); ?>
</span>
</th>
</tr>
</table>
<p class="submit">
<?php echo $this->nonce_field('w3tc'); ?>
<input type="submit" name="w3tc_config_dbcluster_config_save" class="w3tc-button-save button-primary" value="<?php _e('Save configuration file', 'w3-total-cache'); ?>" />
</p>
<?php echo $this->postbox_footer(); ?>
</div>
</form>
<?php include W3TC_INC_DIR . '/options/common/footer.php'; ?>
\ No newline at end of file
<tr>
<th><label for="w3tc_dbcluster_config">Database cluster:</th>
<td>
<input type="submit" id="w3tc_dbcluster_config" name="w3tc_dbcluster_config" class="button"
value="<?php echo (w3_is_dbcluster() ? 'Edit Database Cluster Configuration' : 'Enable database cluster'); ?>" /><br />
<span class="description">Create db-cluster-config.php file with your database cluster configuration to enable it.</span>
</td>
</tr>
\ No newline at end of file
<?php if (!defined('W3TC')) die();?>
<?php
/**
* @var string $sub_view
*/
?>
<?php include W3TC_INC_OPTIONS_DIR . '/common/header.php'; ?>
<div id="w3tc_extensions">
<?php
if ($sub_view == 'list')
printf('<p>'.__('Extension support is always %s','w3-total-cache'), '<span class="w3tc-enabled">' . __('enabled', 'w3-total-cache') . '</span>.' .'</p>')
?>
<form action="admin.php?page=<?php echo $this->_page; ?><?php echo $extension ? "&extension={$extension}&action=view" : ''?>" method="post">
<div class="metabox-holder <?php echo $extension?'extension-settings':''?>">
<?php include W3TC_INC_OPTIONS_DIR . "/extensions/$sub_view.php"?>
</div>
</form>
</div>
<?php include W3TC_INC_OPTIONS_DIR . '/common/footer.php'; ?>
<?php
/**
* @var W3_UI_ExtensionsAdminView $this
* @var string $extension_status
* @var int $page
* @var array $extensions list of extensions for current $extension_status
* @var array $extensions_all list of all extensions
* @var array $extensions_active list of all active extensions
* @var array $extensions_inactive list of all inactive extensions
* @var array $extensions_core list of all core extensions
*/
?>
<ul class="subsubsub">
<li class="all"><a href="?page=w3tc_extensions&extension_status=all"<?php echo $extension_status == 'all' ? ' class="current"':''?>>All <span class="count">(<?php echo sizeof($extensions_all) ?>)</span></a> |</li>
<li class="active"><a href="?page=w3tc_extensions&extension_status=active"<?php echo $extension_status == 'active' ? ' class="current"':''?>>Active <span class="count">(<?php echo sizeof($extensions_active) ?>)</span></a> |</li>
<li class="inactive"><a href="?page=w3tc_extensions&extension_status=inactive"<?php echo $extension_status == 'inactive' ? ' class="current"':''?>>Inactive <span class="count">(<?php echo sizeof($extensions_inactive) ?>)</span></a></li>
</ul>
<div class="tablenav top">
<div class="alignleft actions">
<select name="action">
<option value="-1" selected="selected"><?php _e('Bulk Actions', 'w3-total-cache')?></option>
<option value="activate-selected"><?php _e('Activate', 'w3-total-cache')?></option>
<option value="deactivate-selected"><?php _e('Deactivate', 'w3-total-cache')?></option>
</select>
<input type="submit" name="" id="doaction" class="w3tc-button-save button action" value="<?php esc_attr_e('Apply')?>">
</div>
<div class="tablenav-pages one-page">
<span class="displaying-num"><?php printf( translate_nooped_plural( _n_noop('%s extension', '%s extensions'), sizeof($extensions), 'w3-total-cache' ), sizeof($extensions) ); ?></span>
</div>
<br class="clear">
</div>
<table class="wp-list-table widefat plugins extensions" cellspacing="0">
<thead>
<tr>
<th scope="col" id="cb" class="manage-column column-cb check-column" style=""><label class="screen-reader-text" for="cb-select-all-1"><?php _e('Select All', 'w3-total-cache')?></label><input id="cb-select-all-1" type="checkbox"></th><th scope="col" id="name" class="manage-column column-name" style=""><?php _e('Extension', 'w3-total-cache')?></th><th scope="col" id="description" class="manage-column column-description" style=""><?php _e('Description', 'w3-total-cache')?></th>
</tr>
</thead>
<tfoot>
<tr>
<th scope="col" class="manage-column column-cb check-column" style=""><label class="screen-reader-text" for="cb-select-all-2"><?php _e('Select All', 'w3-total-cache')?></label><input id="cb-select-all-2" type="checkbox"></th><th scope="col" class="manage-column column-name" style=""><?php _e('Extension', 'w3-total-cache')?></th><th scope="col" class="manage-column column-description" style=""><?php _e('Description', 'w3-total-cache')?></th>
</tr>
</tfoot>
<tbody id="the-list">
<?php
$cb_id = 0;
foreach($extensions as $extension => $meta):
$meta = $this->default_meta($meta);
$cb_id++;
?>
<?php do_action("w3tc_extension_before_row-{$extension}") ?>
<tr id="<?php echo esc_attr($extension)?>" class="<?php echo w3_is_extension_active($extension) ? 'active' : 'inactive'?>">
<th scope="row" class="check-column">
<label class="screen-reader-text" for="checkbox_<?php echo $cb_id?>"><?php printf(__('Select %s'), $meta['name']) ?></label>
<input type="checkbox" name="checked[]" value="<?php echo esc_attr($extension) ?>" id="checkbox_<?php echo $cb_id?>" <?php disabled(!$meta['enabled'])?>>
</th>
<td class="plugin-title">
<strong><?php esc_html_e($meta['name']) ?></strong>
<div class="row-actions-visible">
<?php if (w3_is_extension_active($extension)):
$activate = '<a class="edit" href="' . esc_attr(w3_admin_url(sprintf('admin.php?page=w3tc_extensions&extension=%s', $extension))).'&action=view">'. __('Settings').'</a>';
$extra_links = apply_filters("w3tc_extension_plugin_links-{$extension}", array($activate));
$links = implode(' | ', $extra_links);
if ($links) {
echo $links, ' | ';
}
?>
<span class="0">
</span>
<span class="deactivate">
<a href="<?php esc_attr_e(wp_nonce_url(w3_admin_url(sprintf('admin.php?page=w3tc_extensions&action=deactivate&extension=%s&amp;extension_status=%s&amp;paged=%d', $extension, $extension_status, $page)), 'w3tc')) ?>" title="<?php esc_attr_e('Deactivate this extension', 'w3-total-cache') ?> ">
<?php _e('Deactivate') ?>
</a>
</span>
<?php else: ?>
<span class="activate">
<?php if ($meta['enabled']): ?>
<a href="<?php esc_attr_e(wp_nonce_url(w3_admin_url(sprintf('admin.php?page=w3tc_extensions&action=activate&extension=%s&amp;extension_status=%s&amp;paged=%d', $extension, $extension_status, $page)), 'w3tc')) ?>" title="<?php esc_attr_e('Activate this extension', 'w3-total-cache') ?> ">
<?php _e('Activate') ?>
</a>
<?php else: ?>
<?php _e('Disabled: Unsupported', 'w3-total-cache') ?>
<?php endif; ?>
</span>
<?php endif ?>
</div>
</td>
<td class="column-description desc">
<div class="plugin-description">
<p><?php _e($meta['description']) ?>
<?php if (!$meta['enabled']): ?>
<br />
<span class="description"><?php printf(__('Requirements: %s', 'w3-total-cache'), apply_filters("w3tc_extension_requirements-{$extension}", $meta['requirements'])) ?></span>
<?php do_action("w3tc_extension_requirements-{$extension}") ?>
<?php endif ?>
</p>
</div>
<div class="<?php echo w3_is_extension_active($extension) ? 'active' : 'inactive'?> second plugin-version-author-uri">
<?php printf(__('Version %s', 'w3-total-cache'), $meta['version'])?> | <?php printf(__('By %s', 'w3-total-cache'), sprintf('<a href="%s" title="' . __('Visit author homepage') . '">%s</a>', $meta['author uri'], $meta['author'])) ?> | <a href="<?php esc_attr_e($meta['extension uri']) ?>" title="<?php esc_attr_e('Visit extension site', 'w3-total-cache') ?>"><?php _e('Visit extension site', 'w3-total-cache')?></a>
</div>
</td>
</tr>
<?php do_action("w3tc_extension_after_row", $extension) ?>
<?php do_action("w3tc_extension_after_row-{$extension}") ?>
<?php if (is_network_admin() && !w3_force_master()): ?>
<tr>
<th></th>
<th><?php _e('Network policy:', 'w3-total-cache'); ?></th>
<td>
<?php $this->checkbox_admin_extensions("extensions.configuration_sealed", $extension); ?> <?php printf(__('Apply the %s settings to the entire network.', 'w3-total-cache'), $meta['name']); ?></label>
</td>
</tr>
<?php endif; ?>
<?php endforeach ?>
</tbody>
</table>
<div class="tablenav bottom">
<div class="alignleft actions">
<select name="action">
<option value="-1" selected="selected"><?php _e('Bulk Actions', 'w3-total-cache')?></option>
<option value="activate-selected"><?php _e('Activate', 'w3-total-cache')?></option>
<option value="deactivate-selected"><?php _e('Deactivate', 'w3-total-cache')?></option>
</select>
<input type="submit" name="" id="doaction" class="w3tc-button-save button action" value="<?php esc_attr_e('Apply')?>">
</div>
<div class="tablenav-pages one-page">
<span class="displaying-num"><?php printf( translate_nooped_plural( _n_noop('%s extension', '%s extensions'), sizeof($extensions), 'w3-total-cache' ), sizeof($extensions) ); ?></span>
</div>
<br class="clear">
</div>
<?php if (is_network_admin()): ?>
<p class="submit">
<?php echo $this->nonce_field('w3tc'); ?>
<input type="submit" name="w3tc_save_options" class="w3tc-button-save button-primary" value="<?php _e('Save network settings', 'w3-total-cache'); ?>" />
</p>
<?php endif ?>
<?php
/**
* @var W3_UI_ExtensionsAdminView $this
* @var string $active_tab
* @var string $extension
* @var array $meta
*/
?>
<?php do_action("w3tc_extensions_page-{$extension}") ?>
<?php echo $this->postbox_header(htmlspecialchars($meta['author']) . ' - ' . htmlspecialchars($meta['name']), '', $extension) ?>
<p><span class="description"><?php echo esc_html($meta['description']); ?></span></p>
<?php do_action("w3tc_before_do_settings_sections_{$extension}") ?>
<?php w3tc_do_settings_sections("{$extension}")?>
<?php do_action("w3tc_after_do_settings_sections_{$extension}") ?>
<p class="submit">
<input type="hidden" name="redirect" value="<?php echo w3_admin_url('admin.php?page=w3tc_extensions&extension=' . $extension . '&action=view') ?>" />
<?php echo $this->nonce_field('w3tc'); ?>
<input type="submit" name="w3tc_save_options" class="w3tc-button-save button-primary" value="<?php _e('Save settings', 'w3-total-cache'); ?>" />
</p>
<?php echo $this->postbox_footer(); ?>
<?php if (!defined('W3TC')) die(); ?>
<?php include W3TC_INC_DIR . '/options/common/header.php'; ?>
<h4><?php _e('Table of Contents', 'w3-total-cache'); ?></h4>
<div id="toc">
<ul>
<?php foreach ($faq as $section => $entries): ?>
<li class="col">
<h5><?php echo strtoupper($section); ?>:</h5>
<ul>
<?php foreach ($entries as $id => $entry): ?>
<?php if (!isset($entry['question'])): ?>
<h5><?php echo strtoupper($id); ?>:</h5>
<ul>
<?php foreach ($entry as $entry2): ?>
<li><a href="#q<?php echo $entry2['index']; ?>"><?php echo $entry2['question']; ?></a></li>
<?php endforeach; ?>
</ul>
<?php else:?>
<li><a href="#q<?php echo $entry['index']; ?>"><?php echo $entry['question']; ?></a></li>
<?php endif ?>
<?php endforeach; ?>
</ul>
</li>
<?php endforeach; ?>
</ul>
</div>
<div id="qa">
<hr />
<?php foreach ($faq as $section => $entries): ?>
<?php foreach ($entries as $id => $entry): ?>
<?php if (!isset($entry['question'])): ?>
<?php foreach ($entry as $entry2): ?>
<p id="q<?php echo $entry2['index']; ?>"><strong><?php echo $entry2['question']; ?></strong></p>
<?php echo $entry2['answer']; ?>
<p align="right"><a href="#toc">back to top</a></p>
<?php endforeach; ?>
<?php else:?>
<p id="q<?php echo $entry['index']; ?>"><strong><?php echo $entry['question']; ?></strong></p>
<?php echo $entry['answer']; ?>
<p align="right"><a href="#toc">back to top</a></p>
<?php endif ?>
<?php endforeach; ?>
<?php endforeach; ?>
</div>
<?php include W3TC_INC_DIR . '/options/common/footer.php'; ?>
<?php if (!defined('W3TC')) die(); ?>
<input type="hidden" name="minify.ccjs.options.formatting" value="" />
<label>
<input class="js_enabled" type="checkbox" name="minify.ccjs.options.formatting"
value="pretty_print"
<?php checked($this->_config->get_string('minify.ccjs.options.formatting'), 'pretty_print'); ?>
<?php $this->sealing_disabled('minify') ?> /> <?php w3_e_config_label('minify.ccjs.options.formatting') ?>
</label>
<br />
<?php
if (!defined('W3TC')) {
die();
}
$compilation_levels = array(
'WHITESPACE_ONLY' => __('Whitespace only', 'w3-total-cache'),
'SIMPLE_OPTIMIZATIONS' => __('Simple optimizations', 'w3-total-cache'),
'ADVANCED_OPTIMIZATIONS' => __('Advanced optimizations', 'w3-total-cache')
);
$compilation_level = $this->_config->get_string('minify.ccjs.options.compilation_level');
?>
<tr>
<th><label for="minify_ccjs_path_java"><?php w3_e_config_label('minify.ccjs.path.java') ?></label></th>
<td>
<input id="minify_ccjs_path_java" class="js_enabled" type="text"
<?php $this->sealing_disabled('minify') ?> name="minify.ccjs.path.java" value="<?php echo esc_attr($this->_config->get_string('minify.ccjs.path.java')); ?>" size="60" />
</td>
</tr>
<tr>
<th><label for="minify_ccjs_path_jar"><?php w3_e_config_label('minify.ccjs.path.jar') ?></label></th>
<td>
<input id="minify_ccjs_path_jar" class="js_enabled" type="text"
<?php $this->sealing_disabled('minify') ?> name="minify.ccjs.path.jar" value="<?php echo esc_attr($this->_config->get_string('minify.ccjs.path.jar')); ?>" size="60" />
</td>
</tr>
<tr>
<th>&nbsp;</th>
<td>
<input class="minifier_test js_enabled button {type: 'ccjs', nonce: '<?php echo wp_create_nonce('w3tc'); ?>'}" type="button" value="<?php _e('Test Closure Compiler', 'w3-total-cache'); ?>" />
<span class="minifier_test_status w3tc-status w3tc-process"></span>
</td>
</tr>
<tr>
<th><label for="minify_ccjs_options_compilation_level"><?php w3_e_config_label('minify.ccjs.options.compilation_level') ?></label></th>
<td>
<select id="minify_ccjs_options_compilation_level" class="js_enabled" name="minify.ccjs.options.compilation_level"
<?php $this->sealing_disabled('minify') ?>>
<?php foreach ($compilation_levels as $compilation_level_key => $compilation_level_name): ?>
<option value="<?php echo esc_attr($compilation_level_key); ?>" <?php selected($compilation_level, $compilation_level_key); ?>><?php echo $compilation_level_name; ?></option>
<?php endforeach; ?>
</select>
</td>
</tr>
<?php if (!defined('W3TC')) die(); ?>
<?php $this->checkbox('minify.css.strip.comments', false, 'css_') ?> <?php w3_e_config_label('minify.css.strip.comments') ?></label><br />
<?php $this->checkbox('minify.css.strip.crlf', false, 'css_') ?> <?php w3_e_config_label('minify.css.strip.crlf') ?></label><br />
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment