Version Description
- Improved media library import compatibility
- Improved various notifications
- Changed expires implementation to last accessed instead of last modified
- Resolved Apache 1.3 compatibility issue
- Fixed issues with document root detection on some servers
- Fixed an issue with minification of script tags with HTML comments inside
- Fixed bug with minify gzip compression
- Fixed bug with cache-control headers
- Fixed bug with empty fatal error notification on network activation
- Fixed bug with minify when https is active
- Fixed bug with fatal error upon activation when uploads path does not exist
Download this release
Release Info
Developer | fredericktownes |
Plugin | W3 Total Cache |
Version | 0.9.1.2 |
Comparing to | |
See all releases |
Code changes from version 0.9.1.1 to 0.9.1.2
- inc/define.php +56 -33
- inc/lightbox/self_test.phtml +1 -2
- inc/mime/all.php +1 -1
- inc/network_activation.php +15 -0
- inc/options/browsercache.phtml +13 -6
- inc/options/general.phtml +1 -1
- inc/options/install.phtml +1 -1
- inc/options/pgcache.phtml +2 -2
- inc/options/support_email.phtml +22 -0
- ini/xcache.ini +4 -5
- lib/Minify/Minify.php +2 -2
- lib/Minify/Minify/HTML.php +1 -1
- lib/W3/Cdn/Ftp.php +20 -3
- lib/W3/Config.php +6 -3
- lib/W3/Minify.php +7 -2
- lib/W3/Plugin/BrowserCache.php +11 -4
- lib/W3/Plugin/Cdn.php +1 -15
- lib/W3/Plugin/Minify.php +1 -1
- lib/W3/Plugin/PgCache.php +4 -3
- lib/W3/Plugin/TotalCache.php +48 -14
- readme.txt +33 -10
- w3-total-cache.php +2 -15
inc/define.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
define('W3TC_VERSION', '0.9.1.
|
4 |
define('W3TC_POWERED_BY', 'W3 Total Cache/' . W3TC_VERSION);
|
5 |
define('W3TC_EMAIL', 'w3tc@w3-edge.com');
|
6 |
define('W3TC_PAYPAL_URL', 'https://www.paypal.com/cgi-bin/webscr');
|
@@ -56,34 +56,45 @@ define('W3TC_CDN_TABLE_QUEUE', 'w3tc_cdn_queue');
|
|
56 |
$_w3tc_actions = array();
|
57 |
|
58 |
/**
|
59 |
-
*
|
60 |
-
*
|
61 |
-
* @param string $error
|
62 |
* @return void
|
63 |
*/
|
64 |
-
function
|
65 |
{
|
66 |
$active_plugins = (array) get_option('active_plugins');
|
|
|
67 |
|
68 |
// workaround for WPMU deactivation bug
|
69 |
remove_action('deactivate_' . W3TC_FILE, 'deactivate_sitewide_plugin');
|
70 |
|
|
|
|
|
71 |
$key = array_search(W3TC_FILE, $active_plugins);
|
72 |
|
73 |
if ($key !== false) {
|
74 |
-
do_action('deactivate_plugin', W3TC_FILE);
|
75 |
-
|
76 |
array_splice($active_plugins, $key, 1);
|
77 |
-
|
78 |
-
do_action('deactivate_' . W3TC_FILE);
|
79 |
-
do_action('deactivated_plugin', W3TC_FILE);
|
80 |
-
|
81 |
-
update_option('active_plugins', $active_plugins);
|
82 |
-
|
83 |
-
} else {
|
84 |
-
do_action('deactivate_' . W3TC_FILE);
|
85 |
}
|
86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
include W3TC_DIR . '/inc/error.phtml';
|
88 |
exit();
|
89 |
}
|
@@ -115,6 +126,9 @@ function w3_writable_error($path)
|
|
115 |
*/
|
116 |
function w3_network_activate_error()
|
117 |
{
|
|
|
|
|
|
|
118 |
echo '<p><strong>W3 Total Cache Error:</strong> plugin cannot be activated network-wide.</p>';
|
119 |
echo '<p><a href="javascript:history.back(-1);">Back</a>';
|
120 |
exit();
|
@@ -702,12 +716,12 @@ function w3_get_document_root()
|
|
702 |
static $document_root = null;
|
703 |
|
704 |
if ($document_root === null) {
|
705 |
-
if (isset($_SERVER['
|
706 |
-
$document_root = $_SERVER['DOCUMENT_ROOT'];
|
707 |
-
} elseif (isset($_SERVER['SCRIPT_FILENAME'])) {
|
708 |
$document_root = substr($_SERVER['SCRIPT_FILENAME'], 0, -strlen($_SERVER['PHP_SELF']));
|
709 |
} elseif (isset($_SERVER['PATH_TRANSLATED'])) {
|
710 |
$document_root = substr($_SERVER['PATH_TRANSLATED'], 0, -strlen($_SERVER['PHP_SELF']));
|
|
|
|
|
711 |
} else {
|
712 |
$document_root = w3_get_site_root();
|
713 |
}
|
@@ -1108,7 +1122,7 @@ function w3_http_request($method, $url, $data = '', $auth = '', $check_status =
|
|
1108 |
$request_uri = $path . ($query != '' ? '?' . $query : '');
|
1109 |
|
1110 |
$request_headers_array = array(
|
1111 |
-
sprintf('%s %s HTTP/1.
|
1112 |
sprintf('Host: %s', $host),
|
1113 |
sprintf('User-Agent: %s', W3TC_POWERED_BY),
|
1114 |
'Connection: close'
|
@@ -1690,24 +1704,33 @@ function w3_get_permalink_rules()
|
|
1690 |
$rules .= "</Files>\n";
|
1691 |
$rules .= "</IfModule>\n";
|
1692 |
} elseif (w3_is_network_mode()) {
|
|
|
|
|
1693 |
$rules .= "# BEGIN WordPress\n";
|
1694 |
$rules .= "<IfModule mod_rewrite.c>\n";
|
1695 |
-
$rules .= "
|
1696 |
-
$rules .= "
|
1697 |
-
$rules .= "
|
1698 |
|
1699 |
-
$rules .= "
|
1700 |
-
$rules .= "
|
|
|
|
|
|
|
|
|
|
|
1701 |
|
1702 |
-
$rules .= "
|
1703 |
-
$rules .= "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1704 |
|
1705 |
-
$rules .= "
|
1706 |
-
$rules .= " RewriteCond %{REQUEST_FILENAME} -d\n";
|
1707 |
-
$rules .= " RewriteRule ^ - [L]\n";
|
1708 |
-
$rules .= " RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) [L]\n";
|
1709 |
-
$rules .= " RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\\.php)$ [L]\n";
|
1710 |
-
$rules .= " RewriteRule . index.php [L]\n";
|
1711 |
$rules .= "</IfModule>\n";
|
1712 |
$rules .= "# END WordPress\n";
|
1713 |
} else {
|
@@ -1719,7 +1742,7 @@ function w3_get_permalink_rules()
|
|
1719 |
$rules .= " RewriteBase " . $home_path . "\n";
|
1720 |
$rules .= " RewriteCond %{REQUEST_FILENAME} !-f\n";
|
1721 |
$rules .= " RewriteCond %{REQUEST_FILENAME} !-d\n";
|
1722 |
-
$rules .= " RewriteRule . " . $
|
1723 |
$rules .= "</IfModule>\n";
|
1724 |
$rules .= "# END WordPress\n";
|
1725 |
}
|
1 |
<?php
|
2 |
|
3 |
+
define('W3TC_VERSION', '0.9.1.2');
|
4 |
define('W3TC_POWERED_BY', 'W3 Total Cache/' . W3TC_VERSION);
|
5 |
define('W3TC_EMAIL', 'w3tc@w3-edge.com');
|
6 |
define('W3TC_PAYPAL_URL', 'https://www.paypal.com/cgi-bin/webscr');
|
56 |
$_w3tc_actions = array();
|
57 |
|
58 |
/**
|
59 |
+
* Deactivate plugin after activation error
|
60 |
+
*
|
|
|
61 |
* @return void
|
62 |
*/
|
63 |
+
function w3_activation_cleanup()
|
64 |
{
|
65 |
$active_plugins = (array) get_option('active_plugins');
|
66 |
+
$active_plugins_network = (array) get_site_option('active_sitewide_plugins');
|
67 |
|
68 |
// workaround for WPMU deactivation bug
|
69 |
remove_action('deactivate_' . W3TC_FILE, 'deactivate_sitewide_plugin');
|
70 |
|
71 |
+
do_action('deactivate_plugin', W3TC_FILE);
|
72 |
+
|
73 |
$key = array_search(W3TC_FILE, $active_plugins);
|
74 |
|
75 |
if ($key !== false) {
|
|
|
|
|
76 |
array_splice($active_plugins, $key, 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
}
|
78 |
|
79 |
+
unset($active_plugins_network[W3TC_FILE]);
|
80 |
+
|
81 |
+
do_action('deactivate_' . W3TC_FILE);
|
82 |
+
do_action('deactivated_plugin', W3TC_FILE);
|
83 |
+
|
84 |
+
update_option('active_plugins', $active_plugins);
|
85 |
+
update_site_option('active_sitewide_plugins', $active_plugins_network);
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* W3 activate error
|
90 |
+
*
|
91 |
+
* @param string $error
|
92 |
+
* @return void
|
93 |
+
*/
|
94 |
+
function w3_activate_error($error)
|
95 |
+
{
|
96 |
+
w3_activation_cleanup();
|
97 |
+
|
98 |
include W3TC_DIR . '/inc/error.phtml';
|
99 |
exit();
|
100 |
}
|
126 |
*/
|
127 |
function w3_network_activate_error()
|
128 |
{
|
129 |
+
w3_activation_cleanup();
|
130 |
+
wp_redirect(plugins_url('inc/network_activation.php', W3TC_FILE));
|
131 |
+
|
132 |
echo '<p><strong>W3 Total Cache Error:</strong> plugin cannot be activated network-wide.</p>';
|
133 |
echo '<p><a href="javascript:history.back(-1);">Back</a>';
|
134 |
exit();
|
716 |
static $document_root = null;
|
717 |
|
718 |
if ($document_root === null) {
|
719 |
+
if (isset($_SERVER['SCRIPT_FILENAME'])) {
|
|
|
|
|
720 |
$document_root = substr($_SERVER['SCRIPT_FILENAME'], 0, -strlen($_SERVER['PHP_SELF']));
|
721 |
} elseif (isset($_SERVER['PATH_TRANSLATED'])) {
|
722 |
$document_root = substr($_SERVER['PATH_TRANSLATED'], 0, -strlen($_SERVER['PHP_SELF']));
|
723 |
+
} elseif (isset($_SERVER['DOCUMENT_ROOT'])) {
|
724 |
+
$document_root = $_SERVER['DOCUMENT_ROOT'];
|
725 |
} else {
|
726 |
$document_root = w3_get_site_root();
|
727 |
}
|
1122 |
$request_uri = $path . ($query != '' ? '?' . $query : '');
|
1123 |
|
1124 |
$request_headers_array = array(
|
1125 |
+
sprintf('%s %s HTTP/1.0', $method, $request_uri),
|
1126 |
sprintf('Host: %s', $host),
|
1127 |
sprintf('User-Agent: %s', W3TC_POWERED_BY),
|
1128 |
'Connection: close'
|
1704 |
$rules .= "</Files>\n";
|
1705 |
$rules .= "</IfModule>\n";
|
1706 |
} elseif (w3_is_network_mode()) {
|
1707 |
+
$subdomain_install = is_subdomain_install();
|
1708 |
+
|
1709 |
$rules .= "# BEGIN WordPress\n";
|
1710 |
$rules .= "<IfModule mod_rewrite.c>\n";
|
1711 |
+
$rules .= "RewriteEngine On\n";
|
1712 |
+
$rules .= "RewriteBase " . $base_path . "\n";
|
1713 |
+
$rules .= "RewriteRule ^index\\.php$ - [L]\n\n";
|
1714 |
|
1715 |
+
$rules .= "# uploaded files\n";
|
1716 |
+
$rules .= "RewriteRule ^" . ($subdomain_install ? '' : '([_0-9a-zA-Z-]+/)?') . "files/(.+) wp-includes/ms-files.php?file=$" . ($subdomain_install ? 1 : 2) . " [L]\n\n";
|
1717 |
+
|
1718 |
+
if (!$subdomain_install) {
|
1719 |
+
$rules .= "# add a trailing slash to /wp-admin\n";
|
1720 |
+
$rules .= "RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]\n";
|
1721 |
+
}
|
1722 |
|
1723 |
+
$rules .= "RewriteCond %{REQUEST_FILENAME} -f [OR]\n";
|
1724 |
+
$rules .= "RewriteCond %{REQUEST_FILENAME} -d\n";
|
1725 |
+
$rules .= "RewriteRule ^ - [L]\n";
|
1726 |
+
|
1727 |
+
// @todo custom content dir.
|
1728 |
+
if (!$subdomain_install) {
|
1729 |
+
$rules .= "RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]\n";
|
1730 |
+
$rules .= "RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\\.php)$ $2 [L]\n";
|
1731 |
+
}
|
1732 |
|
1733 |
+
$rules .= "RewriteRule . index.php [L]\n";
|
|
|
|
|
|
|
|
|
|
|
1734 |
$rules .= "</IfModule>\n";
|
1735 |
$rules .= "# END WordPress\n";
|
1736 |
} else {
|
1742 |
$rules .= " RewriteBase " . $home_path . "\n";
|
1743 |
$rules .= " RewriteCond %{REQUEST_FILENAME} !-f\n";
|
1744 |
$rules .= " RewriteCond %{REQUEST_FILENAME} !-d\n";
|
1745 |
+
$rules .= " RewriteRule . " . $home_path . "index.php [L]\n";
|
1746 |
$rules .= "</IfModule>\n";
|
1747 |
$rules .= "# END WordPress\n";
|
1748 |
}
|
inc/lightbox/self_test.phtml
CHANGED
@@ -280,8 +280,7 @@
|
|
280 |
<?php else: ?>
|
281 |
<span class="w3tc-test-error">Not write-able</span>
|
282 |
<?php endif; ?>
|
283 |
-
<?php endif; endif; ?>
|
284 |
-
<br />
|
285 |
|
286 |
Uploads directory:
|
287 |
<?php $uploads_dir = @wp_upload_dir(); if (!empty($uploads_dir['error'])): ?>
|
280 |
<?php else: ?>
|
281 |
<span class="w3tc-test-error">Not write-able</span>
|
282 |
<?php endif; ?>
|
283 |
+
<?php endif; ?><br /><?php endif; ?>
|
|
|
284 |
|
285 |
Uploads directory:
|
286 |
<?php $uploads_dir = @wp_upload_dir(); if (!empty($uploads_dir['error'])): ?>
|
inc/mime/all.php
CHANGED
@@ -236,7 +236,7 @@ return array(
|
|
236 |
'jpeg|jpg|jpe' => 'image/jpeg',
|
237 |
'jpgv' => 'video/jpeg',
|
238 |
'jpm|jpgm' => 'video/jpm',
|
239 |
-
'js' => 'application/javascript',
|
240 |
'json' => 'application/json',
|
241 |
'karbon' => 'application/vnd.kde.karbon',
|
242 |
'kfo' => 'application/vnd.kde.kformula',
|
236 |
'jpeg|jpg|jpe' => 'image/jpeg',
|
237 |
'jpgv' => 'video/jpeg',
|
238 |
'jpm|jpgm' => 'video/jpm',
|
239 |
+
'js' => 'application/x-javascript',
|
240 |
'json' => 'application/json',
|
241 |
'karbon' => 'application/vnd.kde.karbon',
|
242 |
'kfo' => 'application/vnd.kde.kformula',
|
inc/network_activation.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
+
<head>
|
4 |
+
<title>Network Activation Error</title>
|
5 |
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
6 |
+
</head>
|
7 |
+
<body>
|
8 |
+
<p>
|
9 |
+
<strong>W3 Total Cache Error:</strong> plugin cannot be activated network-wide.
|
10 |
+
</p>
|
11 |
+
<p>
|
12 |
+
<a href="javascript:history.back(-1);">Back</a>
|
13 |
+
</p>
|
14 |
+
</body>
|
15 |
+
</html>
|
inc/options/browsercache.phtml
CHANGED
@@ -12,42 +12,49 @@
|
|
12 |
|
13 |
<table class="form-table">
|
14 |
<tr>
|
15 |
-
<th>
|
16 |
<label><input id="browsercache_expires" type="checkbox" name="expires" value="1"<?php checked($browsercache_expires, true); ?> /> Set expires header</label>
|
17 |
<br /><span class="description">Set the expires header to encourage browser caching of files.</span>
|
18 |
</th>
|
19 |
</tr>
|
20 |
<tr>
|
21 |
-
<th>
|
22 |
<label><input id="browsercache_cache_control" type="checkbox" name="cache_control" value="1"<?php checked($browsercache_cache_control, true); ?> /> Set cache control header</label>
|
23 |
<br /><span class="description">Set pragma and cache-control headers to encourage browser caching of files.</span>
|
24 |
</th>
|
25 |
</tr>
|
26 |
<tr>
|
27 |
-
<th>
|
28 |
<label><input id="browsercache_etag" type="checkbox" name="etag" value="1"<?php checked($browsercache_etag, true); ?> /> Set entity tag (eTag)</label>
|
29 |
<br /><span class="description">Set the Etag header to encourage browser caching of files.</span>
|
30 |
</th>
|
31 |
</tr>
|
32 |
<tr>
|
33 |
-
<th>
|
34 |
<label><input id="browsercache_w3tc" type="checkbox" name="w3tc" value="1"<?php checked($browsercache_w3tc, true); ?> /> Set W3 Total Cache header</label>
|
35 |
<br /><span class="description">Set this header to assist in identifying optimized files.</span>
|
36 |
</th>
|
37 |
</tr>
|
38 |
<tr>
|
39 |
-
<th>
|
40 |
<label><input id="browsercache_compression" type="checkbox" name="compression"<?php checked($browsercache_compression, true); ?> value="1" /> Enable <acronym title="Hypertext Transfer Protocol">HTTP</acronym> (gzip) compression</label>
|
41 |
<br /><span class="description">Reduce the download time for text-based files.</span>
|
42 |
</th>
|
43 |
</tr>
|
44 |
<tr>
|
45 |
-
<th>
|
46 |
<input type="hidden" name="browsercache.no404wp" value="0" />
|
47 |
<label><input type="checkbox" name="browsercache.no404wp" value="1"<?php checked($this->_config->get_boolean('browsercache.no404wp'), true); ?> /> Do not process 404 errors for static objects with WordPress</label>
|
48 |
<br /><span class="description">Reduce server load by allowing the web server to handle 404 errors for static files, like images etc.</span>
|
49 |
</th>
|
50 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
</table>
|
52 |
|
53 |
<p class="submit">
|
12 |
|
13 |
<table class="form-table">
|
14 |
<tr>
|
15 |
+
<th colspan="2">
|
16 |
<label><input id="browsercache_expires" type="checkbox" name="expires" value="1"<?php checked($browsercache_expires, true); ?> /> Set expires header</label>
|
17 |
<br /><span class="description">Set the expires header to encourage browser caching of files.</span>
|
18 |
</th>
|
19 |
</tr>
|
20 |
<tr>
|
21 |
+
<th colspan="2">
|
22 |
<label><input id="browsercache_cache_control" type="checkbox" name="cache_control" value="1"<?php checked($browsercache_cache_control, true); ?> /> Set cache control header</label>
|
23 |
<br /><span class="description">Set pragma and cache-control headers to encourage browser caching of files.</span>
|
24 |
</th>
|
25 |
</tr>
|
26 |
<tr>
|
27 |
+
<th colspan="2">
|
28 |
<label><input id="browsercache_etag" type="checkbox" name="etag" value="1"<?php checked($browsercache_etag, true); ?> /> Set entity tag (eTag)</label>
|
29 |
<br /><span class="description">Set the Etag header to encourage browser caching of files.</span>
|
30 |
</th>
|
31 |
</tr>
|
32 |
<tr>
|
33 |
+
<th colspan="2">
|
34 |
<label><input id="browsercache_w3tc" type="checkbox" name="w3tc" value="1"<?php checked($browsercache_w3tc, true); ?> /> Set W3 Total Cache header</label>
|
35 |
<br /><span class="description">Set this header to assist in identifying optimized files.</span>
|
36 |
</th>
|
37 |
</tr>
|
38 |
<tr>
|
39 |
+
<th colspan="2">
|
40 |
<label><input id="browsercache_compression" type="checkbox" name="compression"<?php checked($browsercache_compression, true); ?> value="1" /> Enable <acronym title="Hypertext Transfer Protocol">HTTP</acronym> (gzip) compression</label>
|
41 |
<br /><span class="description">Reduce the download time for text-based files.</span>
|
42 |
</th>
|
43 |
</tr>
|
44 |
<tr>
|
45 |
+
<th colspan="2">
|
46 |
<input type="hidden" name="browsercache.no404wp" value="0" />
|
47 |
<label><input type="checkbox" name="browsercache.no404wp" value="1"<?php checked($this->_config->get_boolean('browsercache.no404wp'), true); ?> /> Do not process 404 errors for static objects with WordPress</label>
|
48 |
<br /><span class="description">Reduce server load by allowing the web server to handle 404 errors for static files, like images etc.</span>
|
49 |
</th>
|
50 |
</tr>
|
51 |
+
<tr>
|
52 |
+
<th valign="top"><label for="browsercache_no404wp_exceptions">404 errors exception list:</label></th>
|
53 |
+
<td>
|
54 |
+
<textarea id="browsercache_no404wp_exceptions" name="browsercache.no404wp.exceptions" cols="40" rows="5"><?php echo htmlspecialchars(implode("\r\n", $this->_config->get_array('browsercache.no404wp.exceptions'))); ?></textarea><br />
|
55 |
+
<span class="description">Always ignore the specified files.</span>
|
56 |
+
</td>
|
57 |
+
</tr>
|
58 |
</table>
|
59 |
|
60 |
<p class="submit">
|
inc/options/general.phtml
CHANGED
@@ -24,7 +24,7 @@
|
|
24 |
<tr>
|
25 |
<th colspan="2">
|
26 |
<label>
|
27 |
-
<input id="enabled" type="checkbox" name="enabled" value="1"<?php checked($
|
28 |
Deselect this option to disable all caching functionality.
|
29 |
</label>
|
30 |
</th>
|
24 |
<tr>
|
25 |
<th colspan="2">
|
26 |
<label>
|
27 |
+
<input id="enabled" type="checkbox" name="enabled" value="1"<?php checked($enabled_checked, true); ?> />
|
28 |
Deselect this option to disable all caching functionality.
|
29 |
</label>
|
30 |
</th>
|
inc/options/install.phtml
CHANGED
@@ -8,8 +8,8 @@
|
|
8 |
</li>
|
9 |
<li>On the "<a href="admin.php?page=w3tc_general">General</a>" tab and select your caching methods for page, database and minify. In most cases, "disk enhanced" mode for page cache, "disk" mode for minify and "disk" mode for database caching are "good" settings.</li>
|
10 |
<li><em>Recommended:</em> On the "<a href="admin.php?page=w3tc_minify">Minify</a>" tab all of the recommended settings are preset. Use the help button to simplify discovery of your <acronym title="Cascading Style Sheet">CSS</acronym> and <acronym title="JavaScript">JS</acronym> files and groups. Pay close attention to the method and location of your <acronym title="JavaScript">JS</acronym> group embeddings. See the plugin's <a href="admin.php?page=w3tc_faq">FAQ</a> for more information on usage.</li>
|
11 |
-
<li><em>Recommended:</em> If you already have a content delivery network (<acronym title="Content Delivery Network">CDN</acronym>) provider, proceed to the "<a href="admin.php?page=w3tc_cdn">Content Delivery Network</a>" tab and populate the fields and set your preferences. If you do not use the Media Library, you will need to import your images etc into the default locations. Use the Media Library Import Tool on the "Content Delivery Network" tab to perform this task. If you do not have a <acronym title="Content Delivery Network">CDN</acronym> provider, you can still improve your site's performance using the "Self-hosted" method. On your own server, create a subdomain and matching <acronym title="Domain Name System">DNS</acronym> Zone record; e.g. static.domain.com and configure <acronym title="File Transfer Protocol">FTP</acronym> options on the "Content Delivery Network" tab accordingly. Be sure to <acronym title="File Transfer Protocol">FTP</acronym> upload the appropriate files, using the available upload buttons.</li>
|
12 |
<li><em>Recommended:</em> On the "<a href="admin.php?page=w3tc_browsercache">Browser Cache</a>" tab, HTTP compression is enabled by default. Make sure to enable other options to suit your goals.</li>
|
|
|
13 |
<li><em>Optional:</em> On the "<a href="admin.php?page=w3tc_dbcache">Database Cache</a>" tab the recommended settings are preset. If using a shared hosting account use the "disk" method with caution; in either of these cases the response time of the disk may not be fast enough, so this option is disabled by default.</li>
|
14 |
<li><em>Optional:</em> On the "<a href="admin.php?page=w3tc_objectcache">Object Cache</a>" tab the recommended settings are preset. If using a shared hosting account use the "disk" method with caution, the response time of the disk may not be fast enough, so this option is disabled by default. Test this option with and without database cache to ensure that it provides a performance increase.</li>
|
15 |
<li><em>Optional:</em> On the "<a href="admin.php?page=w3tc_mobile">User Agent Groups</a>" tab, specify any user agents, like mobile phones if a mobile theme is used.</li>
|
8 |
</li>
|
9 |
<li>On the "<a href="admin.php?page=w3tc_general">General</a>" tab and select your caching methods for page, database and minify. In most cases, "disk enhanced" mode for page cache, "disk" mode for minify and "disk" mode for database caching are "good" settings.</li>
|
10 |
<li><em>Recommended:</em> On the "<a href="admin.php?page=w3tc_minify">Minify</a>" tab all of the recommended settings are preset. Use the help button to simplify discovery of your <acronym title="Cascading Style Sheet">CSS</acronym> and <acronym title="JavaScript">JS</acronym> files and groups. Pay close attention to the method and location of your <acronym title="JavaScript">JS</acronym> group embeddings. See the plugin's <a href="admin.php?page=w3tc_faq">FAQ</a> for more information on usage.</li>
|
|
|
11 |
<li><em>Recommended:</em> On the "<a href="admin.php?page=w3tc_browsercache">Browser Cache</a>" tab, HTTP compression is enabled by default. Make sure to enable other options to suit your goals.</li>
|
12 |
+
<li><em>Recommended:</em> If you already have a content delivery network (<acronym title="Content Delivery Network">CDN</acronym>) provider, proceed to the "<a href="admin.php?page=w3tc_cdn">Content Delivery Network</a>" tab and populate the fields and set your preferences. If you do not use the Media Library, you will need to import your images etc into the default locations. Use the Media Library Import Tool on the "Content Delivery Network" tab to perform this task. If you do not have a <acronym title="Content Delivery Network">CDN</acronym> provider, you can still improve your site's performance using the "Self-hosted" method. On your own server, create a subdomain and matching <acronym title="Domain Name System">DNS</acronym> Zone record; e.g. static.domain.com and configure <acronym title="File Transfer Protocol">FTP</acronym> options on the "Content Delivery Network" tab accordingly. Be sure to <acronym title="File Transfer Protocol">FTP</acronym> upload the appropriate files, using the available upload buttons.</li>
|
13 |
<li><em>Optional:</em> On the "<a href="admin.php?page=w3tc_dbcache">Database Cache</a>" tab the recommended settings are preset. If using a shared hosting account use the "disk" method with caution; in either of these cases the response time of the disk may not be fast enough, so this option is disabled by default.</li>
|
14 |
<li><em>Optional:</em> On the "<a href="admin.php?page=w3tc_objectcache">Object Cache</a>" tab the recommended settings are preset. If using a shared hosting account use the "disk" method with caution, the response time of the disk may not be fast enough, so this option is disabled by default. Test this option with and without database cache to ensure that it provides a performance increase.</li>
|
15 |
<li><em>Optional:</em> On the "<a href="admin.php?page=w3tc_mobile">User Agent Groups</a>" tab, specify any user agents, like mobile phones if a mobile theme is used.</li>
|
inc/options/pgcache.phtml
CHANGED
@@ -29,14 +29,14 @@
|
|
29 |
<tr>
|
30 |
<th>
|
31 |
<input type="hidden" name="pgcache.cache.home" value="0" />
|
32 |
-
<label><input type="checkbox" name="pgcache.cache.home" value="1"<?php checked($this->_config->get_boolean('pgcache.cache.home'), true); ?> /> Cache
|
33 |
<span class="description">For many blogs this is your most visited page, it is recommended that you cache it.</span>
|
34 |
</th>
|
35 |
</tr>
|
36 |
<tr>
|
37 |
<th>
|
38 |
<input type="hidden" name="pgcache.cache.feed" value="0" />
|
39 |
-
<label><input type="checkbox" name="pgcache.cache.feed" value="1"<?php checked($this->_config->get_boolean('pgcache.cache.feed'), true); ?> /> Cache site, categories, tags, comments
|
40 |
<span class="description">Even if using a feed proxy service (like <a href="http://en.wikipedia.org/wiki/FeedBurner" target="_blank">FeedBurner</a>), enabling this option is still recommended.</span>
|
41 |
</th>
|
42 |
</tr>
|
29 |
<tr>
|
30 |
<th>
|
31 |
<input type="hidden" name="pgcache.cache.home" value="0" />
|
32 |
+
<label><input type="checkbox" name="pgcache.cache.home" value="1"<?php checked($this->_config->get_boolean('pgcache.cache.home'), true); ?> /> Cache home page</label><br />
|
33 |
<span class="description">For many blogs this is your most visited page, it is recommended that you cache it.</span>
|
34 |
</th>
|
35 |
</tr>
|
36 |
<tr>
|
37 |
<th>
|
38 |
<input type="hidden" name="pgcache.cache.feed" value="0" />
|
39 |
+
<label><input type="checkbox" name="pgcache.cache.feed" value="1"<?php checked($this->_config->get_boolean('pgcache.cache.feed'), true); ?> /> Cache feeds: site, categories, tags, comments</label><br />
|
40 |
<span class="description">Even if using a feed proxy service (like <a href="http://en.wikipedia.org/wiki/FeedBurner" target="_blank">FeedBurner</a>), enabling this option is still recommended.</span>
|
41 |
</th>
|
42 |
</tr>
|
inc/options/support_email.phtml
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html>
|
2 |
+
<head></head>
|
3 |
+
<body>
|
4 |
+
<p>
|
5 |
+
Date: <?php echo date('m/d/Y H:i:s'); ?><br />
|
6 |
+
Request type: <?php echo htmlspecialchars($request_type); ?><br />
|
7 |
+
URL: <a href="<?php echo htmlspecialchars($url); ?>"><?php echo htmlspecialchars($url); ?></a><br />
|
8 |
+
Forum Topic URL: <a href="<?php echo htmlspecialchars($forum_url); ?>"><?php echo htmlspecialchars($forum_url); ?></a><br />
|
9 |
+
<?php if ($request_data_url): ?>
|
10 |
+
Request data: <a href="<?php echo htmlspecialchars($request_data_url); ?>"><?php echo htmlspecialchars($request_data_url); ?></a>
|
11 |
+
<?php endif; ?>
|
12 |
+
</p>
|
13 |
+
<p>
|
14 |
+
<?php echo nl2br(htmlspecialchars($description)); ?>
|
15 |
+
</p>
|
16 |
+
<hr />
|
17 |
+
<font size="-1" color="#ccc">
|
18 |
+
E-mail sent from IP: <?php echo htmlspecialchars($_SERVER['REMOTE_ADDR']); ?><br />
|
19 |
+
User Agent: <?php echo htmlspecialchars($_SERVER['HTTP_USER_AGENT']); ?>
|
20 |
+
</font>
|
21 |
+
</body>
|
22 |
+
</html>
|
ini/xcache.ini
CHANGED
@@ -4,9 +4,9 @@
|
|
4 |
zend_extension = "/usr/lib/php/modules/xcache.so"
|
5 |
zend_extension_ts = "/usr/lib/php/modules/xcache.so"
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
xcache.test = Off
|
11 |
xcache.coredump_directory = ""
|
12 |
|
@@ -24,7 +24,6 @@ xcache.var_slots = 8K
|
|
24 |
xcache.var_ttl = 0
|
25 |
xcache.var_maxttl = 0
|
26 |
xcache.var_gc_interval = 300
|
27 |
-
xcache.readonly_protection = Off
|
28 |
xcache.mmap_path = "/dev/zero"
|
29 |
|
30 |
xcache.optimizer = Off
|
@@ -33,4 +32,4 @@ xcache.coverager = Off
|
|
33 |
xcache.coveragedump_directory = ""
|
34 |
|
35 |
xcache.stat = Off
|
36 |
-
|
4 |
zend_extension = "/usr/lib/php/modules/xcache.so"
|
5 |
zend_extension_ts = "/usr/lib/php/modules/xcache.so"
|
6 |
|
7 |
+
xcache.admin.user = ""
|
8 |
+
xcache.admin.pass = ""
|
9 |
+
xcache.admin.enable_auth = Off
|
10 |
xcache.test = Off
|
11 |
xcache.coredump_directory = ""
|
12 |
|
24 |
xcache.var_ttl = 0
|
25 |
xcache.var_maxttl = 0
|
26 |
xcache.var_gc_interval = 300
|
|
|
27 |
xcache.mmap_path = "/dev/zero"
|
28 |
|
29 |
xcache.optimizer = Off
|
32 |
xcache.coveragedump_directory = ""
|
33 |
|
34 |
xcache.stat = Off
|
35 |
+
xcache.readonly_protection = Off
|
lib/Minify/Minify.php
CHANGED
@@ -275,7 +275,7 @@ class Minify {
|
|
275 |
// memory.
|
276 |
$cacheId = self::_getCacheId();
|
277 |
$fullCacheId = (self::$_options['encodeMethod'])
|
278 |
-
? $cacheId . self::$_options['encodeMethod']
|
279 |
: $cacheId;
|
280 |
// check cache for valid entry
|
281 |
$cacheIsReady = self::$_cache->isValid($fullCacheId, self::$_options['lastModifiedTime']);
|
@@ -287,7 +287,7 @@ class Minify {
|
|
287 |
self::$_cache->store($cacheId, $content);
|
288 |
|
289 |
if (self::$_options['encodeOutput'] && function_exists('gzencode')) {
|
290 |
-
self::$_cache->store($cacheId . '.
|
291 |
}
|
292 |
}
|
293 |
} else {
|
275 |
// memory.
|
276 |
$cacheId = self::_getCacheId();
|
277 |
$fullCacheId = (self::$_options['encodeMethod'])
|
278 |
+
? $cacheId . '.' . self::$_options['encodeMethod']
|
279 |
: $cacheId;
|
280 |
// check cache for valid entry
|
281 |
$cacheIsReady = self::$_cache->isValid($fullCacheId, self::$_options['lastModifiedTime']);
|
287 |
self::$_cache->store($cacheId, $content);
|
288 |
|
289 |
if (self::$_options['encodeOutput'] && function_exists('gzencode')) {
|
290 |
+
self::$_cache->store($cacheId . '.' . self::$_options['encodeMethod'], gzencode($content, self::$_options['encodeLevel']));
|
291 |
}
|
292 |
}
|
293 |
} else {
|
lib/Minify/Minify/HTML.php
CHANGED
@@ -258,7 +258,7 @@ class Minify_HTML {
|
|
258 |
$ws2 = ($m[4] === '') ? '' : ' ';
|
259 |
|
260 |
// remove HTML comments (and ending "//" if present)
|
261 |
-
$js = preg_replace('/(?:^\\s*<!--\\s*|\\s*(?:\\/\\/)?\\s*-->\\s*$)/', '', $js);
|
262 |
|
263 |
// remove CDATA section markers
|
264 |
$js = $this->_removeCdata($js);
|
258 |
$ws2 = ($m[4] === '') ? '' : ' ';
|
259 |
|
260 |
// remove HTML comments (and ending "//" if present)
|
261 |
+
$js = preg_replace('/(?:^\\s*(?:\\/\\/)?\\s*<!--\\s*|\\s*(?:\\/\\/)?\\s*-->\\s*$)/', '', $js);
|
262 |
|
263 |
// remove CDATA section markers
|
264 |
$js = $this->_removeCdata($js);
|
lib/W3/Cdn/Ftp.php
CHANGED
@@ -81,6 +81,7 @@ class W3_Cdn_Ftp extends W3_Cdn_Base
|
|
81 |
|
82 |
/**
|
83 |
* Sends MDTM command
|
|
|
84 |
* @param string $remote_file
|
85 |
* @return boolean
|
86 |
*/
|
@@ -91,6 +92,22 @@ class W3_Cdn_Ftp extends W3_Cdn_Base
|
|
91 |
return @ftp_raw($this->_ftp, $command);
|
92 |
}
|
93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
/**
|
95 |
* Uploads files to FTP
|
96 |
*
|
@@ -130,7 +147,7 @@ class W3_Cdn_Ftp extends W3_Cdn_Base
|
|
130 |
continue 2;
|
131 |
}
|
132 |
|
133 |
-
|
134 |
|
135 |
if (!@ftp_chdir($this->_ftp, $dir)) {
|
136 |
@ftp_close($this->_ftp);
|
@@ -161,7 +178,7 @@ class W3_Cdn_Ftp extends W3_Cdn_Base
|
|
161 |
|
162 |
if ($result) {
|
163 |
$count++;
|
164 |
-
|
165 |
}
|
166 |
}
|
167 |
|
@@ -242,7 +259,7 @@ class W3_Cdn_Ftp extends W3_Cdn_Base
|
|
242 |
|
243 |
return false;
|
244 |
} else {
|
245 |
-
|
246 |
}
|
247 |
|
248 |
if (!@ftp_chdir($this->_ftp, $tmp_dir)) {
|
81 |
|
82 |
/**
|
83 |
* Sends MDTM command
|
84 |
+
*
|
85 |
* @param string $remote_file
|
86 |
* @return boolean
|
87 |
*/
|
92 |
return @ftp_raw($this->_ftp, $command);
|
93 |
}
|
94 |
|
95 |
+
/**
|
96 |
+
* Changes permissions
|
97 |
+
*
|
98 |
+
* @param string $filename
|
99 |
+
* @param integer $mode
|
100 |
+
* @return boolean
|
101 |
+
*/
|
102 |
+
function _chmod($filename, $mode)
|
103 |
+
{
|
104 |
+
if (function_exists('ftp_chmod')) {
|
105 |
+
return @ftp_chmod($this->_ftp, $mode, $filename);
|
106 |
+
}
|
107 |
+
|
108 |
+
return true;
|
109 |
+
}
|
110 |
+
|
111 |
/**
|
112 |
* Uploads files to FTP
|
113 |
*
|
147 |
continue 2;
|
148 |
}
|
149 |
|
150 |
+
$this->_chmod($dir, 0755);
|
151 |
|
152 |
if (!@ftp_chdir($this->_ftp, $dir)) {
|
153 |
@ftp_close($this->_ftp);
|
178 |
|
179 |
if ($result) {
|
180 |
$count++;
|
181 |
+
$this->_chmod($remote_file, 0644);
|
182 |
}
|
183 |
}
|
184 |
|
259 |
|
260 |
return false;
|
261 |
} else {
|
262 |
+
$this->_chmod($tmp_dir, 0755);
|
263 |
}
|
264 |
|
265 |
if (!@ftp_chdir($this->_ftp, $tmp_dir)) {
|
lib/W3/Config.php
CHANGED
@@ -160,6 +160,7 @@ class W3_Config
|
|
160 |
|
161 |
'browsercache.enabled' => 'boolean',
|
162 |
'browsercache.no404wp' => 'boolean',
|
|
|
163 |
'browsercache.cssjs.compression' => 'boolean',
|
164 |
'browsercache.cssjs.expires' => 'boolean',
|
165 |
'browsercache.cssjs.lifetime' => 'integer',
|
@@ -396,9 +397,12 @@ class W3_Config
|
|
396 |
|
397 |
'browsercache.enabled' => true,
|
398 |
'browsercache.no404wp' => false,
|
|
|
|
|
|
|
399 |
'browsercache.cssjs.compression' => true,
|
400 |
'browsercache.cssjs.expires' => false,
|
401 |
-
'browsercache.cssjs.lifetime' =>
|
402 |
'browsercache.cssjs.cache.control' => false,
|
403 |
'browsercache.cssjs.cache.policy' => 'cache_validation',
|
404 |
'browsercache.cssjs.etag' => false,
|
@@ -547,7 +551,6 @@ class W3_Config
|
|
547 |
'sgh',
|
548 |
'sharp',
|
549 |
'sharp\-tq\-gx10',
|
550 |
-
'sie',
|
551 |
'small',
|
552 |
'smartphone',
|
553 |
'softbank',
|
@@ -932,7 +935,7 @@ class W3_Config
|
|
932 |
{
|
933 |
@fputs($fp, str_repeat("\t", $this->_tabs));
|
934 |
|
935 |
-
if (is_numeric($key)) {
|
936 |
@fputs($fp, sprintf("%d => ", $key));
|
937 |
} else {
|
938 |
@fputs($fp, sprintf("'%s' => ", addslashes($key)));
|
160 |
|
161 |
'browsercache.enabled' => 'boolean',
|
162 |
'browsercache.no404wp' => 'boolean',
|
163 |
+
'browsercache.no404wp.exceptions' => 'array',
|
164 |
'browsercache.cssjs.compression' => 'boolean',
|
165 |
'browsercache.cssjs.expires' => 'boolean',
|
166 |
'browsercache.cssjs.lifetime' => 'integer',
|
397 |
|
398 |
'browsercache.enabled' => true,
|
399 |
'browsercache.no404wp' => false,
|
400 |
+
'browsercache.no404wp.exceptions' => array(
|
401 |
+
'robots\.txt'
|
402 |
+
),
|
403 |
'browsercache.cssjs.compression' => true,
|
404 |
'browsercache.cssjs.expires' => false,
|
405 |
+
'browsercache.cssjs.lifetime' => 31536000,
|
406 |
'browsercache.cssjs.cache.control' => false,
|
407 |
'browsercache.cssjs.cache.policy' => 'cache_validation',
|
408 |
'browsercache.cssjs.etag' => false,
|
551 |
'sgh',
|
552 |
'sharp',
|
553 |
'sharp\-tq\-gx10',
|
|
|
554 |
'small',
|
555 |
'smartphone',
|
556 |
'softbank',
|
935 |
{
|
936 |
@fputs($fp, str_repeat("\t", $this->_tabs));
|
937 |
|
938 |
+
if (is_numeric($key) && (string) (int) $key === (string) $key) {
|
939 |
@fputs($fp, sprintf("%d => ", $key));
|
940 |
} else {
|
941 |
@fputs($fp, sprintf("'%s' => ", addslashes($key)));
|
lib/W3/Minify.php
CHANGED
@@ -59,6 +59,11 @@ class W3_Minify
|
|
59 |
require_once W3TC_LIB_MINIFY_DIR . '/Minify.php';
|
60 |
require_once W3TC_LIB_MINIFY_DIR . '/HTTP/Encoder.php';
|
61 |
|
|
|
|
|
|
|
|
|
|
|
62 |
HTTP_Encoder::$encodeToIe6 = true;
|
63 |
|
64 |
Minify::$uploaderHoursBehind = $this->_config->get_integer('minify.fixtime');
|
@@ -67,7 +72,7 @@ class W3_Minify
|
|
67 |
$browsercache = $this->_config->get_boolean('browsercache.enabled');
|
68 |
|
69 |
$serve_options = $this->_config->get_array('minify.options');
|
70 |
-
$serve_options['maxAge'] =
|
71 |
$serve_options['encodeOutput'] = ($browsercache && $this->_config->get_boolean('browsercache.cssjs.compression'));
|
72 |
$serve_options['cacheHeaders'] = array(
|
73 |
'use_etag' => ($browsercache && $this->_config->get_boolean('browsercache.cssjs.etag')),
|
@@ -493,7 +498,7 @@ class W3_Minify
|
|
493 |
$from_email = 'wordpress@' . w3_get_domain($_SERVER['SERVER_NAME']);
|
494 |
$from_name = get_option('blogname');
|
495 |
$to_name = $to_email = get_option('admin_email');
|
496 |
-
$body = @
|
497 |
|
498 |
$headers = array(
|
499 |
sprintf('From: "%s" <%s>', addslashes($from_name), $from_email),
|
59 |
require_once W3TC_LIB_MINIFY_DIR . '/Minify.php';
|
60 |
require_once W3TC_LIB_MINIFY_DIR . '/HTTP/Encoder.php';
|
61 |
|
62 |
+
/**
|
63 |
+
* Fix DOCUMENT_ROOT for minify
|
64 |
+
*/
|
65 |
+
$_SERVER['DOCUMENT_ROOT'] = w3_get_document_root();
|
66 |
+
|
67 |
HTTP_Encoder::$encodeToIe6 = true;
|
68 |
|
69 |
Minify::$uploaderHoursBehind = $this->_config->get_integer('minify.fixtime');
|
72 |
$browsercache = $this->_config->get_boolean('browsercache.enabled');
|
73 |
|
74 |
$serve_options = $this->_config->get_array('minify.options');
|
75 |
+
$serve_options['maxAge'] = $this->_config->get_integer('browsercache.cssjs.lifetime');
|
76 |
$serve_options['encodeOutput'] = ($browsercache && $this->_config->get_boolean('browsercache.cssjs.compression'));
|
77 |
$serve_options['cacheHeaders'] = array(
|
78 |
'use_etag' => ($browsercache && $this->_config->get_boolean('browsercache.cssjs.etag')),
|
498 |
$from_email = 'wordpress@' . w3_get_domain($_SERVER['SERVER_NAME']);
|
499 |
$from_name = get_option('blogname');
|
500 |
$to_name = $to_email = get_option('admin_email');
|
501 |
+
$body = @file_get_contents(W3TC_DIR . '/inc/email/minify_error_notification.html');
|
502 |
|
503 |
$headers = array(
|
504 |
sprintf('From: "%s" <%s>', addslashes($from_name), $from_email),
|
lib/W3/Plugin/BrowserCache.php
CHANGED
@@ -175,19 +175,19 @@ class W3_Plugin_BrowserCache extends W3_Plugin
|
|
175 |
|
176 |
if ($cssjs_expires && $cssjs_lifetime) {
|
177 |
foreach ($cssjs_types as $mime_type) {
|
178 |
-
$rules .= " ExpiresByType " . $mime_type . "
|
179 |
}
|
180 |
}
|
181 |
|
182 |
if ($html_expires && $html_lifetime) {
|
183 |
foreach ($html_types as $mime_type) {
|
184 |
-
$rules .= " ExpiresByType " . $mime_type . "
|
185 |
}
|
186 |
}
|
187 |
|
188 |
if ($other_expires && $other_lifetime) {
|
189 |
foreach ($other_types as $mime_type) {
|
190 |
-
$rules .= " ExpiresByType " . $mime_type . "
|
191 |
}
|
192 |
}
|
193 |
|
@@ -344,10 +344,17 @@ class W3_Plugin_BrowserCache extends W3_Plugin
|
|
344 |
}
|
345 |
}
|
346 |
|
|
|
|
|
347 |
$rules = '';
|
348 |
$rules .= "# BEGIN W3TC Skip 404 error handling by WordPress for static files\n";
|
349 |
$rules .= "<IfModule mod_rewrite.c>\n";
|
350 |
$rules .= " RewriteEngine On\n";
|
|
|
|
|
|
|
|
|
|
|
351 |
$rules .= " RewriteCond %{REQUEST_FILENAME} !-f\n";
|
352 |
$rules .= " RewriteCond %{REQUEST_FILENAME} !-d\n";
|
353 |
$rules .= " RewriteCond %{REQUEST_FILENAME} \\.(" . implode('|', $extensions) . ")$ [NC]\n";
|
@@ -583,7 +590,7 @@ class W3_Plugin_BrowserCache extends W3_Plugin
|
|
583 |
$expires = $this->_config->get_boolean('browsercache.' . $section . '.expires');
|
584 |
$lifetime = $this->_config->get_integer('browsercache.' . $section . '.lifetime');
|
585 |
$cache_control = $this->_config->get_boolean('browsercache.' . $section . '.cache.control');
|
586 |
-
$cache_policy = $this->_config->
|
587 |
$etag = $this->_config->get_boolean('browsercache.' . $section . '.etag');
|
588 |
$w3tc = $this->_config->get_boolean('browsercache.' . $section . '.w3tc');
|
589 |
|
175 |
|
176 |
if ($cssjs_expires && $cssjs_lifetime) {
|
177 |
foreach ($cssjs_types as $mime_type) {
|
178 |
+
$rules .= " ExpiresByType " . $mime_type . " A" . $cssjs_lifetime . "\n";
|
179 |
}
|
180 |
}
|
181 |
|
182 |
if ($html_expires && $html_lifetime) {
|
183 |
foreach ($html_types as $mime_type) {
|
184 |
+
$rules .= " ExpiresByType " . $mime_type . " A" . $html_lifetime . "\n";
|
185 |
}
|
186 |
}
|
187 |
|
188 |
if ($other_expires && $other_lifetime) {
|
189 |
foreach ($other_types as $mime_type) {
|
190 |
+
$rules .= " ExpiresByType " . $mime_type . " A" . $other_lifetime . "\n";
|
191 |
}
|
192 |
}
|
193 |
|
344 |
}
|
345 |
}
|
346 |
|
347 |
+
$exceptions = $this->_config->get_array('browsercache.no404wp.exceptions');
|
348 |
+
|
349 |
$rules = '';
|
350 |
$rules .= "# BEGIN W3TC Skip 404 error handling by WordPress for static files\n";
|
351 |
$rules .= "<IfModule mod_rewrite.c>\n";
|
352 |
$rules .= " RewriteEngine On\n";
|
353 |
+
|
354 |
+
if (count($exceptions)) {
|
355 |
+
$rules .= " RewriteCond %{REQUEST_URI} !(" . implode('|', $exceptions) . ")\n";
|
356 |
+
}
|
357 |
+
|
358 |
$rules .= " RewriteCond %{REQUEST_FILENAME} !-f\n";
|
359 |
$rules .= " RewriteCond %{REQUEST_FILENAME} !-d\n";
|
360 |
$rules .= " RewriteCond %{REQUEST_FILENAME} \\.(" . implode('|', $extensions) . ")$ [NC]\n";
|
590 |
$expires = $this->_config->get_boolean('browsercache.' . $section . '.expires');
|
591 |
$lifetime = $this->_config->get_integer('browsercache.' . $section . '.lifetime');
|
592 |
$cache_control = $this->_config->get_boolean('browsercache.' . $section . '.cache.control');
|
593 |
+
$cache_policy = $this->_config->get_string('browsercache.' . $section . '.cache.policy');
|
594 |
$etag = $this->_config->get_boolean('browsercache.' . $section . '.etag');
|
595 |
$w3tc = $this->_config->get_boolean('browsercache.' . $section . '.w3tc');
|
596 |
|
lib/W3/Plugin/Cdn.php
CHANGED
@@ -118,20 +118,6 @@ class W3_Plugin_Cdn extends W3_Plugin
|
|
118 |
{
|
119 |
global $wpdb;
|
120 |
|
121 |
-
$upload_info = w3_upload_info();
|
122 |
-
|
123 |
-
if (!$upload_info) {
|
124 |
-
$upload_path = get_option('upload_path');
|
125 |
-
$upload_path = trim($upload_path);
|
126 |
-
|
127 |
-
if (empty($upload_path)) {
|
128 |
-
echo 'Your store uploads folder is not available. Default WordPress directories will be created: <strong>wp-content/uploads/</strong>.<br />';
|
129 |
-
$upload_path = WP_CONTENT_DIR . '/uploads';
|
130 |
-
}
|
131 |
-
|
132 |
-
w3_writable_error($upload_path);
|
133 |
-
}
|
134 |
-
|
135 |
$sql = sprintf('DROP TABLE IF EXISTS `%s%s`', $wpdb->prefix, W3TC_CDN_TABLE_QUEUE);
|
136 |
|
137 |
$wpdb->query($sql);
|
@@ -965,7 +951,7 @@ class W3_Plugin_Cdn extends W3_Plugin
|
|
965 |
/**
|
966 |
* Otherwise copy file from local path
|
967 |
*/
|
968 |
-
$src_path = w3_get_document_root() . urldecode($src);
|
969 |
|
970 |
if (file_exists($src_path)) {
|
971 |
$download_result = @copy($src_path, $dst);
|
118 |
{
|
119 |
global $wpdb;
|
120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
$sql = sprintf('DROP TABLE IF EXISTS `%s%s`', $wpdb->prefix, W3TC_CDN_TABLE_QUEUE);
|
122 |
|
123 |
$wpdb->query($sql);
|
951 |
/**
|
952 |
* Otherwise copy file from local path
|
953 |
*/
|
954 |
+
$src_path = w3_get_document_root() . '/' . urldecode($src);
|
955 |
|
956 |
if (file_exists($src_path)) {
|
957 |
$download_result = @copy($src_path, $dst);
|
lib/W3/Plugin/Minify.php
CHANGED
@@ -422,7 +422,7 @@ class W3_Plugin_Minify extends W3_Plugin
|
|
422 |
static $theme = null;
|
423 |
|
424 |
if ($theme === null) {
|
425 |
-
$theme = substr(md5(
|
426 |
}
|
427 |
|
428 |
return $theme;
|
422 |
static $theme = null;
|
423 |
|
424 |
if ($theme === null) {
|
425 |
+
$theme = substr(md5(get_theme_root() . get_template() . get_stylesheet()), 0, 6);
|
426 |
}
|
427 |
|
428 |
return $theme;
|
lib/W3/Plugin/PgCache.php
CHANGED
@@ -549,8 +549,9 @@ class W3_Plugin_PgCache extends W3_Plugin
|
|
549 |
/**
|
550 |
* Generate directives
|
551 |
*/
|
552 |
-
$home_path = w3_get_home_path();
|
553 |
$base_path = w3_get_base_path();
|
|
|
|
|
554 |
$cache_dir = w3_path(W3TC_CACHE_FILE_PGCACHE_DIR);
|
555 |
|
556 |
$rules = '';
|
@@ -682,12 +683,12 @@ class W3_Plugin_PgCache extends W3_Plugin
|
|
682 |
/**
|
683 |
* Check if cache file exists
|
684 |
*/
|
685 |
-
$rules .= " RewriteCond \"" . $cache_dir . $
|
686 |
|
687 |
/**
|
688 |
* Make final rewrite
|
689 |
*/
|
690 |
-
$rules .= " RewriteRule (.*) \"" . $base_path . ltrim(str_replace(w3_get_site_root(), '', $cache_dir), '/') . $
|
691 |
$rules .= "</IfModule>\n";
|
692 |
|
693 |
$rules .= "# END W3TC Page Cache\n\n";
|
549 |
/**
|
550 |
* Generate directives
|
551 |
*/
|
|
|
552 |
$base_path = w3_get_base_path();
|
553 |
+
$home_path = ($is_multisite ? $base_path : w3_get_home_path());
|
554 |
+
|
555 |
$cache_dir = w3_path(W3TC_CACHE_FILE_PGCACHE_DIR);
|
556 |
|
557 |
$rules = '';
|
683 |
/**
|
684 |
* Check if cache file exists
|
685 |
*/
|
686 |
+
$rules .= " RewriteCond \"" . $cache_dir . $home_path . "$1/_index%{ENV:W3TC_UA}%{ENV:W3TC_SSL}.html%{ENV:W3TC_ENC}\" -f\n";
|
687 |
|
688 |
/**
|
689 |
* Make final rewrite
|
690 |
*/
|
691 |
+
$rules .= " RewriteRule (.*) \"" . $base_path . ltrim(str_replace(w3_get_site_root(), '', $cache_dir), '/') . $home_path . "$1/_index%{ENV:W3TC_UA}%{ENV:W3TC_SSL}.html%{ENV:W3TC_ENC}\" [L]\n";
|
692 |
$rules .= "</IfModule>\n";
|
693 |
|
694 |
$rules .= "# END W3TC Page Cache\n\n";
|
lib/W3/Plugin/TotalCache.php
CHANGED
@@ -263,6 +263,16 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
263 |
*/
|
264 |
function activate()
|
265 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
266 |
$files = array(
|
267 |
W3TC_INSTALL_DIR . '/db.php',
|
268 |
W3TC_INSTALL_DIR . '/advanced-cache.php',
|
@@ -1076,12 +1086,12 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
1076 |
'config_save' => sprintf('The settings could not be saved because the config file is not write-able. Please run <strong>chmod 777 %s</strong> to resolve this issue.', (file_exists($config_path) ? $config_path : dirname($config_path))),
|
1077 |
'fancy_permalinks_disabled_pgcache' => sprintf('Fancy permalinks are disabled. Please %s it first, then re-attempt to enabling the enhanced disk mode.', $this->button_link('enable', 'options-permalink.php')),
|
1078 |
'fancy_permalinks_disabled_browsercache' => sprintf('Fancy permalinks are disabled. Please %s it first, then re-attempt to enabling the \'Do not process 404 errors for static objects with WordPress\'.', $this->button_link('enable', 'options-permalink.php')),
|
1079 |
-
'pgcache_write_rules_core' => sprintf('
|
1080 |
-
'pgcache_write_rules_cache' => sprintf('The page cache rules
|
1081 |
-
'browsercache_write_rules_cache' => sprintf('The browser cache rules
|
1082 |
-
'browsercache_write_rules_no404wp' => sprintf('The browser cache rules
|
1083 |
'browsercache_write_rules_cdn' => sprintf('The browser cache rules for CDN could not be modified. Please check CDN settings.'),
|
1084 |
-
'minify_write_rules' => sprintf('The minify cache rules
|
1085 |
'support_request_type' => 'Please select request type.',
|
1086 |
'support_request_url' => 'Please enter the address of your site in the site <acronym title="Uniform Resource Locator">URL</acronym> field.',
|
1087 |
'support_request_name' => 'Please enter your name in the Name field',
|
@@ -1285,7 +1295,9 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
1285 |
|
1286 |
if ($data) {
|
1287 |
$matches = null;
|
1288 |
-
|
|
|
|
|
1289 |
$changelog = (array) preg_split('~[\r\n]+~', trim($matches[1]));
|
1290 |
|
1291 |
echo '<div style="color: #f00;">Take a minute to update, here\'s why:</div><div style="font-weight: normal;">';
|
@@ -1454,7 +1466,7 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
1454 |
if (w3_is_multisite()) {
|
1455 |
$this->_errors[] = sprintf('Enhanced mode page cache is not operational. Your .htaccess rules could not be modified. Please verify <strong>%s</strong> has the following rules: %s <textarea class="w3tc-rules" cols="120" rows="10" readonly="readonly">%s</textarea> %s', $pgcache_rules_core_path, $this->button('view code', '', 'w3tc-show-rules'), htmlspecialchars($w3_plugin_pgcache->generate_rules_core()), $this->button_hide_note('Hide this message', 'pgcache_rules_core'));
|
1456 |
} else {
|
1457 |
-
$this->_errors[] = sprintf('You\'ve selected disk caching with enhanced mode however the .htaccess file is not properly configured. Please
|
1458 |
}
|
1459 |
}
|
1460 |
|
@@ -1543,7 +1555,7 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
1543 |
if (w3_is_multisite()) {
|
1544 |
$this->_errors[] = sprintf('Browser Cache feature is not operational. Your .htaccess rules could not be modified. Please verify <strong>%s</strong> has the following rules: %s <textarea class="w3tc-rules" cols="120" rows="10" readonly="readonly">%s</textarea> %s', $browsercache_rules_cache_path, $this->button('view code', '', 'w3tc-show-rules'), htmlspecialchars($w3_plugin_browsercache->generate_rules_cache()), $this->button_hide_note('Hide this message', 'browsercache_rules_cache'));
|
1545 |
} else {
|
1546 |
-
$this->_errors[] = sprintf('You\'ve enabled Browser Cache feature however the .htaccess file is not properly configured. Please
|
1547 |
}
|
1548 |
}
|
1549 |
|
@@ -1553,7 +1565,7 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
1553 |
if (w3_is_multisite()) {
|
1554 |
$this->_errors[] = sprintf('Browser Cache feature is not operational. Your .htaccess rules could not be modified. Please verify <strong>%s</strong> has the following rules: %s <textarea class="w3tc-rules" cols="120" rows="10" readonly="readonly">%s</textarea> %s', $browsercache_rules_no404wp_path, $this->button('view code', '', 'w3tc-show-rules'), htmlspecialchars($w3_plugin_browsercache->generate_rules_no404wp()), $this->button_hide_note('Hide this message', 'browsercache_rules_no404wp'));
|
1555 |
} else {
|
1556 |
-
$this->_errors[] = sprintf('You\'ve enabled Browser Cache feature however the .htaccess file is not properly configured. Please
|
1557 |
}
|
1558 |
}
|
1559 |
}
|
@@ -1601,14 +1613,35 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
1601 |
/**
|
1602 |
* Check permalinks
|
1603 |
*/
|
1604 |
-
if ($this->_config->get_boolean('notes.no_permalink_rules') && (($this->_config->get_boolean('pgcache.enabled') && $this->_config->get_string('pgcache.engine') == 'file_pgcache') || $this->_config->get_boolean('browsercache.enabled')
|
1605 |
$this->_errors[] = sprintf('The required directives for fancy permalinks could not be detected, please confirm they are available: %s <textarea class="w3tc-rules" cols="120" rows="10" readonly="readonly">%s</textarea> %s', $this->button('view code', '', 'w3tc-show-rules'), htmlspecialchars(w3_get_permalink_rules()), $this->button_hide_note('Hide this message', 'no_permalink_rules'));
|
1606 |
}
|
1607 |
|
1608 |
/**
|
1609 |
-
*
|
1610 |
*/
|
1611 |
if ($this->_config->get_boolean('cdn.enabled')) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1612 |
$cdn_engine = $this->_config->get_string('cdn.engine');
|
1613 |
|
1614 |
switch (true) {
|
@@ -1735,6 +1768,7 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
1735 |
$cdn_enabled = $this->_config->get_boolean('cdn.enabled');
|
1736 |
|
1737 |
$enabled = ($pgcache_enabled || $minify_enabled || $dbcache_enabled || $objectcache_enabled || $browsercache_enabled || $cdn_enabled);
|
|
|
1738 |
|
1739 |
$check_apc = function_exists('apc_store');
|
1740 |
$check_eaccelerator = function_exists('eaccelerator_put');
|
@@ -4177,7 +4211,7 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
4177 |
foreach ((array) $locations as $location => $config) {
|
4178 |
if (isset($config['files'])) {
|
4179 |
foreach ((array) $config['files'] as $file) {
|
4180 |
-
if (!in_array($file, $js_groups[$template])) {
|
4181 |
$js_groups[$template][] = $file;
|
4182 |
}
|
4183 |
|
@@ -4194,7 +4228,7 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
4194 |
foreach ((array) $locations as $location => $config) {
|
4195 |
if (isset($config['files'])) {
|
4196 |
foreach ((array) $config['files'] as $file) {
|
4197 |
-
if (!in_array($file, $css_groups[$template])) {
|
4198 |
$css_groups[$template][] = $file;
|
4199 |
}
|
4200 |
|
@@ -4959,7 +4993,7 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
4959 |
{
|
4960 |
$themes = array();
|
4961 |
$wp_themes = get_themes();
|
4962 |
-
$theme_root =
|
4963 |
|
4964 |
foreach ($wp_themes as $wp_theme) {
|
4965 |
$theme_key = substr(md5($theme_root . $wp_theme['Template'] . $wp_theme['Stylesheet']), 0, 6);
|
263 |
*/
|
264 |
function activate()
|
265 |
{
|
266 |
+
/**
|
267 |
+
* Disable buggy sitewide activation in WPMU and WP 3.0
|
268 |
+
*/
|
269 |
+
if ((w3_is_wpmu() && isset($_GET['sitewide'])) || (w3_is_network_mode() && isset($_GET['networkwide']))) {
|
270 |
+
w3_network_activate_error();
|
271 |
+
}
|
272 |
+
|
273 |
+
/**
|
274 |
+
* Check installation files
|
275 |
+
*/
|
276 |
$files = array(
|
277 |
W3TC_INSTALL_DIR . '/db.php',
|
278 |
W3TC_INSTALL_DIR . '/advanced-cache.php',
|
1086 |
'config_save' => sprintf('The settings could not be saved because the config file is not write-able. Please run <strong>chmod 777 %s</strong> to resolve this issue.', (file_exists($config_path) ? $config_path : dirname($config_path))),
|
1087 |
'fancy_permalinks_disabled_pgcache' => sprintf('Fancy permalinks are disabled. Please %s it first, then re-attempt to enabling the enhanced disk mode.', $this->button_link('enable', 'options-permalink.php')),
|
1088 |
'fancy_permalinks_disabled_browsercache' => sprintf('Fancy permalinks are disabled. Please %s it first, then re-attempt to enabling the \'Do not process 404 errors for static objects with WordPress\'.', $this->button_link('enable', 'options-permalink.php')),
|
1089 |
+
'pgcache_write_rules_core' => sprintf('The page cache rules could not be modified. Please %srun <strong>chmod 777 %s</strong> to resolve this issue.', (file_exists($pgcache_rules_core_path) ? '' : sprintf('create an empty file in <strong>%s</strong> and ', $pgcache_rules_core_path)), $pgcache_rules_core_path),
|
1090 |
+
'pgcache_write_rules_cache' => sprintf('The page cache rules could not be modified. Please run <strong>chmod 777 %s</strong> to resolve this issue.', (file_exists($pgcache_rules_cache_path) ? $pgcache_rules_cache_path : dirname($pgcache_rules_cache_path))),
|
1091 |
+
'browsercache_write_rules_cache' => sprintf('The browser cache rules could not be modified. Please %srun <strong>chmod 777 %s</strong> to resolve this issue.', (file_exists($browsercache_rules_cache_path) ? '' : sprintf('create an empty file in <strong>%s</strong> and ', $browsercache_rules_cache_path)), $browsercache_rules_cache_path),
|
1092 |
+
'browsercache_write_rules_no404wp' => sprintf('The browser cache rules could not be modified. Please %srun <strong>chmod 777 %s</strong> to resolve this issue.', (file_exists($browsercache_rules_no404wp_path) ? '' : sprintf('create an empty file in <strong>%s</strong> and ', $browsercache_rules_no404wp_path)), $browsercache_rules_no404wp_path),
|
1093 |
'browsercache_write_rules_cdn' => sprintf('The browser cache rules for CDN could not be modified. Please check CDN settings.'),
|
1094 |
+
'minify_write_rules' => sprintf('The minify cache rules could not be modified. Please run <strong>chmod 777 %s</strong> to resolve this issue.', (file_exists($minify_rules_path) ? $minify_rules_path : dirname($minify_rules_path))),
|
1095 |
'support_request_type' => 'Please select request type.',
|
1096 |
'support_request_url' => 'Please enter the address of your site in the site <acronym title="Uniform Resource Locator">URL</acronym> field.',
|
1097 |
'support_request_name' => 'Please enter your name in the Name field',
|
1295 |
|
1296 |
if ($data) {
|
1297 |
$matches = null;
|
1298 |
+
$regexp = '~==\s*Changelog\s*==\s*=\s*[0-9.]+\s*=(.*)(=\s*' . preg_quote(W3TC_VERSION) . '\s*=|$)~Uis';
|
1299 |
+
|
1300 |
+
if (preg_match($regexp, $data, $matches)) {
|
1301 |
$changelog = (array) preg_split('~[\r\n]+~', trim($matches[1]));
|
1302 |
|
1303 |
echo '<div style="color: #f00;">Take a minute to update, here\'s why:</div><div style="font-weight: normal;">';
|
1466 |
if (w3_is_multisite()) {
|
1467 |
$this->_errors[] = sprintf('Enhanced mode page cache is not operational. Your .htaccess rules could not be modified. Please verify <strong>%s</strong> has the following rules: %s <textarea class="w3tc-rules" cols="120" rows="10" readonly="readonly">%s</textarea> %s', $pgcache_rules_core_path, $this->button('view code', '', 'w3tc-show-rules'), htmlspecialchars($w3_plugin_pgcache->generate_rules_core()), $this->button_hide_note('Hide this message', 'pgcache_rules_core'));
|
1468 |
} else {
|
1469 |
+
$this->_errors[] = sprintf('You\'ve selected disk caching with enhanced mode however the .htaccess file is not properly configured. Please %srun <strong>chmod 777 %s</strong>, then %s. To manually modify your server configuration for enhanced mode append the following code: %s <textarea class="w3tc-rules" cols="120" rows="10" readonly="readonly">%s</textarea> and %s.', (file_exists($pgcache_rules_core_path) ? '' : sprintf('create an empty file in <strong>%s</strong> and ', $pgcache_rules_core_path)), $pgcache_rules_core_path, $this->button_link('try again', sprintf('admin.php?page=%s&pgcache_write_rules_core', $this->_page)), $this->button('view code', '', 'w3tc-show-rules'), htmlspecialchars($w3_plugin_pgcache->generate_rules_core()), $this->button_hide_note('hide this message', 'pgcache_rules_core'));
|
1470 |
}
|
1471 |
}
|
1472 |
|
1555 |
if (w3_is_multisite()) {
|
1556 |
$this->_errors[] = sprintf('Browser Cache feature is not operational. Your .htaccess rules could not be modified. Please verify <strong>%s</strong> has the following rules: %s <textarea class="w3tc-rules" cols="120" rows="10" readonly="readonly">%s</textarea> %s', $browsercache_rules_cache_path, $this->button('view code', '', 'w3tc-show-rules'), htmlspecialchars($w3_plugin_browsercache->generate_rules_cache()), $this->button_hide_note('Hide this message', 'browsercache_rules_cache'));
|
1557 |
} else {
|
1558 |
+
$this->_errors[] = sprintf('You\'ve enabled Browser Cache feature however the .htaccess file is not properly configured. Please %srun <strong>chmod 777 %s</strong>, then %s. To manually modify these settings use the following code: %s <textarea class="w3tc-rules" cols="120" rows="10" readonly="readonly">%s</textarea> and %s.', (file_exists($browsercache_rules_cache_path) ? '' : sprintf('create an empty file in <strong>%s</strong> and ', $browsercache_rules_cache_path)), $browsercache_rules_cache_path, $this->button_link('try again', sprintf('admin.php?page=%s&browsercache_write_rules_cache', $this->_page)), $this->button('view code', '', 'w3tc-show-rules'), htmlspecialchars($w3_plugin_browsercache->generate_rules_cache()), $this->button_hide_note('hide this message', 'browsercache_rules_cache'));
|
1559 |
}
|
1560 |
}
|
1561 |
|
1565 |
if (w3_is_multisite()) {
|
1566 |
$this->_errors[] = sprintf('Browser Cache feature is not operational. Your .htaccess rules could not be modified. Please verify <strong>%s</strong> has the following rules: %s <textarea class="w3tc-rules" cols="120" rows="10" readonly="readonly">%s</textarea> %s', $browsercache_rules_no404wp_path, $this->button('view code', '', 'w3tc-show-rules'), htmlspecialchars($w3_plugin_browsercache->generate_rules_no404wp()), $this->button_hide_note('Hide this message', 'browsercache_rules_no404wp'));
|
1567 |
} else {
|
1568 |
+
$this->_errors[] = sprintf('You\'ve enabled Browser Cache feature however the .htaccess file is not properly configured. Please %srun <strong>chmod 777 %s</strong>, then %s. To manually modify these settings use the following code: %s <textarea class="w3tc-rules" cols="120" rows="10" readonly="readonly">%s</textarea> and %s.', (file_exists($browsercache_rules_no404wp_path) ? '' : sprintf('create an empty file in <strong>%s</strong> and ', $browsercache_rules_no404wp_path)), $browsercache_rules_no404wp_path, $this->button_link('try again', sprintf('admin.php?page=%s&browsercache_write_rules_no404wp', $this->_page)), $this->button('view code', '', 'w3tc-show-rules'), htmlspecialchars($w3_plugin_browsercache->generate_rules_no404wp()), $this->button_hide_note('hide this message', 'browsercache_rules_no404wp'));
|
1569 |
}
|
1570 |
}
|
1571 |
}
|
1613 |
/**
|
1614 |
* Check permalinks
|
1615 |
*/
|
1616 |
+
if ($this->_config->get_boolean('notes.no_permalink_rules') && (($this->_config->get_boolean('pgcache.enabled') && $this->_config->get_string('pgcache.engine') == 'file_pgcache') || ($this->_config->get_boolean('browsercache.enabled') && $this->_config->get_boolean('browsercache.no404wp'))) && !w3_is_permalink_rules()) {
|
1617 |
$this->_errors[] = sprintf('The required directives for fancy permalinks could not be detected, please confirm they are available: %s <textarea class="w3tc-rules" cols="120" rows="10" readonly="readonly">%s</textarea> %s', $this->button('view code', '', 'w3tc-show-rules'), htmlspecialchars(w3_get_permalink_rules()), $this->button_hide_note('Hide this message', 'no_permalink_rules'));
|
1618 |
}
|
1619 |
|
1620 |
/**
|
1621 |
+
* CDN
|
1622 |
*/
|
1623 |
if ($this->_config->get_boolean('cdn.enabled')) {
|
1624 |
+
/**
|
1625 |
+
* Check upload settings
|
1626 |
+
*/
|
1627 |
+
$upload_info = w3_upload_info();
|
1628 |
+
|
1629 |
+
if (!$upload_info) {
|
1630 |
+
$upload_path = get_option('upload_path');
|
1631 |
+
$upload_path = trim($upload_path);
|
1632 |
+
|
1633 |
+
if (empty($upload_path)) {
|
1634 |
+
$upload_path = WP_CONTENT_DIR . '/uploads';
|
1635 |
+
|
1636 |
+
$this->_errors[] = sprintf('Your store uploads folder is not available. Default WordPress directories will be created: <strong>%s</strong>.', $upload_path);
|
1637 |
+
}
|
1638 |
+
|
1639 |
+
$this->_errors[] = sprintf('The path found in the database (%s) is inconsistent with the current paths found on your server. Please manually adjust the upload path either in miscellaneous settings or in the site\'s edit page if in network mode.', $upload_path);
|
1640 |
+
}
|
1641 |
+
|
1642 |
+
/**
|
1643 |
+
* Check CDN settings
|
1644 |
+
*/
|
1645 |
$cdn_engine = $this->_config->get_string('cdn.engine');
|
1646 |
|
1647 |
switch (true) {
|
1768 |
$cdn_enabled = $this->_config->get_boolean('cdn.enabled');
|
1769 |
|
1770 |
$enabled = ($pgcache_enabled || $minify_enabled || $dbcache_enabled || $objectcache_enabled || $browsercache_enabled || $cdn_enabled);
|
1771 |
+
$enabled_checked = ($pgcache_enabled && $minify_enabled && $dbcache_enabled && $objectcache_enabled && $browsercache_enabled && $cdn_enabled);
|
1772 |
|
1773 |
$check_apc = function_exists('apc_store');
|
1774 |
$check_eaccelerator = function_exists('eaccelerator_put');
|
4211 |
foreach ((array) $locations as $location => $config) {
|
4212 |
if (isset($config['files'])) {
|
4213 |
foreach ((array) $config['files'] as $file) {
|
4214 |
+
if (!isset($js_groups[$template]) || !in_array($file, $js_groups[$template])) {
|
4215 |
$js_groups[$template][] = $file;
|
4216 |
}
|
4217 |
|
4228 |
foreach ((array) $locations as $location => $config) {
|
4229 |
if (isset($config['files'])) {
|
4230 |
foreach ((array) $config['files'] as $file) {
|
4231 |
+
if (!isset($css_groups[$template]) || !in_array($file, $css_groups[$template])) {
|
4232 |
$css_groups[$template][] = $file;
|
4233 |
}
|
4234 |
|
4993 |
{
|
4994 |
$themes = array();
|
4995 |
$wp_themes = get_themes();
|
4996 |
+
$theme_root = get_theme_root();
|
4997 |
|
4998 |
foreach ($wp_themes as $wp_theme) {
|
4999 |
$theme_key = substr(md5($theme_root . $wp_theme['Template'] . $wp_theme['Stylesheet']), 0, 6);
|
readme.txt
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
=== Plugin Name ===
|
2 |
Contributors: fredericktownes
|
3 |
Tags: user experience, cache, caching, page cache, css cache, js cache, db cache, disk cache, disk caching, database cache, http compression, gzip, deflate, minify, CDN, content delivery network, media library, performance, speed, multiple hosts, CSS, merge, combine, unobtrusive javascript, compress, optimize, optimizer, JavaScript, JS, cascading style sheet, plugin, yslow, YUI, google, google rank, google page speed, S3, CloudFront, AWS, Amazon Web Services, cloud files, rackspace, batcache, wp cache, wp super cache, w3 total cache, buddypress
|
4 |
-
Requires at least: 2.
|
5 |
Tested up to: 3.1
|
6 |
-
Stable tag: 0.9.1.
|
7 |
|
8 |
-
|
9 |
|
10 |
== Description ==
|
11 |
|
@@ -229,7 +229,7 @@ Install the plugin to read the full FAQ.
|
|
229 |
1. Locate and activate the plugin on the "Plugins" page. Page caching will **automatically be running** in basic mode. Set the permissions of wp-content and wp-content/uploads back to 755, e.g.: `# chmod 755 /var/www/vhosts/domain.com/httpdocs/wp-content/`.
|
230 |
1. Now click the "Settings" link to proceed to the "General" tab and select your caching methods for page, database and minify. In most cases, "disk enhanced" mode for page cache, "disk" mode for minify and "disk" mode for database caching are "good" settings.
|
231 |
1. *Recommended:* On the "Minify Settings" tab, all of the recommended settings are preset. Use the help button to simplify discovery of your CSS and JS files and groups. Pay close attention to the method and location of your JS group embeddings. See the plugin's FAQ for more information on usage.
|
232 |
-
1. *Recommended:* On the "Browser Cache" tab,
|
233 |
1. *Recommended:* If you already have a content delivery network (CDN) provider, proceed to the "Content Delivery Network" tab and populate the fields and set your preferences. If you do not use the Media Library, you will need to import your images etc into the default locations. Use the Media Library Import Tool on the "Content Delivery Network" tab to perform this task. If you do not have a CDN provider, you can still improve your site's performance using the "Self-hosted" method. On your own server, create a subdomain and matching DNS Zone record; e.g. static.domain.com and configure FTP options on the "Content Delivery Network" tab accordingly. Be sure to FTP upload the appropriate files, using the available upload buttons.
|
234 |
1. *Recommended:* On the "Browser Cache" tab, HTTP compression is enabled by default. Make sure to enable other options to suit your goals.
|
235 |
1. *Optional:* On the "Database Cache" tab, the recommended settings are preset. If using a shared hosting account use the "disk" method with caution, the response time of the disk may not be fast enough, so this option is disabled by default. Try object caching instead for shared hosting.
|
@@ -242,6 +242,16 @@ Install the plugin to read the full FAQ.
|
|
242 |
|
243 |
== Press: Mentions, Tutorials & Reviews ==
|
244 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
**July 2010:**
|
246 |
|
247 |
* [Getting W3 Total Cache and a mobile plugin to work in WordPress](http://blog.trasatti.it/2010/07/getting-w3-total-cache-and-a-mobile-plugin-to-work-in-wordpress.html), Andrea Trasatti
|
@@ -349,12 +359,25 @@ Please reach out to all of these people and support their projects if you're so
|
|
349 |
|
350 |
== Changelog ==
|
351 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
352 |
= 0.9.1.1 =
|
353 |
* Added an additional notification to help users identify incomplete installations upon activation
|
354 |
* Reverted previous Cloud Files workaround
|
355 |
-
* Fixed
|
356 |
-
* Fixed
|
357 |
-
* Fixed
|
358 |
|
359 |
= 0.9.1 =
|
360 |
* Improved Rackspace Cloud Files implementation
|
@@ -433,7 +456,7 @@ Please reach out to all of these people and support their projects if you're so
|
|
433 |
* Improved memcached detection by supporting only PECL memcache
|
434 |
* Fixed bug with disk enhanced method of page cache in WordPress MU
|
435 |
* Fixed false match of page cache files in disk enhanced method of page cache
|
436 |
-
* Fixed
|
437 |
* Fixed missing trailing slash issue when using disk enhanced page caching
|
438 |
* Fixed auto-embed bug CSS and JS when already manually embedded
|
439 |
|
@@ -533,12 +556,12 @@ Please reach out to all of these people and support their projects if you're so
|
|
533 |
* Removed unnecessary minify options
|
534 |
* Minification error dialogs now disabled when JS or CSS minify settings disabled
|
535 |
* Normalized line endings with /n as per minify author's direction
|
536 |
-
* Resolved
|
537 |
|
538 |
= 0.7.5 =
|
539 |
* Added handling for magic_quotes set to on
|
540 |
* Fixed issue with auto-download/upgrade and additional error checking
|
541 |
-
* Fixed
|
542 |
* Improved handling of inline comments and JavaScript in HTML documents
|
543 |
* Improved handing of @import CSS embedding
|
544 |
* Addressed privilege control issue
|
1 |
=== Plugin Name ===
|
2 |
Contributors: fredericktownes
|
3 |
Tags: user experience, cache, caching, page cache, css cache, js cache, db cache, disk cache, disk caching, database cache, http compression, gzip, deflate, minify, CDN, content delivery network, media library, performance, speed, multiple hosts, CSS, merge, combine, unobtrusive javascript, compress, optimize, optimizer, JavaScript, JS, cascading style sheet, plugin, yslow, YUI, google, google rank, google page speed, S3, CloudFront, AWS, Amazon Web Services, cloud files, rackspace, batcache, wp cache, wp super cache, w3 total cache, buddypress
|
4 |
+
Requires at least: 2.8
|
5 |
Tested up to: 3.1
|
6 |
+
Stable tag: 0.9.1.2
|
7 |
|
8 |
+
Easily optimize the speed and user experience of your site with caching: browser, page, object, database, minify and content delivery network support.
|
9 |
|
10 |
== Description ==
|
11 |
|
229 |
1. Locate and activate the plugin on the "Plugins" page. Page caching will **automatically be running** in basic mode. Set the permissions of wp-content and wp-content/uploads back to 755, e.g.: `# chmod 755 /var/www/vhosts/domain.com/httpdocs/wp-content/`.
|
230 |
1. Now click the "Settings" link to proceed to the "General" tab and select your caching methods for page, database and minify. In most cases, "disk enhanced" mode for page cache, "disk" mode for minify and "disk" mode for database caching are "good" settings.
|
231 |
1. *Recommended:* On the "Minify Settings" tab, all of the recommended settings are preset. Use the help button to simplify discovery of your CSS and JS files and groups. Pay close attention to the method and location of your JS group embeddings. See the plugin's FAQ for more information on usage.
|
232 |
+
1. *Recommended:* On the "Browser Cache" tab, HTTP compression is enabled by default. Make sure to enable other options to suit your goals.
|
233 |
1. *Recommended:* If you already have a content delivery network (CDN) provider, proceed to the "Content Delivery Network" tab and populate the fields and set your preferences. If you do not use the Media Library, you will need to import your images etc into the default locations. Use the Media Library Import Tool on the "Content Delivery Network" tab to perform this task. If you do not have a CDN provider, you can still improve your site's performance using the "Self-hosted" method. On your own server, create a subdomain and matching DNS Zone record; e.g. static.domain.com and configure FTP options on the "Content Delivery Network" tab accordingly. Be sure to FTP upload the appropriate files, using the available upload buttons.
|
234 |
1. *Recommended:* On the "Browser Cache" tab, HTTP compression is enabled by default. Make sure to enable other options to suit your goals.
|
235 |
1. *Optional:* On the "Database Cache" tab, the recommended settings are preset. If using a shared hosting account use the "disk" method with caution, the response time of the disk may not be fast enough, so this option is disabled by default. Try object caching instead for shared hosting.
|
242 |
|
243 |
== Press: Mentions, Tutorials & Reviews ==
|
244 |
|
245 |
+
**August 2010:**
|
246 |
+
|
247 |
+
* [How to configure WordPress Blogs Search Engine Friendly](http://solvater.com/2010/09/how-to-configure-wordpress-blog-search-engine-friendly-complete-beginners-guide-for-wordpress-seo/), Arafath Hashmi
|
248 |
+
* [How to Install and Setup W3 Total Cache for Beginners](http://www.wpbeginner.com/plugins/how-to-install-and-setup-w3-total-cache-for-beginners/)
|
249 |
+
* [20 Most Useful WordPress Plugins](http://zemalf.posterous.com/20-most-useful-wordpress-plugins), Antti Kokkonen
|
250 |
+
* [Speed up, compress and optimise WordPress using W3 Total Cache](http://thisishelpful.com/speed-compress-optimise-wordpress-w3-total-cache.html)
|
251 |
+
* [W3 Total Cache - Further optimization of the blog](http://www.bhoffmeier.de/2010/08/21/w3-total-cache-weitere-optimierung-des-blogs/), Bernd Hoffmeier
|
252 |
+
* [W3 Total Cache Fixes Bugs, Adds Features with Update](http://www.whoishostingthis.com/blog/2010/08/04/first-draft-w3-total-cache-fixes-bugs-adds-features-with-update/), Jonathan
|
253 |
+
* [The Quickest Way To Make Your Blog Load Faster](http://www.peterleehc.com/blog/work-from-home/the-quickest-way-to-make-your-blog-load-faster), Peter Lee
|
254 |
+
|
255 |
**July 2010:**
|
256 |
|
257 |
* [Getting W3 Total Cache and a mobile plugin to work in WordPress](http://blog.trasatti.it/2010/07/getting-w3-total-cache-and-a-mobile-plugin-to-work-in-wordpress.html), Andrea Trasatti
|
359 |
|
360 |
== Changelog ==
|
361 |
|
362 |
+
= 0.9.1.2 =
|
363 |
+
* Improved media library import compatibility
|
364 |
+
* Improved various notifications
|
365 |
+
* Changed expires implementation to last accessed instead of last modified
|
366 |
+
* Resolved Apache 1.3 compatibility issue
|
367 |
+
* Fixed issues with document root detection on some servers
|
368 |
+
* Fixed an issue with minification of script tags with HTML comments inside
|
369 |
+
* Fixed bug with minify gzip compression
|
370 |
+
* Fixed bug with cache-control headers
|
371 |
+
* Fixed bug with empty fatal error notification on network activation
|
372 |
+
* Fixed bug with minify when https is active
|
373 |
+
* Fixed bug with fatal error upon activation when uploads path does not exist
|
374 |
+
|
375 |
= 0.9.1.1 =
|
376 |
* Added an additional notification to help users identify incomplete installations upon activation
|
377 |
* Reverted previous Cloud Files workaround
|
378 |
+
* Fixed bug with preview mode buttons
|
379 |
+
* Fixed bug with duplicate entries appearing when using minify help tool more than once
|
380 |
+
* Fixed bug with browser cache rules generation for media files
|
381 |
|
382 |
= 0.9.1 =
|
383 |
* Improved Rackspace Cloud Files implementation
|
456 |
* Improved memcached detection by supporting only PECL memcache
|
457 |
* Fixed bug with disk enhanced method of page cache in WordPress MU
|
458 |
* Fixed false match of page cache files in disk enhanced method of page cache
|
459 |
+
* Fixed bug with cron anomalies caused by caching of wp_options table
|
460 |
* Fixed missing trailing slash issue when using disk enhanced page caching
|
461 |
* Fixed auto-embed bug CSS and JS when already manually embedded
|
462 |
|
556 |
* Removed unnecessary minify options
|
557 |
* Minification error dialogs now disabled when JS or CSS minify settings disabled
|
558 |
* Normalized line endings with /n as per minify author's direction
|
559 |
+
* Resolved bug in the minify library preventing proper permission notification messages
|
560 |
|
561 |
= 0.7.5 =
|
562 |
* Added handling for magic_quotes set to on
|
563 |
* Fixed issue with auto-download/upgrade and additional error checking
|
564 |
+
* Fixed bug preventing minify working properly if either CSS or JS minification was disabled
|
565 |
* Improved handling of inline comments and JavaScript in HTML documents
|
566 |
* Improved handing of @import CSS embedding
|
567 |
* Addressed privilege control issue
|
w3-total-cache.php
CHANGED
@@ -2,13 +2,13 @@
|
|
2 |
/*
|
3 |
Plugin Name: W3 Total Cache
|
4 |
Description: The fastest and most complete WordPress performance plugin. Dramatically improve the speed and user experience of your site. Add browser, page, object and database caching as well as minify and content delivery network (CDN) to WordPress.
|
5 |
-
Version: 0.9.1.
|
6 |
Plugin URI: http://www.w3-edge.com/wordpress-plugins/w3-total-cache/
|
7 |
Author: Frederick Townes
|
8 |
Author URI: http://www.linkedin.com/in/w3edge
|
9 |
*/
|
10 |
|
11 |
-
/* Copyright 2009 Frederick Townes <ftownes@w3-edge.com>
|
12 |
Portions of this distribution are copyrighted by:
|
13 |
Copyright (c) 2008 Ryan Grove <ryan@wonko.com>
|
14 |
Copyright (c) 2008 Steve Clay <steve@mrclay.org>
|
@@ -36,19 +36,6 @@ if (!defined('W3TC_IN_MINIFY')) {
|
|
36 |
*/
|
37 |
require_once dirname(__FILE__) . '/inc/define.php';
|
38 |
|
39 |
-
/**
|
40 |
-
* Disable buggy sitewide activation in WPMU and WP 3.0
|
41 |
-
*/
|
42 |
-
if (isset($_GET['action']) && $_GET['action'] == 'activate' && isset($_GET['plugin']) && $_GET['plugin'] == W3TC_FILE) {
|
43 |
-
if (w3_is_wpmu() && isset($_GET['sitewide'])) {
|
44 |
-
unset($_GET['sitewide']);
|
45 |
-
}
|
46 |
-
|
47 |
-
if (w3_is_network_mode() && isset($_GET['networkwide'])) {
|
48 |
-
w3_network_activate_error();
|
49 |
-
}
|
50 |
-
}
|
51 |
-
|
52 |
/**
|
53 |
* Load plugins
|
54 |
*/
|
2 |
/*
|
3 |
Plugin Name: W3 Total Cache
|
4 |
Description: The fastest and most complete WordPress performance plugin. Dramatically improve the speed and user experience of your site. Add browser, page, object and database caching as well as minify and content delivery network (CDN) to WordPress.
|
5 |
+
Version: 0.9.1.2
|
6 |
Plugin URI: http://www.w3-edge.com/wordpress-plugins/w3-total-cache/
|
7 |
Author: Frederick Townes
|
8 |
Author URI: http://www.linkedin.com/in/w3edge
|
9 |
*/
|
10 |
|
11 |
+
/* Copyright (c) 2009 Frederick Townes <ftownes@w3-edge.com>
|
12 |
Portions of this distribution are copyrighted by:
|
13 |
Copyright (c) 2008 Ryan Grove <ryan@wonko.com>
|
14 |
Copyright (c) 2008 Steve Clay <steve@mrclay.org>
|
36 |
*/
|
37 |
require_once dirname(__FILE__) . '/inc/define.php';
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
/**
|
40 |
* Load plugins
|
41 |
*/
|