Version Description
- Added option to CDN Settings to skip specified directories
- Added option to allow for full control of HTTP compression options for page cache (some WordPress installations have issues with deflate)
- Added sql_calc_found_rows to default auto reject SQL list
- Added more notification cases identified and configured
- Added new mobile user agents for Japanese market
- Page cache performance improvements for disk enhanced mode
- Improved FAQ and option descriptions
- Improved apache directives for minify headers
- Improved handling of redirects
- Improved name space to avoid issues with other plugins
- Improved handling of incomplete installations, caching runs with default options if custom settings file does not exist
- Fixed anomalies with memcached-client.php in some environments
- Fixed another interface bug with management of minify files
- Fixed minor bug with table column length for some MySQL versions
- Fixed minify bug with CRLF
- Fixed minify bug with handling of zlib compression enabled
- Fixed handling of pages with CDN Media Library import
Download this release
Release Info
Developer | fredericktownes |
Plugin | W3 Total Cache |
Version | 0.8.5.1 |
Comparing to | |
See all releases |
Code changes from version 0.8.5 to 0.8.5.1
- inc/css/error.css +49 -0
- inc/css/popup.css +83 -83
- inc/define.php +147 -60
- inc/error.phtml +13 -0
- inc/options/cdn.phtml +21 -10
- inc/options/common/header.phtml +2 -2
- inc/options/dbcache.phtml +1 -1
- inc/options/faq.phtml +11 -8
- inc/options/general.phtml +11 -10
- inc/options/install.phtml +79 -68
- inc/options/minify.phtml +18 -16
- inc/options/pgcache.phtml +7 -7
- inc/popup/cdn_rename_domain.phtml +1 -1
- inc/popup/common/header.phtml +4 -5
- ini/_htaccess +2 -4
- ini/apc.ini +23 -5
- ini/eaccelerator.ini +25 -0
- ini/memcache.ini +1 -0
- ini/xcache.ini +36 -0
- lib/Minify/HTTP/Encoder.php +2 -0
- lib/Minify/Minify/CSS/UriRewriter.php +2 -2
- lib/W3/Config.php +122 -86
- lib/W3/Db.php +40 -17
- lib/W3/Minify.php +1 -0
- lib/W3/PgCache.php +31 -35
- lib/W3/Plugin.php +2 -1
- lib/W3/Plugin/Cdn.php +47 -16
- lib/W3/Plugin/Minify.php +1 -1
- lib/W3/Plugin/PgCache.php +4 -2
- lib/W3/Plugin/TotalCache.php +106 -73
- lib/W3/Request.php +16 -4
- readme.txt +113 -24
- w3-total-cache-config-example.php +0 -249
- w3-total-cache.php +2 -2
- wp-content/advanced-cache.php +3 -6
- wp-content/db.php +2 -7
- wp-content/w3tc/min/index.php +3 -6
inc/css/error.css
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
* {
|
2 |
+
margin: 0;
|
3 |
+
padding: 0;
|
4 |
+
color: #464646;
|
5 |
+
}
|
6 |
+
|
7 |
+
html,body {
|
8 |
+
height: 100%;
|
9 |
+
}
|
10 |
+
|
11 |
+
body {
|
12 |
+
line-height: 1.4em;
|
13 |
+
}
|
14 |
+
|
15 |
+
body,input {
|
16 |
+
font-family: "Lucida Grande", Verdana, Arial;
|
17 |
+
font-size: 13px;
|
18 |
+
}
|
19 |
+
|
20 |
+
a {
|
21 |
+
color: #21759B;
|
22 |
+
}
|
23 |
+
|
24 |
+
a:hover {
|
25 |
+
color: #D54E21;
|
26 |
+
}
|
27 |
+
|
28 |
+
.button,input[type="button"],input[type="submit"] {
|
29 |
+
font-size: 11px;
|
30 |
+
line-height: 16px;
|
31 |
+
background: #f2f2f2 url(../../../../../wp-admin/images/white-grad.png) repeat-x scroll left top;
|
32 |
+
border: 1px solid #bbb;
|
33 |
+
color: #464646;
|
34 |
+
text-shadow: 0 1px 0 #fff;
|
35 |
+
cursor: pointer;
|
36 |
+
padding: 2px 8px;
|
37 |
+
border-radius: 11px;
|
38 |
+
-webkit-border-radius: 11px;
|
39 |
+
-moz-border-radius: 11px;
|
40 |
+
}
|
41 |
+
|
42 |
+
.button:hover,input[type="button"]:hover,input[type="submit"]:hover {
|
43 |
+
border-color: #666;
|
44 |
+
color: #000;
|
45 |
+
}
|
46 |
+
|
47 |
+
.button:active,input[type="button"]:active,input[type="submit"]:active {
|
48 |
+
background: #F2F2F2 url(../../../../../images/white-grad-active.png) repeat-x scroll left top;
|
49 |
+
}
|
inc/css/popup.css
CHANGED
@@ -1,175 +1,175 @@
|
|
1 |
* {
|
2 |
-
margin:0;
|
3 |
-
padding:0;
|
4 |
-
color
|
5 |
}
|
6 |
|
7 |
html,body {
|
8 |
-
height:100%;
|
9 |
}
|
10 |
|
11 |
body {
|
12 |
-
line-height:
|
13 |
-
background
|
14 |
}
|
15 |
|
16 |
body,td,textarea,input,select {
|
17 |
-
font-family:"Lucida Grande", Verdana, Arial;
|
18 |
-
font-size:13px;
|
19 |
}
|
20 |
|
21 |
p {
|
22 |
-
margin:1em 0;
|
23 |
}
|
24 |
|
25 |
h1 {
|
26 |
-
font-family:Georgia, "Times New Roman", "Bitstream Charter";
|
27 |
-
font-size:24px;
|
28 |
-
font-style:italic;
|
29 |
-
font-weight:400;
|
30 |
-
line-height:35px;
|
31 |
-
margin-bottom:0.8em 0;
|
32 |
-
text-shadow:0 1px 0 #fff;
|
33 |
}
|
34 |
|
35 |
a {
|
36 |
-
color
|
37 |
}
|
38 |
|
39 |
a:hover {
|
40 |
-
color
|
41 |
}
|
42 |
|
43 |
#content {
|
44 |
-
padding:40px 50px;
|
45 |
}
|
46 |
|
47 |
.clear {
|
48 |
-
clear:both;
|
49 |
}
|
50 |
|
51 |
.button,input[type="button"],input[type="submit"] {
|
52 |
-
font-size:11px;
|
53 |
-
line-height:16px;
|
54 |
-
background
|
55 |
-
border:1px solid #bbb;
|
56 |
-
color
|
57 |
-
text-shadow:0 1px 0 #fff;
|
58 |
-
cursor:pointer;
|
59 |
-
padding:2px 8px;
|
60 |
-
border-radius:11px;
|
61 |
-
-webkit-border-radius:11px;
|
62 |
-
-moz-border-radius:11px;
|
63 |
}
|
64 |
|
65 |
.button:hover,input[type="button"]:hover,input[type="submit"]:hover {
|
66 |
-
border-color
|
67 |
-
color
|
68 |
}
|
69 |
|
70 |
.button:active,input[type="button"]:active,input[type="submit"]:active {
|
71 |
-
background
|
72 |
}
|
73 |
|
74 |
.progress {
|
75 |
-
background
|
76 |
-
border:1px solid #464646;
|
77 |
-
padding:1px;
|
78 |
-
margin:1em 0;
|
79 |
-
position:relative;
|
80 |
}
|
81 |
|
82 |
.progress-value {
|
83 |
-
position:absolute;
|
84 |
-
line-height:30px;
|
85 |
-
font-size:16px;
|
86 |
-
font-weight:700;
|
87 |
-
color
|
88 |
-
text-align:center;
|
89 |
-
width:100%;
|
90 |
}
|
91 |
|
92 |
.progress-bar {
|
93 |
-
float:left;
|
94 |
-
width:0;
|
95 |
-
height:30px;
|
96 |
-
background
|
97 |
}
|
98 |
|
99 |
.log {
|
100 |
-
border:1px solid #464646;
|
101 |
-
height:279px;
|
102 |
-
overflow:auto;
|
103 |
}
|
104 |
|
105 |
.log div {
|
106 |
-
padding:3px;
|
107 |
-
border-bottom:1px solid #464646;
|
108 |
}
|
109 |
|
110 |
.log-success {
|
111 |
-
background
|
112 |
}
|
113 |
|
114 |
.log-error {
|
115 |
-
background
|
116 |
}
|
117 |
|
118 |
.empty {
|
119 |
-
font-weight:700;
|
120 |
-
font-style:italic;
|
121 |
}
|
122 |
|
123 |
.table {
|
124 |
-
width:100%;
|
125 |
-
border-collapse:collapse;
|
126 |
}
|
127 |
|
128 |
.table td,th {
|
129 |
-
border:1px solid #ccc;
|
130 |
-
padding:3px 2px;
|
131 |
}
|
132 |
|
133 |
.table th {
|
134 |
-
background
|
135 |
}
|
136 |
|
137 |
.queue td {
|
138 |
-
font-size:10px;
|
139 |
}
|
140 |
|
141 |
.updated,.error {
|
142 |
-
-moz-border-radius-bottomleft:3px;
|
143 |
-
-moz-border-radius-bottomright:3px;
|
144 |
-
-moz-border-radius-topleft:3px;
|
145 |
-
-moz-border-radius-topright:3px;
|
146 |
-
border-style:solid;
|
147 |
-
border-width:1px;
|
148 |
-
padding:0 0.6em;
|
149 |
-
margin:0.5em 0;
|
150 |
}
|
151 |
|
152 |
.updated {
|
153 |
-
background
|
154 |
-
border-color
|
155 |
}
|
156 |
|
157 |
.error {
|
158 |
-
background-color
|
159 |
-
border-color
|
160 |
}
|
161 |
|
162 |
.updated p,.error p {
|
163 |
-
line-height:1;
|
164 |
-
margin:0.5em 0;
|
165 |
-
padding:2px;
|
166 |
}
|
167 |
|
168 |
.tab-selected {
|
169 |
-
font-weight:700;
|
170 |
}
|
171 |
|
172 |
.rules {
|
173 |
-
width:100%;
|
174 |
-
font-size:9px;
|
175 |
}
|
1 |
* {
|
2 |
+
margin: 0;
|
3 |
+
padding: 0;
|
4 |
+
color: #464646;
|
5 |
}
|
6 |
|
7 |
html,body {
|
8 |
+
height: 100%;
|
9 |
}
|
10 |
|
11 |
body {
|
12 |
+
line-height: 1em;
|
13 |
+
background: #f9f9f9;
|
14 |
}
|
15 |
|
16 |
body,td,textarea,input,select {
|
17 |
+
font-family: "Lucida Grande", Verdana, Arial;
|
18 |
+
font-size: 13px;
|
19 |
}
|
20 |
|
21 |
p {
|
22 |
+
margin: 1em 0;
|
23 |
}
|
24 |
|
25 |
h1 {
|
26 |
+
font-family: Georgia, "Times New Roman", "Bitstream Charter";
|
27 |
+
font-size: 24px;
|
28 |
+
font-style: italic;
|
29 |
+
font-weight: 400;
|
30 |
+
line-height: 35px;
|
31 |
+
margin-bottom: 0.8em 0;
|
32 |
+
text-shadow: 0 1px 0 #fff;
|
33 |
}
|
34 |
|
35 |
a {
|
36 |
+
color: #21759B;
|
37 |
}
|
38 |
|
39 |
a:hover {
|
40 |
+
color: #D54E21;
|
41 |
}
|
42 |
|
43 |
#content {
|
44 |
+
padding: 40px 50px;
|
45 |
}
|
46 |
|
47 |
.clear {
|
48 |
+
clear: both;
|
49 |
}
|
50 |
|
51 |
.button,input[type="button"],input[type="submit"] {
|
52 |
+
font-size: 11px;
|
53 |
+
line-height: 16px;
|
54 |
+
background: #f2f2f2 url(../../../../../wp-admin/images/white-grad.png) repeat-x scroll left top;
|
55 |
+
border: 1px solid #bbb;
|
56 |
+
color: #464646;
|
57 |
+
text-shadow: 0 1px 0 #fff;
|
58 |
+
cursor: pointer;
|
59 |
+
padding: 2px 8px;
|
60 |
+
border-radius: 11px;
|
61 |
+
-webkit-border-radius: 11px;
|
62 |
+
-moz-border-radius: 11px;
|
63 |
}
|
64 |
|
65 |
.button:hover,input[type="button"]:hover,input[type="submit"]:hover {
|
66 |
+
border-color: #666;
|
67 |
+
color: #000;
|
68 |
}
|
69 |
|
70 |
.button:active,input[type="button"]:active,input[type="submit"]:active {
|
71 |
+
background: #F2F2F2 url(../../../../../wp-admin/images/white-grad-active.png) repeat-x scroll left top;
|
72 |
}
|
73 |
|
74 |
.progress {
|
75 |
+
background: #fff;
|
76 |
+
border: 1px solid #464646;
|
77 |
+
padding: 1px;
|
78 |
+
margin: 1em 0;
|
79 |
+
position: relative;
|
80 |
}
|
81 |
|
82 |
.progress-value {
|
83 |
+
position: absolute;
|
84 |
+
line-height: 30px;
|
85 |
+
font-size: 16px;
|
86 |
+
font-weight: 700;
|
87 |
+
color: #000;
|
88 |
+
text-align: center;
|
89 |
+
width: 100%;
|
90 |
}
|
91 |
|
92 |
.progress-bar {
|
93 |
+
float: left;
|
94 |
+
width: 0;
|
95 |
+
height: 30px;
|
96 |
+
background: #fc2;
|
97 |
}
|
98 |
|
99 |
.log {
|
100 |
+
border: 1px solid #464646;
|
101 |
+
height: 279px;
|
102 |
+
overflow: auto;
|
103 |
}
|
104 |
|
105 |
.log div {
|
106 |
+
padding: 3px;
|
107 |
+
border-bottom: 1px solid #464646;
|
108 |
}
|
109 |
|
110 |
.log-success {
|
111 |
+
background: #bfb;
|
112 |
}
|
113 |
|
114 |
.log-error {
|
115 |
+
background: #f99;
|
116 |
}
|
117 |
|
118 |
.empty {
|
119 |
+
font-weight: 700;
|
120 |
+
font-style: italic;
|
121 |
}
|
122 |
|
123 |
.table {
|
124 |
+
width: 100%;
|
125 |
+
border-collapse: collapse;
|
126 |
}
|
127 |
|
128 |
.table td,th {
|
129 |
+
border: 1px solid #ccc;
|
130 |
+
padding: 3px 2px;
|
131 |
}
|
132 |
|
133 |
.table th {
|
134 |
+
background: #eee;
|
135 |
}
|
136 |
|
137 |
.queue td {
|
138 |
+
font-size: 10px;
|
139 |
}
|
140 |
|
141 |
.updated,.error {
|
142 |
+
-moz-border-radius-bottomleft: 3px;
|
143 |
+
-moz-border-radius-bottomright: 3px;
|
144 |
+
-moz-border-radius-topleft: 3px;
|
145 |
+
-moz-border-radius-topright: 3px;
|
146 |
+
border-style: solid;
|
147 |
+
border-width: 1px;
|
148 |
+
padding: 0 0.6em;
|
149 |
+
margin: 0.5em 0;
|
150 |
}
|
151 |
|
152 |
.updated {
|
153 |
+
background: #ffffe0;
|
154 |
+
border-color: #e6db55;
|
155 |
}
|
156 |
|
157 |
.error {
|
158 |
+
background-color: #ffebe8;
|
159 |
+
border-color: #cc0000;
|
160 |
}
|
161 |
|
162 |
.updated p,.error p {
|
163 |
+
line-height: 1;
|
164 |
+
margin: 0.5em 0;
|
165 |
+
padding: 2px;
|
166 |
}
|
167 |
|
168 |
.tab-selected {
|
169 |
+
font-weight: 700;
|
170 |
}
|
171 |
|
172 |
.rules {
|
173 |
+
width: 100%;
|
174 |
+
font-size: 9px;
|
175 |
}
|
inc/define.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
define('W3TC_VERSION', '0.8.5');
|
4 |
define('W3TC_POWERED_BY', 'W3 Total Cache/' . W3TC_VERSION);
|
5 |
define('W3TC_LINK_URL', 'http://www.w3-edge.com/wordpress-plugins/');
|
6 |
define('W3TC_LINK_NAME', 'WordPress Plugins');
|
@@ -34,7 +34,6 @@ define('W3TC_LOG_DIR', W3TC_CONTENT_DIR . '/log');
|
|
34 |
define('W3TC_TMP_DIR', W3TC_CONTENT_DIR . '/tmp');
|
35 |
|
36 |
define('W3TC_CONFIG_PATH', WP_CONTENT_DIR . '/w3-total-cache-config' . (($w3_blog_id = w3_get_blog_id()) != '' ? '-' . $w3_blog_id : '') . '.php');
|
37 |
-
define('W3TC_CONFIG_EXAMPLE_PATH', W3TC_DIR . '/w3-total-cache-config-example.php');
|
38 |
|
39 |
define('W3TC_MINIFY_LOG_FILE', W3TC_LOG_DIR . '/minify.log');
|
40 |
|
@@ -50,29 +49,60 @@ define('W3TC_FEED_URL', 'http://feeds.feedburner.com/W3TOTALCACHE');
|
|
50 |
define('W3TC_FEED_ITEMS', 3);
|
51 |
define('W3TC_README_URL', 'http://plugins.trac.wordpress.org/browser/w3-total-cache/trunk/readme.txt?format=txt');
|
52 |
|
53 |
-
define('W3TC_TWITTER_STATUS', 'I just optimized my #wordpress blog\'s performance using the W3 Total Cache #plugin by @w3edge. Check it out! http://j.mp/A69xX');
|
54 |
define('W3TC_SUPPORT_US_TIMEOUT', 2592000);
|
55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
/**
|
57 |
* W3 writable error
|
58 |
*
|
59 |
* @param string $path
|
60 |
-
* @param boolean $die
|
61 |
* @return string
|
62 |
*/
|
63 |
-
function w3_writable_error($path
|
64 |
{
|
|
|
|
|
|
|
65 |
if (w3_check_open_basedir($path)) {
|
66 |
-
|
|
|
|
|
|
|
|
|
67 |
} else {
|
68 |
-
$error = sprintf('<strong>%s</strong> could not be created, <strong>open_basedir</strong> restriction in effect, please check your php.ini settings:<br /><strong style="color: #f00;">open_basedir = "%s"</strong></br />then
|
69 |
}
|
70 |
|
71 |
-
|
72 |
-
die($error);
|
73 |
-
}
|
74 |
-
|
75 |
-
return $error;
|
76 |
}
|
77 |
|
78 |
/**
|
@@ -297,27 +327,6 @@ function w3_get_blog_id()
|
|
297 |
return $id;
|
298 |
}
|
299 |
|
300 |
-
/**
|
301 |
-
* Returns domain from host
|
302 |
-
*
|
303 |
-
* @param string $host
|
304 |
-
* @return string
|
305 |
-
*/
|
306 |
-
function w3_get_domain($host)
|
307 |
-
{
|
308 |
-
$host = strtolower($host);
|
309 |
-
|
310 |
-
if (strpos($host, 'www.') === 0) {
|
311 |
-
$host = str_replace('www.', '', $host);
|
312 |
-
}
|
313 |
-
|
314 |
-
if (($pos = strpos($host, ':'))) {
|
315 |
-
$host = substr($host, 0, $pos);
|
316 |
-
}
|
317 |
-
|
318 |
-
return $host;
|
319 |
-
}
|
320 |
-
|
321 |
/**
|
322 |
* Returns site url [fast]
|
323 |
*
|
@@ -328,8 +337,23 @@ function w3_get_site_url()
|
|
328 |
static $site_url = null;
|
329 |
|
330 |
if ($site_url === null) {
|
331 |
-
|
332 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
333 |
}
|
334 |
|
335 |
return $site_url;
|
@@ -364,6 +388,51 @@ function w3_get_site_url_regexp()
|
|
364 |
return $regexp;
|
365 |
}
|
366 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
367 |
/**
|
368 |
* Get domain URL
|
369 |
*
|
@@ -399,30 +468,6 @@ function w3_get_domain_url_regexp()
|
|
399 |
return $regexp;
|
400 |
}
|
401 |
|
402 |
-
/**
|
403 |
-
* Returns blog path
|
404 |
-
*
|
405 |
-
* @return string
|
406 |
-
*/
|
407 |
-
function w3_get_site_path()
|
408 |
-
{
|
409 |
-
static $site_path = null;
|
410 |
-
|
411 |
-
if ($site_path === null) {
|
412 |
-
$site_url = w3_get_site_url();
|
413 |
-
$domain_url = w3_get_domain_url();
|
414 |
-
|
415 |
-
$site_path = str_replace($domain_url, '', $site_url);
|
416 |
-
$site_path = rtrim($site_path, '/');
|
417 |
-
|
418 |
-
if ($site_path != '') {
|
419 |
-
$site_path .= '/';
|
420 |
-
}
|
421 |
-
}
|
422 |
-
|
423 |
-
return $site_path;
|
424 |
-
}
|
425 |
-
|
426 |
/**
|
427 |
* Returns upload info
|
428 |
*
|
@@ -538,7 +583,7 @@ function w3_get_engine_name($engine)
|
|
538 |
break;
|
539 |
|
540 |
case 'file_pgcache':
|
541 |
-
$engine_name = 'disk (
|
542 |
break;
|
543 |
|
544 |
default:
|
@@ -980,6 +1025,48 @@ function w3_preg_quote($string, $delimiter = null)
|
|
980 |
return $string;
|
981 |
}
|
982 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
983 |
/**
|
984 |
* Send powered by header
|
985 |
*/
|
1 |
<?php
|
2 |
|
3 |
+
define('W3TC_VERSION', '0.8.5.1');
|
4 |
define('W3TC_POWERED_BY', 'W3 Total Cache/' . W3TC_VERSION);
|
5 |
define('W3TC_LINK_URL', 'http://www.w3-edge.com/wordpress-plugins/');
|
6 |
define('W3TC_LINK_NAME', 'WordPress Plugins');
|
34 |
define('W3TC_TMP_DIR', W3TC_CONTENT_DIR . '/tmp');
|
35 |
|
36 |
define('W3TC_CONFIG_PATH', WP_CONTENT_DIR . '/w3-total-cache-config' . (($w3_blog_id = w3_get_blog_id()) != '' ? '-' . $w3_blog_id : '') . '.php');
|
|
|
37 |
|
38 |
define('W3TC_MINIFY_LOG_FILE', W3TC_LOG_DIR . '/minify.log');
|
39 |
|
49 |
define('W3TC_FEED_ITEMS', 3);
|
50 |
define('W3TC_README_URL', 'http://plugins.trac.wordpress.org/browser/w3-total-cache/trunk/readme.txt?format=txt');
|
51 |
|
52 |
+
define('W3TC_TWITTER_STATUS', 'I just optimized my #wordpress blog\'s #performance using the W3 Total Cache #plugin by @w3edge. Check it out! http://j.mp/A69xX');
|
53 |
define('W3TC_SUPPORT_US_TIMEOUT', 2592000);
|
54 |
|
55 |
+
/**
|
56 |
+
* W3 activate error
|
57 |
+
*
|
58 |
+
* @param string $error
|
59 |
+
* @return void
|
60 |
+
*/
|
61 |
+
function w3_activate_error($error)
|
62 |
+
{
|
63 |
+
$active_plugins = (array) get_option('active_plugins');
|
64 |
+
|
65 |
+
$key = array_search(W3TC_FILE, $active_plugins);
|
66 |
+
|
67 |
+
if ($key !== false) {
|
68 |
+
do_action('deactivate_plugin', W3TC_FILE);
|
69 |
+
|
70 |
+
array_splice($active_plugins, $key, 1);
|
71 |
+
|
72 |
+
do_action('deactivate_' . W3TC_FILE);
|
73 |
+
do_action('deactivated_plugin', W3TC_FILE);
|
74 |
+
|
75 |
+
update_option('active_plugins', $active_plugins);
|
76 |
+
} else {
|
77 |
+
do_action('deactivate_' . W3TC_FILE);
|
78 |
+
}
|
79 |
+
|
80 |
+
include W3TC_DIR . '/inc/error.phtml';
|
81 |
+
exit();
|
82 |
+
}
|
83 |
+
|
84 |
/**
|
85 |
* W3 writable error
|
86 |
*
|
87 |
* @param string $path
|
|
|
88 |
* @return string
|
89 |
*/
|
90 |
+
function w3_writable_error($path)
|
91 |
{
|
92 |
+
$activate_url = wp_nonce_url('plugins.php?action=activate&plugin=' . W3TC_FILE, 'activate-plugin_' . W3TC_FILE);
|
93 |
+
$reactivate_button = sprintf('<input type="button" value="re-activate plugin" onclick="top.location.href = \'%s\'" />', addslashes($activate_url));
|
94 |
+
|
95 |
if (w3_check_open_basedir($path)) {
|
96 |
+
if (file_exists($path)) {
|
97 |
+
$error = sprintf('<strong>%s</strong> is not write-able, please run following command:<br /><strong style="color: #f00;">chmod 777 %s</strong><br />then %s.', $path, $path, $reactivate_button);
|
98 |
+
} else {
|
99 |
+
$error = sprintf('<strong>%s</strong> could not be created, please run following command:<br /><strong style="color: #f00;">chmod 777 %s</strong><br />then %s.', $path, dirname($path), $reactivate_button);
|
100 |
+
}
|
101 |
} else {
|
102 |
+
$error = sprintf('<strong>%s</strong> could not be created, <strong>open_basedir</strong> restriction in effect, please check your php.ini settings:<br /><strong style="color: #f00;">open_basedir = "%s"</strong></br />then %s.', $path, ini_get('open_basedir'), $reactivate_button);
|
103 |
}
|
104 |
|
105 |
+
w3_activate_error($error);
|
|
|
|
|
|
|
|
|
106 |
}
|
107 |
|
108 |
/**
|
327 |
return $id;
|
328 |
}
|
329 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
330 |
/**
|
331 |
* Returns site url [fast]
|
332 |
*
|
337 |
static $site_url = null;
|
338 |
|
339 |
if ($site_url === null) {
|
340 |
+
if (function_exists('get_option')) {
|
341 |
+
$site_url = get_option('siteurl');
|
342 |
+
$site_url = rtrim($site_url, '/') . '/';
|
343 |
+
} else {
|
344 |
+
$site_url = sprintf('http://%s/', $_SERVER['HTTP_HOST']);
|
345 |
+
|
346 |
+
if (! empty($_SERVER['DOCUMENT_ROOT'])) {
|
347 |
+
$document_root = realpath($_SERVER['DOCUMENT_ROOT']);
|
348 |
+
$abspath = realpath(ABSPATH);
|
349 |
+
$path = str_replace($abspath, '', $document_root);
|
350 |
+
$path = trim($path, '/\\');
|
351 |
+
|
352 |
+
if ($path != '') {
|
353 |
+
$site_url .= $path . '/';
|
354 |
+
}
|
355 |
+
}
|
356 |
+
}
|
357 |
}
|
358 |
|
359 |
return $site_url;
|
388 |
return $regexp;
|
389 |
}
|
390 |
|
391 |
+
/**
|
392 |
+
* Returns blog path
|
393 |
+
*
|
394 |
+
* @return string
|
395 |
+
*/
|
396 |
+
function w3_get_site_path()
|
397 |
+
{
|
398 |
+
static $site_path = null;
|
399 |
+
|
400 |
+
if ($site_path === null) {
|
401 |
+
$site_url = w3_get_site_url();
|
402 |
+
$domain_url = w3_get_domain_url();
|
403 |
+
|
404 |
+
$site_path = str_replace($domain_url, '', $site_url);
|
405 |
+
$site_path = rtrim($site_path, '/');
|
406 |
+
|
407 |
+
if ($site_path != '') {
|
408 |
+
$site_path .= '/';
|
409 |
+
}
|
410 |
+
}
|
411 |
+
|
412 |
+
return $site_path;
|
413 |
+
}
|
414 |
+
|
415 |
+
/**
|
416 |
+
* Returns domain from host
|
417 |
+
*
|
418 |
+
* @param string $host
|
419 |
+
* @return string
|
420 |
+
*/
|
421 |
+
function w3_get_domain($host)
|
422 |
+
{
|
423 |
+
$host = strtolower($host);
|
424 |
+
|
425 |
+
if (strpos($host, 'www.') === 0) {
|
426 |
+
$host = str_replace('www.', '', $host);
|
427 |
+
}
|
428 |
+
|
429 |
+
if (($pos = strpos($host, ':'))) {
|
430 |
+
$host = substr($host, 0, $pos);
|
431 |
+
}
|
432 |
+
|
433 |
+
return $host;
|
434 |
+
}
|
435 |
+
|
436 |
/**
|
437 |
* Get domain URL
|
438 |
*
|
468 |
return $regexp;
|
469 |
}
|
470 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
471 |
/**
|
472 |
* Returns upload info
|
473 |
*
|
583 |
break;
|
584 |
|
585 |
case 'file_pgcache':
|
586 |
+
$engine_name = 'disk (enhanced)';
|
587 |
break;
|
588 |
|
589 |
default:
|
1025 |
return $string;
|
1026 |
}
|
1027 |
|
1028 |
+
/**
|
1029 |
+
* Normalize file path
|
1030 |
+
*
|
1031 |
+
* @param string $file
|
1032 |
+
* @return string
|
1033 |
+
*/
|
1034 |
+
function w3_normalize_file($file)
|
1035 |
+
{
|
1036 |
+
$site_url_regexp = '~' . w3_get_site_url_regexp() . '~i';
|
1037 |
+
$file = preg_replace($site_url_regexp, '', $file);
|
1038 |
+
$file = ltrim($file, '/\\');
|
1039 |
+
|
1040 |
+
return $file;
|
1041 |
+
}
|
1042 |
+
|
1043 |
+
/**
|
1044 |
+
* Returns true if zlib output compression is enabled otherwise false
|
1045 |
+
*
|
1046 |
+
* @return boolean
|
1047 |
+
*/
|
1048 |
+
function w3_zlib_output_compression()
|
1049 |
+
{
|
1050 |
+
return w3_to_boolean(ini_get('zlib.output_compression'));
|
1051 |
+
}
|
1052 |
+
|
1053 |
+
/**
|
1054 |
+
* Recursive strips slahes from the var
|
1055 |
+
*
|
1056 |
+
* @param mixed $var
|
1057 |
+
* @return mixed
|
1058 |
+
*/
|
1059 |
+
function w3_stripslashes($var)
|
1060 |
+
{
|
1061 |
+
if (is_string($var)) {
|
1062 |
+
return stripslashes($var);
|
1063 |
+
} elseif (is_array($var)) {
|
1064 |
+
$var = array_map('w3_stripslashes', $var);
|
1065 |
+
}
|
1066 |
+
|
1067 |
+
return $var;
|
1068 |
+
}
|
1069 |
+
|
1070 |
/**
|
1071 |
* Send powered by header
|
1072 |
*/
|
inc/error.phtml
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
|
3 |
+
<head>
|
4 |
+
<link rel="stylesheet" type="text/css" href="<?php echo WP_PLUGIN_URL; ?>/w3-total-cache/inc/css/error.css"></link>
|
5 |
+
<title>Error</title>
|
6 |
+
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
|
7 |
+
</head>
|
8 |
+
<body>
|
9 |
+
<p>
|
10 |
+
<?php echo $error; ?>
|
11 |
+
</p>
|
12 |
+
</body>
|
13 |
+
</html>
|
inc/options/cdn.phtml
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
<p>
|
13 |
You can <input id="cdn_export_library" class="button" type="button" value="export media library to CDN" />,
|
14 |
use the <input id="cdn_rename_domain" class="button" type="button" value="domain rename tool" />,
|
15 |
-
<input id="cdn_import_library" class="button" type="button" value="import attachments into the Media Library
|
16 |
<input id="cdn_queue" class="button" type="button" value="view unsuccessful file transfers" /> now.
|
17 |
</p>
|
18 |
<?php endif; ?>
|
@@ -41,7 +41,8 @@
|
|
41 |
<tr>
|
42 |
<th<?php if ($cdn_mirror): ?> colspan="2"<?php endif; ?>>
|
43 |
<input type="hidden" name="cdn.includes.enable" value="0" />
|
44 |
-
<label><input type="checkbox" name="cdn.includes.enable" value="1"<?php checked($this->_config->get_boolean('cdn.includes.enable'), true); ?> /> Host wp-includes/ files</label
|
|
|
45 |
</th>
|
46 |
<?php if (! $cdn_mirror): ?>
|
47 |
<td>
|
@@ -52,7 +53,8 @@
|
|
52 |
<tr>
|
53 |
<th<?php if ($cdn_mirror): ?> colspan="2"<?php endif; ?>>
|
54 |
<input type="hidden" name="cdn.theme.enable" value="0" />
|
55 |
-
<label><input type="checkbox" name="cdn.theme.enable" value="1"<?php checked($this->_config->get_boolean('cdn.theme.enable'), true); ?> /> Host active theme files</label
|
|
|
56 |
</th>
|
57 |
<?php if (! $cdn_mirror): ?>
|
58 |
<td>
|
@@ -62,19 +64,21 @@
|
|
62 |
</tr>
|
63 |
<tr>
|
64 |
<th<?php if ($cdn_mirror): ?> colspan="2"<?php endif; ?>>
|
65 |
-
<input type="hidden" name="cdn.minify.enable" value="0" />
|
66 |
-
<label><input type="checkbox" name="cdn.minify.enable" value="1"<?php
|
|
|
67 |
</th>
|
68 |
<?php if (! $cdn_mirror): ?>
|
69 |
<td>
|
70 |
-
<input class="button cdn_export" type="button" name="minify" value="Upload minify files"<?php if (! W3TC_PHP5): ?> disabled="disabled"<?php endif; ?> />
|
71 |
</td>
|
72 |
<?php endif; ?>
|
73 |
</tr>
|
74 |
<tr>
|
75 |
<th<?php if ($cdn_mirror): ?> colspan="2"<?php endif; ?>>
|
76 |
<input type="hidden" name="cdn.custom.enable" value="0" />
|
77 |
-
<label><input type="checkbox" name="cdn.custom.enable" value="1"<?php checked($this->_config->get_boolean('cdn.custom.enable'), true); ?> /> Host custom files</label
|
|
|
78 |
</th>
|
79 |
<?php if (! $cdn_mirror): ?>
|
80 |
<td>
|
@@ -83,7 +87,7 @@
|
|
83 |
<?php endif; ?>
|
84 |
</tr>
|
85 |
<tr>
|
86 |
-
<th style="width: 300px;"><label for="cdn_includes_files">wp-includes
|
87 |
<td>
|
88 |
<input id="cdn_includes_files" type="text" name="cdn.includes.files" value="<?php echo htmlspecialchars($this->_config->get_string('cdn.includes.files')); ?>" size="40" /><br />
|
89 |
<span class="description">Specify the file types within the WordPress core to host with the <acronym title="Content Delivery Network">CDN</acronym>.</span>
|
@@ -99,17 +103,24 @@
|
|
99 |
<tr>
|
100 |
<th valign="top"><label for="cdn_custom_files">Custom file list:</label></th>
|
101 |
<td>
|
102 |
-
<textarea id="cdn_custom_files" name="cdn.custom.files" cols="
|
103 |
<span class="description">Specify any files outside of theme or other common directories to host with the <acronym title="Content Delivery Network">CDN</acronym>.</span>
|
104 |
</td>
|
105 |
</tr>
|
106 |
<tr>
|
107 |
<th valign="top"><label for="cdn_reject_ua">Rejected user agents:</label></th>
|
108 |
<td>
|
109 |
-
<textarea id="cdn_reject_ua" name="cdn.reject.ua" cols="
|
110 |
<span class="description">Specify user agents that should not access files hosted with the <acronym title="Content Delivery Network">CDN</acronym>.</span>
|
111 |
</td>
|
112 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
<?php if (! $cdn_mirror): ?>
|
114 |
<tr>
|
115 |
<th colspan="2">
|
12 |
<p>
|
13 |
You can <input id="cdn_export_library" class="button" type="button" value="export media library to CDN" />,
|
14 |
use the <input id="cdn_rename_domain" class="button" type="button" value="domain rename tool" />,
|
15 |
+
<input id="cdn_import_library" class="button" type="button" value="import attachments into the Media Library" /> or
|
16 |
<input id="cdn_queue" class="button" type="button" value="view unsuccessful file transfers" /> now.
|
17 |
</p>
|
18 |
<?php endif; ?>
|
41 |
<tr>
|
42 |
<th<?php if ($cdn_mirror): ?> colspan="2"<?php endif; ?>>
|
43 |
<input type="hidden" name="cdn.includes.enable" value="0" />
|
44 |
+
<label><input type="checkbox" name="cdn.includes.enable" value="1"<?php checked($this->_config->get_boolean('cdn.includes.enable'), true); ?> /> Host wp-includes/ files</label><br />
|
45 |
+
<span class="description">If checked, WordPress static core file types specified in the "wp-includes file types to upload" field below will be hosted with the <acronym title="Content Delivery Network">CDN</acronym>.</span>
|
46 |
</th>
|
47 |
<?php if (! $cdn_mirror): ?>
|
48 |
<td>
|
53 |
<tr>
|
54 |
<th<?php if ($cdn_mirror): ?> colspan="2"<?php endif; ?>>
|
55 |
<input type="hidden" name="cdn.theme.enable" value="0" />
|
56 |
+
<label><input type="checkbox" name="cdn.theme.enable" value="1"<?php checked($this->_config->get_boolean('cdn.theme.enable'), true); ?> /> Host active theme files</label><br />
|
57 |
+
<span class="description">If checked, all active theme file types specified in the "theme file types to upload" field below will be hosted with the <acronym title="Content Delivery Network">CDN</acronym>.</span>
|
58 |
</th>
|
59 |
<?php if (! $cdn_mirror): ?>
|
60 |
<td>
|
64 |
</tr>
|
65 |
<tr>
|
66 |
<th<?php if ($cdn_mirror): ?> colspan="2"<?php endif; ?>>
|
67 |
+
<input type="hidden" name="cdn.minify.enable" value="0"<?php if (! W3TC_PHP5 || ! $minify_enabled): ?> disabled="disabled"<?php endif; ?> />
|
68 |
+
<label><input type="checkbox" name="cdn.minify.enable" value="1"<?php checked($this->_config->get_boolean('cdn.minify.enable'), true); ?><?php if (! W3TC_PHP5 || ! $minify_enabled): ?> disabled="disabled"<?php endif; ?> /> Host minified <acronym title="Cascading Style Sheet">CSS</acronym> and <acronym title="JavaScript">JS</acronym> files</label><br />
|
69 |
+
<span class="description">If checked, minified <acronym>CSS</acronym> and <acronym>JS</acronym> files will be hosted with the <acronym title="Content Delivery Network">CDN</acronym>.</span>
|
70 |
</th>
|
71 |
<?php if (! $cdn_mirror): ?>
|
72 |
<td>
|
73 |
+
<input class="button cdn_export" type="button" name="minify" value="Upload minify files"<?php if (! W3TC_PHP5 || ! $minify_enabled): ?> disabled="disabled"<?php endif; ?> />
|
74 |
</td>
|
75 |
<?php endif; ?>
|
76 |
</tr>
|
77 |
<tr>
|
78 |
<th<?php if ($cdn_mirror): ?> colspan="2"<?php endif; ?>>
|
79 |
<input type="hidden" name="cdn.custom.enable" value="0" />
|
80 |
+
<label><input type="checkbox" name="cdn.custom.enable" value="1"<?php checked($this->_config->get_boolean('cdn.custom.enable'), true); ?> /> Host custom files</label><br />
|
81 |
+
<span class="description">If checked, any file names or paths specified in the "custom file list" field below will be hosted with the <acronym title="Content Delivery Network">CDN</acronym>.</span>
|
82 |
</th>
|
83 |
<?php if (! $cdn_mirror): ?>
|
84 |
<td>
|
87 |
<?php endif; ?>
|
88 |
</tr>
|
89 |
<tr>
|
90 |
+
<th style="width: 300px;"><label for="cdn_includes_files">wp-includes file types to upload:</label></th>
|
91 |
<td>
|
92 |
<input id="cdn_includes_files" type="text" name="cdn.includes.files" value="<?php echo htmlspecialchars($this->_config->get_string('cdn.includes.files')); ?>" size="40" /><br />
|
93 |
<span class="description">Specify the file types within the WordPress core to host with the <acronym title="Content Delivery Network">CDN</acronym>.</span>
|
103 |
<tr>
|
104 |
<th valign="top"><label for="cdn_custom_files">Custom file list:</label></th>
|
105 |
<td>
|
106 |
+
<textarea id="cdn_custom_files" name="cdn.custom.files" cols="40" rows="5"><?php echo htmlspecialchars(implode("\r\n", $this->_config->get_array('cdn.custom.files'))); ?></textarea><br />
|
107 |
<span class="description">Specify any files outside of theme or other common directories to host with the <acronym title="Content Delivery Network">CDN</acronym>.</span>
|
108 |
</td>
|
109 |
</tr>
|
110 |
<tr>
|
111 |
<th valign="top"><label for="cdn_reject_ua">Rejected user agents:</label></th>
|
112 |
<td>
|
113 |
+
<textarea id="cdn_reject_ua" name="cdn.reject.ua" cols="40" rows="5"><?php echo htmlspecialchars(implode("\r\n", $this->_config->get_array('cdn.reject.ua'))); ?></textarea><br />
|
114 |
<span class="description">Specify user agents that should not access files hosted with the <acronym title="Content Delivery Network">CDN</acronym>.</span>
|
115 |
</td>
|
116 |
</tr>
|
117 |
+
<tr>
|
118 |
+
<th valign="top"><label for="cdn_reject_files">Rejected files:</label></th>
|
119 |
+
<td>
|
120 |
+
<textarea id="cdn_reject_files" name="cdn.reject.files" cols="40" rows="5"><?php echo htmlspecialchars(implode("\r\n", $this->_config->get_array('cdn.reject.files'))); ?></textarea><br />
|
121 |
+
<span class="description">Specify the path of files that should not use the <acronym title="Content Delivery Network">CDN</acronym>.</span>
|
122 |
+
</td>
|
123 |
+
</tr>
|
124 |
<?php if (! $cdn_mirror): ?>
|
125 |
<tr>
|
126 |
<th colspan="2">
|
inc/options/common/header.phtml
CHANGED
@@ -14,13 +14,13 @@ jQuery(function($) {
|
|
14 |
<h2>W3 Total Cache</h2>
|
15 |
|
16 |
<?php foreach ($this->_errors as $error): ?>
|
17 |
-
<div
|
18 |
<p><?php echo $error; ?></p>
|
19 |
</div>
|
20 |
<?php endforeach; ?>
|
21 |
|
22 |
<?php foreach ($this->_notes as $note): ?>
|
23 |
-
<div
|
24 |
<p><?php echo $note; ?></p>
|
25 |
</div>
|
26 |
<?php endforeach; ?>
|
14 |
<h2>W3 Total Cache</h2>
|
15 |
|
16 |
<?php foreach ($this->_errors as $error): ?>
|
17 |
+
<div class="error">
|
18 |
<p><?php echo $error; ?></p>
|
19 |
</div>
|
20 |
<?php endforeach; ?>
|
21 |
|
22 |
<?php foreach ($this->_notes as $note): ?>
|
23 |
+
<div class="updated fade">
|
24 |
<p><?php echo $note; ?></p>
|
25 |
</div>
|
26 |
<?php endforeach; ?>
|
inc/options/dbcache.phtml
CHANGED
@@ -46,7 +46,7 @@
|
|
46 |
<tr>
|
47 |
<th valign="top"><label for="dbcache_reject_sql">Ignored query stems:</label></th>
|
48 |
<td>
|
49 |
-
<textarea id="dbcache_reject_sql" name="dbcache.reject.sql" cols="
|
50 |
<span class="description">Do not cache queries that contain these input contents. The entered prefix (set in wp-config.php) will be replaced with current database prefix (default: wp_).</span>
|
51 |
</td>
|
52 |
</tr>
|
46 |
<tr>
|
47 |
<th valign="top"><label for="dbcache_reject_sql">Ignored query stems:</label></th>
|
48 |
<td>
|
49 |
+
<textarea id="dbcache_reject_sql" name="dbcache.reject.sql" cols="40" rows="5"><?php echo htmlspecialchars(implode("\r\n", $this->_config->get_array('dbcache.reject.sql'))); ?></textarea><br />
|
50 |
<span class="description">Do not cache queries that contain these input contents. The entered prefix (set in wp-config.php) will be replaced with current database prefix (default: wp_).</span>
|
51 |
</td>
|
52 |
</tr>
|
inc/options/faq.phtml
CHANGED
@@ -94,7 +94,7 @@
|
|
94 |
<li><a href="#q76">Hang on, don't I need to modify my <acronym title="Cascading Style Sheet">CSS</acronym> files so they'll work on the <acronym title="Content Delivery Network">CDN</acronym>?</a></li>
|
95 |
<li><a href="#q77">I don't have time to deal with this, but I know I need it. Will you help me?</a></li>
|
96 |
<li><a href="#q92">What about query string variables on <acronym title="Cascading Style Sheet">CSS</acronym> and <acronym title="JavaScript">JS</acronym>, do they matter?</a></li>
|
97 |
-
<li><a href="#q95">Is this plugin comptatible with GD Star Rating?</li>
|
98 |
<li><a href="#q96">How do I cache only the home page?</a></li>
|
99 |
<li><a href="#q97">I see garbage characters instead of the normal web site, what's going on here?</a></li>
|
100 |
<li><a href="#q98">What is the purpose of the "Media Library Import" tool and how do I use it?</a></li>
|
@@ -189,13 +189,15 @@
|
|
189 |
<li><a href="http://www.mozilla.com/firefox/" target="_blank">Mozilla Firefox</a> + <a href="http://getfirebug.com/" target="_blank">Firebug</a> + <a href="http://stevesouders.com/hammerhead/" target="_blank">Hammerhead</a></li>
|
190 |
<li><a href="http://www.google.com/chrome" target="_blank">Google Chrome</a> + <a href="http://code.google.com/webtoolkit/speedtracer/" target="_blank">Google Speed Tracer</a></li>
|
191 |
</ul>
|
|
|
|
|
|
|
|
|
|
|
192 |
<ul>
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
</ul>
|
197 |
-
<ul>
|
198 |
-
<li><a href="http://www.port80software.com/tools/compresscheck.asp" target="_blank">Port80 Compression Check</a> (requires <acronym title="Microsoft Internet Explorer">MSIE</acronym>6 support to be enabled)</li>
|
199 |
<li><a href="http://www.gidnetwork.com/tools/gzip-test.php" target="_blank">A simple online web page compression / deflate / <acronym title="GNU zip">gzip</acronym> test tool</a></li>
|
200 |
<li><a href="http://www.websiteoptimization.com/services/analyze/" target="_blank">Web Page Analyzer</a></li>
|
201 |
</ul>
|
@@ -428,7 +430,7 @@ No, you can drag and drop them into the desired order on the minify settings pag
|
|
428 |
Yes, you can specify which file types you would like served by <acronym title="Content Delivery Network">CDN</acronym> and they will be uploaded and always downloaded from that location. This includes the smilies, JavaScript files et al. By default we take care of them all.</p>
|
429 |
<p align="right"><a href="#toc">back to top</a></p>
|
430 |
<p id="q73"><strong>What if I don't want to work with a <acronym title="Content Delivery Network">CDN</acronym> right now, is there any other use for this feature?</strong><br />
|
431 |
-
Yes! You can take advantage of the <a href="http://www.mozilla.org/projects/netlib/http/pipelining-faq.html">pipelining</a> support in some browsers by creating a sub-domain for the static content for your site. So you could
|
432 |
<p align="right"><a href="#toc">back to top</a></p>
|
433 |
<p id="q74"><strong>Are minified files uploaded to my <acronym title="Content Delivery Network">CDN</acronym> provider?</strong><br />
|
434 |
Yes, any <acronym title="Cascading Style Sheet">CSS</acronym> and <acronym title="JavaScript">JS</acronym> you manage with the plugin are minified before being uploaded to your <acronym title="Content Delivery Network">CDN</acronym>. You don't have to make any special changes to your theme. We encourage you to make sure that your provider supports <acronym title="Hypertext Transfer Protocol">HTTP</acronym> compression as the benefit of having your static assets available from more than one <acronym title="Point of Presence">POP</acronym> alone is not enough.</p>
|
@@ -437,6 +439,7 @@ No, you can drag and drop them into the desired order on the minify settings pag
|
|
437 |
That depends on how you use your blog and where most of your readers read your blog (regionally). Here's a short list:</p>
|
438 |
<ul>
|
439 |
<li><a href="http://www.maxcdn.com/" target="_blank">MaxCDN</a></li>
|
|
|
440 |
<li><a href="http://www.cotendo.com/" target="_blank">Cotendo</a></li>
|
441 |
<li><a href="https://vps.net/cdn-signup" target="_blank">VPS NET</a></li>
|
442 |
<li><a href="http://aws.amazon.com/s3/" target="_blank">Amazon S3</a> / <a href="http://aws.amazon.com/cloudfront/" target="_blank">Cloudfront</a></li>
|
94 |
<li><a href="#q76">Hang on, don't I need to modify my <acronym title="Cascading Style Sheet">CSS</acronym> files so they'll work on the <acronym title="Content Delivery Network">CDN</acronym>?</a></li>
|
95 |
<li><a href="#q77">I don't have time to deal with this, but I know I need it. Will you help me?</a></li>
|
96 |
<li><a href="#q92">What about query string variables on <acronym title="Cascading Style Sheet">CSS</acronym> and <acronym title="JavaScript">JS</acronym>, do they matter?</a></li>
|
97 |
+
<li><a href="#q95">Is this plugin comptatible with GD Star Rating?</a></li>
|
98 |
<li><a href="#q96">How do I cache only the home page?</a></li>
|
99 |
<li><a href="#q97">I see garbage characters instead of the normal web site, what's going on here?</a></li>
|
100 |
<li><a href="#q98">What is the purpose of the "Media Library Import" tool and how do I use it?</a></li>
|
189 |
<li><a href="http://www.mozilla.com/firefox/" target="_blank">Mozilla Firefox</a> + <a href="http://getfirebug.com/" target="_blank">Firebug</a> + <a href="http://stevesouders.com/hammerhead/" target="_blank">Hammerhead</a></li>
|
190 |
<li><a href="http://www.google.com/chrome" target="_blank">Google Chrome</a> + <a href="http://code.google.com/webtoolkit/speedtracer/" target="_blank">Google Speed Tracer</a></li>
|
191 |
</ul>
|
192 |
+
<ul>
|
193 |
+
<li><a href="http://tools.pingdom.com/" target="_blank">Pingdom</a></li>
|
194 |
+
<li><a href="http://www.webpagetest.org/test" target="_blank">WebPagetest</a></li>
|
195 |
+
<li><a href="http://www.gomez.com/instant-test-pro/" target="_blank">Gomez Instant Test Pro</a></li>
|
196 |
+
</ul>
|
197 |
<ul>
|
198 |
+
<li><a href="http://redbot.org/" target="_blank">Resource Expert Droid</a></li>
|
199 |
+
<li><a href="http://www.procata.com/cachetest/" target="_blank">Web Caching Tests</a></li>
|
200 |
+
<li><a href="http://www.port80software.com/tools/compresscheck.asp" target="_blank">Port80 Compression Check</a> (minify requires <acronym title="Microsoft Internet Explorer">MSIE</acronym>6 support to be enabled)</li>
|
|
|
|
|
|
|
201 |
<li><a href="http://www.gidnetwork.com/tools/gzip-test.php" target="_blank">A simple online web page compression / deflate / <acronym title="GNU zip">gzip</acronym> test tool</a></li>
|
202 |
<li><a href="http://www.websiteoptimization.com/services/analyze/" target="_blank">Web Page Analyzer</a></li>
|
203 |
</ul>
|
430 |
Yes, you can specify which file types you would like served by <acronym title="Content Delivery Network">CDN</acronym> and they will be uploaded and always downloaded from that location. This includes the smilies, JavaScript files et al. By default we take care of them all.</p>
|
431 |
<p align="right"><a href="#toc">back to top</a></p>
|
432 |
<p id="q73"><strong>What if I don't want to work with a <acronym title="Content Delivery Network">CDN</acronym> right now, is there any other use for this feature?</strong><br />
|
433 |
+
Yes! You can take advantage of the <a href="http://www.mozilla.org/projects/netlib/http/pipelining-faq.html">pipelining</a> support in some browsers by creating a sub-domain for the static content for your site. So you could select the "Origin Push / Self-hosted" method of the General Settings tab. Create static.domain.com on your server (and update your <acronym title="Domain Name System">DNS</acronym> zone) and then specify the <acronym title="File Transfer Protocol">FTP</acronym> details for it in the plugin configuration panel and you're done. If you disable the scripting options on your server you'll find that your server will actually respond slightly faster from that sub-domain because it's just sending files and not processing them.</p>
|
434 |
<p align="right"><a href="#toc">back to top</a></p>
|
435 |
<p id="q74"><strong>Are minified files uploaded to my <acronym title="Content Delivery Network">CDN</acronym> provider?</strong><br />
|
436 |
Yes, any <acronym title="Cascading Style Sheet">CSS</acronym> and <acronym title="JavaScript">JS</acronym> you manage with the plugin are minified before being uploaded to your <acronym title="Content Delivery Network">CDN</acronym>. You don't have to make any special changes to your theme. We encourage you to make sure that your provider supports <acronym title="Hypertext Transfer Protocol">HTTP</acronym> compression as the benefit of having your static assets available from more than one <acronym title="Point of Presence">POP</acronym> alone is not enough.</p>
|
439 |
That depends on how you use your blog and where most of your readers read your blog (regionally). Here's a short list:</p>
|
440 |
<ul>
|
441 |
<li><a href="http://www.maxcdn.com/" target="_blank">MaxCDN</a></li>
|
442 |
+
<li><a href="http://www.rackspacecloud.com/cloud_hosting_products/files" target="_blank">Rackspace Cloud Files</a></li>
|
443 |
<li><a href="http://www.cotendo.com/" target="_blank">Cotendo</a></li>
|
444 |
<li><a href="https://vps.net/cdn-signup" target="_blank">VPS NET</a></li>
|
445 |
<li><a href="http://aws.amazon.com/s3/" target="_blank">Amazon S3</a> / <a href="http://aws.amazon.com/cloudfront/" target="_blank">Cloudfront</a></li>
|
inc/options/general.phtml
CHANGED
@@ -42,15 +42,15 @@
|
|
42 |
</tr>
|
43 |
</table>
|
44 |
|
45 |
-
<p>Enable minify to combine, remove white space / comments and compress (<acronym title="GNU zip">gzip</acronym> / deflate) your (theme's / plugin's / external) <acronym title="Cascading Style
|
46 |
|
47 |
<table class="form-table">
|
48 |
<tr>
|
49 |
<th valign="top">Minify:</th>
|
50 |
<td>
|
51 |
-
<input type="hidden" name="minify.enabled" value="0" />
|
52 |
<label><input class="enabled" type="checkbox" name="minify.enabled" value="1"<?php checked($minify_enabled, true); ?><?php if (! W3TC_PHP5): ?> disabled="disabled"<?php endif; ?> /> <strong>Enable</strong></label><br />
|
53 |
-
<span class="description">Minification can decrease file size of <acronym title="Hypertext Markup Language">HTML</acronym>, <acronym title="Cascading Style
|
54 |
</td>
|
55 |
</tr>
|
56 |
<tr>
|
@@ -73,7 +73,7 @@
|
|
73 |
<td>
|
74 |
<input type="hidden" name="dbcache.enabled" value="0" />
|
75 |
<label><input class="enabled" type="checkbox" name="dbcache.enabled" value="1"<?php checked($dbcache_enabled, true); ?> /> <strong>Enable</strong></label><br />
|
76 |
-
<span class="description">Caching database objects may decrease the response time of your blog by
|
77 |
</td>
|
78 |
</tr>
|
79 |
<tr>
|
@@ -88,7 +88,7 @@
|
|
88 |
</tr>
|
89 |
</table>
|
90 |
|
91 |
-
<p>Host your wp-includes
|
92 |
|
93 |
<table class="form-table">
|
94 |
<tr>
|
@@ -103,9 +103,9 @@
|
|
103 |
<td>
|
104 |
<select name="cdn.engine">
|
105 |
<option value="mirror"<?php selected($this->_config->get_string('cdn.engine'), 'mirror'); ?>>Origin Pull (Mirror)</option>
|
|
|
106 |
<option value="cf"<?php selected($this->_config->get_string('cdn.engine'), 'cf'); ?><?php if (! W3TC_PHP5 || ! $check_curl): ?> disabled="disabled"<?php endif; ?>>Amazon CloudFront</option>
|
107 |
-
<option value="s3"<?php selected($this->_config->get_string('cdn.engine'), 's3'); ?><?php if (! W3TC_PHP5 || ! $check_curl): ?> disabled="disabled"<?php endif; ?>>Amazon Simple Storage Service (
|
108 |
-
<option value="ftp"<?php selected($this->_config->get_string('cdn.engine'), 'ftp'); ?>>Self-hosted (File Transfer Protocol)</option>
|
109 |
</select><br />
|
110 |
<span class="description">Select the <acronym title="Content Delivery Network">CDN</acronym> type you wish to use.</span>
|
111 |
</td>
|
@@ -119,14 +119,15 @@
|
|
119 |
<th valign="top">Debug Mode:</th>
|
120 |
<td>
|
121 |
<input type="hidden" name="debug" value="0" />
|
122 |
-
<label><input type="checkbox" name="debug" value="1"<?php checked($debug, true); ?> /> <strong>Enable</strong></label
|
|
|
123 |
</td>
|
124 |
</tr>
|
125 |
</table>
|
126 |
|
127 |
<h3>Support Us</h3>
|
128 |
|
129 |
-
<p>We're working to make WordPress better. Please support us
|
130 |
|
131 |
<p>
|
132 |
<label>Link to us:
|
@@ -136,7 +137,7 @@
|
|
136 |
<option value="<?php echo $support_id; ?>"<?php selected($support, $support_id); ?>><?php echo htmlspecialchars($support_name); ?></option>
|
137 |
<?php endforeach; ?>
|
138 |
</select>
|
139 |
-
</label> (easy) or tell your friends with a <
|
140 |
</p>
|
141 |
|
142 |
<p>If you want to place the link manually here is the code:</p>
|
42 |
</tr>
|
43 |
</table>
|
44 |
|
45 |
+
<p>Enable minify to combine, remove white space / comments and compress (<acronym title="GNU zip">gzip</acronym> / deflate) your (theme's / plugin's / external) <acronym title="Cascading Style Sheet">CSS</acronym> and <acronym title="JavaScript">JS</acronym> files.</p>
|
46 |
|
47 |
<table class="form-table">
|
48 |
<tr>
|
49 |
<th valign="top">Minify:</th>
|
50 |
<td>
|
51 |
+
<input type="hidden" name="minify.enabled" value="0"<?php if (! W3TC_PHP5): ?> disabled="disabled"<?php endif; ?> />
|
52 |
<label><input class="enabled" type="checkbox" name="minify.enabled" value="1"<?php checked($minify_enabled, true); ?><?php if (! W3TC_PHP5): ?> disabled="disabled"<?php endif; ?> /> <strong>Enable</strong></label><br />
|
53 |
+
<span class="description">Minification can decrease file size of <acronym title="Hypertext Markup Language">HTML</acronym>, <acronym title="Cascading Style Sheet">CSS</acronym>, <acronym title="JavaScript">JS</acronym> and feeds respectively by ~10% on average.</span>
|
54 |
</td>
|
55 |
</tr>
|
56 |
<tr>
|
73 |
<td>
|
74 |
<input type="hidden" name="dbcache.enabled" value="0" />
|
75 |
<label><input class="enabled" type="checkbox" name="dbcache.enabled" value="1"<?php checked($dbcache_enabled, true); ?> /> <strong>Enable</strong></label><br />
|
76 |
+
<span class="description">Caching database objects may decrease the response time of your blog by up to 100x.</span>
|
77 |
</td>
|
78 |
</tr>
|
79 |
<tr>
|
88 |
</tr>
|
89 |
</table>
|
90 |
|
91 |
+
<p>Host your wp-includes (WordPress' core files), media library, theme images / <acronym title="Cascading Style Sheet">CSS</acronym> / <acronym title="JavaScript">JS</acronym> with your <acronym title="Content Delivery Network">CDN</acronym> provider.</p>
|
92 |
|
93 |
<table class="form-table">
|
94 |
<tr>
|
103 |
<td>
|
104 |
<select name="cdn.engine">
|
105 |
<option value="mirror"<?php selected($this->_config->get_string('cdn.engine'), 'mirror'); ?>>Origin Pull (Mirror)</option>
|
106 |
+
<option value="ftp"<?php selected($this->_config->get_string('cdn.engine'), 'ftp'); ?>>Origin Push / Self-hosted (File Transfer Protocol Upload)</option>
|
107 |
<option value="cf"<?php selected($this->_config->get_string('cdn.engine'), 'cf'); ?><?php if (! W3TC_PHP5 || ! $check_curl): ?> disabled="disabled"<?php endif; ?>>Amazon CloudFront</option>
|
108 |
+
<option value="s3"<?php selected($this->_config->get_string('cdn.engine'), 's3'); ?><?php if (! W3TC_PHP5 || ! $check_curl): ?> disabled="disabled"<?php endif; ?>>Amazon Simple Storage Service (S3)</option>
|
|
|
109 |
</select><br />
|
110 |
<span class="description">Select the <acronym title="Content Delivery Network">CDN</acronym> type you wish to use.</span>
|
111 |
</td>
|
119 |
<th valign="top">Debug Mode:</th>
|
120 |
<td>
|
121 |
<input type="hidden" name="debug" value="0" />
|
122 |
+
<label><input type="checkbox" name="debug" value="1"<?php checked($debug, true); ?> /> <strong>Enable</strong></label><br />
|
123 |
+
<span class="description">If selected, detailed caching information will be appear at the end of each page in a <acronym title="Hypertext Markup Language">HTML</acronym> comment. View a page's source code to review.</span>
|
124 |
</td>
|
125 |
</tr>
|
126 |
</table>
|
127 |
|
128 |
<h3>Support Us</h3>
|
129 |
|
130 |
+
<p>We're working to make WordPress better. Please support us, here's how:</p>
|
131 |
|
132 |
<p>
|
133 |
<label>Link to us:
|
137 |
<option value="<?php echo $support_id; ?>"<?php selected($support, $support_id); ?>><?php echo htmlspecialchars($support_name); ?></option>
|
138 |
<?php endforeach; ?>
|
139 |
</select>
|
140 |
+
</label> (easy) or tell your friends with a <input type="button" class="button button-tweet" value="tweet" /> (easiest).
|
141 |
</p>
|
142 |
|
143 |
<p>If you want to place the link manually here is the code:</p>
|
inc/options/install.phtml
CHANGED
@@ -4,12 +4,12 @@
|
|
4 |
<h3>Installation</h3>
|
5 |
|
6 |
<ol>
|
7 |
-
<li>Disable and remove any other caching plugin you may be using — most plugins have uninstall procedures you can follow. Make sure wp-content/ has 777 permissions before proceeding, e.g.: # chmod 777 /var/www/vhosts/domain.com/httpdocs/wp-content
|
8 |
-
<li>Ensure that wp-config.php contains the statement
|
9 |
-
<li>
|
10 |
-
<li>
|
11 |
-
<li>
|
12 |
-
<li>
|
13 |
<li>You're done! Get back to blogging!</li>
|
14 |
</ol>
|
15 |
Check out the <acronym title="Frequently Asked Questions">FAQ</acronym> for more details on <a href="options-general.php?page=w3-total-cache/w3-total-cache.php&tab=faq">usage</a>.
|
@@ -25,6 +25,10 @@
|
|
25 |
# yum install php-devel</li>
|
26 |
<li>Install apxs with the following command:<br />
|
27 |
# yum install httpd-devel</li>
|
|
|
|
|
|
|
|
|
28 |
</ol>
|
29 |
<hr />
|
30 |
<p id="memcached"><strong>Memcached (Daemon) Installation:</strong><br />
|
@@ -34,10 +38,7 @@
|
|
34 |
# yum install libevent<br />
|
35 |
<br />
|
36 |
If this succeeds skip to #5. If this fails, then let's compile. Download and extract the <a href="http://www.monkey.org/~provos/libevent/" target="_blank">latest stable version</a>:<br />
|
37 |
-
# cd /usr/local/src<
|
38 |
-
# wget <a href="http://monkey.org/~provos/libevent-1.4.12-stable.tar.gz">http://monkey.org/~provos/libevent-1.4.12-stable.tar.gz</a><br />
|
39 |
-
# gunzip -c libevent-1.4.12-stable.tar.gz | tar xf -<br />
|
40 |
-
# cd libevent-1.4.12-stable</li>
|
41 |
<li>Let's compile:<br />
|
42 |
# ./configure && make && make install</li>
|
43 |
<li>In the output you should see:<br />
|
@@ -50,18 +51,15 @@
|
|
50 |
<li>Configure your server for the new install:<br />
|
51 |
# ldconfig -v</li>
|
52 |
<li>Now find the <a href="http://www.danga.com/memcached/download.bml" target="_blank">latest stable memcached</a>, download and extract:<br />
|
53 |
-
# cd /usr/local/src<
|
54 |
-
# wget <a href="http://memcached.googlecode.com/files/memcached-1.4.3.tar.gz" target="_blank">http://memcached.googlecode.com/files/memcached-1.4.3.tar.gz</a><br />
|
55 |
-
# gunzip -c memcached-1.4.3.tar.gz | tar xf -<br />
|
56 |
-
# cd memcached-1.4.3</li>
|
57 |
<li>Let's compile:<br />
|
58 |
# ./configure && make && make install</li>
|
59 |
<li>Make sure memcached is starts automatically on server boot:<br />
|
60 |
# touch /etc/init.d/memcached<br />
|
61 |
-
# echo '#!/bin/sh -e'
|
62 |
-
# echo '/usr/local/bin/memcached -d -m 128 -p 11211 -u nobody -l localhost'
|
63 |
# chmod u+x /etc/init.d/memcached<br />
|
64 |
-
# echo '/etc/init.d/memcached'
|
65 |
<li>And finally, let's start memcached:<br />
|
66 |
# /etc/init.d/memcached</li>
|
67 |
</ol>
|
@@ -70,44 +68,42 @@
|
|
70 |
<li><a href="http://pureform.wordpress.com/2008/01/10/installing-memcache-on-windows-for-php/" target="_blank">Installing memcache on Windows for <acronym title="Hypertext Preprocessor">PHP</acronym></a></li>
|
71 |
<li><a href="http://pecl4win.php.net/ext.php/php_memcache.dll" target="_blank"><acronym title="PHP Extension Community Library">PECL</acronym> memcached Extensions</a> </li>
|
72 |
</ul>
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
<ol>
|
77 |
<li>Either use <acronym title="PHP Extension Community Library">PECL</acronym> (and skip to #4 if successful):<br />
|
78 |
# pecl install memcache</li>
|
79 |
<li>Or via compilation. Download the <a href="http://pecl.php.net/package/memcache" target="_blank">latest stable version</a> and extract:<br />
|
80 |
-
# cd /usr/local/src
|
81 |
-
|
82 |
-
#
|
83 |
-
|
84 |
-
|
85 |
-
# phpize && ./configure && make && make install<br />
|
86 |
-
# cp -p /usr/local/src/memcache-2.2.5/modules/memcache.so /usr/lib/php/modules/</li>
|
87 |
-
<li>Make sure the module is loaded:<br />
|
88 |
-
# echo "extension=memcache.so" > /etc/php.d/memcache.ini<br />
|
89 |
-
<br />
|
90 |
-
or you can also use the memcache.ini file we prepared for you:<br />
|
91 |
-
# cp -p /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/w3-total-cache/ini/memcache.ini /etc/php.d/</li>
|
92 |
<li>Finally restart apache:<br />
|
93 |
# /etc/init.d/httpd restart</li>
|
94 |
<li>You're done! Memcache should now be available. If the following command retuns anything, you're all set:<br />
|
95 |
# php -r 'phpinfo();' | grep 'memcache'</li>
|
96 |
</ol>
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
<ol>
|
101 |
-
<li>Install <acronym title="Alternative PHP Cache">APC</acronym> using the <acronym title="PHP Extension Community Library">PECL</acronym> command:<br />
|
102 |
# pecl install apc</li>
|
103 |
-
<li>
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
|
|
|
|
|
|
|
|
|
|
111 |
# php -r 'phpinfo();' | grep 'apc'</li>
|
112 |
</ol>
|
113 |
<p>For windows users we recommend checking the following sites for more installation tips:</p>
|
@@ -115,34 +111,49 @@
|
|
115 |
<li><a href="http://www.sitebuddy.com/PHP/Accelerators/apc_windows_binaries_builds" target="_blank"><acronym title="Alternative PHP Cache">APC</acronym> binaries for <acronym title="Hypertext Preprocessor">PHP</acronym> 5.x (windows builds)</a> </li>
|
116 |
<li><a href="http://pecl4win.php.net/ext.php/php_apc.dll" target="_blank"><acronym title="PHP Extension Community Library">PECL</acronym> <acronym title="Alternative PHP Cache">APC</acronym> Extensions</a> </li>
|
117 |
</ul>
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
<ol>
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
</ol>
|
141 |
<hr />
|
142 |
<p><strong>Note(s):</strong></p>
|
143 |
<ul>
|
144 |
-
<li>The provided instructions are for CentOS, however we can provide others based on <a href="mailto:wordpressexperts@w3-edge.com">your requests</a>.</li>
|
145 |
-
<li>In the case where
|
146 |
<li>Restarting the web server will empty your <acronym title="Alternative PHP Cache">APC</acronym> cache, which means it will have to be rebuilt over time and your site's performance will suffer during this period. Still, <acronym title="Alternative PHP Cache">APC</acronym> should be installed in any case to maximize WordPress performance.</li>
|
147 |
<li>Consider using memcached for objects that must persist across web server restarts or that you wish to share amongst your pool of servers (or cluster), e.g.: database objects or page cache.</li>
|
148 |
<li>Some yum or mirrors may not have the necessary packages, in such cases you may have to do a manual installation.</li>
|
4 |
<h3>Installation</h3>
|
5 |
|
6 |
<ol>
|
7 |
+
<li>Disable and remove any other caching plugin you may be using — most plugins have uninstall procedures you can follow. Make sure wp-content/ has 777 permissions before proceeding, e.g.: # chmod 777 /var/www/vhosts/domain.com/httpdocs/wp-content/ using your web hosting control panel or your <acronym title="Secure Shell">SSH</acronym> account.</li>
|
8 |
+
<li>Ensure that wp-config.php (typically found in the root directory) contains the statement: define('WP_CACHE', true); If you previously used a caching plugin, this statement is likely to exist already.</li>
|
9 |
+
<li>Set the permissions of wp-content back to 755, e.g.: # chmod 755 /var/www/vhosts/domain.com/httpdocs/wp-content/</li>
|
10 |
+
<li>On the "<a href="options-general.php?page=w3-total-cache/w3-total-cache.php&tab=general">General Settings</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>
|
11 |
+
<li>Optional: On the "<a href="options-general.php?page=w3-total-cache/w3-total-cache.php&tab=minify">Minify Settings</a>" tab all of the recommended settings are preset. View your site's <acronym title="Hypertext Markup Language">HTML</acronym> source and search for .css and .js files and then specify any <acronym title="Cascading Style Sheet">CSS</acronym> and <acronym title="JavaScript">JS</acronym> files in the respective section. In the case of <acronym title="JavaScript">JS</acronym> files you can (optionally) specify the type and location of the embedding using the drop down menu. See the plugin's <a href="options-general.php?page=w3-total-cache/w3-total-cache.php&tab=faq">FAQ</a> for more information on usage.</li>
|
12 |
+
<li>Optional: If you already have a content delivery network (<acronym title="Content Delivery Network">CDN</acronym>) provider, proceed to the "<a href="options-general.php?page=w3-total-cache/w3-total-cache.php&tab=cdn"><acronym title="Content Delivery Network">CDN</acronym> Settings</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 <acronym title="Content Delivery Network">CDN</acronym> Setting 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 <acronym title="Content Delivery Network">CDN</acronym> tab accordingly. Be sure to <acronym title="File Transfer Protocol">FTP</acronym> upload the appropriate files, using the available upload buttons.</li>
|
13 |
<li>You're done! Get back to blogging!</li>
|
14 |
</ol>
|
15 |
Check out the <acronym title="Frequently Asked Questions">FAQ</acronym> for more details on <a href="options-general.php?page=w3-total-cache/w3-total-cache.php&tab=faq">usage</a>.
|
25 |
# yum install php-devel</li>
|
26 |
<li>Install apxs with the following command:<br />
|
27 |
# yum install httpd-devel</li>
|
28 |
+
<li>Make sure GCC is up-to-date:<br />
|
29 |
+
# yum install gcc make</li>
|
30 |
+
<li>Make sure ZLIB is fully installed:<br />
|
31 |
+
# yum install zlib-devel</li>
|
32 |
</ol>
|
33 |
<hr />
|
34 |
<p id="memcached"><strong>Memcached (Daemon) Installation:</strong><br />
|
38 |
# yum install libevent<br />
|
39 |
<br />
|
40 |
If this succeeds skip to #5. If this fails, then let's compile. Download and extract the <a href="http://www.monkey.org/~provos/libevent/" target="_blank">latest stable version</a>:<br />
|
41 |
+
# cd /usr/local/src && wget <a href="http://monkey.org/~provos/libevent-1.4.12-stable.tar.gz" target="_blank">http://monkey.org/~provos/libevent-1.4.12-stable.tar.gz</a> && tar -xzf libevent-1.4.12-stable.tar.gz && cd libevent-1.4.12-stable</li>
|
|
|
|
|
|
|
42 |
<li>Let's compile:<br />
|
43 |
# ./configure && make && make install</li>
|
44 |
<li>In the output you should see:<br />
|
51 |
<li>Configure your server for the new install:<br />
|
52 |
# ldconfig -v</li>
|
53 |
<li>Now find the <a href="http://www.danga.com/memcached/download.bml" target="_blank">latest stable memcached</a>, download and extract:<br />
|
54 |
+
# cd /usr/local/src && wget <a href="http://memcached.googlecode.com/files/memcached-1.4.3.tar.gz" target="_blank">http://memcached.googlecode.com/files/memcached-1.4.3.tar.gz</a> && tar -xzf memcached-1.4.3.tar.gz && cd memcached-1.4.3</li>
|
|
|
|
|
|
|
55 |
<li>Let's compile:<br />
|
56 |
# ./configure && make && make install</li>
|
57 |
<li>Make sure memcached is starts automatically on server boot:<br />
|
58 |
# touch /etc/init.d/memcached<br />
|
59 |
+
# echo '#!/bin/sh -e' >> /etc/init.d/memcached<br />
|
60 |
+
# echo '/usr/local/bin/memcached -d -m 128 -p 11211 -u nobody -l localhost' >> /etc/init.d/memcached<br />
|
61 |
# chmod u+x /etc/init.d/memcached<br />
|
62 |
+
# echo '/etc/init.d/memcached' >> /etc/rc.local</li>
|
63 |
<li>And finally, let's start memcached:<br />
|
64 |
# /etc/init.d/memcached</li>
|
65 |
</ol>
|
68 |
<li><a href="http://pureform.wordpress.com/2008/01/10/installing-memcache-on-windows-for-php/" target="_blank">Installing memcache on Windows for <acronym title="Hypertext Preprocessor">PHP</acronym></a></li>
|
69 |
<li><a href="http://pecl4win.php.net/ext.php/php_memcache.dll" target="_blank"><acronym title="PHP Extension Community Library">PECL</acronym> memcached Extensions</a> </li>
|
70 |
</ul>
|
71 |
+
<hr />
|
72 |
+
<p id="memcache"><strong><acronym title="PHP Extension Community Library">PECL</acronym> Memcache Module Installation:</strong><br />
|
73 |
+
<em>Time required: 1 minute</em></p>
|
74 |
<ol>
|
75 |
<li>Either use <acronym title="PHP Extension Community Library">PECL</acronym> (and skip to #4 if successful):<br />
|
76 |
# pecl install memcache</li>
|
77 |
<li>Or via compilation. Download the <a href="http://pecl.php.net/package/memcache" target="_blank">latest stable version</a> and extract:<br />
|
78 |
+
# cd /usr/local/src/ && wget <a href="http://pecl.php.net/get/memcache-2.2.5.tgz" target="_blank">http://pecl.php.net/get/memcache-2.2.5.tgz</a> && tar -xzf memcache-2.2.5.tgz && cd memcache-2.2.5</li>
|
79 |
+
<li>Now we start to compile:<br />
|
80 |
+
# phpize && ./configure && make && make install</li>
|
81 |
+
<li>You can also use the memcache.ini file we prepared for you:<br />
|
82 |
+
# cp /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/w3-total-cache/ini/memcache.ini /etc/php.d/</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
<li>Finally restart apache:<br />
|
84 |
# /etc/init.d/httpd restart</li>
|
85 |
<li>You're done! Memcache should now be available. If the following command retuns anything, you're all set:<br />
|
86 |
# php -r 'phpinfo();' | grep 'memcache'</li>
|
87 |
</ol>
|
88 |
+
<hr />
|
89 |
+
<p id="APC"><strong><acronym title="PHP Extension Community Library">PECL</acronym> <acronym title="Alternative PHP Cache">APC</acronym> Installation:</strong><br />
|
90 |
+
<em>Time required: 1 minute</em></p>
|
91 |
<ol>
|
92 |
+
<li>Install <acronym title="Alternative PHP Cache">APC</acronym> using the <acronym title="PHP Extension Community Library">PECL</acronym> command (and skip to #5 if successful):<br />
|
93 |
# pecl install apc</li>
|
94 |
+
<li>Or via compilation. Download the <a href="http://pecl.php.net/package/APC" target="_blank">latest stable version</a> and extract:<br />
|
95 |
+
# cd /usr/local/src && wget <a href="http://pecl.php.net/get/APC-3.0.19.tgz" target="_blank">http://pecl.php.net/get/APC-3.0.19.tgz</a> && tar -xzf APC-3.0.19.tgz && cd APC-3.0.19</li>
|
96 |
+
<li>Note the path returned for the following command:<br />
|
97 |
+
# whereis php-config</li>
|
98 |
+
<li>Use the output from #2 to modify the --with-apxs and --with-php-config flags in the following compile command:<br />
|
99 |
+
# phpize && ./configure --enable-apc --enable-apc-mmap --with-apxs=/usr/bin/phpize --with-php-config=/usr/bin/php-config && make && make install<br />
|
100 |
+
<br />The result should be similar to:<br />
|
101 |
+
Installing shared extensions: /usr/lib/php/modules/</li>
|
102 |
+
<li>You can also use the apc.ini file we prepared for you:<br />
|
103 |
+
# cp /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/w3-total-cache/ini/apc.ini /etc/php.d/</li>
|
104 |
+
<li>Restart apache when ready:<br />
|
105 |
+
# /etc/init.d/httpd restart</li>
|
106 |
+
<li>You're done! <acronym title="Alternative PHP Cache">APC</acronym> should now be available. If the following command retuns anything, you're all set:<br />
|
107 |
# php -r 'phpinfo();' | grep 'apc'</li>
|
108 |
</ol>
|
109 |
<p>For windows users we recommend checking the following sites for more installation tips:</p>
|
111 |
<li><a href="http://www.sitebuddy.com/PHP/Accelerators/apc_windows_binaries_builds" target="_blank"><acronym title="Alternative PHP Cache">APC</acronym> binaries for <acronym title="Hypertext Preprocessor">PHP</acronym> 5.x (windows builds)</a> </li>
|
112 |
<li><a href="http://pecl4win.php.net/ext.php/php_apc.dll" target="_blank"><acronym title="PHP Extension Community Library">PECL</acronym> <acronym title="Alternative PHP Cache">APC</acronym> Extensions</a> </li>
|
113 |
</ul>
|
114 |
+
<hr />
|
115 |
+
<p id="eAccelerator"><strong>eAccelerator Installation:</strong><br />
|
116 |
+
<em>Time required: 1 minute</em></p>
|
117 |
+
<ol>
|
118 |
+
<li>If using <acronym title="Hypertext Preprocessor">PHP</acronym> v5.2+, download the <a href="http://bart.eaccelerator.net/source/0.9.6/eaccelerator-0.9.6-rc1.tar.bz2" target="_blank">latest compatible version</a> and extract:<br />
|
119 |
+
# cd /usr/local/src && wget <a href="http://bart.eaccelerator.net/source/0.9.6/eaccelerator-0.9.6-rc1.tar.bz2" target="_blank">http://bart.eaccelerator.net/source/0.9.6/eaccelerator-0.9.6-rc1.tar.bz2</a> && tar -xjf eaccelerator-0.9.6-rc1.tar.bz2 && cd eaccelerator-0.9.6-rc1</li>
|
120 |
+
<li>Note the path returned for the following command:<br />
|
121 |
+
# whereis php-config</li>
|
122 |
+
<li>Use the output from #2 to modify the --with-php-config flag in the following compile command:<br />
|
123 |
+
# phpize && ./configure --enable-eaccelerator=shared --with-php-config=/usr/bin/php-config && make && make install<br />
|
124 |
+
<br />The result should be similar to:<br />
|
125 |
+
Installing shared extensions: /usr/lib/php/modules/</li>
|
126 |
+
<li>You can also use the eaccelerator.ini file we prepared for you:<br />
|
127 |
+
# cp /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/w3-total-cache/ini/eaccelerator.ini /etc/php.d/</li>
|
128 |
+
<li>Restart apache when ready:<br />
|
129 |
+
# /etc/init.d/httpd restart</li>
|
130 |
+
<li>You're done! eAccelerator should now be available. If the following command retuns anything, you're all set:<br />
|
131 |
+
# php -r 'phpinfo();' | grep 'eaccelerator'</li>
|
132 |
+
</ol>
|
133 |
+
<hr />
|
134 |
+
<p id="XCache"><strong>XCache Installation:</strong><br />
|
135 |
+
<em>Time required: 1 minute</em></p>
|
136 |
+
<ol>
|
137 |
+
<li>Download the <a href="http://xcache.lighttpd.net/pub/Releases/1.3.0/xcache-1.3.0.tar.gz" target="_blank">latest compatible version</a> and extract:<br />
|
138 |
+
# cd /usr/local/src && wget <a href="http://xcache.lighttpd.net/pub/Releases/1.3.0/xcache-1.3.0.tar.gz" target="_blank">http://xcache.lighttpd.net/pub/Releases/1.3.0/xcache-1.3.0.tar.gz</a> && tar -xzf xcache-1.3.0.tar.gz && cd xcache-1.3.0</li>
|
139 |
+
<li>Note the path returned for the following command:<br />
|
140 |
+
# whereis php-config</li>
|
141 |
+
<li>Use the output from #2 to modify the --with-php-config flag in the following compile command:<br />
|
142 |
+
# phpize && ./configure --with-php-config=/usr/bin/php-config --enable-xcache --enable-xcache-optimizer --enable-xcache-coverager && make && make install<br />
|
143 |
+
<br />The result should be similar to:<br />
|
144 |
+
Installing shared extensions: /usr/lib/php/modules/</li>
|
145 |
+
<li>You can also use the eaccelerator.ini file we prepared for you:<br />
|
146 |
+
# cp /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/w3-total-cache/ini/xcache.ini /etc/php.d/</li>
|
147 |
+
<li>Restart apache when ready:<br />
|
148 |
+
# /etc/init.d/httpd restart</li>
|
149 |
+
<li>You're done! eAccelerator should now be available. If the following command retuns anything, you're all set:<br />
|
150 |
+
# php -r 'phpinfo();' | grep 'xcache'</li>
|
151 |
</ol>
|
152 |
<hr />
|
153 |
<p><strong>Note(s):</strong></p>
|
154 |
<ul>
|
155 |
+
<li>The provided instructions are for 32-bit CentOS, however we can provide others based on <a href="mailto:wordpressexperts@w3-edge.com">your requests</a>.</li>
|
156 |
+
<li>In the case where Apache is not used, the .htaccess file located in the root directory of the WordPress installation, wp-content/w3tc/pgcache/.htaccess and wp-content/w3tc/min/.htaccess contain directives that must be re-created for your web server software.</li>
|
157 |
<li>Restarting the web server will empty your <acronym title="Alternative PHP Cache">APC</acronym> cache, which means it will have to be rebuilt over time and your site's performance will suffer during this period. Still, <acronym title="Alternative PHP Cache">APC</acronym> should be installed in any case to maximize WordPress performance.</li>
|
158 |
<li>Consider using memcached for objects that must persist across web server restarts or that you wish to share amongst your pool of servers (or cluster), e.g.: database objects or page cache.</li>
|
159 |
<li>Some yum or mirrors may not have the necessary packages, in such cases you may have to do a manual installation.</li>
|
inc/options/minify.phtml
CHANGED
@@ -42,14 +42,14 @@
|
|
42 |
<th colspan="2">
|
43 |
<input type="hidden" name="minify.rewrite" value="0" />
|
44 |
<label><input type="checkbox" name="minify.rewrite" value="1"<?php checked($this->_config->get_boolean('minify.rewrite'), true); ?> /> Rewrite <acronym title="Uniform Resource Locator">URL</acronym> structure</label><br />
|
45 |
-
<span class="description">If disabled, <acronym title="Cascading Style
|
46 |
</th>
|
47 |
</tr>
|
48 |
<tr>
|
49 |
<th colspan="2">
|
50 |
<input type="hidden" name="minify.upload" value="0" />
|
51 |
<label><input type="checkbox" name="minify.upload" value="1"<?php checked($this->_config->get_boolean('minify.upload'), true); ?> /> Automatically upload modified files</label><br />
|
52 |
-
<span class="description">If CDN is enabled (and not using the origin pull method), your minified files will be automatically uploaded.</span>
|
53 |
</th>
|
54 |
</tr>
|
55 |
<tr>
|
@@ -65,7 +65,7 @@
|
|
65 |
</tr>
|
66 |
<tr>
|
67 |
<th><label for="minify_file_gc">Garbage collection interval:</label></th>
|
68 |
-
<td><input id="minify_file_gc" type="text" name="minify.file.gc" value="<?php echo $this->_config->get_integer('minify.file.gc'); ?>" size="8"<?php if ($this->_config->get_string('minify.engine') != 'file'
|
69 |
<br /><span class="description">If caching to disk, specify how frequently expired cache data is removed. For busy sites, a lower value is best.</span>
|
70 |
</td>
|
71 |
</tr>
|
@@ -79,7 +79,7 @@
|
|
79 |
<input type="hidden" name="minify.html.strip.crlf" value="0" />
|
80 |
<label><input id="html_enabled" type="checkbox" name="minify.html.enable" value="1"<?php checked($this->_config->get_boolean('minify.html.enable'), true); ?> /> Minify</label><br />
|
81 |
<label><input class="html_enabled" type="checkbox" name="minify.html.reject.admin" value="1"<?php checked($this->_config->get_boolean('minify.html.reject.admin'), true); ?> /> Don't Minify <acronym title="Hypertext Markup Language">HTML</acronym> for logged in administrators</label><br />
|
82 |
-
<label><input class="html_enabled" type="checkbox" name="minify.html.inline.css" value="1"<?php checked($this->_config->get_boolean('minify.html.inline.css'), true); ?> /> Inline <acronym title="Cascading Style
|
83 |
<label><input class="html_enabled" type="checkbox" name="minify.html.inline.js" value="1"<?php checked($this->_config->get_boolean('minify.html.inline.js'), true); ?> /> Inline <acronym title="JavaScript">JS</acronym> Minification</label><br />
|
84 |
<label><input class="html_enabled" type="checkbox" name="minify.html.strip.crlf" value="1"<?php checked($this->_config->get_boolean('minify.html.strip.crlf'), true); ?> /> Line break removal</label><br />
|
85 |
</td>
|
@@ -100,7 +100,7 @@
|
|
100 |
</td>
|
101 |
</tr>
|
102 |
<tr>
|
103 |
-
<th valign="top"><acronym title="Cascading Style
|
104 |
<td>
|
105 |
<input type="hidden" name="minify.css.enable" value="0" />
|
106 |
<input type="hidden" name="minify.css.strip.comments" value="0" />
|
@@ -113,7 +113,7 @@
|
|
113 |
<tr>
|
114 |
<th valign="top"><label for="minify_reject_ua">Rejected user agents:</label></th>
|
115 |
<td>
|
116 |
-
<textarea id="minify_reject_ua" name="minify.reject.ua" cols="
|
117 |
<span class="description">Specify user agents that will never receive minified content.</span>
|
118 |
</td>
|
119 |
</tr>
|
@@ -122,13 +122,14 @@
|
|
122 |
<td>
|
123 |
<p>
|
124 |
<label>
|
125 |
-
<select id="js_groups" class="js_enabled">
|
126 |
-
<?php foreach ($groups as $
|
127 |
-
<option value="<?php echo $
|
128 |
<?php endforeach; ?>
|
129 |
</select>
|
130 |
Group:
|
131 |
-
</label
|
|
|
132 |
</p>
|
133 |
<ol id="js_files">
|
134 |
<?php foreach ($js_groups as $js_group => $js_locations): ?>
|
@@ -146,17 +147,18 @@
|
|
146 |
</td>
|
147 |
</tr>
|
148 |
<tr>
|
149 |
-
<th valign="top"><acronym title="Cascading Style
|
150 |
<td>
|
151 |
<p>
|
152 |
<label>
|
153 |
-
<select id="css_groups" class="css_enabled">
|
154 |
-
<?php foreach ($groups as $
|
155 |
-
<option value="<?php echo $
|
156 |
<?php endforeach; ?>
|
157 |
</select>
|
158 |
Group:
|
159 |
-
</label
|
|
|
160 |
</p>
|
161 |
<ol id="css_files">
|
162 |
<?php foreach ($css_groups as $css_group => $css_locations): ?>
|
@@ -169,7 +171,7 @@
|
|
169 |
<?php endforeach; ?>
|
170 |
<?php endforeach; ?>
|
171 |
</ol>
|
172 |
-
<div id="css_files_empty" class="w3tc-empty" style="display: none;">No <acronym title="Cascading Style
|
173 |
<input id="css_file_add" class="css_enabled button" type="button" value="Add a style sheet" />
|
174 |
</td>
|
175 |
</tr>
|
42 |
<th colspan="2">
|
43 |
<input type="hidden" name="minify.rewrite" value="0" />
|
44 |
<label><input type="checkbox" name="minify.rewrite" value="1"<?php checked($this->_config->get_boolean('minify.rewrite'), true); ?> /> Rewrite <acronym title="Uniform Resource Locator">URL</acronym> structure</label><br />
|
45 |
+
<span class="description">If disabled, <acronym title="Cascading Style Sheet">CSS</acronym> and <acronym title="JavaScript">JS</acronym> embeddings will use GET variables instead of "fancy links."</span>
|
46 |
</th>
|
47 |
</tr>
|
48 |
<tr>
|
49 |
<th colspan="2">
|
50 |
<input type="hidden" name="minify.upload" value="0" />
|
51 |
<label><input type="checkbox" name="minify.upload" value="1"<?php checked($this->_config->get_boolean('minify.upload'), true); ?> /> Automatically upload modified files</label><br />
|
52 |
+
<span class="description">If <acronym title="Content Delivery Network">CDN</acronym> is enabled (and not using the origin pull method), your minified files will be automatically uploaded.</span>
|
53 |
</th>
|
54 |
</tr>
|
55 |
<tr>
|
65 |
</tr>
|
66 |
<tr>
|
67 |
<th><label for="minify_file_gc">Garbage collection interval:</label></th>
|
68 |
+
<td><input id="minify_file_gc" type="text" name="minify.file.gc" value="<?php echo $this->_config->get_integer('minify.file.gc'); ?>" size="8"<?php if ($this->_config->get_string('minify.engine') != 'file'): ?> disabled="disabled"<?php endif; ?> /> seconds
|
69 |
<br /><span class="description">If caching to disk, specify how frequently expired cache data is removed. For busy sites, a lower value is best.</span>
|
70 |
</td>
|
71 |
</tr>
|
79 |
<input type="hidden" name="minify.html.strip.crlf" value="0" />
|
80 |
<label><input id="html_enabled" type="checkbox" name="minify.html.enable" value="1"<?php checked($this->_config->get_boolean('minify.html.enable'), true); ?> /> Minify</label><br />
|
81 |
<label><input class="html_enabled" type="checkbox" name="minify.html.reject.admin" value="1"<?php checked($this->_config->get_boolean('minify.html.reject.admin'), true); ?> /> Don't Minify <acronym title="Hypertext Markup Language">HTML</acronym> for logged in administrators</label><br />
|
82 |
+
<label><input class="html_enabled" type="checkbox" name="minify.html.inline.css" value="1"<?php checked($this->_config->get_boolean('minify.html.inline.css'), true); ?> /> Inline <acronym title="Cascading Style Sheet">CSS</acronym> Minification</label><br />
|
83 |
<label><input class="html_enabled" type="checkbox" name="minify.html.inline.js" value="1"<?php checked($this->_config->get_boolean('minify.html.inline.js'), true); ?> /> Inline <acronym title="JavaScript">JS</acronym> Minification</label><br />
|
84 |
<label><input class="html_enabled" type="checkbox" name="minify.html.strip.crlf" value="1"<?php checked($this->_config->get_boolean('minify.html.strip.crlf'), true); ?> /> Line break removal</label><br />
|
85 |
</td>
|
100 |
</td>
|
101 |
</tr>
|
102 |
<tr>
|
103 |
+
<th valign="top"><acronym title="Cascading Style Sheet">CSS</acronym> minify settings:</th>
|
104 |
<td>
|
105 |
<input type="hidden" name="minify.css.enable" value="0" />
|
106 |
<input type="hidden" name="minify.css.strip.comments" value="0" />
|
113 |
<tr>
|
114 |
<th valign="top"><label for="minify_reject_ua">Rejected user agents:</label></th>
|
115 |
<td>
|
116 |
+
<textarea id="minify_reject_ua" name="minify.reject.ua" cols="40" rows="5"><?php echo htmlspecialchars(implode("\r\n", $this->_config->get_array('minify.reject.ua'))); ?></textarea><br />
|
117 |
<span class="description">Specify user agents that will never receive minified content.</span>
|
118 |
</td>
|
119 |
</tr>
|
122 |
<td>
|
123 |
<p>
|
124 |
<label>
|
125 |
+
<select id="js_groups" class="js_enabled" name="js_group">
|
126 |
+
<?php foreach ($groups as $group_key => $group_text): ?>
|
127 |
+
<option value="<?php echo $group_key; ?>"<?php selected($group_key, $js_group); ?>><?php echo htmlspecialchars($group_text); ?></option>
|
128 |
<?php endforeach; ?>
|
129 |
</select>
|
130 |
Group:
|
131 |
+
</label><br />
|
132 |
+
<span class="description">Add scripts used in all templates to the default group. Use the menu above to manage scripts unique to a specific template.</span>
|
133 |
</p>
|
134 |
<ol id="js_files">
|
135 |
<?php foreach ($js_groups as $js_group => $js_locations): ?>
|
147 |
</td>
|
148 |
</tr>
|
149 |
<tr>
|
150 |
+
<th valign="top"><acronym title="Cascading Style Sheet">CSS</acronym> file management:</th>
|
151 |
<td>
|
152 |
<p>
|
153 |
<label>
|
154 |
+
<select id="css_groups" class="css_enabled" name="css_group">
|
155 |
+
<?php foreach ($groups as $group_key => $group_text): ?>
|
156 |
+
<option value="<?php echo $group_key; ?>"<?php selected($group_key, $css_group); ?>><?php echo htmlspecialchars($group_text); ?></option>
|
157 |
<?php endforeach; ?>
|
158 |
</select>
|
159 |
Group:
|
160 |
+
</label><br />
|
161 |
+
<span class="description">Add style sheets used in all templates to the default group. Use the menu above to manage style sheets unique to a specific template.</span>
|
162 |
</p>
|
163 |
<ol id="css_files">
|
164 |
<?php foreach ($css_groups as $css_group => $css_locations): ?>
|
171 |
<?php endforeach; ?>
|
172 |
<?php endforeach; ?>
|
173 |
</ol>
|
174 |
+
<div id="css_files_empty" class="w3tc-empty" style="display: none;">No <acronym title="Cascading Style Sheet">CSS</acronym> files added</div>
|
175 |
<input id="css_file_add" class="css_enabled button" type="button" value="Add a style sheet" />
|
176 |
</td>
|
177 |
</tr>
|
inc/options/pgcache.phtml
CHANGED
@@ -71,7 +71,7 @@
|
|
71 |
</tr>
|
72 |
<tr>
|
73 |
<th colspan="2">
|
74 |
-
<input type="hidden" name="pgcache.cache.query" value="0" />
|
75 |
<label><input type="checkbox" name="pgcache.cache.query" value="1"<?php checked($this->_config->get_boolean('pgcache.cache.query'), true); ?><?php if ($this->_config->get_string('pgcache.engine') == 'file_pgcache'): ?> disabled="disabled"<?php endif; ?> /> Cache <acronym title="Uniform Resource Identifier">URI</acronym>s with query string variables</label><br />
|
76 |
<span class="description">Search result (and similar) pages will be cached if enabled.</span>
|
77 |
</th>
|
@@ -79,42 +79,42 @@
|
|
79 |
<tr>
|
80 |
<th valign="top"><label for="pgcache_reject_ua">Rejected User Agents:</label></th>
|
81 |
<td>
|
82 |
-
<textarea id="pgcache_reject_ua" name="pgcache.reject.ua" cols="
|
83 |
<span class="description">Never send cached pages to these user agents.</span>
|
84 |
</td>
|
85 |
</tr>
|
86 |
<tr>
|
87 |
<th valign="top"><label for="pgcache_reject_cookie">Rejected Cookies:</label></th>
|
88 |
<td>
|
89 |
-
<textarea id="pgcache_reject_cookie" name="pgcache.reject.cookie" cols="
|
90 |
<span class="description">Never cache pages that use the specified cookies.</span>
|
91 |
</td>
|
92 |
</tr>
|
93 |
<tr>
|
94 |
<th valign="top"><label for="pgcache_reject_uri">Never cache the following pages:</label></th>
|
95 |
<td>
|
96 |
-
<textarea id="pgcache_reject_uri" name="pgcache.reject.uri" cols="
|
97 |
<span class="description">Always ignore the specified pages / directories.</span>
|
98 |
</td>
|
99 |
</tr>
|
100 |
<tr>
|
101 |
<th valign="top"><label for="pgcache_accept_files">Caching exception list:</label></th>
|
102 |
<td>
|
103 |
-
<textarea id="pgcache_accept_files" name="pgcache.accept.files" cols="
|
104 |
<span class="description">Cache the specified pages / directories even if listed in the "never cache the following pages" field.</span>
|
105 |
</td>
|
106 |
</tr>
|
107 |
<tr>
|
108 |
<th valign="top"><label for="pgcache_cache_headers">Specify page headers:</label></th>
|
109 |
<td>
|
110 |
-
<textarea id="pgcache_cache_headers" name="pgcache.cache.headers" cols="
|
111 |
<span class="description">Specify additional page headers to cache.</span>
|
112 |
</td>
|
113 |
</tr>
|
114 |
<tr>
|
115 |
<th valign="top"><label for="pgcache_mobile_agents">Mobile user agents:</label></th>
|
116 |
<td>
|
117 |
-
<textarea id="pgcache_mobile_agents" name="pgcache.mobile.agents" cols="
|
118 |
<span class="description">Specify which mobile devices to detect.</span>
|
119 |
</td>
|
120 |
</tr>
|
71 |
</tr>
|
72 |
<tr>
|
73 |
<th colspan="2">
|
74 |
+
<input type="hidden" name="pgcache.cache.query" value="0"<?php if ($this->_config->get_string('pgcache.engine') == 'file_pgcache'): ?> disabled="disabled"<?php endif; ?> />
|
75 |
<label><input type="checkbox" name="pgcache.cache.query" value="1"<?php checked($this->_config->get_boolean('pgcache.cache.query'), true); ?><?php if ($this->_config->get_string('pgcache.engine') == 'file_pgcache'): ?> disabled="disabled"<?php endif; ?> /> Cache <acronym title="Uniform Resource Identifier">URI</acronym>s with query string variables</label><br />
|
76 |
<span class="description">Search result (and similar) pages will be cached if enabled.</span>
|
77 |
</th>
|
79 |
<tr>
|
80 |
<th valign="top"><label for="pgcache_reject_ua">Rejected User Agents:</label></th>
|
81 |
<td>
|
82 |
+
<textarea id="pgcache_reject_ua" name="pgcache.reject.ua" cols="40" rows="5"><?php echo htmlspecialchars(implode("\r\n", $this->_config->get_array('pgcache.reject.ua'))); ?></textarea><br />
|
83 |
<span class="description">Never send cached pages to these user agents.</span>
|
84 |
</td>
|
85 |
</tr>
|
86 |
<tr>
|
87 |
<th valign="top"><label for="pgcache_reject_cookie">Rejected Cookies:</label></th>
|
88 |
<td>
|
89 |
+
<textarea id="pgcache_reject_cookie" name="pgcache.reject.cookie" cols="40" rows="5"><?php echo htmlspecialchars(implode("\r\n", $this->_config->get_array('pgcache.reject.cookie'))); ?></textarea><br />
|
90 |
<span class="description">Never cache pages that use the specified cookies.</span>
|
91 |
</td>
|
92 |
</tr>
|
93 |
<tr>
|
94 |
<th valign="top"><label for="pgcache_reject_uri">Never cache the following pages:</label></th>
|
95 |
<td>
|
96 |
+
<textarea id="pgcache_reject_uri" name="pgcache.reject.uri" cols="40" rows="5"><?php echo htmlspecialchars(implode("\r\n", $this->_config->get_array('pgcache.reject.uri'))); ?></textarea><br />
|
97 |
<span class="description">Always ignore the specified pages / directories.</span>
|
98 |
</td>
|
99 |
</tr>
|
100 |
<tr>
|
101 |
<th valign="top"><label for="pgcache_accept_files">Caching exception list:</label></th>
|
102 |
<td>
|
103 |
+
<textarea id="pgcache_accept_files" name="pgcache.accept.files" cols="40" rows="5"><?php echo htmlspecialchars(implode("\r\n", $this->_config->get_array('pgcache.accept.files'))); ?></textarea><br />
|
104 |
<span class="description">Cache the specified pages / directories even if listed in the "never cache the following pages" field.</span>
|
105 |
</td>
|
106 |
</tr>
|
107 |
<tr>
|
108 |
<th valign="top"><label for="pgcache_cache_headers">Specify page headers:</label></th>
|
109 |
<td>
|
110 |
+
<textarea id="pgcache_cache_headers" name="pgcache.cache.headers" cols="40" rows="5"<?php if (! W3TC_PHP5 || $this->_config->get_string('pgcache.engine') == 'file_pgcache'): ?> disabled="disabled"<?php endif; ?>><?php echo htmlspecialchars(implode("\r\n", $this->_config->get_array('pgcache.cache.headers'))); ?></textarea><br />
|
111 |
<span class="description">Specify additional page headers to cache.</span>
|
112 |
</td>
|
113 |
</tr>
|
114 |
<tr>
|
115 |
<th valign="top"><label for="pgcache_mobile_agents">Mobile user agents:</label></th>
|
116 |
<td>
|
117 |
+
<textarea id="pgcache_mobile_agents" name="pgcache.mobile.agents" cols="40" rows="5"><?php echo htmlspecialchars(implode("\r\n", $this->_config->get_array('pgcache.mobile.agents'))); ?></textarea><br />
|
118 |
<span class="description">Specify which mobile devices to detect.</span>
|
119 |
</td>
|
120 |
</tr>
|
inc/popup/cdn_rename_domain.phtml
CHANGED
@@ -32,7 +32,7 @@ jQuery(function() {
|
|
32 |
<tr>
|
33 |
<td>Domains to rename:</td>
|
34 |
<td>
|
35 |
-
<textarea cols="
|
36 |
e.g.: domain.com
|
37 |
</td>
|
38 |
</tr>
|
32 |
<tr>
|
33 |
<td>Domains to rename:</td>
|
34 |
<td>
|
35 |
+
<textarea cols="40" rows="3" id="cdn_rename_domain_names"></textarea><br />
|
36 |
e.g.: domain.com
|
37 |
</td>
|
38 |
</tr>
|
inc/popup/common/header.phtml
CHANGED
@@ -12,20 +12,20 @@
|
|
12 |
}
|
13 |
?>
|
14 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
15 |
-
<html xmlns="http://www.w3.org/1999/xhtml"
|
16 |
<head>
|
17 |
<link rel="stylesheet" type="text/css" href="<?php echo WP_PLUGIN_URL; ?>/w3-total-cache/inc/css/popup.css"></link>
|
18 |
<script type="text/javascript" src="<?php echo w3_get_site_url(); ?>/<?php echo WPINC; ?>/js/jquery/jquery.js"></script>
|
19 |
<script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/w3-total-cache/inc/js/popup.js"></script>
|
20 |
<title><?php echo htmlspecialchars($title); ?> - W3 Total Cache</title>
|
21 |
-
<meta http-equiv="Content-Type" content="
|
22 |
</head>
|
23 |
<body>
|
24 |
<div id="content">
|
25 |
<h1><?php echo htmlspecialchars($title); ?></h1>
|
26 |
|
27 |
<?php if (count($errors)): ?>
|
28 |
-
<div
|
29 |
<?php foreach ($errors as $error): ?>
|
30 |
<p><?php echo $error; ?></p>
|
31 |
<?php endforeach; ?>
|
@@ -33,10 +33,9 @@
|
|
33 |
<?php endif; ?>
|
34 |
|
35 |
<?php if (count($notes)): ?>
|
36 |
-
<div
|
37 |
<?php foreach ($notes as $note): ?>
|
38 |
<p><?php echo $note; ?></p>
|
39 |
<?php endforeach; ?>
|
40 |
</div>
|
41 |
<?php endif; ?>
|
42 |
-
|
12 |
}
|
13 |
?>
|
14 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
15 |
+
<html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
|
16 |
<head>
|
17 |
<link rel="stylesheet" type="text/css" href="<?php echo WP_PLUGIN_URL; ?>/w3-total-cache/inc/css/popup.css"></link>
|
18 |
<script type="text/javascript" src="<?php echo w3_get_site_url(); ?>/<?php echo WPINC; ?>/js/jquery/jquery.js"></script>
|
19 |
<script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/w3-total-cache/inc/js/popup.js"></script>
|
20 |
<title><?php echo htmlspecialchars($title); ?> - W3 Total Cache</title>
|
21 |
+
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
|
22 |
</head>
|
23 |
<body>
|
24 |
<div id="content">
|
25 |
<h1><?php echo htmlspecialchars($title); ?></h1>
|
26 |
|
27 |
<?php if (count($errors)): ?>
|
28 |
+
<div class="error">
|
29 |
<?php foreach ($errors as $error): ?>
|
30 |
<p><?php echo $error; ?></p>
|
31 |
<?php endforeach; ?>
|
33 |
<?php endif; ?>
|
34 |
|
35 |
<?php if (count($notes)): ?>
|
36 |
+
<div class="updated fade">
|
37 |
<?php foreach ($notes as $note): ?>
|
38 |
<p><?php echo $note; ?></p>
|
39 |
<?php endforeach; ?>
|
40 |
</div>
|
41 |
<?php endif; ?>
|
|
ini/_htaccess
CHANGED
@@ -81,14 +81,12 @@ ExpiresByType text/xsd A259200
|
|
81 |
ExpiresByType text/xsl A259200
|
82 |
</IfModule>
|
83 |
|
84 |
-
<FilesMatch "\.(bmp|ico|html?|tiff?|gif|jpe?g|png|svgz?|swf|txt|xsd|xsl|xml)$">
|
85 |
<IfModule mod_headers.c>
|
86 |
# Set Pragma header
|
87 |
Header set Pragma "public"
|
88 |
# Set Cache-Control header
|
89 |
-
Header
|
90 |
-
# For optimal performance remove cookies
|
91 |
-
#Header unset Set-Cookie
|
92 |
</IfModule>
|
93 |
|
94 |
# Set Entity Tag header
|
81 |
ExpiresByType text/xsl A259200
|
82 |
</IfModule>
|
83 |
|
84 |
+
<FilesMatch "\.(bmp|css|ico|html?|js|tiff?|gif|jpe?g|png|svgz?|swf|txt|xsd|xsl|xml)$">
|
85 |
<IfModule mod_headers.c>
|
86 |
# Set Pragma header
|
87 |
Header set Pragma "public"
|
88 |
# Set Cache-Control header
|
89 |
+
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
|
|
|
|
|
90 |
</IfModule>
|
91 |
|
92 |
# Set Entity Tag header
|
ini/apc.ini
CHANGED
@@ -1,14 +1,32 @@
|
|
1 |
; /etc/php.d/apc.ini
|
2 |
|
3 |
extension = apc.so
|
|
|
4 |
apc.enabled = 1
|
5 |
apc.shm_segments = 1
|
|
|
6 |
apc.optimization = 0
|
7 |
-
apc.
|
|
|
8 |
apc.ttl = 7200
|
9 |
apc.user_ttl = 7200
|
10 |
-
apc.
|
11 |
-
apc.mmap_file_mask = /tmp/apc.XXXXXX
|
12 |
-
apc.enable_cli = 1
|
13 |
apc.cache_by_default = 1
|
14 |
-
apc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
; /etc/php.d/apc.ini
|
2 |
|
3 |
extension = apc.so
|
4 |
+
|
5 |
apc.enabled = 1
|
6 |
apc.shm_segments = 1
|
7 |
+
apc.shm_size = 32
|
8 |
apc.optimization = 0
|
9 |
+
apc.max_file_size = 1000
|
10 |
+
apc.num_files_hint = 4096
|
11 |
apc.ttl = 7200
|
12 |
apc.user_ttl = 7200
|
13 |
+
apc.gc_ttl = 0
|
|
|
|
|
14 |
apc.cache_by_default = 1
|
15 |
+
apc.filters = ""
|
16 |
+
apc.mmap_file_mask = "/tmp/apc.XXXXXX"
|
17 |
+
apc.slam_defense = 0
|
18 |
+
apc.file_update_protection = 2
|
19 |
+
apc.enable_cli = 0
|
20 |
+
apc.max_file_size = 1M
|
21 |
+
apc.stat = 1
|
22 |
+
apc.write_lock = 1
|
23 |
+
apc.report_autofilter = 0
|
24 |
+
apc.include_once_override = 0
|
25 |
+
;apc.rfc1867 = 0
|
26 |
+
;apc.rfc1867_prefix = "upload_"
|
27 |
+
;apc.rfc1867_name = "APC_UPLOAD_PROGRESS"
|
28 |
+
;apc.rfc1867_freq = 0
|
29 |
+
apc.localcache = 0
|
30 |
+
apc.localcache.size = 512
|
31 |
+
apc.coredump_unmap = 0
|
32 |
+
apc.stat_ctime = 0
|
ini/eaccelerator.ini
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
; /etc/php.d/eaccelerator.ini
|
2 |
+
|
3 |
+
;extension = eaccelerator.so
|
4 |
+
zend_extension = "/usr/lib/php/modules/eaccelerator.so"
|
5 |
+
zend_extension_ts = "/usr/lib/php/modules/eaccelerator.so"
|
6 |
+
|
7 |
+
eaccelerator.shm_size = 32
|
8 |
+
;eaccelerator.cache_dir = "/tmp/eaccelerator"
|
9 |
+
eaccelerator.enable = 1
|
10 |
+
eaccelerator.optimizer = 0
|
11 |
+
eaccelerator.debug = 0
|
12 |
+
eaccelerator.log_file = "/var/log/httpd/eaccelerator_log"
|
13 |
+
eaccelerator.name_space = ""
|
14 |
+
eaccelerator.check_mtime = 1
|
15 |
+
eaccelerator.filter = ""
|
16 |
+
eaccelerator.shm_max = 0
|
17 |
+
eaccelerator.shm_ttl = 7200
|
18 |
+
eaccelerator.shm_prune_period = 7200
|
19 |
+
eaccelerator.shm_only = 1
|
20 |
+
eaccelerator.compress = 0
|
21 |
+
eaccelerator.compress_level = 9
|
22 |
+
eaccelerator.keys = shm
|
23 |
+
eaccelerator.sessions = shm
|
24 |
+
eaccelerator.content = shm
|
25 |
+
eaccelerator.allowed_admin_path = "/var/www/html/controlpanel"
|
ini/memcache.ini
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
; /etc/php.d/memcache.ini
|
2 |
|
3 |
extension = memcache.so
|
|
|
4 |
memcache.allow_failover = 1
|
5 |
memcache.redundancy = 1
|
6 |
memcache.session_redundancy = 2
|
1 |
; /etc/php.d/memcache.ini
|
2 |
|
3 |
extension = memcache.so
|
4 |
+
|
5 |
memcache.allow_failover = 1
|
6 |
memcache.redundancy = 1
|
7 |
memcache.session_redundancy = 2
|
ini/xcache.ini
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
; /etc/php.d/xcache.ini
|
2 |
+
|
3 |
+
;extension = xcache.so
|
4 |
+
zend_extension = "/usr/lib/php/modules/xcache.so"
|
5 |
+
zend_extension_ts = "/usr/lib/php/modules/xcache.so"
|
6 |
+
|
7 |
+
;xcache.admin.user = "admin"
|
8 |
+
;xcache.admin.pass = ""
|
9 |
+
;xcache.admin.enable_auth = On
|
10 |
+
xcache.test = Off
|
11 |
+
xcache.coredump_directory = ""
|
12 |
+
|
13 |
+
xcache.shm_scheme = mmap
|
14 |
+
|
15 |
+
xcache.cacher = On
|
16 |
+
xcache.size = 32M
|
17 |
+
xcache.count = 8
|
18 |
+
xcache.slots = 8K
|
19 |
+
xcache.ttl = 0
|
20 |
+
xcache.gc_interval = 0
|
21 |
+
xcache.var_size = 16M
|
22 |
+
xcache.var_count = 1
|
23 |
+
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
|
31 |
+
|
32 |
+
xcache.coverager = Off
|
33 |
+
xcache.coveragedump_directory = ""
|
34 |
+
|
35 |
+
xcache.stat = Off
|
36 |
+
;xcache.readonly_protection = On
|
lib/Minify/HTTP/Encoder.php
CHANGED
@@ -195,6 +195,8 @@ class HTTP_Encoder {
|
|
195 |
// @link http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
|
196 |
|
197 |
if (! isset($_SERVER['HTTP_ACCEPT_ENCODING'])
|
|
|
|
|
198 |
|| self::_isBuggyIe())
|
199 |
{
|
200 |
return array('', '');
|
195 |
// @link http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
|
196 |
|
197 |
if (! isset($_SERVER['HTTP_ACCEPT_ENCODING'])
|
198 |
+
|| w3_zlib_output_compression()
|
199 |
+
|| headers_sent()
|
200 |
|| self::_isBuggyIe())
|
201 |
{
|
202 |
return array('', '');
|
lib/Minify/Minify/CSS/UriRewriter.php
CHANGED
@@ -172,12 +172,12 @@ class Minify_CSS_UriRewriter {
|
|
172 |
$path = (! empty($parse_url['path']) ? $parse_url['path'] : '/');
|
173 |
$dir_css = preg_replace('~[^/]+$~', '', $path);
|
174 |
$dir_obj = preg_replace('~[^/]+$~', '', $uri);
|
175 |
-
$dir = ltrim((strpos($dir_obj, '/') === 0 ? w3_realpath($dir_obj) : w3_realpath($dir_css . $dir_obj)), '/');
|
176 |
$file = basename($uri);
|
177 |
|
178 |
$uri = sprintf('%s://%s%s/%s%s', $scheme, $host, $port, $dir, $file);
|
179 |
}
|
180 |
-
}
|
181 |
$uri = self::$_prependPath . $uri;
|
182 |
}
|
183 |
} else {
|
172 |
$path = (! empty($parse_url['path']) ? $parse_url['path'] : '/');
|
173 |
$dir_css = preg_replace('~[^/]+$~', '', $path);
|
174 |
$dir_obj = preg_replace('~[^/]+$~', '', $uri);
|
175 |
+
$dir = (ltrim((strpos($dir_obj, '/') === 0 ? w3_realpath($dir_obj) : w3_realpath($dir_css . $dir_obj)), '/'));
|
176 |
$file = basename($uri);
|
177 |
|
178 |
$uri = sprintf('%s://%s%s/%s%s', $scheme, $host, $port, $dir, $file);
|
179 |
}
|
180 |
+
} else {
|
181 |
$uri = self::$_prependPath . $uri;
|
182 |
}
|
183 |
} else {
|
lib/W3/Config.php
CHANGED
@@ -125,6 +125,7 @@ class W3_Config
|
|
125 |
'cdn.cf.cname' => 'string',
|
126 |
'cdn.reject.ua' => 'array',
|
127 |
'cdn.reject.uri' => 'array',
|
|
|
128 |
|
129 |
'common.support' => 'string',
|
130 |
'common.install' => 'integer',
|
@@ -134,7 +135,6 @@ class W3_Config
|
|
134 |
'notes.defaults' => 'boolean',
|
135 |
'notes.wp_content_perms' => 'boolean',
|
136 |
'notes.cdn_first_time' => 'boolean',
|
137 |
-
'notes.no_memcached_nor_apc' => 'boolean',
|
138 |
'notes.php_is_old' => 'boolean',
|
139 |
'notes.theme_changed' => 'boolean',
|
140 |
'notes.wp_upgraded' => 'boolean',
|
@@ -146,7 +146,9 @@ class W3_Config
|
|
146 |
'notes.pgcache_rules_cache' => 'boolean',
|
147 |
'notes.minify_rules' => 'boolean',
|
148 |
'notes.support_us' => 'boolean',
|
149 |
-
'notes.no_curl' => 'boolean'
|
|
|
|
|
150 |
);
|
151 |
|
152 |
var $_defaults = array(
|
@@ -161,7 +163,9 @@ class W3_Config
|
|
161 |
'dbcache.reject.logged' => true,
|
162 |
'dbcache.reject.uri' => array(),
|
163 |
'dbcache.reject.cookie' => array(),
|
164 |
-
'dbcache.reject.sql' => array(
|
|
|
|
|
165 |
'dbcache.lifetime' => 180,
|
166 |
|
167 |
'pgcache.enabled' => true,
|
@@ -204,103 +208,107 @@ class W3_Config
|
|
204 |
'pgcache.reject.cookie' => array(),
|
205 |
'pgcache.mobile.redirect' => '',
|
206 |
'pgcache.mobile.agents' => array(
|
207 |
-
'Android',
|
208 |
'2.0 MMP',
|
209 |
'240x320',
|
|
|
|
|
|
|
|
|
|
|
|
|
210 |
'AvantGo',
|
|
|
|
|
211 |
'BlackBerry',
|
212 |
'Blazer',
|
|
|
213 |
'Cellphone',
|
|
|
214 |
'Danger',
|
215 |
'DoCoMo',
|
216 |
'Elaine/3.0',
|
|
|
217 |
'EudoraWeb',
|
218 |
-
'
|
|
|
|
|
|
|
219 |
'IEMobile',
|
220 |
-
'
|
221 |
-
'
|
|
|
|
|
222 |
'KYOCERA/WX310K',
|
|
|
223 |
'LG/U990',
|
|
|
224 |
'MIDP-2.0',
|
225 |
'MMEF20',
|
226 |
'MOT-V',
|
|
|
|
|
|
|
227 |
'NetFront',
|
228 |
'Newt',
|
229 |
'Nintendo Wii',
|
230 |
'Nitro',
|
231 |
'Nokia',
|
|
|
|
|
232 |
'Opera Mini',
|
|
|
|
|
|
|
|
|
|
|
|
|
233 |
'Palm',
|
|
|
|
|
234 |
'Playstation Portable',
|
235 |
-
'portalmmm',
|
236 |
-
'Proxinet',
|
237 |
'ProxiNet',
|
|
|
|
|
|
|
|
|
|
|
238 |
'SHARP-TQ-GX10',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
239 |
'Small',
|
|
|
|
|
240 |
'SonyEricsson',
|
|
|
241 |
'Symbian OS',
|
242 |
'SymbianOS',
|
243 |
'TS21i-10',
|
|
|
|
|
244 |
'UP.Browser',
|
245 |
'UP.Link',
|
246 |
-
'
|
|
|
|
|
247 |
'WinWAP',
|
248 |
-
'
|
249 |
-
'
|
250 |
-
'Huawei',
|
251 |
-
'MobilePhone',
|
252 |
-
'Motorola',
|
253 |
-
'nokia',
|
254 |
-
'Novarra',
|
255 |
-
'O2',
|
256 |
-
'Samsung',
|
257 |
-
'Sanyo',
|
258 |
-
'Smartphone',
|
259 |
-
'Symbian',
|
260 |
-
'Toshiba',
|
261 |
-
'Treo',
|
262 |
-
'vodafone',
|
263 |
'Xda',
|
264 |
-
'
|
265 |
-
'Amoi',
|
266 |
-
'ASUS',
|
267 |
-
'Audiovox',
|
268 |
-
'AU-MIC',
|
269 |
-
'BenQ',
|
270 |
-
'Bird',
|
271 |
-
'CDM',
|
272 |
'dopod',
|
273 |
-
'
|
274 |
-
'
|
275 |
-
'HP.iPAQ',
|
276 |
'i-mobile',
|
277 |
-
'
|
278 |
-
'
|
279 |
-
'
|
280 |
-
'
|
281 |
-
'
|
282 |
-
'NEWGEN',
|
283 |
-
'Panasonic',
|
284 |
-
'PANTECH',
|
285 |
-
'PG',
|
286 |
-
'Philips',
|
287 |
-
'PPC',
|
288 |
-
'PT',
|
289 |
-
'Qtek',
|
290 |
-
'Sagem',
|
291 |
-
'SCH',
|
292 |
-
'SEC',
|
293 |
-
'Sendo',
|
294 |
-
'SGH',
|
295 |
-
'Sharp',
|
296 |
-
'SIE',
|
297 |
-
'SoftBank',
|
298 |
-
'SPH',
|
299 |
-
'UTS',
|
300 |
-
'Vertu',
|
301 |
-
'Opera.Mobi',
|
302 |
-
'Windows.CE',
|
303 |
-
'ZTE'
|
304 |
),
|
305 |
|
306 |
'minify.enabled' => true,
|
@@ -349,7 +357,7 @@ class W3_Config
|
|
349 |
'cdn.debug' => false,
|
350 |
'cdn.engine' => 'ftp',
|
351 |
'cdn.includes.enable' => true,
|
352 |
-
'cdn.includes.files' => '
|
353 |
'cdn.theme.enable' => true,
|
354 |
'cdn.theme.files' => '*.css;*.js;*.gif;*.png;*.jpg;*.ico',
|
355 |
'cdn.minify.enable' => true,
|
@@ -377,6 +385,9 @@ class W3_Config
|
|
377 |
'cdn.cf.cname' => '',
|
378 |
'cdn.reject.ua' => array(),
|
379 |
'cdn.reject.uri' => array(),
|
|
|
|
|
|
|
380 |
|
381 |
'common.support' => '',
|
382 |
'common.install' => 0,
|
@@ -386,7 +397,6 @@ class W3_Config
|
|
386 |
'notes.defaults' => true,
|
387 |
'notes.wp_content_perms' => true,
|
388 |
'notes.cdn_first_time' => true,
|
389 |
-
'notes.no_memcached_nor_apc' => true,
|
390 |
'notes.php_is_old' => true,
|
391 |
'notes.theme_changed' => false,
|
392 |
'notes.wp_upgraded' => false,
|
@@ -398,29 +408,27 @@ class W3_Config
|
|
398 |
'notes.pgcache_rules_cache' => true,
|
399 |
'notes.minify_rules' => true,
|
400 |
'notes.support_us' => true,
|
401 |
-
'notes.no_curl' => true
|
|
|
|
|
402 |
);
|
403 |
|
404 |
/**
|
405 |
* PHP5 Constructor
|
406 |
-
* @param boolean $check_config
|
407 |
*/
|
408 |
-
function __construct(
|
409 |
{
|
410 |
$this->load_defaults();
|
411 |
-
|
412 |
-
if (! $this->load() && $check_config) {
|
413 |
-
die(sprintf('<strong>W3 Total Cache Error:</strong> Unable to read config file or it is broken. Please create <strong>%s</strong> from <strong>%s</strong>.', W3TC_CONFIG_PATH, W3TC_CONFIG_EXAMPLE_PATH));
|
414 |
-
}
|
415 |
}
|
416 |
|
417 |
/**
|
418 |
* PHP4 Constructor
|
419 |
* @param booleab $check_config
|
420 |
*/
|
421 |
-
function W3_Config(
|
422 |
{
|
423 |
-
$this->__construct(
|
424 |
}
|
425 |
|
426 |
/**
|
@@ -444,25 +452,27 @@ class W3_Config
|
|
444 |
|
445 |
switch ($key) {
|
446 |
/**
|
447 |
-
*
|
448 |
*/
|
449 |
-
case 'pgcache.
|
450 |
-
|
451 |
-
|
|
|
|
|
452 |
}
|
453 |
break;
|
454 |
|
455 |
/**
|
456 |
-
*
|
457 |
*/
|
458 |
-
case 'pgcache.
|
459 |
-
if (!
|
460 |
-
return
|
461 |
}
|
462 |
break;
|
463 |
|
464 |
/**
|
465 |
-
* Disabled some page cache options when
|
466 |
*/
|
467 |
case 'pgcache.cache.query':
|
468 |
if ($this->get_boolean('pgcache.enabled') && $this->get_string('pgcache.engine') == 'file_pgcache') {
|
@@ -470,8 +480,11 @@ class W3_Config
|
|
470 |
}
|
471 |
break;
|
472 |
|
|
|
|
|
|
|
473 |
case 'pgcache.cache.headers':
|
474 |
-
if ($this->get_boolean('pgcache.enabled') && $this->get_string('pgcache.engine') == 'file_pgcache') {
|
475 |
return array();
|
476 |
}
|
477 |
break;
|
@@ -480,12 +493,33 @@ class W3_Config
|
|
480 |
* Disabled minify when PHP5 is not installed
|
481 |
*/
|
482 |
case 'minify.enabled':
|
483 |
-
case 'cdn.minify.enable':
|
484 |
if (! W3TC_PHP5) {
|
485 |
return false;
|
486 |
}
|
487 |
break;
|
488 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
489 |
case 'cdn.engine':
|
490 |
if (($value == 's3' || $value == 'cf') && (! W3TC_PHP5 || ! function_exists('curl_init'))) {
|
491 |
return 'mirror';
|
@@ -604,10 +638,12 @@ class W3_Config
|
|
604 |
{
|
605 |
require_once W3TC_LIB_W3_DIR . '/Request.php';
|
606 |
|
|
|
|
|
607 |
foreach ($this->_keys as $key => $type) {
|
608 |
$request_key = str_replace('.', '_', $key);
|
609 |
|
610 |
-
if (! isset($
|
611 |
continue;
|
612 |
}
|
613 |
|
125 |
'cdn.cf.cname' => 'string',
|
126 |
'cdn.reject.ua' => 'array',
|
127 |
'cdn.reject.uri' => 'array',
|
128 |
+
'cdn.reject.files' => 'array',
|
129 |
|
130 |
'common.support' => 'string',
|
131 |
'common.install' => 'integer',
|
135 |
'notes.defaults' => 'boolean',
|
136 |
'notes.wp_content_perms' => 'boolean',
|
137 |
'notes.cdn_first_time' => 'boolean',
|
|
|
138 |
'notes.php_is_old' => 'boolean',
|
139 |
'notes.theme_changed' => 'boolean',
|
140 |
'notes.wp_upgraded' => 'boolean',
|
146 |
'notes.pgcache_rules_cache' => 'boolean',
|
147 |
'notes.minify_rules' => 'boolean',
|
148 |
'notes.support_us' => 'boolean',
|
149 |
+
'notes.no_curl' => 'boolean',
|
150 |
+
'notes.no_zlib' => 'boolean',
|
151 |
+
'notes.zlib_output_compression' => 'boolean'
|
152 |
);
|
153 |
|
154 |
var $_defaults = array(
|
163 |
'dbcache.reject.logged' => true,
|
164 |
'dbcache.reject.uri' => array(),
|
165 |
'dbcache.reject.cookie' => array(),
|
166 |
+
'dbcache.reject.sql' => array(
|
167 |
+
'gdsr_'
|
168 |
+
),
|
169 |
'dbcache.lifetime' => 180,
|
170 |
|
171 |
'pgcache.enabled' => true,
|
208 |
'pgcache.reject.cookie' => array(),
|
209 |
'pgcache.mobile.redirect' => '',
|
210 |
'pgcache.mobile.agents' => array(
|
|
|
211 |
'2.0 MMP',
|
212 |
'240x320',
|
213 |
+
'ASUS',
|
214 |
+
'AU-MIC',
|
215 |
+
'Alcatel',
|
216 |
+
'Amoi',
|
217 |
+
'Android',
|
218 |
+
'Audiovox',
|
219 |
'AvantGo',
|
220 |
+
'BenQ',
|
221 |
+
'Bird',
|
222 |
'BlackBerry',
|
223 |
'Blazer',
|
224 |
+
'CDM',
|
225 |
'Cellphone',
|
226 |
+
'DDIPOCKET',
|
227 |
'Danger',
|
228 |
'DoCoMo',
|
229 |
'Elaine/3.0',
|
230 |
+
'Ericsson',
|
231 |
'EudoraWeb',
|
232 |
+
'Fly',
|
233 |
+
'HP.iPAQ',
|
234 |
+
'Haier',
|
235 |
+
'Huawei',
|
236 |
'IEMobile',
|
237 |
+
'J-PHONE',
|
238 |
+
'KDDI',
|
239 |
+
'KONKA',
|
240 |
+
'KWC',
|
241 |
'KYOCERA/WX310K',
|
242 |
+
'LG',
|
243 |
'LG/U990',
|
244 |
+
'Lenovo',
|
245 |
'MIDP-2.0',
|
246 |
'MMEF20',
|
247 |
'MOT-V',
|
248 |
+
'MobilePhone',
|
249 |
+
'Motorola',
|
250 |
+
'NEWGEN',
|
251 |
'NetFront',
|
252 |
'Newt',
|
253 |
'Nintendo Wii',
|
254 |
'Nitro',
|
255 |
'Nokia',
|
256 |
+
'Novarra',
|
257 |
+
'O2',
|
258 |
'Opera Mini',
|
259 |
+
'Opera.Mobi',
|
260 |
+
'PANTECH',
|
261 |
+
'PDXGW',
|
262 |
+
'PG',
|
263 |
+
'PPC',
|
264 |
+
'PT',
|
265 |
'Palm',
|
266 |
+
'Panasonic',
|
267 |
+
'Philips',
|
268 |
'Playstation Portable',
|
|
|
|
|
269 |
'ProxiNet',
|
270 |
+
'Proxinet',
|
271 |
+
'Qtek',
|
272 |
+
'SCH',
|
273 |
+
'SEC',
|
274 |
+
'SGH',
|
275 |
'SHARP-TQ-GX10',
|
276 |
+
'SIE',
|
277 |
+
'SPH',
|
278 |
+
'Sagem',
|
279 |
+
'Samsung',
|
280 |
+
'Sanyo',
|
281 |
+
'Sendo',
|
282 |
+
'Sharp',
|
283 |
'Small',
|
284 |
+
'Smartphone',
|
285 |
+
'SoftBank',
|
286 |
'SonyEricsson',
|
287 |
+
'Symbian',
|
288 |
'Symbian OS',
|
289 |
'SymbianOS',
|
290 |
'TS21i-10',
|
291 |
+
'Toshiba',
|
292 |
+
'Treo',
|
293 |
'UP.Browser',
|
294 |
'UP.Link',
|
295 |
+
'UTS',
|
296 |
+
'Vertu',
|
297 |
+
'WILLCOME',
|
298 |
'WinWAP',
|
299 |
+
'Windows CE',
|
300 |
+
'Windows.CE',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
301 |
'Xda',
|
302 |
+
'ZTE',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
303 |
'dopod',
|
304 |
+
'hiptop',
|
305 |
+
'htc',
|
|
|
306 |
'i-mobile',
|
307 |
+
'iPhone',
|
308 |
+
'iPod',
|
309 |
+
'nokia',
|
310 |
+
'portalmmm',
|
311 |
+
'vodafone'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
312 |
),
|
313 |
|
314 |
'minify.enabled' => true,
|
357 |
'cdn.debug' => false,
|
358 |
'cdn.engine' => 'ftp',
|
359 |
'cdn.includes.enable' => true,
|
360 |
+
'cdn.includes.files' => 'wlwmanifest.xml;*.css;*.js;*.gif;*.png;*.jpg',
|
361 |
'cdn.theme.enable' => true,
|
362 |
'cdn.theme.files' => '*.css;*.js;*.gif;*.png;*.jpg;*.ico',
|
363 |
'cdn.minify.enable' => true,
|
385 |
'cdn.cf.cname' => '',
|
386 |
'cdn.reject.ua' => array(),
|
387 |
'cdn.reject.uri' => array(),
|
388 |
+
'cdn.reject.files' => array(
|
389 |
+
'wp-content/uploads/wpcf7_captcha/*'
|
390 |
+
),
|
391 |
|
392 |
'common.support' => '',
|
393 |
'common.install' => 0,
|
397 |
'notes.defaults' => true,
|
398 |
'notes.wp_content_perms' => true,
|
399 |
'notes.cdn_first_time' => true,
|
|
|
400 |
'notes.php_is_old' => true,
|
401 |
'notes.theme_changed' => false,
|
402 |
'notes.wp_upgraded' => false,
|
408 |
'notes.pgcache_rules_cache' => true,
|
409 |
'notes.minify_rules' => true,
|
410 |
'notes.support_us' => true,
|
411 |
+
'notes.no_curl' => true,
|
412 |
+
'notes.no_zlib' => true,
|
413 |
+
'notes.zlib_output_compression' => true
|
414 |
);
|
415 |
|
416 |
/**
|
417 |
* PHP5 Constructor
|
|
|
418 |
*/
|
419 |
+
function __construct()
|
420 |
{
|
421 |
$this->load_defaults();
|
422 |
+
$this->load();
|
|
|
|
|
|
|
423 |
}
|
424 |
|
425 |
/**
|
426 |
* PHP4 Constructor
|
427 |
* @param booleab $check_config
|
428 |
*/
|
429 |
+
function W3_Config()
|
430 |
{
|
431 |
+
$this->__construct();
|
432 |
}
|
433 |
|
434 |
/**
|
452 |
|
453 |
switch ($key) {
|
454 |
/**
|
455 |
+
* Check cache engines
|
456 |
*/
|
457 |
+
case 'pgcache.engine':
|
458 |
+
case 'dbcache.engine':
|
459 |
+
case 'minify.engine':
|
460 |
+
if ($value == 'apc' && ! function_exists('apc_store')) {
|
461 |
+
return 'file';
|
462 |
}
|
463 |
break;
|
464 |
|
465 |
/**
|
466 |
+
* Disable compression if compression functions don't exist
|
467 |
*/
|
468 |
+
case 'pgcache.compression':
|
469 |
+
if ((stristr($value, 'gzip') && ! function_exists('gzencode')) || (stristr($value, 'deflate') && ! function_exists('gzdeflate'))) {
|
470 |
+
return '';
|
471 |
}
|
472 |
break;
|
473 |
|
474 |
/**
|
475 |
+
* Disabled some page cache options when enhanced mode enabled
|
476 |
*/
|
477 |
case 'pgcache.cache.query':
|
478 |
if ($this->get_boolean('pgcache.enabled') && $this->get_string('pgcache.engine') == 'file_pgcache') {
|
480 |
}
|
481 |
break;
|
482 |
|
483 |
+
/**
|
484 |
+
* Don't support additional headers in some cases
|
485 |
+
*/
|
486 |
case 'pgcache.cache.headers':
|
487 |
+
if (! W3TC_PHP5 || ($this->get_boolean('pgcache.enabled') && $this->get_string('pgcache.engine') == 'file_pgcache')) {
|
488 |
return array();
|
489 |
}
|
490 |
break;
|
493 |
* Disabled minify when PHP5 is not installed
|
494 |
*/
|
495 |
case 'minify.enabled':
|
|
|
496 |
if (! W3TC_PHP5) {
|
497 |
return false;
|
498 |
}
|
499 |
break;
|
500 |
|
501 |
+
/**
|
502 |
+
* Disable minify compressions if zlib is not installed
|
503 |
+
*/
|
504 |
+
case 'minify.compress':
|
505 |
+
case 'minify.compress.ie6':
|
506 |
+
if (! function_exists('gzencode')) {
|
507 |
+
return false;
|
508 |
+
}
|
509 |
+
break;
|
510 |
+
|
511 |
+
/**
|
512 |
+
* Disable CDN minify when PHP5 is not installed or minify is disabled
|
513 |
+
*/
|
514 |
+
case 'cdn.minify.enable':
|
515 |
+
if (! W3TC_PHP5 || ! $this->get_boolean('minify.enabled')) {
|
516 |
+
return false;
|
517 |
+
}
|
518 |
+
break;
|
519 |
+
|
520 |
+
/**
|
521 |
+
* Check CDN engines
|
522 |
+
*/
|
523 |
case 'cdn.engine':
|
524 |
if (($value == 's3' || $value == 'cf') && (! W3TC_PHP5 || ! function_exists('curl_init'))) {
|
525 |
return 'mirror';
|
638 |
{
|
639 |
require_once W3TC_LIB_W3_DIR . '/Request.php';
|
640 |
|
641 |
+
$request = W3_Request::get_request();
|
642 |
+
|
643 |
foreach ($this->_keys as $key => $type) {
|
644 |
$request_key = str_replace('.', '_', $key);
|
645 |
|
646 |
+
if (! isset($request[$request_key])) {
|
647 |
continue;
|
648 |
}
|
649 |
|
lib/W3/Db.php
CHANGED
@@ -72,9 +72,17 @@ class W3_Db extends wpdb
|
|
72 |
function __construct($dbuser, $dbpassword, $dbname, $dbhost)
|
73 |
{
|
74 |
require_once W3TC_LIB_W3_DIR . '/Config.php';
|
|
|
75 |
$this->_config = & W3_Config::instance();
|
76 |
$this->_lifetime = $this->_config->get_integer('dbcache.lifetime');
|
77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
parent::__construct($dbuser, $dbpassword, $dbname, $dbhost);
|
79 |
}
|
80 |
|
@@ -357,29 +365,18 @@ class W3_Db extends wpdb
|
|
357 |
}
|
358 |
|
359 |
/**
|
360 |
-
*
|
361 |
*
|
|
|
362 |
* @return string
|
363 |
*/
|
364 |
-
function
|
365 |
{
|
366 |
-
$
|
367 |
-
|
368 |
-
$debug_info .= sprintf("%s%d\r\n", str_pad('Total queries: ', 20), $this->query_total);
|
369 |
-
$debug_info .= sprintf("%s%d\r\n", str_pad('Cached queries: ', 20), $this->query_hits);
|
370 |
-
$debug_info .= sprintf("%s%.3f\r\n", str_pad('Total query time: ', 20), $this->time_total);
|
371 |
-
|
372 |
-
if (count($this->query_stats)) {
|
373 |
-
$debug_info .= "SQL info:\r\n";
|
374 |
-
$debug_info .= sprintf("%s | %s | %s | % s | %s\r\n", str_pad('#', 5, ' ', STR_PAD_LEFT), str_pad('Time (s)', 8, ' ', STR_PAD_LEFT), str_pad('Caching (Reject reason)', 30, ' ', STR_PAD_BOTH), str_pad('Status', 10, ' ', STR_PAD_BOTH), 'Query');
|
375 |
-
foreach ($this->query_stats as $index => $query) {
|
376 |
-
$debug_info .= sprintf("%s | %s | %s | %s | %s\r\n", str_pad($index + 1, 5, ' ', STR_PAD_LEFT), str_pad(round($query['time_total'], 3), 8, ' ', STR_PAD_LEFT), str_pad(($query['caching'] ? 'enabled' : sprintf('disabled (%s)', $query['reason'])), 30, ' ', STR_PAD_BOTH), str_pad(($query['cached'] ? 'Cached' : 'Not cached'), 10, ' ', STR_PAD_BOTH), str_replace('-->', '-- >', trim($query['query'])));
|
377 |
-
}
|
378 |
}
|
379 |
|
380 |
-
$
|
381 |
-
|
382 |
-
return $debug_info;
|
383 |
}
|
384 |
|
385 |
/**
|
@@ -551,4 +548,30 @@ class W3_Db extends wpdb
|
|
551 |
|
552 |
return sprintf('w3tc_%s_sql_%s', md5($blog_id), md5($sql));
|
553 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
554 |
}
|
72 |
function __construct($dbuser, $dbpassword, $dbname, $dbhost)
|
73 |
{
|
74 |
require_once W3TC_LIB_W3_DIR . '/Config.php';
|
75 |
+
|
76 |
$this->_config = & W3_Config::instance();
|
77 |
$this->_lifetime = $this->_config->get_integer('dbcache.lifetime');
|
78 |
|
79 |
+
if ($this->_config->get_boolean('dbcache.enabled') && $this->_config->get_boolean('dbcache.debug')) {
|
80 |
+
ob_start(array(
|
81 |
+
&$this,
|
82 |
+
'ob_callback'
|
83 |
+
));
|
84 |
+
}
|
85 |
+
|
86 |
parent::__construct($dbuser, $dbpassword, $dbname, $dbhost);
|
87 |
}
|
88 |
|
365 |
}
|
366 |
|
367 |
/**
|
368 |
+
* Output buffering callback
|
369 |
*
|
370 |
+
* @param string $buffer
|
371 |
* @return string
|
372 |
*/
|
373 |
+
function ob_callback($buffer)
|
374 |
{
|
375 |
+
if ($buffer != '' && w3_is_xml($buffer)) {
|
376 |
+
$buffer .= "\r\n\r\n" . $this->_get_debug_info();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
377 |
}
|
378 |
|
379 |
+
return $buffer;
|
|
|
|
|
380 |
}
|
381 |
|
382 |
/**
|
548 |
|
549 |
return sprintf('w3tc_%s_sql_%s', md5($blog_id), md5($sql));
|
550 |
}
|
551 |
+
|
552 |
+
/**
|
553 |
+
* Returns debug info
|
554 |
+
*
|
555 |
+
* @return string
|
556 |
+
*/
|
557 |
+
function _get_debug_info()
|
558 |
+
{
|
559 |
+
$debug_info = "<!-- W3 Total Cache: Db cache debug info:\r\n";
|
560 |
+
$debug_info .= sprintf("%s%s\r\n", str_pad('Engine: ', 20), w3_get_engine_name($this->_config->get_string('dbcache.engine')));
|
561 |
+
$debug_info .= sprintf("%s%d\r\n", str_pad('Total queries: ', 20), $this->query_total);
|
562 |
+
$debug_info .= sprintf("%s%d\r\n", str_pad('Cached queries: ', 20), $this->query_hits);
|
563 |
+
$debug_info .= sprintf("%s%.3f\r\n", str_pad('Total query time: ', 20), $this->time_total);
|
564 |
+
|
565 |
+
if (count($this->query_stats)) {
|
566 |
+
$debug_info .= "SQL info:\r\n";
|
567 |
+
$debug_info .= sprintf("%s | %s | %s | % s | %s\r\n", str_pad('#', 5, ' ', STR_PAD_LEFT), str_pad('Time (s)', 8, ' ', STR_PAD_LEFT), str_pad('Caching (Reject reason)', 30, ' ', STR_PAD_BOTH), str_pad('Status', 10, ' ', STR_PAD_BOTH), 'Query');
|
568 |
+
foreach ($this->query_stats as $index => $query) {
|
569 |
+
$debug_info .= sprintf("%s | %s | %s | %s | %s\r\n", str_pad($index + 1, 5, ' ', STR_PAD_LEFT), str_pad(round($query['time_total'], 3), 8, ' ', STR_PAD_LEFT), str_pad(($query['caching'] ? 'enabled' : sprintf('disabled (%s)', $query['reason'])), 30, ' ', STR_PAD_BOTH), str_pad(($query['cached'] ? 'Cached' : 'Not cached'), 10, ' ', STR_PAD_BOTH), str_replace('-->', '-- >', trim($query['query'])));
|
570 |
+
}
|
571 |
+
}
|
572 |
+
|
573 |
+
$debug_info .= '-->';
|
574 |
+
|
575 |
+
return $debug_info;
|
576 |
+
}
|
577 |
}
|
lib/W3/Minify.php
CHANGED
@@ -29,6 +29,7 @@ class W3_Minify
|
|
29 |
function __construct()
|
30 |
{
|
31 |
require_once W3TC_LIB_W3_DIR . '/Config.php';
|
|
|
32 |
$this->_config = & W3_Config::instance();
|
33 |
}
|
34 |
|
29 |
function __construct()
|
30 |
{
|
31 |
require_once W3TC_LIB_W3_DIR . '/Config.php';
|
32 |
+
|
33 |
$this->_config = & W3_Config::instance();
|
34 |
}
|
35 |
|
lib/W3/PgCache.php
CHANGED
@@ -37,11 +37,11 @@ class W3_PgCache
|
|
37 |
var $_lifetime = 0;
|
38 |
|
39 |
/**
|
40 |
-
*
|
41 |
*
|
42 |
* @var boolean
|
43 |
*/
|
44 |
-
var $
|
45 |
|
46 |
/**
|
47 |
* Debug flag
|
@@ -67,7 +67,7 @@ class W3_PgCache
|
|
67 |
$this->_config = & W3_Config::instance();
|
68 |
$this->_debug = $this->_config->get_boolean('pgcache.debug');
|
69 |
$this->_lifetime = $this->_config->get_integer('pgcache.lifetime');
|
70 |
-
$this->
|
71 |
}
|
72 |
|
73 |
/**
|
@@ -125,7 +125,7 @@ class W3_PgCache
|
|
125 |
$data = $cache->get($page_key);
|
126 |
|
127 |
if ($data !== false) {
|
128 |
-
if ($this->
|
129 |
$is_404 = false;
|
130 |
$headers = array();
|
131 |
$time = $cache->mtime($page_key);
|
@@ -138,19 +138,9 @@ class W3_PgCache
|
|
138 |
}
|
139 |
|
140 |
/**
|
141 |
-
*
|
142 |
-
*/
|
143 |
-
if ($this->_debug) {
|
144 |
-
$time_total = w3_microtime() - $this->_time_start;
|
145 |
-
$debug_info = $this->_get_debug_info($page_key, true, '', true, $time_total);
|
146 |
-
$this->_append_content($content, "\r\n\r\n" . $debug_info, $compression);
|
147 |
-
}
|
148 |
-
|
149 |
-
/**
|
150 |
-
* Calculate content etag and length
|
151 |
*/
|
152 |
$etag = md5($content);
|
153 |
-
$content_length = strlen($content);
|
154 |
|
155 |
if ($is_404) {
|
156 |
/**
|
@@ -167,7 +157,16 @@ class W3_PgCache
|
|
167 |
/**
|
168 |
* Send headers
|
169 |
*/
|
170 |
-
$this->_send_headers($time, $etag, $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
|
172 |
echo $content;
|
173 |
exit();
|
@@ -196,7 +195,7 @@ class W3_PgCache
|
|
196 |
$compression = $this->_get_compression();
|
197 |
$compressions = $this->_get_compressions();
|
198 |
|
199 |
-
if ($this->
|
200 |
$is_404 = false;
|
201 |
$headers = array();
|
202 |
} else {
|
@@ -230,7 +229,7 @@ class W3_PgCache
|
|
230 |
/**
|
231 |
* Store cache data
|
232 |
*/
|
233 |
-
if ($this->
|
234 |
$cache->set($_page_key, $_content);
|
235 |
} else {
|
236 |
$_data = array(
|
@@ -250,19 +249,9 @@ class W3_PgCache
|
|
250 |
}
|
251 |
|
252 |
/**
|
253 |
-
*
|
254 |
-
*/
|
255 |
-
if ($this->_debug) {
|
256 |
-
$time_total = w3_microtime() - $this->_time_start;
|
257 |
-
$debug_info = $this->_get_debug_info($page_key, true, '', false, $time_total);
|
258 |
-
$this->_append_content($buffer, "\r\n\r\n" . $debug_info, $compression);
|
259 |
-
}
|
260 |
-
|
261 |
-
/**
|
262 |
-
* Calculate content etag and content length
|
263 |
*/
|
264 |
$etag = md5($buffer);
|
265 |
-
$content_length = strlen($buffer);
|
266 |
|
267 |
if (! $is_404) {
|
268 |
/**
|
@@ -274,7 +263,16 @@ class W3_PgCache
|
|
274 |
/**
|
275 |
* Send headers
|
276 |
*/
|
277 |
-
$this->_send_headers($time, $etag, $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
} elseif ($this->_debug) {
|
279 |
/**
|
280 |
* Append debug info
|
@@ -614,7 +612,7 @@ class W3_PgCache
|
|
614 |
*/
|
615 |
function _get_compression()
|
616 |
{
|
617 |
-
if (!
|
618 |
$compressions = $this->_get_compressions();
|
619 |
|
620 |
foreach ($compressions as $compression) {
|
@@ -855,12 +853,11 @@ class W3_PgCache
|
|
855 |
* Sends headers
|
856 |
* @param string $etag
|
857 |
* @param integer $time
|
858 |
-
* @param integer $content_length
|
859 |
* @param string $compression
|
860 |
* @param array $custom_headers
|
861 |
* @return boolean
|
862 |
*/
|
863 |
-
function _send_headers($time, $etag, $
|
864 |
{
|
865 |
$curr_time = time();
|
866 |
$expires = $time + $this->_lifetime;
|
@@ -877,8 +874,7 @@ class W3_PgCache
|
|
877 |
|
878 |
$headers = array_merge($headers, array(
|
879 |
'Vary' => 'Cookie',
|
880 |
-
'Etag' => $etag
|
881 |
-
'Content-Length' => $content_length
|
882 |
));
|
883 |
|
884 |
if ($compression) {
|
37 |
var $_lifetime = 0;
|
38 |
|
39 |
/**
|
40 |
+
* Enhanced mode flag
|
41 |
*
|
42 |
* @var boolean
|
43 |
*/
|
44 |
+
var $_enhanced_mode = false;
|
45 |
|
46 |
/**
|
47 |
* Debug flag
|
67 |
$this->_config = & W3_Config::instance();
|
68 |
$this->_debug = $this->_config->get_boolean('pgcache.debug');
|
69 |
$this->_lifetime = $this->_config->get_integer('pgcache.lifetime');
|
70 |
+
$this->_enhanced_mode = ($this->_config->get_string('pgcache.engine') == 'file_pgcache');
|
71 |
}
|
72 |
|
73 |
/**
|
125 |
$data = $cache->get($page_key);
|
126 |
|
127 |
if ($data !== false) {
|
128 |
+
if ($this->_enhanced_mode) {
|
129 |
$is_404 = false;
|
130 |
$headers = array();
|
131 |
$time = $cache->mtime($page_key);
|
138 |
}
|
139 |
|
140 |
/**
|
141 |
+
* Calculate content etag
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
*/
|
143 |
$etag = md5($content);
|
|
|
144 |
|
145 |
if ($is_404) {
|
146 |
/**
|
157 |
/**
|
158 |
* Send headers
|
159 |
*/
|
160 |
+
$this->_send_headers($time, $etag, $compression, $headers);
|
161 |
+
|
162 |
+
/**
|
163 |
+
* Append debug info
|
164 |
+
*/
|
165 |
+
if ($this->_debug) {
|
166 |
+
$time_total = w3_microtime() - $this->_time_start;
|
167 |
+
$debug_info = $this->_get_debug_info($page_key, true, '', true, $time_total);
|
168 |
+
$this->_append_content($content, "\r\n\r\n" . $debug_info, $compression);
|
169 |
+
}
|
170 |
|
171 |
echo $content;
|
172 |
exit();
|
195 |
$compression = $this->_get_compression();
|
196 |
$compressions = $this->_get_compressions();
|
197 |
|
198 |
+
if ($this->_enhanced_mode) {
|
199 |
$is_404 = false;
|
200 |
$headers = array();
|
201 |
} else {
|
229 |
/**
|
230 |
* Store cache data
|
231 |
*/
|
232 |
+
if ($this->_enhanced_mode) {
|
233 |
$cache->set($_page_key, $_content);
|
234 |
} else {
|
235 |
$_data = array(
|
249 |
}
|
250 |
|
251 |
/**
|
252 |
+
* Calculate content etag
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
253 |
*/
|
254 |
$etag = md5($buffer);
|
|
|
255 |
|
256 |
if (! $is_404) {
|
257 |
/**
|
263 |
/**
|
264 |
* Send headers
|
265 |
*/
|
266 |
+
$this->_send_headers($time, $etag, $compression);
|
267 |
+
|
268 |
+
/**
|
269 |
+
* Append debug info
|
270 |
+
*/
|
271 |
+
if ($this->_debug) {
|
272 |
+
$time_total = w3_microtime() - $this->_time_start;
|
273 |
+
$debug_info = $this->_get_debug_info($page_key, true, '', false, $time_total);
|
274 |
+
$this->_append_content($buffer, "\r\n\r\n" . $debug_info, $compression);
|
275 |
+
}
|
276 |
} elseif ($this->_debug) {
|
277 |
/**
|
278 |
* Append debug info
|
612 |
*/
|
613 |
function _get_compression()
|
614 |
{
|
615 |
+
if (! w3_zlib_output_compression() && ! headers_sent()) {
|
616 |
$compressions = $this->_get_compressions();
|
617 |
|
618 |
foreach ($compressions as $compression) {
|
853 |
* Sends headers
|
854 |
* @param string $etag
|
855 |
* @param integer $time
|
|
|
856 |
* @param string $compression
|
857 |
* @param array $custom_headers
|
858 |
* @return boolean
|
859 |
*/
|
860 |
+
function _send_headers($time, $etag, $compression, $custom_headers = array())
|
861 |
{
|
862 |
$curr_time = time();
|
863 |
$expires = $time + $this->_lifetime;
|
874 |
|
875 |
$headers = array_merge($headers, array(
|
876 |
'Vary' => 'Cookie',
|
877 |
+
'Etag' => $etag
|
|
|
878 |
));
|
879 |
|
880 |
if ($compression) {
|
lib/W3/Plugin.php
CHANGED
@@ -22,7 +22,8 @@ class W3_Plugin
|
|
22 |
function __construct()
|
23 |
{
|
24 |
require_once W3TC_LIB_W3_DIR . '/Config.php';
|
25 |
-
|
|
|
26 |
}
|
27 |
|
28 |
/**
|
22 |
function __construct()
|
23 |
{
|
24 |
require_once W3TC_LIB_W3_DIR . '/Config.php';
|
25 |
+
|
26 |
+
$this->_config = & W3_Config::instance();
|
27 |
}
|
28 |
|
29 |
/**
|
lib/W3/Plugin/Cdn.php
CHANGED
@@ -128,7 +128,9 @@ class W3_Plugin_Cdn extends W3_Plugin
|
|
128 |
$wpdb->query($sql);
|
129 |
|
130 |
if (! $wpdb->result) {
|
131 |
-
|
|
|
|
|
132 |
}
|
133 |
|
134 |
$this->schedule();
|
@@ -260,9 +262,9 @@ class W3_Plugin_Cdn extends W3_Plugin
|
|
260 |
function ob_callback($buffer)
|
261 |
{
|
262 |
if ($buffer != '' && w3_is_xml($buffer)) {
|
263 |
-
$site_url_regexp = w3_get_site_url_regexp();
|
264 |
-
$upload_info = w3_upload_info();
|
265 |
$regexps = array();
|
|
|
|
|
266 |
|
267 |
if ($upload_info) {
|
268 |
$regexps[] = '~(["\'])((' . $site_url_regexp . ')?/?(' . w3_preg_quote($upload_info['upload_url']) . '[^"\'>]+))~';
|
@@ -270,7 +272,7 @@ class W3_Plugin_Cdn extends W3_Plugin
|
|
270 |
|
271 |
if ($this->_config->get_boolean('cdn.includes.enable')) {
|
272 |
$mask = $this->_config->get_string('cdn.includes.files');
|
273 |
-
if (
|
274 |
$regexps[] = '~(["\'])((' . $site_url_regexp . ')?/?(' . w3_preg_quote(WPINC) . '/(' . $this->get_regexp_by_mask($mask) . ')))~';
|
275 |
}
|
276 |
}
|
@@ -278,7 +280,7 @@ class W3_Plugin_Cdn extends W3_Plugin
|
|
278 |
if ($this->_config->get_boolean('cdn.theme.enable')) {
|
279 |
$theme_dir = preg_replace('~' . $site_url_regexp . '~i', '', get_stylesheet_directory_uri());
|
280 |
$mask = $this->_config->get_string('cdn.theme.files');
|
281 |
-
if (
|
282 |
$regexps[] = '~(["\'])((' . $site_url_regexp . ')?/?(' . w3_preg_quote($theme_dir) . '/(' . $this->get_regexp_by_mask($mask) . ')))~';
|
283 |
}
|
284 |
}
|
@@ -289,13 +291,18 @@ class W3_Plugin_Cdn extends W3_Plugin
|
|
289 |
|
290 |
if ($this->_config->get_boolean('cdn.custom.enable')) {
|
291 |
$masks = $this->_config->get_array('cdn.custom.files');
|
292 |
-
|
|
|
293 |
$mask_regexps = array();
|
|
|
294 |
foreach ($masks as $mask) {
|
295 |
-
|
296 |
-
|
|
|
|
|
297 |
}
|
298 |
-
|
|
|
299 |
}
|
300 |
}
|
301 |
|
@@ -648,7 +655,6 @@ class W3_Plugin_Cdn extends W3_Plugin
|
|
648 |
$results = array();
|
649 |
|
650 |
$site_url = w3_get_site_url();
|
651 |
-
$site_url_regexp = w3_get_site_url_regexp();
|
652 |
$upload_info = w3_upload_info();
|
653 |
|
654 |
if ($upload_info) {
|
@@ -687,7 +693,7 @@ class W3_Plugin_Cdn extends W3_Plugin
|
|
687 |
|
688 |
if (preg_match_all('~(href|src)=[\'"]?([^\'"<>\s]+)[\'"]?~', $post_content, $matches, PREG_SET_ORDER)) {
|
689 |
foreach ($matches as $match) {
|
690 |
-
$src =
|
691 |
|
692 |
if (preg_match('~(' . $regexp . ')$~', $src)) {
|
693 |
$src_dir = date('Y/m', strtotime($post->post_date));
|
@@ -963,17 +969,18 @@ class W3_Plugin_Cdn extends W3_Plugin
|
|
963 |
*/
|
964 |
function get_files_custom()
|
965 |
{
|
966 |
-
$site_url_regexp = w3_get_site_url_regexp();
|
967 |
-
$custom_files = $this->_config->get_array('cdn.custom.files');
|
968 |
$files = array();
|
|
|
969 |
|
970 |
foreach ($custom_files as $custom_file) {
|
971 |
-
if (
|
972 |
-
$custom_file =
|
973 |
$dir = trim(dirname($custom_file), '/\\');
|
|
|
974 |
if ($dir == '.') {
|
975 |
$dir = '';
|
976 |
}
|
|
|
977 |
$mask = basename($custom_file);
|
978 |
$files = array_merge($files, $this->search_files(ABSPATH . $dir, $dir, $mask));
|
979 |
}
|
@@ -1032,7 +1039,7 @@ class W3_Plugin_Cdn extends W3_Plugin
|
|
1032 |
function link_replace_callback($matches)
|
1033 |
{
|
1034 |
global $wpdb;
|
1035 |
-
static $queue = null;
|
1036 |
|
1037 |
if (in_array($matches[2], $this->replaced_urls)) {
|
1038 |
return $matches[0];
|
@@ -1043,10 +1050,34 @@ class W3_Plugin_Cdn extends W3_Plugin
|
|
1043 |
$queue = $wpdb->get_col($sql);
|
1044 |
}
|
1045 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1046 |
if (in_array(ltrim($matches[4], '/'), $queue)) {
|
1047 |
return $matches[0];
|
1048 |
}
|
1049 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1050 |
$path = '/' . w3_get_site_path() . $matches[4];
|
1051 |
|
1052 |
$cdn = & $this->get_cdn();
|
128 |
$wpdb->query($sql);
|
129 |
|
130 |
if (! $wpdb->result) {
|
131 |
+
$error = sprintf('Unable to create table <strong>%s%s</strong>: %s', $wpdb->prefix, W3TC_CDN_TABLE_QUEUE, $wpdb->last_error);
|
132 |
+
|
133 |
+
w3_activate_error($error);
|
134 |
}
|
135 |
|
136 |
$this->schedule();
|
262 |
function ob_callback($buffer)
|
263 |
{
|
264 |
if ($buffer != '' && w3_is_xml($buffer)) {
|
|
|
|
|
265 |
$regexps = array();
|
266 |
+
$upload_info = w3_upload_info();
|
267 |
+
$site_url_regexp = w3_get_site_url_regexp();
|
268 |
|
269 |
if ($upload_info) {
|
270 |
$regexps[] = '~(["\'])((' . $site_url_regexp . ')?/?(' . w3_preg_quote($upload_info['upload_url']) . '[^"\'>]+))~';
|
272 |
|
273 |
if ($this->_config->get_boolean('cdn.includes.enable')) {
|
274 |
$mask = $this->_config->get_string('cdn.includes.files');
|
275 |
+
if ($mask != '') {
|
276 |
$regexps[] = '~(["\'])((' . $site_url_regexp . ')?/?(' . w3_preg_quote(WPINC) . '/(' . $this->get_regexp_by_mask($mask) . ')))~';
|
277 |
}
|
278 |
}
|
280 |
if ($this->_config->get_boolean('cdn.theme.enable')) {
|
281 |
$theme_dir = preg_replace('~' . $site_url_regexp . '~i', '', get_stylesheet_directory_uri());
|
282 |
$mask = $this->_config->get_string('cdn.theme.files');
|
283 |
+
if ($mask != '') {
|
284 |
$regexps[] = '~(["\'])((' . $site_url_regexp . ')?/?(' . w3_preg_quote($theme_dir) . '/(' . $this->get_regexp_by_mask($mask) . ')))~';
|
285 |
}
|
286 |
}
|
291 |
|
292 |
if ($this->_config->get_boolean('cdn.custom.enable')) {
|
293 |
$masks = $this->_config->get_array('cdn.custom.files');
|
294 |
+
|
295 |
+
if (count($masks)) {
|
296 |
$mask_regexps = array();
|
297 |
+
|
298 |
foreach ($masks as $mask) {
|
299 |
+
if ($mask != '') {
|
300 |
+
$mask = w3_normalize_file($mask);
|
301 |
+
$mask_regexps[] = $this->get_regexp_by_mask($mask);
|
302 |
+
}
|
303 |
}
|
304 |
+
|
305 |
+
$regexps[] = '~(["\'])((' . $site_url_regexp . ')?/?(' . implode('|', $mask_regexps) . '))~i';
|
306 |
}
|
307 |
}
|
308 |
|
655 |
$results = array();
|
656 |
|
657 |
$site_url = w3_get_site_url();
|
|
|
658 |
$upload_info = w3_upload_info();
|
659 |
|
660 |
if ($upload_info) {
|
693 |
|
694 |
if (preg_match_all('~(href|src)=[\'"]?([^\'"<>\s]+)[\'"]?~', $post_content, $matches, PREG_SET_ORDER)) {
|
695 |
foreach ($matches as $match) {
|
696 |
+
$src = w3_normalize_file($match[2]);
|
697 |
|
698 |
if (preg_match('~(' . $regexp . ')$~', $src)) {
|
699 |
$src_dir = date('Y/m', strtotime($post->post_date));
|
969 |
*/
|
970 |
function get_files_custom()
|
971 |
{
|
|
|
|
|
972 |
$files = array();
|
973 |
+
$custom_files = $this->_config->get_array('cdn.custom.files');
|
974 |
|
975 |
foreach ($custom_files as $custom_file) {
|
976 |
+
if ($custom_file != '') {
|
977 |
+
$custom_file = w3_normalize_file($custom_file);
|
978 |
$dir = trim(dirname($custom_file), '/\\');
|
979 |
+
|
980 |
if ($dir == '.') {
|
981 |
$dir = '';
|
982 |
}
|
983 |
+
|
984 |
$mask = basename($custom_file);
|
985 |
$files = array_merge($files, $this->search_files(ABSPATH . $dir, $dir, $mask));
|
986 |
}
|
1039 |
function link_replace_callback($matches)
|
1040 |
{
|
1041 |
global $wpdb;
|
1042 |
+
static $queue = null, $reject_files = null;
|
1043 |
|
1044 |
if (in_array($matches[2], $this->replaced_urls)) {
|
1045 |
return $matches[0];
|
1050 |
$queue = $wpdb->get_col($sql);
|
1051 |
}
|
1052 |
|
1053 |
+
if ($reject_files === null) {
|
1054 |
+
$reject_files = $this->_config->get_array('cdn.reject.files');
|
1055 |
+
}
|
1056 |
+
|
1057 |
+
/**
|
1058 |
+
* Don't replace links that are in the queue
|
1059 |
+
*/
|
1060 |
if (in_array(ltrim($matches[4], '/'), $queue)) {
|
1061 |
return $matches[0];
|
1062 |
}
|
1063 |
|
1064 |
+
/**
|
1065 |
+
* Don't replace link for rejected files
|
1066 |
+
*/
|
1067 |
+
foreach ($reject_files as $reject_file) {
|
1068 |
+
if ($reject_file != '') {
|
1069 |
+
$reject_file = w3_normalize_file($reject_file);
|
1070 |
+
$reject_file_regexp = '~^' . $this->get_regexp_by_mask($reject_file) . '$~i';
|
1071 |
+
|
1072 |
+
if (preg_match($reject_file_regexp, $matches[4])) {
|
1073 |
+
return $matches[0];
|
1074 |
+
}
|
1075 |
+
}
|
1076 |
+
}
|
1077 |
+
|
1078 |
+
/**
|
1079 |
+
* Do replacement
|
1080 |
+
*/
|
1081 |
$path = '/' . w3_get_site_path() . $matches[4];
|
1082 |
|
1083 |
$cdn = & $this->get_cdn();
|
lib/W3/Plugin/Minify.php
CHANGED
@@ -844,7 +844,7 @@ class W3_Plugin_Minify extends W3_Plugin
|
|
844 |
$rules .= " RewriteRule (.*) $1%{ENV:APPEND_EXT} [L]\n";
|
845 |
}
|
846 |
|
847 |
-
$rules .= " RewriteRule ^([a-z0-9
|
848 |
|
849 |
$rules .= "</IfModule>\n";
|
850 |
|
844 |
$rules .= " RewriteRule (.*) $1%{ENV:APPEND_EXT} [L]\n";
|
845 |
}
|
846 |
|
847 |
+
$rules .= " RewriteRule ^([a-z0-9\\-_]+)\\.(include(-footer)?(-nb)?)\\.(css|js)$ index.php?gg=$1&g=$2&t=$5 [L]\n";
|
848 |
|
849 |
$rules .= "</IfModule>\n";
|
850 |
|
lib/W3/Plugin/PgCache.php
CHANGED
@@ -124,7 +124,9 @@ class W3_Plugin_PgCache extends W3_Plugin
|
|
124 |
{
|
125 |
if (! $this->locked()) {
|
126 |
if (! $this->update_wp_config()) {
|
127 |
-
|
|
|
|
|
128 |
}
|
129 |
|
130 |
if ($this->_config->get_boolean('pgcache.enabled') && $this->_config->get_string('pgcache.engine') == 'file_pgcache') {
|
@@ -466,7 +468,7 @@ class W3_Plugin_PgCache extends W3_Plugin
|
|
466 |
}
|
467 |
|
468 |
$rules .= " RewriteCond " . str_replace('\\', '/', W3TC_CACHE_FILE_PGCACHE_DIR) . "/%{HTTP_HOST}/$1/index.html%{ENV:APPEND_EXT} -f\n";
|
469 |
-
$rules .= " RewriteRule
|
470 |
$rules .= "</IfModule>\n";
|
471 |
|
472 |
$rules .= "# END W3 Total Cache\n\n";
|
124 |
{
|
125 |
if (! $this->locked()) {
|
126 |
if (! $this->update_wp_config()) {
|
127 |
+
$error = sprintf('<strong>%swp-config.php</strong> could not be written, please edit config and add:<br /><strong style="color:#f00;">define(\'WP_CACHE\', true);</strong> before <strong style="color:#f00;">require_once(ABSPATH . \'wp-settings.php\');</strong><br />then re-activate plugin.', ABSPATH);
|
128 |
+
|
129 |
+
w3_activate_error($error);
|
130 |
}
|
131 |
|
132 |
if ($this->_config->get_boolean('pgcache.enabled') && $this->_config->get_string('pgcache.engine') == 'file_pgcache') {
|
468 |
}
|
469 |
|
470 |
$rules .= " RewriteCond " . str_replace('\\', '/', W3TC_CACHE_FILE_PGCACHE_DIR) . "/%{HTTP_HOST}/$1/index.html%{ENV:APPEND_EXT} -f\n";
|
471 |
+
$rules .= " RewriteRule (.*) " . str_replace(ABSPATH, '', W3TC_CACHE_FILE_PGCACHE_DIR) . "/%{HTTP_HOST}/$1/index.html%{ENV:APPEND_EXT} [L]\n";
|
472 |
$rules .= "</IfModule>\n";
|
473 |
|
474 |
$rules .= "# END W3 Total Cache\n\n";
|
lib/W3/Plugin/TotalCache.php
CHANGED
@@ -232,7 +232,7 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
232 |
$this->_config->set('common.install', time());
|
233 |
}
|
234 |
|
235 |
-
if (!
|
236 |
w3_writable_error(W3TC_CONFIG_PATH);
|
237 |
}
|
238 |
|
@@ -405,6 +405,21 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
405 |
$this->redirect(array(), true);
|
406 |
}
|
407 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
408 |
/**
|
409 |
* Write page cache rules
|
410 |
*/
|
@@ -649,7 +664,7 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
649 |
'flush_memcached' => 'Memcached cache(s) successfully emptied.',
|
650 |
'flush_apc' => 'Opcode (APC) cache successfully emptied.',
|
651 |
'flush_file' => 'Disk cache successfully emptied.',
|
652 |
-
'flush_pgcache' => 'Page cache
|
653 |
'flush_dbcache' => 'Database cache successfully emptied.',
|
654 |
'flush_minify' => 'Minify cache successfully emptied.',
|
655 |
'pgcache_write_rules_core' => 'Page cache rewrite rules have been successfully written.',
|
@@ -678,29 +693,48 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
678 |
}
|
679 |
|
680 |
/**
|
681 |
-
*
|
682 |
*/
|
683 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
684 |
if ($this->_config->get_boolean('notes.theme_changed')) {
|
685 |
$notes[] = sprintf('Your active theme has changed, please %s now to ensure proper operation. %s', $this->button_popup('upload active theme files', 'cdn_export', 'cdn_export_type=theme'), $this->button_hide_note('Hide this message', 'theme_changed'));
|
686 |
}
|
687 |
|
|
|
|
|
|
|
688 |
if ($this->_config->get_boolean('notes.wp_upgraded')) {
|
689 |
$notes[] = sprintf('Have you upgraded WordPress? Please %s files now to ensure proper operation. %s', $this->button_popup('upload wp-includes', 'cdn_export', 'cdn_export_type=includes'), $this->button_hide_note('Hide this message', 'wp_upgraded'));
|
690 |
}
|
691 |
|
692 |
-
|
|
|
|
|
|
|
693 |
$cdn_upload_buttons = array();
|
694 |
|
695 |
if ($this->_config->get_boolean('cdn.includes.enable')) {
|
696 |
$cdn_upload_buttons[] = $this->button_popup('wp-includes', 'cdn_export', 'cdn_export_type=includes');
|
697 |
}
|
|
|
698 |
if ($this->_config->get_boolean('cdn.theme.enable')) {
|
699 |
$cdn_upload_buttons[] = $this->button_popup('theme files', 'cdn_export', 'cdn_export_type=theme');
|
700 |
}
|
701 |
-
|
|
|
702 |
$cdn_upload_buttons[] = $this->button_popup('minify files', 'cdn_export', 'cdn_export_type=minify');
|
703 |
}
|
|
|
704 |
if ($this->_config->get_boolean('cdn.custom.enable')) {
|
705 |
$cdn_upload_buttons[] = $this->button_popup('custom files', 'cdn_export', 'cdn_export_type=custom');
|
706 |
}
|
@@ -709,6 +743,9 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
709 |
}
|
710 |
}
|
711 |
|
|
|
|
|
|
|
712 |
if ($this->_config->get_boolean('notes.plugins_updated')) {
|
713 |
$texts = array();
|
714 |
|
@@ -725,11 +762,16 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
725 |
}
|
726 |
}
|
727 |
|
|
|
|
|
|
|
728 |
if ($this->_config->get_boolean('pgcache.enabled') && $this->_config->get('notes.need_empty_pgcache')) {
|
729 |
$notes[] = sprintf('The setting change(s) made either invalidate your cached data or modify the behavior of your site. %s now to provide a consistent user experience.', $this->button_link('Empty the page cache', sprintf('options-general.php?page=%s&tab=%s&flush_pgcache', W3TC_FILE, $this->_tab)));
|
730 |
-
|
731 |
}
|
732 |
|
|
|
|
|
|
|
733 |
if ($this->_config->get_boolean('minify.enabled') && $this->_config->get('notes.need_empty_minify')) {
|
734 |
$notes[] = sprintf('The setting change(s) made either invalidate your cached data or modify the behavior of your site. %s now to provide a consistent user experience.', $this->button_link('Empty the minify cache', sprintf('options-general.php?page=%s&tab=%s&flush_minify', W3TC_FILE, $this->_tab)));
|
735 |
}
|
@@ -738,11 +780,11 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
738 |
* Show messages
|
739 |
*/
|
740 |
foreach ($errors as $error) {
|
741 |
-
echo sprintf('<div
|
742 |
}
|
743 |
|
744 |
foreach ($notes as $note) {
|
745 |
-
echo sprintf('<div
|
746 |
}
|
747 |
}
|
748 |
|
@@ -838,7 +880,7 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
838 |
function options()
|
839 |
{
|
840 |
/**
|
841 |
-
* Check for
|
842 |
*/
|
843 |
if ($this->_config->get_boolean('pgcache.enabled')) {
|
844 |
if (! $this->check_advanced_cache()) {
|
@@ -910,7 +952,7 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
910 |
}
|
911 |
|
912 |
/**
|
913 |
-
* Check for
|
914 |
*/
|
915 |
if ($this->_config->get_boolean('dbcache.enabled')) {
|
916 |
if (! $this->check_db()) {
|
@@ -931,10 +973,27 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
931 |
$this->_notes[] = sprintf('Unfortunately, <strong>PHP5</strong> is required for full functionality of this plugin; incompatible features are automatically disabled. Please upgrade if possible. %s', $this->button_hide_note('Hide this message', 'php_is_old'));
|
932 |
}
|
933 |
|
934 |
-
|
|
|
|
|
|
|
935 |
$this->_notes[] = sprintf('The <strong>CURL PHP</strong> extension is not available. Please install it to enable S3 or CloudFront functionality. %s', $this->button_hide_note('Hide this message', 'no_curl'));
|
936 |
}
|
937 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
938 |
/**
|
939 |
* Show message when defaults are set
|
940 |
*/
|
@@ -955,10 +1014,28 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
955 |
}
|
956 |
|
957 |
/**
|
958 |
-
* Check
|
959 |
*/
|
960 |
-
if ($this->_config->get_boolean('
|
961 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
962 |
}
|
963 |
|
964 |
/**
|
@@ -1015,8 +1092,8 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
1015 |
|
1016 |
$enabled = ($pgcache_enabled || $dbcache_enabled || $minify_enabled || $cdn_enabled);
|
1017 |
|
1018 |
-
$check_apc =
|
1019 |
-
$check_curl =
|
1020 |
|
1021 |
$pgcache_engine = $this->_config->get_string('pgcache.engine');
|
1022 |
$dbcache_engine = $this->_config->get_string('dbcache.engine');
|
@@ -1082,30 +1159,12 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
1082 |
$cdn_engine = $this->_config->get_string('cdn.engine');
|
1083 |
$cdn_mirror = ($cdn_engine == 'mirror');
|
1084 |
|
|
|
|
|
1085 |
if ($this->_config->get_boolean('notes.cdn_first_time')) {
|
1086 |
$this->_notes[] = sprintf('It appears this is the first time you are using CDN feature. Unless you wish to first import attachments in your posts that are not already in the media library, please start a <strong>"manual export to <acronym title="Content Delivery Network">CDN</acronym>"</strong> and only enable this module after pending attachments have been successfully uploaded. %s', $this->button_hide_note('Hide this message', 'cdn_first_time'));
|
1087 |
}
|
1088 |
|
1089 |
-
if ($cdn_enabled) {
|
1090 |
-
switch (true) {
|
1091 |
-
case ($cdn_engine == 'mirror' && $this->_config->get_string('cdn.mirror.domain') == ''):
|
1092 |
-
$this->_errors[] = 'The <strong>"Replace default hostname with"</strong> field must be populated.';
|
1093 |
-
break;
|
1094 |
-
|
1095 |
-
case ($cdn_engine == 'ftp' && $this->_config->get_string('cdn.ftp.domain') == ''):
|
1096 |
-
$this->_errors[] = 'The <strong>"Replace default hostname with"</strong> field must be populated. Enter the hostname of your <acronym title="Content Delivery Network">CDN</acronym> provider. <em>This is the hostname you would enter into your address bar in order to view objects in your browser.</em>';
|
1097 |
-
break;
|
1098 |
-
|
1099 |
-
case ($cdn_engine == 's3' && ($this->_config->get_string('cdn.s3.key') == '' || $this->_config->get_string('cdn.s3.bucket') == '' || $this->_config->get_string('cdn.s3.bucket') == '')):
|
1100 |
-
$this->_errors[] = 'The <strong>"Access key", "Secret key" and "Bucket"</strong> fields must be populated.';
|
1101 |
-
break;
|
1102 |
-
|
1103 |
-
case ($cdn_engine == 'cf' && ($this->_config->get_string('cdn.cf.key') == '' || $this->_config->get_string('cdn.cf.secret') == '' || $this->_config->get_string('cdn.cf.bucket') == '' || ($this->_config->get_string('cdn.cf.id') == '' && $this->_config->get_string('cdn.cf.cname') == ''))):
|
1104 |
-
$this->_errors[] = 'The <strong>"Access key", "Secret key", "Bucket" and "Replace default hostname with"</strong> fields must be populated.';
|
1105 |
-
break;
|
1106 |
-
}
|
1107 |
-
}
|
1108 |
-
|
1109 |
include W3TC_DIR . '/inc/options/cdn.phtml';
|
1110 |
}
|
1111 |
|
@@ -1779,7 +1838,7 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
1779 |
}
|
1780 |
|
1781 |
$queue = $w3_plugin_cdn->queue_get();
|
1782 |
-
$title = '
|
1783 |
|
1784 |
include W3TC_DIR . '/inc/popup/cdn_queue.phtml';
|
1785 |
}
|
@@ -2397,36 +2456,6 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
2397 |
return (file_exists(WP_CONTENT_DIR . '/db.php') && ($script_data = @file_get_contents(WP_CONTENT_DIR . '/db.php')) && strstr($script_data, 'W3_Db') !== false);
|
2398 |
}
|
2399 |
|
2400 |
-
/**
|
2401 |
-
* Checks Memcache availability
|
2402 |
-
*
|
2403 |
-
* @return boolean
|
2404 |
-
*/
|
2405 |
-
function check_memcache()
|
2406 |
-
{
|
2407 |
-
return class_exists('Memcache');
|
2408 |
-
}
|
2409 |
-
|
2410 |
-
/**
|
2411 |
-
* Checks APC availability
|
2412 |
-
*
|
2413 |
-
* @return boolean
|
2414 |
-
*/
|
2415 |
-
function check_apc()
|
2416 |
-
{
|
2417 |
-
return function_exists('apc_store');
|
2418 |
-
}
|
2419 |
-
|
2420 |
-
/**
|
2421 |
-
* Checks CURL availability
|
2422 |
-
*
|
2423 |
-
* @return boolean
|
2424 |
-
*/
|
2425 |
-
function check_curl()
|
2426 |
-
{
|
2427 |
-
return function_exists('curl_init');
|
2428 |
-
}
|
2429 |
-
|
2430 |
/**
|
2431 |
* Output buffering callback
|
2432 |
*
|
@@ -2438,8 +2467,8 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
2438 |
global $wpdb;
|
2439 |
|
2440 |
if ($buffer != '' && w3_is_xml($buffer)) {
|
2441 |
-
$host = gethostbyaddr($_SERVER['SERVER_ADDR']);
|
2442 |
$date = date('Y-m-d H:i:s');
|
|
|
2443 |
|
2444 |
if ($this->is_supported()) {
|
2445 |
$buffer .= sprintf("\r\n<!-- Served from: %s @ %s by W3 Total Cache -->", $host, $date);
|
@@ -2472,6 +2501,7 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
2472 |
|
2473 |
if ($this->_config->get_boolean('cdn.enabled')) {
|
2474 |
require_once W3TC_LIB_W3_DIR . '/Plugin/Cdn.php';
|
|
|
2475 |
$w3_plugin_cdn = & W3_Plugin_Cdn::instance();
|
2476 |
$cdn = & $w3_plugin_cdn->get_cdn();
|
2477 |
$via = $cdn->get_via();
|
@@ -2481,10 +2511,6 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
2481 |
|
2482 |
$buffer .= sprintf("\r\nServed from: %s @ %s -->", $host, $date);
|
2483 |
}
|
2484 |
-
|
2485 |
-
if ($this->_config->get_boolean('dbcache.enabled') && $this->_config->get_boolean('dbcache.debug') && is_a($wpdb, 'W3_Db')) {
|
2486 |
-
$buffer .= "\r\n\r\n" . $wpdb->get_debug_info();
|
2487 |
-
}
|
2488 |
}
|
2489 |
|
2490 |
return $buffer;
|
@@ -2538,6 +2564,13 @@ class W3_Plugin_TotalCache extends W3_Plugin
|
|
2538 |
return false;
|
2539 |
}
|
2540 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2541 |
return true;
|
2542 |
}
|
2543 |
|
232 |
$this->_config->set('common.install', time());
|
233 |
}
|
234 |
|
235 |
+
if (! $this->_config->save()) {
|
236 |
w3_writable_error(W3TC_CONFIG_PATH);
|
237 |
}
|
238 |
|
405 |
$this->redirect(array(), true);
|
406 |
}
|
407 |
|
408 |
+
/**
|
409 |
+
* Save config
|
410 |
+
*/
|
411 |
+
if (isset($_REQUEST['save_config'])) {
|
412 |
+
if ($this->_config->save()) {
|
413 |
+
$this->redirect(array(
|
414 |
+
'note' => 'config_save'
|
415 |
+
), true);
|
416 |
+
} else {
|
417 |
+
$this->redirect(array(
|
418 |
+
'error' => 'config_save'
|
419 |
+
), true);
|
420 |
+
}
|
421 |
+
}
|
422 |
+
|
423 |
/**
|
424 |
* Write page cache rules
|
425 |
*/
|
664 |
'flush_memcached' => 'Memcached cache(s) successfully emptied.',
|
665 |
'flush_apc' => 'Opcode (APC) cache successfully emptied.',
|
666 |
'flush_file' => 'Disk cache successfully emptied.',
|
667 |
+
'flush_pgcache' => 'Page cache successfully emptied.',
|
668 |
'flush_dbcache' => 'Database cache successfully emptied.',
|
669 |
'flush_minify' => 'Minify cache successfully emptied.',
|
670 |
'pgcache_write_rules_core' => 'Page cache rewrite rules have been successfully written.',
|
693 |
}
|
694 |
|
695 |
/**
|
696 |
+
* Check config file
|
697 |
*/
|
698 |
+
if (! file_exists(W3TC_CONFIG_PATH)) {
|
699 |
+
$errors[] = sprintf('<strong>W3 Total Cache Error:</strong> Default settings are in use. The configuration file could not be read or doesn\'t exist. Please %s to create the file.', $this->button_link('save your settings', sprintf('options-general.php?page=%s&tab=%s&save_config', W3TC_FILE, $this->_tab)));
|
700 |
+
}
|
701 |
+
|
702 |
+
/**
|
703 |
+
* CDN notifications
|
704 |
+
*/
|
705 |
+
if ($this->_config->get_boolean('cdn.enabled') && $this->_config->get_string('cdn.engine') != 'mirror') {
|
706 |
+
/**
|
707 |
+
* Show notification after theme change
|
708 |
+
*/
|
709 |
if ($this->_config->get_boolean('notes.theme_changed')) {
|
710 |
$notes[] = sprintf('Your active theme has changed, please %s now to ensure proper operation. %s', $this->button_popup('upload active theme files', 'cdn_export', 'cdn_export_type=theme'), $this->button_hide_note('Hide this message', 'theme_changed'));
|
711 |
}
|
712 |
|
713 |
+
/**
|
714 |
+
* Show notification after WP upgrade
|
715 |
+
*/
|
716 |
if ($this->_config->get_boolean('notes.wp_upgraded')) {
|
717 |
$notes[] = sprintf('Have you upgraded WordPress? Please %s files now to ensure proper operation. %s', $this->button_popup('upload wp-includes', 'cdn_export', 'cdn_export_type=includes'), $this->button_hide_note('Hide this message', 'wp_upgraded'));
|
718 |
}
|
719 |
|
720 |
+
/**
|
721 |
+
* Show notification after CDN enable
|
722 |
+
*/
|
723 |
+
if ($this->_config->get_boolean('notes.cdn_upload')) {
|
724 |
$cdn_upload_buttons = array();
|
725 |
|
726 |
if ($this->_config->get_boolean('cdn.includes.enable')) {
|
727 |
$cdn_upload_buttons[] = $this->button_popup('wp-includes', 'cdn_export', 'cdn_export_type=includes');
|
728 |
}
|
729 |
+
|
730 |
if ($this->_config->get_boolean('cdn.theme.enable')) {
|
731 |
$cdn_upload_buttons[] = $this->button_popup('theme files', 'cdn_export', 'cdn_export_type=theme');
|
732 |
}
|
733 |
+
|
734 |
+
if ($this->_config->get_boolean('minify.enabled') && $this->_config->get_boolean('cdn.minify.enable')) {
|
735 |
$cdn_upload_buttons[] = $this->button_popup('minify files', 'cdn_export', 'cdn_export_type=minify');
|
736 |
}
|
737 |
+
|
738 |
if ($this->_config->get_boolean('cdn.custom.enable')) {
|
739 |
$cdn_upload_buttons[] = $this->button_popup('custom files', 'cdn_export', 'cdn_export_type=custom');
|
740 |
}
|
743 |
}
|
744 |
}
|
745 |
|
746 |
+
/**
|
747 |
+
* Show notification after plugin activate/deactivate
|
748 |
+
*/
|
749 |
if ($this->_config->get_boolean('notes.plugins_updated')) {
|
750 |
$texts = array();
|
751 |
|
762 |
}
|
763 |
}
|
764 |
|
765 |
+
/**
|
766 |
+
* Show notification when page cache needs to be emptied
|
767 |
+
*/
|
768 |
if ($this->_config->get_boolean('pgcache.enabled') && $this->_config->get('notes.need_empty_pgcache')) {
|
769 |
$notes[] = sprintf('The setting change(s) made either invalidate your cached data or modify the behavior of your site. %s now to provide a consistent user experience.', $this->button_link('Empty the page cache', sprintf('options-general.php?page=%s&tab=%s&flush_pgcache', W3TC_FILE, $this->_tab)));
|
|
|
770 |
}
|
771 |
|
772 |
+
/**
|
773 |
+
* Show notification when minify needs to be emptied
|
774 |
+
*/
|
775 |
if ($this->_config->get_boolean('minify.enabled') && $this->_config->get('notes.need_empty_minify')) {
|
776 |
$notes[] = sprintf('The setting change(s) made either invalidate your cached data or modify the behavior of your site. %s now to provide a consistent user experience.', $this->button_link('Empty the minify cache', sprintf('options-general.php?page=%s&tab=%s&flush_minify', W3TC_FILE, $this->_tab)));
|
777 |
}
|
780 |
* Show messages
|
781 |
*/
|
782 |
foreach ($errors as $error) {
|
783 |
+
echo sprintf('<div class="error"><p>%s</p></div>', $error);
|
784 |
}
|
785 |
|
786 |
foreach ($notes as $note) {
|
787 |
+
echo sprintf('<div class="updated fade"><p>%s</p></div>', $note);
|
788 |
}
|
789 |
}
|
790 |
|
880 |
function options()
|
881 |
{
|
882 |
/**
|
883 |
+
* Check for page cache availability
|
884 |
*/
|
885 |
if ($this->_config->get_boolean('pgcache.enabled')) {
|
886 |
if (! $this->check_advanced_cache()) {
|
952 |
}
|
953 |
|
954 |
/**
|
955 |
+
* Check for database cache availability
|
956 |
*/
|
957 |
if ($this->_config->get_boolean('dbcache.enabled')) {
|
958 |
if (! $this->check_db()) {
|
973 |
$this->_notes[] = sprintf('Unfortunately, <strong>PHP5</strong> is required for full functionality of this plugin; incompatible features are automatically disabled. Please upgrade if possible. %s', $this->button_hide_note('Hide this message', 'php_is_old'));
|
974 |
}
|
975 |
|
976 |
+
/**
|
977 |
+
* Check CURL extension
|
978 |
+
*/
|
979 |
+
if ($this->_config->get_boolean('notes.no_curl') && $this->_config->get_boolean('cdn.enabled') && ! function_exists('curl_init')) {
|
980 |
$this->_notes[] = sprintf('The <strong>CURL PHP</strong> extension is not available. Please install it to enable S3 or CloudFront functionality. %s', $this->button_hide_note('Hide this message', 'no_curl'));
|
981 |
}
|
982 |
|
983 |
+
/**
|
984 |
+
* Check Zlib extension
|
985 |
+
*/
|
986 |
+
if ($this->_config->get_boolean('notes.no_zlib') && (! function_exists('gzencode') || ! function_exists('gzdeflate'))) {
|
987 |
+
$this->_notes[] = sprintf('Unfortunately the PHP installation is incomplete, the <strong>zlib module is missing</strong>. This is a core PHP module. Please notify your server administrator and ask for it to be installed. %s', $this->button_hide_note('Hide this message', 'no_zlib'));
|
988 |
+
}
|
989 |
+
|
990 |
+
/**
|
991 |
+
* Check if Zlib output compression is enabled
|
992 |
+
*/
|
993 |
+
if ($this->_config->get_boolean('notes.zlib_output_compression') && w3_zlib_output_compression()) {
|
994 |
+
$this->_notes[] = sprintf('Either the PHP configuration, Web Server configuration or a script somewhere in your WordPress installation is has set <strong>zlib.output_compression</strong> to enabled.<br />Please locate and disable this setting to ensure proper HTTP compression management. %s', $this->button_hide_note('Hide this message', 'zlib_output_compression'));
|
995 |
+
}
|
996 |
+
|
997 |
/**
|
998 |
* Show message when defaults are set
|
999 |
*/
|
1014 |
}
|
1015 |
|
1016 |
/**
|
1017 |
+
* Check CDN settings
|
1018 |
*/
|
1019 |
+
if ($this->_config->get_boolean('cdn.enabled')) {
|
1020 |
+
$cdn_engine = $this->_config->get_string('cdn.engine');
|
1021 |
+
|
1022 |
+
switch (true) {
|
1023 |
+
case ($cdn_engine == 'mirror' && $this->_config->get_string('cdn.mirror.domain') == ''):
|
1024 |
+
$this->_errors[] = 'The <strong>"Replace default hostname with"</strong> field must be populated.';
|
1025 |
+
break;
|
1026 |
+
|
1027 |
+
case ($cdn_engine == 'ftp' && $this->_config->get_string('cdn.ftp.domain') == ''):
|
1028 |
+
$this->_errors[] = 'The <strong>"Replace default hostname with"</strong> field must be populated. Enter the hostname of your <acronym title="Content Delivery Network">CDN</acronym> provider. <em>This is the hostname you would enter into your address bar in order to view objects in your browser.</em>';
|
1029 |
+
break;
|
1030 |
+
|
1031 |
+
case ($cdn_engine == 's3' && ($this->_config->get_string('cdn.s3.key') == '' || $this->_config->get_string('cdn.s3.bucket') == '' || $this->_config->get_string('cdn.s3.bucket') == '')):
|
1032 |
+
$this->_errors[] = 'The <strong>"Access key", "Secret key" and "Bucket"</strong> fields must be populated.';
|
1033 |
+
break;
|
1034 |
+
|
1035 |
+
case ($cdn_engine == 'cf' && ($this->_config->get_string('cdn.cf.key') == '' || $this->_config->get_string('cdn.cf.secret') == '' || $this->_config->get_string('cdn.cf.bucket') == '' || ($this->_config->get_string('cdn.cf.id') == '' && $this->_config->get_string('cdn.cf.cname') == ''))):
|
1036 |
+
$this->_errors[] = 'The <strong>"Access key", "Secret key", "Bucket" and "Replace default hostname with"</strong> fields must be populated.';
|
1037 |
+
break;
|
1038 |
+
}
|
1039 |
}
|
1040 |
|
1041 |
/**
|
1092 |
|
1093 |
$enabled = ($pgcache_enabled || $dbcache_enabled || $minify_enabled || $cdn_enabled);
|
1094 |
|
1095 |
+
$check_apc = function_exists('apc_store');
|
1096 |
+
$check_curl = function_exists('curl_init');
|
1097 |
|
1098 |
$pgcache_engine = $this->_config->get_string('pgcache.engine');
|
1099 |
$dbcache_engine = $this->_config->get_string('dbcache.engine');
|
1159 |
$cdn_engine = $this->_config->get_string('cdn.engine');
|
1160 |
$cdn_mirror = ($cdn_engine == 'mirror');
|
1161 |
|
1162 |
+
$minify_enabled = $this->_config->get_boolean('minify.enabled');
|
1163 |
+
|
1164 |
if ($this->_config->get_boolean('notes.cdn_first_time')) {
|
1165 |
$this->_notes[] = sprintf('It appears this is the first time you are using CDN feature. Unless you wish to first import attachments in your posts that are not already in the media library, please start a <strong>"manual export to <acronym title="Content Delivery Network">CDN</acronym>"</strong> and only enable this module after pending attachments have been successfully uploaded. %s', $this->button_hide_note('Hide this message', 'cdn_first_time'));
|
1166 |
}
|
1167 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1168 |
include W3TC_DIR . '/inc/options/cdn.phtml';
|
1169 |
}
|
1170 |
|
1838 |
}
|
1839 |
|
1840 |
$queue = $w3_plugin_cdn->queue_get();
|
1841 |
+
$title = 'Unsuccessful transfers queue.';
|
1842 |
|
1843 |
include W3TC_DIR . '/inc/popup/cdn_queue.phtml';
|
1844 |
}
|
2456 |
return (file_exists(WP_CONTENT_DIR . '/db.php') && ($script_data = @file_get_contents(WP_CONTENT_DIR . '/db.php')) && strstr($script_data, 'W3_Db') !== false);
|
2457 |
}
|
2458 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2459 |
/**
|
2460 |
* Output buffering callback
|
2461 |
*
|
2467 |
global $wpdb;
|
2468 |
|
2469 |
if ($buffer != '' && w3_is_xml($buffer)) {
|
|
|
2470 |
$date = date('Y-m-d H:i:s');
|
2471 |
+
$host = (! empty($_SERVER['SERVER_ADDR']) ? @gethostbyaddr($_SERVER['SERVER_ADDR']) : $_SERVER['HTTP_HOST']);
|
2472 |
|
2473 |
if ($this->is_supported()) {
|
2474 |
$buffer .= sprintf("\r\n<!-- Served from: %s @ %s by W3 Total Cache -->", $host, $date);
|
2501 |
|
2502 |
if ($this->_config->get_boolean('cdn.enabled')) {
|
2503 |
require_once W3TC_LIB_W3_DIR . '/Plugin/Cdn.php';
|
2504 |
+
|
2505 |
$w3_plugin_cdn = & W3_Plugin_Cdn::instance();
|
2506 |
$cdn = & $w3_plugin_cdn->get_cdn();
|
2507 |
$via = $cdn->get_via();
|
2511 |
|
2512 |
$buffer .= sprintf("\r\nServed from: %s @ %s -->", $host, $date);
|
2513 |
}
|
|
|
|
|
|
|
|
|
2514 |
}
|
2515 |
|
2516 |
return $buffer;
|
2564 |
return false;
|
2565 |
}
|
2566 |
|
2567 |
+
/**
|
2568 |
+
* Skip if debug mode is enabled
|
2569 |
+
*/
|
2570 |
+
if ($this->_config->get_boolean('pgcache.debug') || $this->_config->get_boolean('dbcache.debug') || $this->_config->get_boolean('minify.debug') || $this->_config->get_boolean('cdn.debug')) {
|
2571 |
+
return false;
|
2572 |
+
}
|
2573 |
+
|
2574 |
return true;
|
2575 |
}
|
2576 |
|
lib/W3/Request.php
CHANGED
@@ -18,11 +18,13 @@ class W3_Request
|
|
18 |
*/
|
19 |
function get($key, $default = null)
|
20 |
{
|
21 |
-
|
22 |
-
|
|
|
|
|
23 |
|
24 |
-
if (
|
25 |
-
$value =
|
26 |
}
|
27 |
|
28 |
return $value;
|
@@ -101,4 +103,14 @@ class W3_Request
|
|
101 |
|
102 |
return $default;
|
103 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
}
|
18 |
*/
|
19 |
function get($key, $default = null)
|
20 |
{
|
21 |
+
$request = W3_Request::get_request();
|
22 |
+
|
23 |
+
if (isset($request[$key])) {
|
24 |
+
$value = $request[$key];
|
25 |
|
26 |
+
if (defined('TEMPLATEPATH') || get_magic_quotes_gpc()) {
|
27 |
+
$value = w3_stripslashes($value);
|
28 |
}
|
29 |
|
30 |
return $value;
|
103 |
|
104 |
return $default;
|
105 |
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Returns request array
|
109 |
+
*
|
110 |
+
* @return array
|
111 |
+
*/
|
112 |
+
function get_request()
|
113 |
+
{
|
114 |
+
return array_merge($_GET, $_POST);
|
115 |
+
}
|
116 |
}
|
readme.txt
CHANGED
@@ -2,22 +2,22 @@
|
|
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, batcache, wp cache, wp super cache, w3 total cache
|
4 |
Requires at least: 2.5
|
5 |
-
Tested up to: 2.9
|
6 |
-
Stable tag: 0.8.5
|
7 |
|
8 |
-
Dramatically improve the user experience of your blog. Add page caching, database caching, minify and content delivery network functionality and more to WordPress.
|
9 |
|
10 |
== Description ==
|
11 |
|
12 |
-
The fastest and most complete WordPress performance optimization plugin. Trusted by many popular blogs like: mashable.com, pearsonified.com, noupe.com, webdesignerdepot.com, freelanceswitch.com,
|
13 |
|
14 |
Benefits:
|
15 |
|
16 |
-
* At least 10x improvement in site performance (when fully configured: Grade A in [YSlow](http://developer.yahoo.com/yslow/) or significant [Google Page Speed](http://code.google.com/speed/page-speed/) Improvements)
|
17 |
* Improves "[site performance](http://googlewebmastercentral.blogspot.com/2009/12/your-sites-performance-in-webmaster.html)" which [may affect your blog's rank](http://searchengineland.com/site-speed-googles-next-ranking-factor-29793) google.com
|
18 |
* "Instant" second page views (browser caching after first page view)
|
19 |
* Reduced page load time: increased visitor time on site (visitors view more pages)
|
20 |
-
* Optimized progressive render (pages appear to
|
21 |
* Improved web server performance (easily sustain high traffic spikes)
|
22 |
* Up to 80% Bandwidth savings via Minify and HTTP compression of HTML, CSS, JavaScript and RSS feeds
|
23 |
|
@@ -27,7 +27,7 @@ Features:
|
|
27 |
* Transparent content delivery network (CDN) integration with Media Library, theme files and WordPress itself
|
28 |
* Caching of (minified and compressed) pages and posts in memory or on disk
|
29 |
* Caching of (minified and compressed) CSS and JavaScript in memory, on disk or on CDN
|
30 |
-
* Caching of RSS (
|
31 |
* Caching of search results pages (i.e. URIs with query string variables) in memory or on disk
|
32 |
* Caching of database objects in memory
|
33 |
* Minification of posts and pages and RSS feeds
|
@@ -66,10 +66,6 @@ Rarely do readers take the time to complain. They typically just stop browsing e
|
|
66 |
|
67 |
-4 - That's right; a youngster in junior high school can get started with this plugin. Seriously, if you did your own WordPress install or have ever installed a plugin before you're in good shape. If you need help, let us know or perhaps we'll make some videos or the like.
|
68 |
|
69 |
-
= But even Matt Mullenweg doesn't agree that additional caching is so important, why bother? =
|
70 |
-
|
71 |
-
You're right, [Matt did say that](http://ma.tt/2008/03/wordpress-is-open-source/#comment-439787). However, this plugin provides more than just "caching". Because he is correct, the web is dynamic and must remain so. But as we explain throughout this FAQ, our goal is to improve the performance of any blog and we deliver. Furthermore, the techniques we use, are well documented from past [WordCamp presentations](http://www.slideshare.net/bazza/high-performance-wordpress), we simply have combined them in a way that we have found stands up to the highest traffic situations.
|
72 |
-
|
73 |
= Which WordPress versions are supported? =
|
74 |
|
75 |
To use all features in the suite, a minimum of version WordPress 2.5 with PHP 5 is required. Earlier versions will benefit from our Media Library Importer to get them back on the upgrade path and into a CDN of their choosing.
|
@@ -95,6 +91,7 @@ On the contrary, as with any other action a user can perform on a site, faster p
|
|
95 |
That depends on how you use your blog and where most of your readers read your blog (regionally). Here's a short list:
|
96 |
|
97 |
* [MaxCDN](http://www.maxcdn.com/)
|
|
|
98 |
* [Cotendo](http://www.cotendo.com/)
|
99 |
* [VPS NET](https://vps.net/cdn-signup)
|
100 |
* [Amazon S3](http://aws.amazon.com/s3/) & [Amazon Cloudfront](http://aws.amazon.com/cloudfront/)
|
@@ -105,47 +102,139 @@ That depends on how you use your blog and where most of your readers read your b
|
|
105 |
* [SimpleCDN](http://www.simplecdn.com/)
|
106 |
* [Voxel](http://www.voxel.net/products-services/voxcast-cdn)
|
107 |
|
108 |
-
=
|
109 |
|
110 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
|
112 |
= I don't understand what a CDN has to do with caching, that's completely different, no? =
|
113 |
|
114 |
Technically no, a CDN is a high performance cache that stores static assets (your theme files, media library etc) in various locations throughout the world in order to provide low latency access to them by readers in those regions. So indeed a CDN is a high performance cache, many of which actually store your frequently requested assets in memory for fastest possible response.
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
= Will this plugin speed up WP Admin? =
|
117 |
|
118 |
Yes, indirectly - if you have a lot of bloggers working with you, you will find that it feels like you have a server dedicated only to WP Admin once this plugin is enabled; the result, increased productivity.
|
119 |
|
120 |
= Which web servers do you support? =
|
121 |
|
122 |
-
We are aware of no incompatibilities with [apache](http://httpd.apache.org/) 1.3+, [IIS](http://www.iis.net/) 5+ or [litespeed](http://litespeedtech.com/products/webserver/overview/) 4.0.2+. If there's a web server you feel we should be actively testing (e.g. [lighttpd](http://www.lighttpd.net/)), we're [interested in hearing](
|
123 |
|
124 |
= Is this plugin server cluster and load balancer friendly? =
|
125 |
|
126 |
Yes, built from the ground up with scale and current hosting paradigms in mind.
|
127 |
|
128 |
-
=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
|
130 |
-
|
131 |
|
132 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
|
134 |
Install the plugin to read the full FAQ.
|
135 |
|
136 |
== Installation ==
|
137 |
|
138 |
-
1. Disable and remove any other caching plugin you may be using — most plugins have uninstall procedures you can follow. Make sure wp-content/ has 777 permissions before proceeding, e.g.: `# chmod 777 /var/www/vhosts/domain.com/httpdocs/wp-content/`
|
139 |
-
1.
|
140 |
-
1. Ensure that wp-config.php contains the statement
|
141 |
-
1. Locate and activate the plugin on the
|
142 |
-
1.
|
143 |
-
1.
|
144 |
-
1.
|
145 |
1. You're done! Get back to blogging!
|
146 |
|
147 |
== Changelog ==
|
148 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
= 0.8.5 =
|
150 |
* Added "enhanced" disk caching mode for page cache, a 160% performance improvement over basic mode
|
151 |
* Added disk caching as an option for Database Cache
|
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, batcache, wp cache, wp super cache, w3 total cache
|
4 |
Requires at least: 2.5
|
5 |
+
Tested up to: 2.9.1
|
6 |
+
Stable tag: 0.8.5.1
|
7 |
|
8 |
+
Dramatically improve the speed and user experience of your blog. Add page caching, database caching, minify and content delivery network functionality and more to WordPress.
|
9 |
|
10 |
== Description ==
|
11 |
|
12 |
+
The fastest and most complete WordPress performance optimization plugin. Trusted by many popular blogs like: mashable.com, briansolis.com, pearsonified.com, ilovetypography.com, noupe.com, webdesignerdepot.com, freelanceswitch.com, tutsplus.com, yoast.com, css-tricks.com, css3.info and others — W3 Total Cache improves the user experience of your blog by improving your server performance, caching every aspect of your site, reducing the download time of your theme and providing transparent content delivery network (CDN) integration.
|
13 |
|
14 |
Benefits:
|
15 |
|
16 |
+
* At least 10x improvement in overall site performance (when fully configured: Grade A in [YSlow](http://developer.yahoo.com/yslow/) or significant [Google Page Speed](http://code.google.com/speed/page-speed/) Improvements)
|
17 |
* Improves "[site performance](http://googlewebmastercentral.blogspot.com/2009/12/your-sites-performance-in-webmaster.html)" which [may affect your blog's rank](http://searchengineland.com/site-speed-googles-next-ranking-factor-29793) google.com
|
18 |
* "Instant" second page views (browser caching after first page view)
|
19 |
* Reduced page load time: increased visitor time on site (visitors view more pages)
|
20 |
+
* Optimized progressive render (pages appear to render immediately)
|
21 |
* Improved web server performance (easily sustain high traffic spikes)
|
22 |
* Up to 80% Bandwidth savings via Minify and HTTP compression of HTML, CSS, JavaScript and RSS feeds
|
23 |
|
27 |
* Transparent content delivery network (CDN) integration with Media Library, theme files and WordPress itself
|
28 |
* Caching of (minified and compressed) pages and posts in memory or on disk
|
29 |
* Caching of (minified and compressed) CSS and JavaScript in memory, on disk or on CDN
|
30 |
+
* Caching of RSS (site, categories, tags, comments) feeds in memory or on disk
|
31 |
* Caching of search results pages (i.e. URIs with query string variables) in memory or on disk
|
32 |
* Caching of database objects in memory
|
33 |
* Minification of posts and pages and RSS feeds
|
66 |
|
67 |
-4 - That's right; a youngster in junior high school can get started with this plugin. Seriously, if you did your own WordPress install or have ever installed a plugin before you're in good shape. If you need help, let us know or perhaps we'll make some videos or the like.
|
68 |
|
|
|
|
|
|
|
|
|
69 |
= Which WordPress versions are supported? =
|
70 |
|
71 |
To use all features in the suite, a minimum of version WordPress 2.5 with PHP 5 is required. Earlier versions will benefit from our Media Library Importer to get them back on the upgrade path and into a CDN of their choosing.
|
91 |
That depends on how you use your blog and where most of your readers read your blog (regionally). Here's a short list:
|
92 |
|
93 |
* [MaxCDN](http://www.maxcdn.com/)
|
94 |
+
* [Rackspace Cloud Files](http://www.rackspacecloud.com/cloud_hosting_products/files)
|
95 |
* [Cotendo](http://www.cotendo.com/)
|
96 |
* [VPS NET](https://vps.net/cdn-signup)
|
97 |
* [Amazon S3](http://aws.amazon.com/s3/) & [Amazon Cloudfront](http://aws.amazon.com/cloudfront/)
|
102 |
* [SimpleCDN](http://www.simplecdn.com/)
|
103 |
* [Voxel](http://www.voxel.net/products-services/voxcast-cdn)
|
104 |
|
105 |
+
= How do I configure Amazon Simple Storage Service (Amazon S3) or Amazon CloudFront as my CDN? =
|
106 |
|
107 |
+
First [create an S3 account](http://aws.amazon.com/). Next, you need to obtain your "Access key" and "Secret key" from the "Access Credentials" section of the "[Security Credentials](http://aws-portal.amazon.com/gp/aws/developer/account/index.html?action=access-key)" page of "My Account." Make sure the status is "active." Next, make sure that "Amazon Simple Storage Service (Amazon S3)" is the selected type of CDN on the General Settings tab (if not change the setting and save the changes). Now on the CDN Settings tab enter your "Access key," "Secret key" and create a bucket. Click the "Test S3 Upload" button and make sure that the test is successful, if not check your settings and try again.
|
108 |
+
|
109 |
+
Save your settings. Make sure that you export your media library, upload your wp-includes (WordPress core files) theme files, and custom files if you wish to host each of those with AWS. Unless you wish to use CloudFront, you're almost done, skip to the next paragraph if you're using CloudFront. Just go to the General Settings tab and click the checkbox and save the settings to enable CDN functionality and empty the cache for the changes to take effect.
|
110 |
+
|
111 |
+
To use CloudFront, perform all of the steps above, except select the "Amazon CloudFront" CDN type in the CDN section of the General Settings tab. Proceed to the [AWS Management Console](https://console.aws.amazon.com/cloudfront/) and create a new distribution: select the S3 Bucket you created earlier as the "Origin," enter a [CNAME](http://docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide/index.html?CNAMEs.html) if you wish to add one to your DNS Zone. Make sure that "Distribution Status" is enabled and "State" is deployed. Now on CDN Settings tab of the plugin, copy the subdomain found in the AWS Management Console and enter the CNAME used for the distribution in the "CNAME" field.
|
112 |
+
|
113 |
+
Now go to the General Settings tab and click the checkbox and save the settings to enable CDN functionality and empty the cache for the changes to take effect.
|
114 |
+
|
115 |
+
= How do I use an Origin Pull (Mirror) CDN? =
|
116 |
+
Login to your CDN providers control panel or account management area. Following any set up steps they provide, create a new "pull zone" or "bucket" for your site's domain name. If there's a set up wizard or any troubleshooting tips your provider offers, be sure to review them. In the CDN Settings tab of the plugin, enter the hostname your CDN provider provided in the "replace default hostname with" field. You should always do a quick check by opening a test file from the CDN hostname, e.g. http://cdn.domain.com/favicon.ico. Troubleshoot with yoru CDN provider until this test is successful.
|
117 |
+
|
118 |
+
Now go to the General Settings tab and click the checkbox and save the settings to enable CDN functionality and empty the cache for the changes to take effect.
|
119 |
+
|
120 |
+
= What if I don't want to work with a CDN right now, is there any other use for this feature? =
|
121 |
+
|
122 |
+
Yes! You can take advantage of the [pipelining](http://www.mozilla.org/projects/netlib/http/pipelining-faq.html) support in some browsers by creating a sub-domain for the static content for your site. So you could select the "Origin Push / Self-hosted" method of the General Settings tab. Create static.domain.com on your server (and update your DNS zone) and then specify the FTP details for it in the plugin configuration panel and you're done. If you disable the scripting options on your server you'll find that your server will actually respond slightly faster from that sub-domain because it's just sending files and not processing them.
|
123 |
|
124 |
= I don't understand what a CDN has to do with caching, that's completely different, no? =
|
125 |
|
126 |
Technically no, a CDN is a high performance cache that stores static assets (your theme files, media library etc) in various locations throughout the world in order to provide low latency access to them by readers in those regions. So indeed a CDN is a high performance cache, many of which actually store your frequently requested assets in memory for fastest possible response.
|
127 |
|
128 |
+
= But even Matt Mullenweg doesn't agree that additional caching is so important, why bother? =
|
129 |
+
|
130 |
+
You're right, [Matt did say that](http://ma.tt/2008/03/wordpress-is-open-source/#comment-439787). However, this plugin provides more than just "caching". Because he is correct, the web is dynamic and must remain so. But as we explain throughout this FAQ, our goal is to improve the performance of any blog and we deliver. Furthermore, the techniques we use, are well documented from past [WordCamp presentations](http://www.slideshare.net/bazza/high-performance-wordpress), we simply have combined them in a way that we have found stands up to the highest traffic situations.
|
131 |
+
|
132 |
+
= Why would I want to cache my feeds? =
|
133 |
+
|
134 |
+
We feel that caching objects after the first request and checking for updates before responding subsequent requests (which is kind of how web browsers work too) creates more opportunities for interesting applications and mashups where the blogosphere doesn't require institutional investment to be able to handle developers making hundreds of requests every day the same way we use Google, Twitter and Facebook (for example) APIs today. Think about it, even when major search engines crawl your site, they have to be "gentle" so they don't bring it down, let's turn the paradigm around so that every blog can deliver content in real-time in various ways.
|
135 |
+
|
136 |
= Will this plugin speed up WP Admin? =
|
137 |
|
138 |
Yes, indirectly - if you have a lot of bloggers working with you, you will find that it feels like you have a server dedicated only to WP Admin once this plugin is enabled; the result, increased productivity.
|
139 |
|
140 |
= Which web servers do you support? =
|
141 |
|
142 |
+
We are aware of no incompatibilities with [apache](http://httpd.apache.org/) 1.3+, [IIS](http://www.iis.net/) 5+ or [litespeed](http://litespeedtech.com/products/webserver/overview/) 4.0.2+. If there's a web server you feel we should be actively testing (e.g. [lighttpd](http://www.lighttpd.net/)), we're [interested in hearing](http://www.w3-edge.com/contact/).
|
143 |
|
144 |
= Is this plugin server cluster and load balancer friendly? =
|
145 |
|
146 |
Yes, built from the ground up with scale and current hosting paradigms in mind.
|
147 |
|
148 |
+
= I don't have time to deal with this, but I know I need it. Will you help me? =
|
149 |
+
|
150 |
+
Yes! Please [reach out to us](http://www.w3-edge.com/contact/) and we'll get you acclimated so you can "set it and forget it."
|
151 |
+
|
152 |
+
= Is this plugin comptatible with GD Star Rating? =
|
153 |
+
|
154 |
+
Yes. Follow these steps:
|
155 |
+
|
156 |
+
1. Enable dynamic loading of ratings by checking GD Star Rating -> Settings -> Features "Cache support option"
|
157 |
+
1. If Database cache enabled in W3 Total Cache add "wp_gdsr" to "Ignored query stems" option on the Database Cache settings tab, otherwise ratings will not updated after voting
|
158 |
+
1. Empty all caches
|
159 |
+
|
160 |
+
= I see garbage characters instead of the normal web site, what's going on here? =
|
161 |
+
|
162 |
+
If a theme or it's files use the call php_flush() or function flush() that will interfere with the plugins normal operation; making the plugin send cached files before essential operations have finished. The flush() call is no longer necessary and should be removed.
|
163 |
+
|
164 |
+
= How do I cache only the home page? =
|
165 |
+
|
166 |
+
Add `/.+` to page cache "Never cache the following pages" option on the page cache settings tab.
|
167 |
+
|
168 |
+
= I'm getting blank pages or 500 error codes when trying to upgrade on WordPress MU =
|
169 |
|
170 |
+
First, make sure the plugin is not active (disabled) site-wide. Then make sure it's deactivated site-wide. Now you should be able to successful upgrade without breaking your site.
|
171 |
|
172 |
+
= What is the purpose of the "Media Library Import" tool and how do I use it? =
|
173 |
+
|
174 |
+
The media library import tool is for old or "messy" WordPress installations that have attachments (images etc in posts or pages) scattered about the web server or "hot linked" to 3rd party sites instead of properly using the media library.
|
175 |
+
|
176 |
+
The tool will scan your posts and pages for the cases above and copy them to your media library, update your posts to use the link addresses and produce a .htaccess file containing the list of of permanent redirects, so search engines can find the files in their new location.
|
177 |
+
|
178 |
+
You should backup your database before performing this operation.
|
179 |
+
|
180 |
+
= How do I find the JS and CSS to optimize (minify) them with this plugin? =
|
181 |
+
|
182 |
+
View your page source in your browser and search for any `<style>`, `<link>` or `<script>` tags that contain external CSS or JS files and one by one add them to the minify settings page. Do not include any CSS in conditional statements (unless you know what you are doing) like:
|
183 |
+
|
184 |
+
`<!--[if lte IE 8]><link rel="stylesheet" type="text/css" href="/wp-content/themes/default/lte.css" media="screen,projection" /><![endif]-->`
|
185 |
+
|
186 |
+
The plugin will concatenate, minify, HTTP compress and check for updates to these files automatically from now on. If you have any CSS or JS that are inline consider making them external files so that you can use them with minify.
|
187 |
+
|
188 |
+
= This is too good to be true, how can I test the results? =
|
189 |
+
You will be able to see it instantly on each page load, but for tangible metrics, consider the following tools:
|
190 |
+
|
191 |
+
* [Mozilla Firefox](http://www.mozilla.com/firefox/) + [Firebug](http://getfirebug.com/) + [Yahoo! YSlow](http://developer.yahoo.com/yslow/)
|
192 |
+
* [Mozilla Firefox](http://www.mozilla.com/firefox/) + [Firebug](http://getfirebug.com/) + [Google Page Speed](http://code.google.com/speed/page-speed/)
|
193 |
+
* [Mozilla Firefox](http://www.mozilla.com/firefox/) + [Firebug](http://getfirebug.com/) + [Hammerhead](http://stevesouders.com/hammerhead/)
|
194 |
+
* [Google Chrome](http://www.google.com/chrome) + [Google Speed Tracer](http://code.google.com/webtoolkit/speedtracer/)
|
195 |
+
* [Pingdom](http://tools.pingdom.com/)
|
196 |
+
* [WebPagetest](http://www.webpagetest.org/test)
|
197 |
+
* [Gomez Instant Test Pro](http://www.gomez.com/instant-test-pro/)
|
198 |
+
* [Resource Expert Droid](http://redbot.org/)
|
199 |
+
* [Web Caching Tests](http://www.procata.com/cachetest/)
|
200 |
+
* [Port80 Compression Check (minify requires MSIE6 support to be enabled)](http://www.port80software.com/tools/compresscheck.asp)
|
201 |
+
* [A simple online web page compression / deflate / gzip test tool](http://www.gidnetwork.com/tools/gzip-test.php)
|
202 |
+
* [Web Page Analyzer](http://www.websiteoptimization.com/services/analyze/)
|
203 |
|
204 |
Install the plugin to read the full FAQ.
|
205 |
|
206 |
== Installation ==
|
207 |
|
208 |
+
1. Disable and remove any other caching plugin you may be using — most plugins have uninstall procedures you can follow. Make sure wp-content/ has 777 permissions before proceeding, e.g.: `# chmod 777 /var/www/vhosts/domain.com/httpdocs/wp-content/` using your web hosting control panel or your SSH account.
|
209 |
+
1. Login as an administrator to your WordPress Admin account. Using the "Add New" menu item under the "Plugins" section of the navigation, you can either search for: w3 total cache or if you've downloaded the plugin already, click the "Upload" link, find the .zip file you download and then click "Install Now". Or you can unzip and FTP upload the plugin to your plugins directory (wp-content/plugins/). In either case, when done wp-content/plugins/w3-total-cache/ should exist.
|
210 |
+
1. Ensure that wp-config.php (typically found in the root directory) contains the statement: `define('WP_CACHE', true);` If you previously used a caching plugin, this statement is likely to exist already.
|
211 |
+
1. Locate and activate the plugin on the "Plugins" page. Page and database caching will now automatically be running with their default settings. Set the permissions of wp-content back to 755, e.g.: `# chmod 755 /var/www/vhosts/domain.com/httpdocs/wp-content/`
|
212 |
+
1. Now click the "Settings" link to proceed to the "General Settings" 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.
|
213 |
+
1. Optional: On the "Minify Settings" tab all of the recommended settings are preset. View your site's HTML source and search for .css and .js files and then specify any CSS and JS files in the respective section. In the case of JS files you can (optionally) specify the type and location of the embedding using the drop down menu. See the plugin's FAQ for more information on usage.
|
214 |
+
1. Optional: If you already have a content delivery network (CDN) provider, proceed to the "CDN Settings" 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 CDN Setting 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 CDN tab accordingly. Be sure to FTP upload the appropriate files, using the available upload buttons.
|
215 |
1. You're done! Get back to blogging!
|
216 |
|
217 |
== Changelog ==
|
218 |
|
219 |
+
= 0.8.5.1 =
|
220 |
+
* Added option to CDN Settings to skip specified directories
|
221 |
+
* Added option to allow for full control of HTTP compression options for page cache (some WordPress installations have issues with deflate)
|
222 |
+
* Added sql_calc_found_rows to default auto reject SQL list
|
223 |
+
* Added more notification cases identified and configured
|
224 |
+
* Added new mobile user agents for Japanese market
|
225 |
+
* Page cache performance improvements for disk enhanced mode
|
226 |
+
* Improved FAQ and option descriptions
|
227 |
+
* Improved apache directives for minify headers
|
228 |
+
* Improved handling of redirects
|
229 |
+
* Improved name space to avoid issues with other plugins
|
230 |
+
* Improved handling of incomplete installations, caching runs with default options if custom settings file does not exist
|
231 |
+
* Fixed anomalies with memcached-client.php in some environments
|
232 |
+
* Fixed another interface bug with management of minify files
|
233 |
+
* Fixed minor bug with table column length for some MySQL versions
|
234 |
+
* Fixed minify bug with CRLF
|
235 |
+
* Fixed minify bug with handling of zlib compression enabled
|
236 |
+
* Fixed handling of pages with CDN Media Library import
|
237 |
+
|
238 |
= 0.8.5 =
|
239 |
* Added "enhanced" disk caching mode for page cache, a 160% performance improvement over basic mode
|
240 |
* Added disk caching as an option for Database Cache
|
w3-total-cache-config-example.php
DELETED
@@ -1,249 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
return array(
|
4 |
-
'dbcache.enabled' => true,
|
5 |
-
'dbcache.debug' => false,
|
6 |
-
'dbcache.engine' => 'file',
|
7 |
-
'dbcache.file.gc' => 3600,
|
8 |
-
'dbcache.memcached.engine' => 'auto',
|
9 |
-
'dbcache.memcached.servers' => array(
|
10 |
-
'localhost:11211'
|
11 |
-
),
|
12 |
-
'dbcache.reject.logged' => true,
|
13 |
-
'dbcache.reject.uri' => array(),
|
14 |
-
'dbcache.reject.cookie' => array(),
|
15 |
-
'dbcache.reject.sql' => array(),
|
16 |
-
'dbcache.lifetime' => 180,
|
17 |
-
'pgcache.enabled' => true,
|
18 |
-
'pgcache.debug' => false,
|
19 |
-
'pgcache.engine' => 'file',
|
20 |
-
'pgcache.file.gc' => 3600,
|
21 |
-
'pgcache.memcached.engine' => 'auto',
|
22 |
-
'pgcache.memcached.servers' => array(
|
23 |
-
'localhost:11211'
|
24 |
-
),
|
25 |
-
'pgcache.lifetime' => 3600,
|
26 |
-
'pgcache.compression' => 'gzip',
|
27 |
-
'pgcache.cache.query' => true,
|
28 |
-
'pgcache.cache.home' => true,
|
29 |
-
'pgcache.cache.feed' => true,
|
30 |
-
'pgcache.cache.404' => false,
|
31 |
-
'pgcache.cache.flush' => false,
|
32 |
-
'pgcache.cache.headers' => array(
|
33 |
-
'Last-Modified',
|
34 |
-
'Content-Type',
|
35 |
-
'X-Pingback'
|
36 |
-
),
|
37 |
-
'pgcache.accept.files' => array(
|
38 |
-
'wp-comments-popup.php',
|
39 |
-
'wp-links-opml.php',
|
40 |
-
'wp-locations.php'
|
41 |
-
),
|
42 |
-
'pgcache.reject.logged' => true,
|
43 |
-
'pgcache.reject.uri' => array(
|
44 |
-
'wp-.*\.php',
|
45 |
-
'index\.php'
|
46 |
-
),
|
47 |
-
'pgcache.reject.ua' => array(
|
48 |
-
'bot',
|
49 |
-
'ia_archive',
|
50 |
-
'slurp',
|
51 |
-
'crawl',
|
52 |
-
'spider'
|
53 |
-
),
|
54 |
-
'pgcache.reject.cookie' => array(),
|
55 |
-
'pgcache.mobile.redirect' => '',
|
56 |
-
'pgcache.mobile.agents' => array(
|
57 |
-
'Android',
|
58 |
-
'2.0 MMP',
|
59 |
-
'240x320',
|
60 |
-
'AvantGo',
|
61 |
-
'BlackBerry',
|
62 |
-
'Blazer',
|
63 |
-
'Cellphone',
|
64 |
-
'Danger',
|
65 |
-
'DoCoMo',
|
66 |
-
'Elaine/3.0',
|
67 |
-
'EudoraWeb',
|
68 |
-
'hiptop',
|
69 |
-
'IEMobile',
|
70 |
-
'iPhone',
|
71 |
-
'iPod',
|
72 |
-
'KYOCERA/WX310K',
|
73 |
-
'LG/U990',
|
74 |
-
'MIDP-2.0',
|
75 |
-
'MMEF20',
|
76 |
-
'MOT-V',
|
77 |
-
'NetFront',
|
78 |
-
'Newt',
|
79 |
-
'Nintendo Wii',
|
80 |
-
'Nitro',
|
81 |
-
'Nokia',
|
82 |
-
'Opera Mini',
|
83 |
-
'Palm',
|
84 |
-
'Playstation Portable',
|
85 |
-
'portalmmm',
|
86 |
-
'Proxinet',
|
87 |
-
'ProxiNet',
|
88 |
-
'SHARP-TQ-GX10',
|
89 |
-
'Small',
|
90 |
-
'SonyEricsson',
|
91 |
-
'Symbian OS',
|
92 |
-
'SymbianOS',
|
93 |
-
'TS21i-10',
|
94 |
-
'UP.Browser',
|
95 |
-
'UP.Link',
|
96 |
-
'Windows CE',
|
97 |
-
'WinWAP',
|
98 |
-
'Ericsson',
|
99 |
-
'htc',
|
100 |
-
'Huawei',
|
101 |
-
'MobilePhone',
|
102 |
-
'Motorola',
|
103 |
-
'nokia',
|
104 |
-
'Novarra',
|
105 |
-
'O2',
|
106 |
-
'Samsung',
|
107 |
-
'Sanyo',
|
108 |
-
'Smartphone',
|
109 |
-
'Symbian',
|
110 |
-
'Toshiba',
|
111 |
-
'Treo',
|
112 |
-
'vodafone',
|
113 |
-
'Xda',
|
114 |
-
'Alcatel',
|
115 |
-
'Amoi',
|
116 |
-
'ASUS',
|
117 |
-
'Audiovox',
|
118 |
-
'AU-MIC',
|
119 |
-
'BenQ',
|
120 |
-
'Bird',
|
121 |
-
'CDM',
|
122 |
-
'dopod',
|
123 |
-
'Fly',
|
124 |
-
'Haier',
|
125 |
-
'HP.iPAQ',
|
126 |
-
'i-mobile',
|
127 |
-
'KDDI',
|
128 |
-
'KONKA',
|
129 |
-
'KWC',
|
130 |
-
'Lenovo',
|
131 |
-
'LG',
|
132 |
-
'NEWGEN',
|
133 |
-
'Panasonic',
|
134 |
-
'PANTECH',
|
135 |
-
'PG',
|
136 |
-
'Philips',
|
137 |
-
'PPC',
|
138 |
-
'PT',
|
139 |
-
'Qtek',
|
140 |
-
'Sagem',
|
141 |
-
'SCH',
|
142 |
-
'SEC',
|
143 |
-
'Sendo',
|
144 |
-
'SGH',
|
145 |
-
'Sharp',
|
146 |
-
'SIE',
|
147 |
-
'SoftBank',
|
148 |
-
'SPH',
|
149 |
-
'UTS',
|
150 |
-
'Vertu',
|
151 |
-
'Opera.Mobi',
|
152 |
-
'Windows.CE',
|
153 |
-
'ZTE'
|
154 |
-
),
|
155 |
-
|
156 |
-
'minify.enabled' => true,
|
157 |
-
'minify.debug' => false,
|
158 |
-
'minify.engine' => 'file',
|
159 |
-
'minify.file.locking' => true,
|
160 |
-
'minify.file.gc' => 86400,
|
161 |
-
'minify.memcached.engine' => 'auto',
|
162 |
-
'minify.memcached.servers' => array(
|
163 |
-
'localhost:11211'
|
164 |
-
),
|
165 |
-
'minify.rewrite' => true,
|
166 |
-
'minify.fixtime' => 0,
|
167 |
-
'minify.compress' => true,
|
168 |
-
'minify.compress.ie6' => true,
|
169 |
-
'minify.options' => array(
|
170 |
-
'bubbleCssImports' => false,
|
171 |
-
'minApp' => array(
|
172 |
-
'groupsOnly' => false,
|
173 |
-
'maxFiles' => 20
|
174 |
-
)
|
175 |
-
),
|
176 |
-
'minify.symlinks' => array(),
|
177 |
-
'minify.maxage' => 86400,
|
178 |
-
'minify.lifetime' => 86400,
|
179 |
-
'minify.upload' => true,
|
180 |
-
'minify.html.enable' => true,
|
181 |
-
'minify.html.reject.admin' => true,
|
182 |
-
'minify.html.inline.css' => false,
|
183 |
-
'minify.html.inline.js' => false,
|
184 |
-
'minify.html.strip.crlf' => false,
|
185 |
-
'minify.css.enable' => true,
|
186 |
-
'minify.css.strip.comments' => false,
|
187 |
-
'minify.css.strip.crlf' => false,
|
188 |
-
'minify.css.groups' => array(),
|
189 |
-
'minify.js.enable' => true,
|
190 |
-
'minify.js.combine.header' => false,
|
191 |
-
'minify.js.combine.footer' => false,
|
192 |
-
'minify.js.strip.comments' => false,
|
193 |
-
'minify.js.strip.crlf' => false,
|
194 |
-
'minify.js.groups' => array(),
|
195 |
-
'minify.reject.ua' => array(),
|
196 |
-
'minify.reject.uri' => array(),
|
197 |
-
'cdn.enabled' => false,
|
198 |
-
'cdn.debug' => false,
|
199 |
-
'cdn.engine' => 'ftp',
|
200 |
-
'cdn.includes.enable' => true,
|
201 |
-
'cdn.includes.files' => '*.css;*.js;*.gif;*.png;*.jpg',
|
202 |
-
'cdn.theme.enable' => true,
|
203 |
-
'cdn.theme.files' => '*.css;*.js;*.gif;*.png;*.jpg;*.ico',
|
204 |
-
'cdn.minify.enable' => true,
|
205 |
-
'cdn.custom.enable' => true,
|
206 |
-
'cdn.custom.files' => array(
|
207 |
-
'favicon.ico'
|
208 |
-
),
|
209 |
-
'cdn.import.external' => false,
|
210 |
-
'cdn.import.files' => '*.jpg;*.png;*.gif;*.avi;*.wmv;*.mpg;*.wav;*.mp3;*.txt;*.rtf;*.doc;*.xls;*.rar;*.zip;*.tar;*.gz;*.exe',
|
211 |
-
'cdn.limit.queue' => 25,
|
212 |
-
'cdn.mirror.domain' => '',
|
213 |
-
'cdn.ftp.host' => '',
|
214 |
-
'cdn.ftp.user' => '',
|
215 |
-
'cdn.ftp.pass' => '',
|
216 |
-
'cdn.ftp.path' => '',
|
217 |
-
'cdn.ftp.pasv' => false,
|
218 |
-
'cdn.ftp.domain' => '',
|
219 |
-
'cdn.s3.key' => '',
|
220 |
-
'cdn.s3.secret' => '',
|
221 |
-
'cdn.s3.bucket' => '',
|
222 |
-
'cdn.cf.key' => '',
|
223 |
-
'cdn.cf.secret' => '',
|
224 |
-
'cdn.cf.bucket' => '',
|
225 |
-
'cdn.cf.id' => '',
|
226 |
-
'cdn.cf.cname' => '',
|
227 |
-
'cdn.reject.ua' => array(),
|
228 |
-
'cdn.reject.uri' => array(),
|
229 |
-
'common.support' => '',
|
230 |
-
'common.install' => 0,
|
231 |
-
'common.tweeted' => 0,
|
232 |
-
'common.widget.latest' => true,
|
233 |
-
'notes.defaults' => true,
|
234 |
-
'notes.wp_content_perms' => true,
|
235 |
-
'notes.cdn_first_time' => true,
|
236 |
-
'notes.no_memcached_nor_apc' => true,
|
237 |
-
'notes.php_is_old' => true,
|
238 |
-
'notes.theme_changed' => false,
|
239 |
-
'notes.wp_upgraded' => false,
|
240 |
-
'notes.plugins_updated' => false,
|
241 |
-
'notes.cdn_upload' => false,
|
242 |
-
'notes.need_empty_pgcache' => false,
|
243 |
-
'notes.need_empty_minify' => false,
|
244 |
-
'notes.pgcache_rules_core' => true,
|
245 |
-
'notes.pgcache_rules_cache' => true,
|
246 |
-
'notes.minify_rules' => true,
|
247 |
-
'notes.support_us' => true,
|
248 |
-
'notes.no_curl' => true
|
249 |
-
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
w3-total-cache.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: W3 Total Cache
|
4 |
-
Description: The fastest and most complete WordPress performance plugin. Dramatically improve the user experience of your blog by adding: page caching, database caching, minify, content delivery network (CDN) functionality and more...
|
5 |
-
Version: 0.8.5
|
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
|
1 |
<?php
|
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 blog by adding: page caching, database caching, minify, content delivery network (CDN) functionality and more...
|
5 |
+
Version: 0.8.5.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
|
wp-content/advanced-cache.php
CHANGED
@@ -12,10 +12,7 @@ if (! is_dir(W3TC_DIR) || ! file_exists(W3TC_DIR . '/inc/define.php')) {
|
|
12 |
}
|
13 |
|
14 |
require_once W3TC_DIR . '/inc/define.php';
|
15 |
-
|
16 |
-
if (file_exists(W3TC_CONFIG_PATH)) {
|
17 |
-
require_once W3TC_DIR . '/lib/W3/PgCache.php';
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
}
|
12 |
}
|
13 |
|
14 |
require_once W3TC_DIR . '/inc/define.php';
|
15 |
+
require_once W3TC_DIR . '/lib/W3/PgCache.php';
|
|
|
|
|
16 |
|
17 |
+
$w3_pgcache = & W3_PgCache::instance();
|
18 |
+
$w3_pgcache->process();
|
|
wp-content/db.php
CHANGED
@@ -12,11 +12,6 @@ if (! is_dir(W3TC_DIR) || ! file_exists(W3TC_DIR . '/inc/define.php')) {
|
|
12 |
}
|
13 |
|
14 |
require_once W3TC_DIR . '/inc/define.php';
|
15 |
-
|
16 |
-
if (file_exists(W3TC_CONFIG_PATH)) {
|
17 |
-
require_once W3TC_DIR . '/lib/W3/Db.php';
|
18 |
|
19 |
-
|
20 |
-
} else {
|
21 |
-
require_once ABSPATH . WPINC . '/wp-db.php';
|
22 |
-
}
|
12 |
}
|
13 |
|
14 |
require_once W3TC_DIR . '/inc/define.php';
|
15 |
+
require_once W3TC_DIR . '/lib/W3/Db.php';
|
|
|
|
|
16 |
|
17 |
+
$GLOBALS['wpdb'] = & W3_Db::instance();
|
|
|
|
|
|
wp-content/w3tc/min/index.php
CHANGED
@@ -16,10 +16,7 @@ if (! is_dir(W3TC_DIR) || ! file_exists(W3TC_DIR . '/inc/define.php')) {
|
|
16 |
}
|
17 |
|
18 |
require_once W3TC_DIR . '/inc/define.php';
|
19 |
-
|
20 |
-
if (file_exists(W3TC_CONFIG_PATH)) {
|
21 |
-
require_once W3TC_DIR . '/lib/W3/Minify.php';
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
}
|
16 |
}
|
17 |
|
18 |
require_once W3TC_DIR . '/inc/define.php';
|
19 |
+
require_once W3TC_DIR . '/lib/W3/Minify.php';
|
|
|
|
|
20 |
|
21 |
+
$w3_minify = & W3_Minify::instance();
|
22 |
+
$w3_minify->process();
|
|