W3 Total Cache - Version 0.8.5.2

Version Description

  • Added support for Bad Behavior plugin
  • Added support for eAccelerator and XCache opcode caches
  • Added support for rewriting href attribute of anchors for images that use the CDN
  • Added deflate http compression support to minify
  • Added setting of file modification time after FTP upload
  • Added check of file modification time and file size before FTP upload
  • Added check of file hash before uploading to Amazon S3
  • Added option to force replacement of uploaded attachments on CDN
  • Added option to toggle feed minification
  • Added combine only option for CSS minification to overcome invalid CSS files
  • Database caching now disabled by default to improve compatibility with some shared hosting environments
  • Default page caching method now disk enhanced
  • Improved HTTP Compression inter-operability
  • Improved compatibility with Multi Site Manager
  • Improved apache compatibility
  • Improved .htaccess directives
  • Improved header management for posts / pages
  • Improved notifications
  • Improved minify handling of external files
  • Improved minify memory limit to avoid blank pages when document size is large
  • Improved minify reliability by reducing comment removal options
  • Improved Media Library Import versatility
  • Improved reliability of plugin activation in WordPress MU
  • Improved security handling for some operations
  • Improved reliability of handling file names containing spaces in CDN functionality
  • Improved non-blocking embedding reliability
  • Improved memcached detection by supporting only PECL memcache
  • Fixed bug with disk enhanced method of page cache in WordPress MU
  • Fixed false match of page cache files in disk enhanced method of page cache
  • Fixed a bug with cron anomalies caused by caching of wp_options table
  • Fixed missing trailing slash issue when using disk enhanced page caching
  • Fixed auto-embed bug CSS and JS when already manually embedded
Download this release

Release Info

Developer fredericktownes
Plugin Icon 128x128 W3 Total Cache
Version 0.8.5.2
Comparing to
See all releases

Code changes from version 0.8.5.1 to 0.8.5.2

Files changed (72) hide show
  1. inc/css/error.css +23 -23
  2. inc/css/lightbox.css +15 -15
  3. inc/css/options.css +62 -38
  4. inc/css/popup.css +85 -83
  5. inc/define.php +324 -251
  6. inc/js/lightbox.js +7 -3
  7. inc/js/options.js +12 -8
  8. inc/js/popup.js +1 -1
  9. inc/lightbox/support_us.phtml +1 -1
  10. inc/mime.php +50 -0
  11. inc/options/about.phtml +19 -9
  12. inc/options/cdn.phtml +161 -126
  13. inc/options/cdn/cf.phtml +4 -7
  14. inc/options/cdn/ftp.phtml +13 -13
  15. inc/options/cdn/mirror.phtml +3 -5
  16. inc/options/cdn/s3.phtml +4 -7
  17. inc/options/common/header.phtml +2 -0
  18. inc/options/dbcache.phtml +57 -42
  19. inc/options/faq.phtml +78 -42
  20. inc/options/general.phtml +221 -129
  21. inc/options/install.phtml +26 -23
  22. inc/options/minify.phtml +216 -166
  23. inc/options/pgcache.phtml +132 -117
  24. inc/options/support.phtml +88 -75
  25. inc/options/support_email.phtml +1 -1
  26. inc/popup/cdn_export_file.phtml +1 -0
  27. inc/popup/cdn_export_library.phtml +1 -0
  28. inc/popup/cdn_import_library.phtml +2 -1
  29. inc/popup/cdn_queue.phtml +1 -0
  30. inc/popup/cdn_rename_domain.phtml +1 -0
  31. inc/widget/latest.phtml +12 -0
  32. inc/widget/latest_control.phtml +4 -0
  33. ini/_htaccess +4 -2
  34. ini/apc.ini +1 -2
  35. ini/memcache.ini +5 -3
  36. lib/Minify/HTTP/ConditionalGet.php +1 -1
  37. lib/Minify/HTTP/Encoder.php +10 -37
  38. lib/Minify/Minify.php +20 -7
  39. lib/Minify/Minify/CSS/UriRewriter.php +3 -0
  40. lib/Minify/Minify/Cache/Eaccelerator.php +130 -0
  41. lib/Minify/Minify/Cache/XCache.php +130 -0
  42. lib/Minify/Minify/CombineOnly.php +28 -0
  43. lib/Minify/Minify/HTML.php +11 -3
  44. lib/W3/Cache.php +24 -6
  45. lib/W3/Cache/Apc.php +1 -1
  46. lib/W3/Cache/Eaccelerator.php +94 -0
  47. lib/W3/Cache/File.php +1 -1
  48. lib/W3/Cache/Memcached.php +103 -46
  49. lib/W3/Cache/Memcached/Base.php +0 -62
  50. lib/W3/Cache/Memcached/Client.php +0 -159
  51. lib/W3/Cache/Memcached/Native.php +0 -145
  52. lib/W3/Cache/Xcache.php +93 -0
  53. lib/W3/Cdn/Base.php +7 -6
  54. lib/W3/Cdn/Ftp.php +28 -9
  55. lib/W3/Cdn/Mirror.php +2 -1
  56. lib/W3/Cdn/S3.php +19 -11
  57. lib/W3/Config.php +60 -49
  58. lib/W3/Db.php +29 -29
  59. lib/W3/Minify.php +72 -48
  60. lib/W3/PgCache.php +127 -104
  61. lib/W3/Plugin.php +18 -14
  62. lib/W3/Plugin/Cdn.php +260 -137
  63. lib/W3/Plugin/DbCache.php +1 -1
  64. lib/W3/Plugin/Minify.php +139 -98
  65. lib/W3/Plugin/PgCache.php +109 -82
  66. lib/W3/Plugin/TotalCache.php +351 -243
  67. lib/memcached-client.php +0 -977
  68. readme.txt +151 -85
  69. w3-total-cache.php +19 -17
  70. wp-content/advanced-cache.php +15 -12
  71. wp-content/db.php +2 -1
  72. wp-content/w3tc/min/index.php +4 -1
inc/css/error.css CHANGED
@@ -1,49 +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
  }
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/lightbox.css CHANGED
@@ -1,29 +1,29 @@
1
  #overlay {
2
- background:#666;
3
  }
4
 
5
  .lightbox {
6
- background:#f9f9f9;
7
- padding:10px 20px;
8
- border:1px solid #bbb;
9
- border-radius:11px;
10
- -webkit-border-radius:11px;
11
- -moz-border-radius:11px;
12
  }
13
 
14
  .lightbox-close {
15
- cursor:hand;
16
- cursor:pointer;
17
- text-decoration:underline;
18
- float:right;
19
  }
20
 
21
  .lightbox-loader {
22
- background-image:url(../images/loader.gif);
23
- background-position:center center;
24
- background-repeat:no-repeat;
25
  }
26
 
27
  .lightbox th {
28
- width:80px;
29
  }
1
  #overlay {
2
+ background: #666;
3
  }
4
 
5
  .lightbox {
6
+ background: #f9f9f9;
7
+ padding: 10px 20px;
8
+ border: 1px solid #bbb;
9
+ border-radius: 11px;
10
+ -webkit-border-radius: 11px;
11
+ -moz-border-radius: 11px;
12
  }
13
 
14
  .lightbox-close {
15
+ cursor: hand;
16
+ cursor: pointer;
17
+ text-decoration: underline;
18
+ float: right;
19
  }
20
 
21
  .lightbox-loader {
22
+ background-image: url(../images/loader.gif);
23
+ background-position: center center;
24
+ background-repeat: no-repeat;
25
  }
26
 
27
  .lightbox th {
28
+ width: 80px;
29
  }
inc/css/options.css CHANGED
@@ -1,109 +1,133 @@
1
  #icon-w3tc-logo {
2
- background:url(../images/logo.png) no-repeat;
3
- float:left;
4
- height:36px;
5
- width:36px
6
  }
7
 
8
  .w3tc-options-menu-selected {
9
- font-weight:700
10
  }
11
 
12
  .w3tc-enabled {
13
- color:#090;
14
- font-weight:700
15
  }
16
 
17
  .w3tc-disabled {
18
- color:#f00;
19
- font-weight:700
20
  }
21
 
22
  .w3tc-empty {
23
- font-weight:700;
24
- font-style:italic
25
  }
26
 
27
  .w3tc-success {
28
- background:#bfb
29
  }
30
 
31
  .w3tc-error {
32
- background:#f99
33
  }
34
 
35
  .w3tc-status {
36
- padding:5px
37
  }
38
 
39
  #w3tc acronym {
40
- border-bottom:1px dotted #666
41
  }
42
 
43
  #w3tc ul {
44
- list-style-type:disc;
45
- list-style-position:inside
46
  }
47
 
48
  #w3tc blockquote {
49
- font-style:italic;
50
  }
51
 
52
  #w3tc blockquote cite {
53
- font-style:400
54
  }
55
 
56
  #w3tc h5 {
57
- margin:0
58
  }
59
 
60
  #w3tc hr {
61
- clear:both;
62
- margin-top:10px
63
  }
64
 
65
  #w3tc ul {
66
- list-style-position:inside
67
  }
68
 
69
  #w3tc #toc a,#qa a {
70
- text-decoration:none
71
  }
72
 
73
  #w3tc #toc a:hover,#qa a:hover {
74
- text-decoration:underline
75
  }
76
 
77
  #w3tc #toc ul {
78
- margin:0;
79
- padding:0
80
  }
81
 
82
  #w3tc #toc li {
83
- margin:0;
84
- padding:0
85
  }
86
 
87
  #w3tc #toc li.col {
88
- float:left;
89
- list-style:none;
90
- margin:0 30px 0 0;
91
- width:30%
92
  }
93
 
94
  #w3tc #toc li.col ul {
95
- margin-left:20px
96
  }
97
 
98
  #w3tc #toc li.col ul li {
99
- list-style:disc
100
  }
101
 
102
  #w3tc #qa {
103
- clear:both;
104
- padding:10px;
105
  }
106
 
107
  #w3tc #qa,#w3tc #about,#w3tc #install {
108
- width:760px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  }
1
  #icon-w3tc-logo {
2
+ background: url(../images/logo.png) no-repeat;
3
+ float: left;
4
+ height: 36px;
5
+ width: 36px
6
  }
7
 
8
  .w3tc-options-menu-selected {
9
+ font-weight: 700
10
  }
11
 
12
  .w3tc-enabled {
13
+ color: #090;
14
+ font-weight: 700
15
  }
16
 
17
  .w3tc-disabled {
18
+ color: #f00;
19
+ font-weight: 700
20
  }
21
 
22
  .w3tc-empty {
23
+ font-weight: 700;
24
+ font-style: italic
25
  }
26
 
27
  .w3tc-success {
28
+ background: #bfb
29
  }
30
 
31
  .w3tc-error {
32
+ background: #f99
33
  }
34
 
35
  .w3tc-status {
36
+ padding: 5px
37
  }
38
 
39
  #w3tc acronym {
40
+ border-bottom: 1px dotted #666
41
  }
42
 
43
  #w3tc ul {
44
+ list-style-type: disc;
45
+ list-style-position: inside
46
  }
47
 
48
  #w3tc blockquote {
49
+ font-style: italic;
50
  }
51
 
52
  #w3tc blockquote cite {
53
+ font-style: 400
54
  }
55
 
56
  #w3tc h5 {
57
+ margin: 0
58
  }
59
 
60
  #w3tc hr {
61
+ clear: both;
62
+ margin-top: 10px
63
  }
64
 
65
  #w3tc ul {
66
+ list-style-position: inside
67
  }
68
 
69
  #w3tc #toc a,#qa a {
70
+ text-decoration: none
71
  }
72
 
73
  #w3tc #toc a:hover,#qa a:hover {
74
+ text-decoration: underline
75
  }
76
 
77
  #w3tc #toc ul {
78
+ margin: 0;
79
+ padding: 0
80
  }
81
 
82
  #w3tc #toc li {
83
+ margin: 0;
84
+ padding: 0
85
  }
86
 
87
  #w3tc #toc li.col {
88
+ float: left;
89
+ list-style: none;
90
+ margin: 0 30px 0 0;
91
+ width: 30%
92
  }
93
 
94
  #w3tc #toc li.col ul {
95
+ margin-left: 20px
96
  }
97
 
98
  #w3tc #toc li.col ul li {
99
+ list-style: disc
100
  }
101
 
102
  #w3tc #qa {
103
+ clear: both;
104
+ padding: 10px;
105
  }
106
 
107
  #w3tc #qa,#w3tc #about,#w3tc #install {
108
+ width: 760px;
109
+ }
110
+
111
+ #w3tc fieldset {
112
+ margin: 1em 0;
113
+ padding: 0 1em 1em 1em;
114
+ border: 1px solid #bbb;
115
+ border-radius: 11px;
116
+ -webkit-border-radius: 11px;
117
+ -moz-border-radius: 11px;
118
+ }
119
+
120
+ #w3tc fieldset .submit {
121
+ margin: 1em 0 0 0;
122
+ padding: 0;
123
+ }
124
+
125
+ #w3tc legend {
126
+ color: #999;
127
+ padding: 0 5px;
128
+ font-weight: bold;
129
+ }
130
+
131
+ #cdn-general th {
132
+ width: 400px;
133
  }
inc/css/popup.css CHANGED
@@ -1,175 +1,177 @@
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
  }
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
+ padding: 0;
15
+ margin: 0;
16
  }
17
 
18
  body,td,textarea,input,select {
19
+ font-family: "Lucida Grande", Verdana, Arial;
20
+ font-size: 13px;
21
  }
22
 
23
  p {
24
+ margin: 1em 0;
25
  }
26
 
27
  h1 {
28
+ font-family: Georgia, "Times New Roman", "Bitstream Charter";
29
+ font-size: 24px;
30
+ font-style: italic;
31
+ font-weight: 400;
32
+ line-height: 35px;
33
+ margin: 0 0 0.8em 0;
34
+ text-shadow: 0 1px 0 #fff;
35
  }
36
 
37
  a {
38
+ color: #21759B;
39
  }
40
 
41
  a:hover {
42
+ color: #D54E21;
43
  }
44
 
45
  #content {
46
+ padding: 10px 50px;
47
  }
48
 
49
  .clear {
50
+ clear: both;
51
  }
52
 
53
  .button,input[type="button"],input[type="submit"] {
54
+ font-size: 11px;
55
+ line-height: 16px;
56
+ background: #f2f2f2 url(../../../../../wp-admin/images/white-grad.png) repeat-x scroll left top;
57
+ border: 1px solid #bbb;
58
+ color: #464646;
59
+ text-shadow: 0 1px 0 #fff;
60
+ cursor: pointer;
61
+ padding: 2px 8px;
62
+ border-radius: 11px;
63
+ -webkit-border-radius: 11px;
64
+ -moz-border-radius: 11px;
65
  }
66
 
67
  .button:hover,input[type="button"]:hover,input[type="submit"]:hover {
68
+ border-color: #666;
69
+ color: #000;
70
  }
71
 
72
  .button:active,input[type="button"]:active,input[type="submit"]:active {
73
+ background: #F2F2F2 url(../../../../../wp-admin/images/white-grad-active.png) repeat-x scroll left top;
74
  }
75
 
76
  .progress {
77
+ background: #fff;
78
+ border: 1px solid #464646;
79
+ padding: 1px;
80
+ margin: 1em 0;
81
+ position: relative;
82
  }
83
 
84
  .progress-value {
85
+ position: absolute;
86
+ line-height: 30px;
87
+ font-size: 16px;
88
+ font-weight: 700;
89
+ color: #000;
90
+ text-align: center;
91
+ width: 100%;
92
  }
93
 
94
  .progress-bar {
95
+ float: left;
96
+ width: 0;
97
+ height: 30px;
98
+ background: #fc2;
99
  }
100
 
101
  .log {
102
+ border: 1px solid #464646;
103
+ height: 279px;
104
+ overflow: auto;
105
  }
106
 
107
  .log div {
108
+ padding: 3px;
109
+ border-bottom: 1px solid #464646;
110
  }
111
 
112
  .log-success {
113
+ background: #bfb;
114
  }
115
 
116
  .log-error {
117
+ background: #f99;
118
  }
119
 
120
  .empty {
121
+ font-weight: 700;
122
+ font-style: italic;
123
  }
124
 
125
  .table {
126
+ width: 100%;
127
+ border-collapse: collapse;
128
  }
129
 
130
  .table td,th {
131
+ border: 1px solid #ccc;
132
+ padding: 3px 2px;
133
  }
134
 
135
  .table th {
136
+ background: #eee;
137
  }
138
 
139
  .queue td {
140
+ font-size: 10px;
141
  }
142
 
143
  .updated,.error {
144
+ -moz-border-radius-bottomleft: 3px;
145
+ -moz-border-radius-bottomright: 3px;
146
+ -moz-border-radius-topleft: 3px;
147
+ -moz-border-radius-topright: 3px;
148
+ border-style: solid;
149
+ border-width: 1px;
150
+ padding: 0 0.6em;
151
+ margin: 0.5em 0;
152
  }
153
 
154
  .updated {
155
+ background: #ffffe0;
156
+ border-color: #e6db55;
157
  }
158
 
159
  .error {
160
+ background-color: #ffebe8;
161
+ border-color: #cc0000;
162
  }
163
 
164
  .updated p,.error p {
165
+ line-height: 1;
166
+ margin: 0.5em 0;
167
+ padding: 2px;
168
  }
169
 
170
  .tab-selected {
171
+ font-weight: 700;
172
  }
173
 
174
  .rules {
175
+ width: 100%;
176
+ font-size: 9px;
177
  }
inc/define.php CHANGED
@@ -1,14 +1,19 @@
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');
 
 
 
 
7
 
8
- if (! defined('W3TC_DIR')) {
9
- define('W3TC_DIR', realpath(dirname(__FILE__) . '/..'));
10
- }
11
 
 
12
  define('W3TC_FILE', 'w3-total-cache/w3-total-cache.php');
13
  define('W3TC_LIB_DIR', W3TC_DIR . '/lib');
14
  define('W3TC_LIB_W3_DIR', W3TC_LIB_DIR . '/W3');
@@ -17,40 +22,40 @@ define('W3TC_PLUGINS_DIR', W3TC_DIR . '/plugins');
17
  define('W3TC_INSTALL_DIR', W3TC_DIR . '/wp-content');
18
  define('W3TC_INSTALL_MINIFY_DIR', W3TC_INSTALL_DIR . '/w3tc/min');
19
 
20
- if (! defined('WP_CONTENT_DIR')) {
21
- define('WP_CONTENT_DIR', realpath(W3TC_DIR . '/../..'));
22
- }
 
 
 
 
 
 
 
23
 
24
- define('WP_CONTENT_DIR_NAME', basename(WP_CONTENT_DIR));
 
25
 
26
- define('W3TC_CONTENT_DIR_NAME', WP_CONTENT_DIR_NAME . '/w3tc');
 
 
27
  define('W3TC_CONTENT_DIR', ABSPATH . W3TC_CONTENT_DIR_NAME);
28
- define('W3TC_CONTENT_MINIFY_DIR_NAME', WP_CONTENT_DIR_NAME . '/w3tc/min');
29
  define('W3TC_CONTENT_MINIFY_DIR', ABSPATH . W3TC_CONTENT_DIR_NAME . '/min');
30
  define('W3TC_CACHE_FILE_DBCACHE_DIR', W3TC_CONTENT_DIR . '/dbcache');
31
  define('W3TC_CACHE_FILE_PGCACHE_DIR', W3TC_CONTENT_DIR . '/pgcache');
32
  define('W3TC_CACHE_FILE_MINIFY_DIR', W3TC_CONTENT_DIR . '/min');
33
  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
-
38
  define('W3TC_MINIFY_LOG_FILE', W3TC_LOG_DIR . '/minify.log');
39
-
40
  define('W3TC_CDN_COMMAND_UPLOAD', 1);
41
  define('W3TC_CDN_COMMAND_DELETE', 2);
42
  define('W3TC_CDN_TABLE_QUEUE', 'w3tc_cdn_queue');
43
 
44
- define('W3TC_PHP5', PHP_VERSION >= 5);
45
- define('W3TC_WIN', (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'));
46
-
47
- define('W3TC_EMAIL', 'w3tc@w3-edge.com');
48
- define('W3TC_FEED_URL', 'http://feeds.feedburner.com/W3TOTALCACHE');
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
@@ -58,6 +63,7 @@ define('W3TC_SUPPORT_US_TIMEOUT', 2592000);
58
  * @param string $error
59
  * @return void
60
  */
 
61
  function w3_activate_error($error)
62
  {
63
  $active_plugins = (array) get_option('active_plugins');
@@ -99,7 +105,7 @@ function w3_writable_error($path)
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);
@@ -176,7 +182,7 @@ function w3_gzdecode($data)
176
  */
177
  function w3_mkdir($path, $mask = 0755, $curr_path = '')
178
  {
179
- $path = preg_replace('~[\\\/]+~', '/', $path);
180
  $path = trim($path, '/');
181
  $dirs = explode('/', $path);
182
 
@@ -255,80 +261,95 @@ function w3_is_xml($content)
255
  }
256
 
257
  /**
258
- * Returns blog ID
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
  *
260
  * @return string
261
  */
262
- function w3_get_blog_id()
263
  {
264
- static $id = null;
265
 
266
- if ($id === null) {
267
- $wpmu = false;
268
-
269
- if (defined('VHOST')) {
270
- $wpmu = true;
271
- } else {
272
- $wpmu = file_exists(ABSPATH . 'wpmu-settings.php');
273
- }
274
-
275
- if ($wpmu) {
276
- if (defined('VHOST') && VHOST === 'yes') {
277
- $id = w3_get_domain($_SERVER['HTTP_HOST']);
278
  } else {
279
- if (defined('PATH_CURRENT_SITE')) {
280
- $base = PATH_CURRENT_SITE;
281
- } elseif (isset($GLOBALS['base'])) {
282
- $base = $GLOBALS['base'];
283
- } else {
284
- $base = '/';
285
- }
286
-
287
- if (empty($base)) {
288
- $base = '/';
289
- }
290
-
291
- $id = strtolower($_SERVER['REQUEST_URI']);
292
 
293
- if (strpos($id, $base) === 0) {
294
- $id = substr_replace($id, '', 0, strlen($base));
295
  }
296
 
297
- if (($pos = strpos($id, '/'))) {
298
- $id = substr($id, 0, $pos);
299
- }
300
 
301
- if (($pos = strpos($id, '?'))) {
302
- $id = substr($id, 0, $pos);
303
- }
304
-
305
- if ($id != '') {
306
- $id = trim($id, '/');
307
-
308
- if (in_array($id, array(
309
- 'page',
310
- 'comments',
311
- 'blog',
312
- 'wp-admin',
313
- 'wp-includes',
314
- 'wp-content',
315
- 'files',
316
- 'feed'
317
- )) || is_file($id)) {
318
- $id = '';
319
- } else {
320
- $id = $id . '.' . w3_get_domain($_SERVER['HTTP_HOST']);
321
- }
322
  }
323
  }
 
 
324
  }
325
  }
326
 
327
- return $id;
328
  }
329
 
330
  /**
331
- * Returns site url [fast]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
332
  *
333
  * @return string
334
  */
@@ -339,21 +360,11 @@ function w3_get_site_url()
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;
@@ -395,21 +406,60 @@ function w3_get_site_url_regexp()
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
  /**
@@ -423,13 +473,15 @@ function w3_get_domain($host)
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
 
@@ -447,7 +499,7 @@ function w3_get_domain_url()
447
  $scheme = $parse_url['scheme'];
448
  $host = $parse_url['host'];
449
  $port = (isset($parse_url['port']) && $parse_url['port'] != 80 ? ':' . (int) $parse_url['port'] : '');
450
- $domain_url = sprintf('%s://%s%s/', $scheme, $host, $port);
451
 
452
  return $domain_url;
453
  }
@@ -482,8 +534,8 @@ function w3_upload_info()
482
 
483
  if (empty($upload_info['error'])) {
484
  $site_url = w3_get_site_url();
485
- $upload_info['upload_url'] = ltrim(str_replace($site_url, '', $upload_info['baseurl']), '/');
486
- $upload_info['upload_dir'] = ltrim(str_replace(ABSPATH, '', $upload_info['basedir']), '/\\');
487
  } else {
488
  $upload_info = false;
489
  }
@@ -578,6 +630,14 @@ function w3_get_engine_name($engine)
578
  $engine_name = 'apc';
579
  break;
580
 
 
 
 
 
 
 
 
 
581
  case 'file':
582
  $engine_name = 'disk';
583
  break;
@@ -638,14 +698,17 @@ function w3_to_boolean($value)
638
  */
639
  function w3_url_request($method, $url, $data = '', $auth = '')
640
  {
 
641
  $method = strtoupper($method);
642
 
643
- if (function_exists('curl_init')) {
644
  $ch = curl_init();
645
 
646
  curl_setopt($ch, CURLOPT_URL, $url);
647
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
648
  curl_setopt($ch, CURLOPT_USERAGENT, W3TC_POWERED_BY);
 
 
649
 
650
  if ($method == 'POST') {
651
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
@@ -658,9 +721,9 @@ function w3_url_request($method, $url, $data = '', $auth = '')
658
 
659
  $contents = curl_exec($ch);
660
 
661
- curl_close($ch);
662
 
663
- return $contents;
664
  } else {
665
  $parse_url = @parse_url($url);
666
 
@@ -671,7 +734,7 @@ function w3_url_request($method, $url, $data = '', $auth = '')
671
  $query = (isset($parse_url['query']) ? $parse_url['query'] : '');
672
  $request_uri = $path . ($query != '' ? '?' . $query : '');
673
 
674
- $headers = array(
675
  sprintf('%s %s HTTP/1.1', $method, $request_uri),
676
  sprintf('Host: %s', $host),
677
  sprintf('User-Agent: %s', W3TC_POWERED_BY),
@@ -679,32 +742,46 @@ function w3_url_request($method, $url, $data = '', $auth = '')
679
  );
680
 
681
  if (! empty($data)) {
682
- $headers[] = sprintf('Content-Length: %d', strlen($data));
683
  }
684
 
685
  if (! empty($auth)) {
686
- $headers[] = sprintf('Authorization: Basic %s', base64_encode($auth));
687
  }
688
 
689
- $request = implode("\r\n", $headers) . "\r\n\r\n" . $data;
 
690
 
691
- if (($fp = @fsockopen($host, $port))) {
692
- $response = '';
693
- @fputs($fp, $request);
694
-
695
- while (! @feof($fp)) {
696
- $response .= @fgets($fp, 4096);
697
- }
698
-
699
- @fclose($fp);
700
-
701
- list (, $contents) = explode("\r\n\r\n", $response, 2);
702
-
703
- return $contents;
 
 
 
 
 
 
 
 
704
  }
705
  }
706
  }
707
-
 
 
 
 
 
708
  }
709
 
710
  /**
@@ -731,6 +808,24 @@ function w3_url_post($url, $data = '', $auth = '')
731
  return w3_url_request('POST', $url, $data, $auth);
732
  }
733
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
734
  /**
735
  * Loads plugins
736
  *
@@ -766,6 +861,19 @@ function w3_is_https()
766
  return false;
767
  }
768
 
 
 
 
 
 
 
 
 
 
 
 
 
 
769
  /**
770
  * Returns realpath of given path
771
  *
@@ -773,7 +881,7 @@ function w3_is_https()
773
  */
774
  function w3_realpath($path)
775
  {
776
- $path = preg_replace('~[/\\\]+~', '/', $path);
777
  $parts = explode('/', $path);
778
  $absolutes = array();
779
 
@@ -836,72 +944,6 @@ function w3_check_open_basedir($path)
836
  return false;
837
  }
838
 
839
- /**
840
- * Returns PHP info
841
- *
842
- * @return array
843
- */
844
- function w3_phpinfo()
845
- {
846
- ob_start();
847
- phpinfo();
848
- $phpinfo = ob_get_clean();
849
-
850
- $phpinfo = preg_replace(array(
851
- '#^.*<body>(.*)</body>.*$#ms',
852
- '#<h2>PHP License</h2>.*$#ms',
853
- '#<h1>Configuration</h1>#',
854
- "#\r?\n#",
855
- "#</(h1|h2|h3|tr)>#",
856
- '# +<#',
857
- "#[ \t]+#",
858
- '#&nbsp;#',
859
- '# +#',
860
- '# class=".*?"#',
861
- '%&#039;%',
862
- '#<tr>(?:.*?)" src="(?:.*?)=(.*?)" alt="PHP Logo" /></a>' . '<h1>PHP Version (.*?)</h1>(?:\n+?)</td></tr>#',
863
- '#<h1><a href="(?:.*?)\?=(.*?)">PHP Credits</a></h1>#',
864
- '#<tr>(?:.*?)" src="(?:.*?)=(.*?)"(?:.*?)Zend Engine (.*?),(?:.*?)</tr>#',
865
- "# +#",
866
- '#<tr>#',
867
- '#</tr>#'
868
- ), array(
869
- '$1',
870
- '',
871
- '',
872
- '',
873
- '</$1>' . "\n",
874
- '<',
875
- ' ',
876
- ' ',
877
- ' ',
878
- '',
879
- ' ',
880
- '<h2>PHP Configuration</h2>' . "\n" . '<tr><td>PHP Version</td><td>$2</td></tr>' . "\n" . '<tr><td>PHP Egg</td><td>$1</td></tr>',
881
- '<tr><td>PHP Credits Egg</td><td>$1</td></tr>',
882
- '<tr><td>Zend Engine</td><td>$2</td></tr>' . "\n" . '<tr><td>Zend Egg</td><td>$1</td></tr>',
883
- ' ',
884
- '%S%',
885
- '%E%'
886
- ), $phpinfo);
887
-
888
- $sections = explode('<h2>', strip_tags($phpinfo, '<h2><th><td>'));
889
-
890
- $pi = array();
891
-
892
- foreach ($sections as $section) {
893
- $n = substr($section, 0, strpos($section, '</h2>'));
894
- $askapache = null;
895
- if (preg_match_all('#%S%(?:<td>(.*?)</td>)?(?:<td>(.*?)</td>)?(?:<td>(.*?)</td>)?%E%#', $section, $askapache, PREG_SET_ORDER)) {
896
- foreach ($askapache as $m) {
897
- $pi[$n][$m[1]] = (! isset($m[3]) || $m[2] == $m[3]) ? $m[2] : array_slice($m, 2);
898
- }
899
- }
900
- }
901
-
902
- return $pi;
903
- }
904
-
905
  /**
906
  * Returns file mime type
907
  *
@@ -910,54 +952,7 @@ function w3_phpinfo()
910
  */
911
  function w3_get_mime_type($file)
912
  {
913
- $mime_types = array(
914
- 'jpg|jpeg|jpe' => 'image/jpeg',
915
- 'gif' => 'image/gif',
916
- 'png' => 'image/png',
917
- 'bmp' => 'image/bmp',
918
- 'tif|tiff' => 'image/tiff',
919
- 'ico' => 'image/x-icon',
920
- 'asf|asx|wax|wmv|wmx' => 'video/asf',
921
- 'avi' => 'video/avi',
922
- 'divx' => 'video/divx',
923
- 'mov|qt' => 'video/quicktime',
924
- 'mpeg|mpg|mpe' => 'video/mpeg',
925
- 'txt|c|cc|h' => 'text/plain',
926
- 'svg' => 'image/svg+xml',
927
- 'rtx' => 'text/richtext',
928
- 'css' => 'text/css',
929
- 'xsl|xsd|xml' => 'text/xml',
930
- 'htm|html' => 'text/html',
931
- 'mp3|m4a' => 'audio/mpeg',
932
- 'mp4|m4v' => 'video/mp4',
933
- 'ra|ram' => 'audio/x-realaudio',
934
- 'wav' => 'audio/wav',
935
- 'ogg' => 'audio/ogg',
936
- 'mid|midi' => 'audio/midi',
937
- 'wma' => 'audio/wma',
938
- 'rtf' => 'application/rtf',
939
- 'js' => 'application/x-javascript',
940
- 'pdf' => 'application/pdf',
941
- 'doc|docx' => 'application/msword',
942
- 'pot|pps|ppt|pptx' => 'application/vnd.ms-powerpoint',
943
- 'wri' => 'application/vnd.ms-write',
944
- 'xla|xls|xlsx|xlt|xlw' => 'application/vnd.ms-excel',
945
- 'mdb' => 'application/vnd.ms-access',
946
- 'mpp' => 'application/vnd.ms-project',
947
- 'swf' => 'application/x-shockwave-flash',
948
- 'class' => 'application/java',
949
- 'tar' => 'application/x-tar',
950
- 'zip' => 'application/zip',
951
- 'gz|gzip' => 'application/x-gzip',
952
- 'exe' => 'application/x-msdownload',
953
- 'odt' => 'application/vnd.oasis.opendocument.text',
954
- 'odp' => 'application/vnd.oasis.opendocument.presentation',
955
- 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
956
- 'odg' => 'application/vnd.oasis.opendocument.graphics',
957
- 'odc' => 'application/vnd.oasis.opendocument.chart',
958
- 'odb' => 'application/vnd.oasis.opendocument.database',
959
- 'odf' => 'application/vnd.oasis.opendocument.formula'
960
- );
961
 
962
  $file_ext = strrchr($file, '.');
963
 
@@ -1026,20 +1021,52 @@ function w3_preg_quote($string, $delimiter = null)
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
  *
@@ -1067,6 +1094,48 @@ function w3_stripslashes($var)
1067
  return $var;
1068
  }
1069
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1070
  /**
1071
  * Send powered by header
1072
  */
@@ -1084,4 +1153,8 @@ function w3_send_x_powered_by()
1084
  @header('X-Powered-By: ' . W3TC_POWERED_BY);
1085
  }
1086
 
 
 
 
 
1087
  w3_send_x_powered_by();
1
  <?php
2
 
3
+ define('W3TC_VERSION', '0.8.5.2');
4
  define('W3TC_POWERED_BY', 'W3 Total Cache/' . W3TC_VERSION);
5
+ define('W3TC_EMAIL', 'w3tc@w3-edge.com');
6
  define('W3TC_LINK_URL', 'http://www.w3-edge.com/wordpress-plugins/');
7
  define('W3TC_LINK_NAME', 'WordPress Plugins');
8
+ define('W3TC_FEED_URL', 'http://feeds.feedburner.com/W3TOTALCACHE');
9
+ define('W3TC_README_URL', 'http://plugins.trac.wordpress.org/browser/w3-total-cache/trunk/readme.txt?format=txt');
10
+ 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');
11
+ define('W3TC_SUPPORT_US_TIMEOUT', 2592000);
12
 
13
+ define('W3TC_PHP5', PHP_VERSION >= 5);
14
+ define('W3TC_WIN', (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'));
 
15
 
16
+ defined('W3TC_DIR') || define('W3TC_DIR', realpath(dirname(__FILE__) . '/..'));
17
  define('W3TC_FILE', 'w3-total-cache/w3-total-cache.php');
18
  define('W3TC_LIB_DIR', W3TC_DIR . '/lib');
19
  define('W3TC_LIB_W3_DIR', W3TC_LIB_DIR . '/W3');
22
  define('W3TC_INSTALL_DIR', W3TC_DIR . '/wp-content');
23
  define('W3TC_INSTALL_MINIFY_DIR', W3TC_INSTALL_DIR . '/w3tc/min');
24
 
25
+ $GLOBALS['w3_reserved_blognames'] = array(
26
+ 'page',
27
+ 'comments',
28
+ 'blog',
29
+ 'wp-admin',
30
+ 'wp-includes',
31
+ 'wp-content',
32
+ 'files',
33
+ 'feed'
34
+ );
35
 
36
+ define('W3TC_BLOGNAME', w3_get_blogname());
37
+ define('W3TC_PREFIX', (W3TC_BLOGNAME != '' ? '-' . W3TC_BLOGNAME : ''));
38
 
39
+ defined('WP_CONTENT_DIR') || define('WP_CONTENT_DIR', realpath(W3TC_DIR . '/../..'));
40
+ define('WP_CONTENT_DIR_NAME', basename(WP_CONTENT_DIR));
41
+ define('W3TC_CONTENT_DIR_NAME', WP_CONTENT_DIR_NAME . '/w3tc' . W3TC_PREFIX);
42
  define('W3TC_CONTENT_DIR', ABSPATH . W3TC_CONTENT_DIR_NAME);
43
+ define('W3TC_CONTENT_MINIFY_DIR_NAME', W3TC_CONTENT_DIR_NAME . '/min');
44
  define('W3TC_CONTENT_MINIFY_DIR', ABSPATH . W3TC_CONTENT_DIR_NAME . '/min');
45
  define('W3TC_CACHE_FILE_DBCACHE_DIR', W3TC_CONTENT_DIR . '/dbcache');
46
  define('W3TC_CACHE_FILE_PGCACHE_DIR', W3TC_CONTENT_DIR . '/pgcache');
47
  define('W3TC_CACHE_FILE_MINIFY_DIR', W3TC_CONTENT_DIR . '/min');
48
  define('W3TC_LOG_DIR', W3TC_CONTENT_DIR . '/log');
49
  define('W3TC_TMP_DIR', W3TC_CONTENT_DIR . '/tmp');
50
+ define('W3TC_CONFIG_PATH', WP_CONTENT_DIR . '/w3-total-cache-config' . W3TC_PREFIX . '.php');
51
+ define('W3TC_CONFIG_MASTER_PATH', WP_CONTENT_DIR . '/w3-total-cache-config.php');
 
52
  define('W3TC_MINIFY_LOG_FILE', W3TC_LOG_DIR . '/minify.log');
 
53
  define('W3TC_CDN_COMMAND_UPLOAD', 1);
54
  define('W3TC_CDN_COMMAND_DELETE', 2);
55
  define('W3TC_CDN_TABLE_QUEUE', 'w3tc_cdn_queue');
56
 
57
+ ini_set('pcre.backtrack_limit', 4194304);
58
+ ini_set('pcre.recursion_limit', 4194304);
 
 
 
 
 
 
 
 
59
 
60
  /**
61
  * W3 activate error
63
  * @param string $error
64
  * @return void
65
  */
66
+
67
  function w3_activate_error($error)
68
  {
69
  $active_plugins = (array) get_option('active_plugins');
105
  $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);
106
  }
107
  } else {
108
+ $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);
109
  }
110
 
111
  w3_activate_error($error);
182
  */
183
  function w3_mkdir($path, $mask = 0755, $curr_path = '')
184
  {
185
+ $path = w3_realpath($path);
186
  $path = trim($path, '/');
187
  $dirs = explode('/', $path);
188
 
261
  }
262
 
263
  /**
264
+ * Returns true if it's WPMU
265
+ * @return boolean
266
+ */
267
+ function w3_is_wpmu()
268
+ {
269
+ static $wpmu = null;
270
+
271
+ if ($wpmu === null) {
272
+ $wpmu = (w3_is_vhost() || file_exists(ABSPATH . 'wpmu-settings.php'));
273
+ }
274
+
275
+ return $wpmu;
276
+ }
277
+
278
+ /**
279
+ * Returns true if WPMU uses vhosts
280
+ * @return boolean
281
+ */
282
+ function w3_is_vhost()
283
+ {
284
+ return (defined('VHOST') && VHOST == 'yes');
285
+ }
286
+
287
+ /**
288
+ * Detect WPMU blogname
289
  *
290
  * @return string
291
  */
292
+ function w3_get_blogname()
293
  {
294
+ static $blogname = null;
295
 
296
+ if ($blogname === null) {
297
+ if (w3_is_wpmu()) {
298
+ $domain = w3_get_domain($_SERVER['HTTP_HOST']);
299
+
300
+ if (w3_is_vhost()) {
301
+ $blogname = $domain;
 
 
 
 
 
 
302
  } else {
303
+ $uri = $_SERVER['REQUEST_URI'];
304
+ $site_path = w3_get_site_path();
 
 
 
 
 
 
 
 
 
 
 
305
 
306
+ if ($site_path != '' && strpos($uri, $site_path) === 0) {
307
+ $uri = substr_replace($uri, '/', 0, strlen($site_path));
308
  }
309
 
310
+ $blogname = w3_get_blogname_from_uri($uri);
 
 
311
 
312
+ if ($blogname != '') {
313
+ $blogname = $blogname . '.' . $domain;
314
+ } else {
315
+ $blogname = $domain;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
316
  }
317
  }
318
+ } else {
319
+ $blogname = '';
320
  }
321
  }
322
 
323
+ return $blogname;
324
  }
325
 
326
  /**
327
+ * Returns blogname from URI
328
+ *
329
+ * @param string $uri
330
+ * @param string
331
+ */
332
+ function w3_get_blogname_from_uri($uri)
333
+ {
334
+ global $w3_reserved_blognames;
335
+
336
+ $blogname = '';
337
+ $matches = null;
338
+ $uri = strtolower($uri);
339
+
340
+ if (preg_match('~^/([a-z0-9-]+)/~', $uri, $matches)) {
341
+ $blogname = $matches[1];
342
+
343
+ if (in_array($blogname, $w3_reserved_blognames) || file_exists($blogname)) {
344
+ $blogname = '';
345
+ }
346
+ }
347
+
348
+ return $blogname;
349
+ }
350
+
351
+ /**
352
+ * Returns site url
353
  *
354
  * @return string
355
  */
360
  if ($site_url === null) {
361
  if (function_exists('get_option')) {
362
  $site_url = get_option('siteurl');
 
363
  } else {
364
+ $site_url = sprintf('http://%s%s', $_SERVER['HTTP_HOST'], w3_get_site_path());
 
 
 
 
 
 
 
 
 
 
 
365
  }
366
+
367
+ $site_url = rtrim($site_url, '/');
368
  }
369
 
370
  return $site_url;
406
  */
407
  function w3_get_site_path()
408
  {
409
+ $document_root = w3_get_document_root();
410
+ $path = str_replace($document_root, '', w3_path(ABSPATH));
411
+ $path = '/' . ltrim($path, '/');
412
 
413
+ if (substr($path, - 1) != '/') {
414
+ $path .= '/';
415
+ }
416
+
417
+ return $path;
418
+ }
419
+
420
+ /**
421
+ * Returns blog path
422
+ *
423
+ * @return string
424
+ */
425
+ function w3_get_blog_path()
426
+ {
427
+ $domain_url = w3_get_domain_url();
428
+ $site_url = w3_get_site_url();
429
+
430
+ $path = str_replace($domain_url, '', $site_url);
431
+ $path = '/' . ltrim($path, '/');
432
+
433
+ if (substr($path, - 1) != '/') {
434
+ $path .= '/';
435
+ }
436
+
437
+ return $path;
438
+ }
439
+
440
+ /**
441
+ * Returns document root
442
+ * @return string
443
+ */
444
+ function w3_get_document_root()
445
+ {
446
+ static $document_root = null;
447
+
448
+ if ($document_root === null) {
449
+ if (isset($_SERVER['DOCUMENT_ROOT'])) {
450
+ $document_root = $_SERVER['DOCUMENT_ROOT'];
451
+ } elseif (isset($_SERVER['SCRIPT_FILENAME'])) {
452
+ $document_root = substr($_SERVER['SCRIPT_FILENAME'], 0, - strlen($_SERVER['PHP_SELF']));
453
+ } elseif (isset($_SERVER['PATH_TRANSLATED'])) {
454
+ $document_root = substr($_SERVER['PATH_TRANSLATED'], 0, - strlen($_SERVER['PHP_SELF']));
455
+ } else {
456
+ $document_root = ABSPATH;
457
  }
458
+
459
+ $document_root = w3_path($document_root);
460
  }
461
 
462
+ return $document_root;
463
  }
464
 
465
  /**
473
  $host = strtolower($host);
474
 
475
  if (strpos($host, 'www.') === 0) {
476
+ $host = substr($host, 4);
477
  }
478
 
479
+ if (($pos = strpos($host, ':')) !== false) {
480
  $host = substr($host, 0, $pos);
481
  }
482
 
483
+ $host = rtrim($host, '.');
484
+
485
  return $host;
486
  }
487
 
499
  $scheme = $parse_url['scheme'];
500
  $host = $parse_url['host'];
501
  $port = (isset($parse_url['port']) && $parse_url['port'] != 80 ? ':' . (int) $parse_url['port'] : '');
502
+ $domain_url = sprintf('%s://%s%s', $scheme, $host, $port);
503
 
504
  return $domain_url;
505
  }
534
 
535
  if (empty($upload_info['error'])) {
536
  $site_url = w3_get_site_url();
537
+ $upload_info['upload_url'] = trim(str_replace($site_url, '', $upload_info['baseurl']), '/');
538
+ $upload_info['upload_dir'] = trim(str_replace(ABSPATH, '', $upload_info['basedir']), '/');
539
  } else {
540
  $upload_info = false;
541
  }
630
  $engine_name = 'apc';
631
  break;
632
 
633
+ case 'eaccelerator':
634
+ $engine_name = 'eaccelerator';
635
+ break;
636
+
637
+ case 'xcache':
638
+ $engine_name = 'xcache';
639
+ break;
640
+
641
  case 'file':
642
  $engine_name = 'disk';
643
  break;
698
  */
699
  function w3_url_request($method, $url, $data = '', $auth = '')
700
  {
701
+ $status = 0;
702
  $method = strtoupper($method);
703
 
704
+ if (! function_exists('curl_init')) {
705
  $ch = curl_init();
706
 
707
  curl_setopt($ch, CURLOPT_URL, $url);
708
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
709
  curl_setopt($ch, CURLOPT_USERAGENT, W3TC_POWERED_BY);
710
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
711
+ curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
712
 
713
  if ($method == 'POST') {
714
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
721
 
722
  $contents = curl_exec($ch);
723
 
724
+ $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
725
 
726
+ curl_close($ch);
727
  } else {
728
  $parse_url = @parse_url($url);
729
 
734
  $query = (isset($parse_url['query']) ? $parse_url['query'] : '');
735
  $request_uri = $path . ($query != '' ? '?' . $query : '');
736
 
737
+ $request_headers_array = array(
738
  sprintf('%s %s HTTP/1.1', $method, $request_uri),
739
  sprintf('Host: %s', $host),
740
  sprintf('User-Agent: %s', W3TC_POWERED_BY),
742
  );
743
 
744
  if (! empty($data)) {
745
+ $request_headers_array[] = sprintf('Content-Length: %d', strlen($data));
746
  }
747
 
748
  if (! empty($auth)) {
749
+ $request_headers_array[] = sprintf('Authorization: Basic %s', base64_encode($auth));
750
  }
751
 
752
+ $request_headers = implode("\r\n", $request_headers_array);
753
+ $request = $request_headers . "\r\n\r\n" . $data;
754
 
755
+ $fp = @fsockopen($host, $port);
756
+
757
+ if (! $fp) {
758
+ return false;
759
+ }
760
+
761
+ $response = '';
762
+ @fputs($fp, $request);
763
+
764
+ while (! @feof($fp)) {
765
+ $response .= @fgets($fp, 4096);
766
+ }
767
+
768
+ @fclose($fp);
769
+
770
+ list ($response_headers, $contents) = explode("\r\n\r\n", $response, 2);
771
+
772
+ $matches = null;
773
+
774
+ if (preg_match('~^HTTP/1.[01] (\d+)~', $response_headers, $matches)) {
775
+ $status = (int) $matches[1];
776
  }
777
  }
778
  }
779
+
780
+ if ($status == 200) {
781
+ return $contents;
782
+ }
783
+
784
+ return false;
785
  }
786
 
787
  /**
808
  return w3_url_request('POST', $url, $data, $auth);
809
  }
810
 
811
+ /**
812
+ * Downloads data to a file
813
+ *
814
+ * @param string $url
815
+ * @param string $file
816
+ * @return boolean
817
+ */
818
+ function w3_download($url, $file)
819
+ {
820
+ $data = w3_url_get($url);
821
+
822
+ if ($data !== false) {
823
+ return @file_put_contents($file, $data);
824
+ }
825
+
826
+ return false;
827
+ }
828
+
829
  /**
830
  * Loads plugins
831
  *
861
  return false;
862
  }
863
 
864
+ /**
865
+ * Converts win path to unix
866
+ * @param string $path
867
+ * @return string
868
+ */
869
+ function w3_path($path)
870
+ {
871
+ $path = preg_replace('~[/\\\]+~', '/', $path);
872
+ $path = rtrim($path, '/');
873
+
874
+ return $path;
875
+ }
876
+
877
  /**
878
  * Returns realpath of given path
879
  *
881
  */
882
  function w3_realpath($path)
883
  {
884
+ $path = w3_path($path);
885
  $parts = explode('/', $path);
886
  $absolutes = array();
887
 
944
  return false;
945
  }
946
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
947
  /**
948
  * Returns file mime type
949
  *
952
  */
953
  function w3_get_mime_type($file)
954
  {
955
+ $mime_types = include W3TC_DIR . '/inc/mime.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
956
 
957
  $file_ext = strrchr($file, '.');
958
 
1021
  }
1022
 
1023
  /**
1024
+ * Converts file path to relative
1025
  *
1026
  * @param string $file
1027
  * @return string
1028
  */
1029
  function w3_normalize_file($file)
1030
  {
1031
+ if (w3_is_url($file)) {
1032
+ if (strstr($file, '?') === false) {
1033
+ $domain_url_regexp = '~' . w3_get_domain_url_regexp() . '~i';
1034
+ $file = preg_replace($domain_url_regexp, '', $file);
1035
+ }
1036
+ } else {
1037
+ $abspath = w3_path(ABSPATH);
1038
+ $file = w3_path($file);
1039
+ $file = str_replace($abspath, '', $file);
1040
+ }
1041
+
1042
+ $file = ltrim($file, '/');
1043
 
1044
  return $file;
1045
  }
1046
 
1047
+ /**
1048
+ * Translates URL to local path
1049
+ * @param string $url
1050
+ * @return string
1051
+ */
1052
+ function w3_translate_file($url)
1053
+ {
1054
+ if (! w3_is_url($url)) {
1055
+ $url = w3_get_domain_url() . '/' . ltrim($url, '/\\');
1056
+ }
1057
+
1058
+ $site_url_regexp = '~' . w3_get_site_url_regexp() . '~i';
1059
+
1060
+ if (preg_match($site_url_regexp, $url) && strstr($url, '?') === false) {
1061
+ $url = preg_replace($site_url_regexp, '', $url);
1062
+ $url = w3_get_site_path() . ltrim($url, '/\\');
1063
+ }
1064
+
1065
+ $url = ltrim($url, '/');
1066
+
1067
+ return $url;
1068
+ }
1069
+
1070
  /**
1071
  * Returns true if zlib output compression is enabled otherwise false
1072
  *
1094
  return $var;
1095
  }
1096
 
1097
+ if (! function_exists('file_put_contents')) {
1098
+ if (! defined('FILE_APPEND')) {
1099
+ define('FILE_APPEND', 8);
1100
+ }
1101
+
1102
+ /**
1103
+ * Puts contents to the file
1104
+ *
1105
+ * @param string $filename
1106
+ * @param string $data
1107
+ * @param integer $flags
1108
+ * @return boolean
1109
+ */
1110
+ function file_put_contents($filename, $data, $flags = 0)
1111
+ {
1112
+ $fp = fopen($filename, ($flags & FILE_APPEND ? 'a' : 'w'));
1113
+
1114
+ if ($fp) {
1115
+ fputs($fp, $data);
1116
+ fclose($fp);
1117
+
1118
+ return true;
1119
+ }
1120
+
1121
+ return false;
1122
+ }
1123
+ }
1124
+
1125
+ /**
1126
+ * Cleanup .htaccess rules
1127
+ * @param string $rules
1128
+ * @return string
1129
+ */
1130
+ function w3_clean_rules($rules)
1131
+ {
1132
+ $rules = preg_replace('~[\r\n]+~', "\n", $rules);
1133
+ $rules = preg_replace('~^\s+~m', '', $rules);
1134
+ $rules = trim($rules);
1135
+
1136
+ return $rules;
1137
+ }
1138
+
1139
  /**
1140
  * Send powered by header
1141
  */
1153
  @header('X-Powered-By: ' . W3TC_POWERED_BY);
1154
  }
1155
 
1156
+ if (w3_is_wpmu()) {
1157
+ unset($_GET['sitewide']);
1158
+ }
1159
+
1160
  w3_send_x_powered_by();
inc/js/lightbox.js CHANGED
@@ -176,16 +176,20 @@ var Overlay = {
176
 
177
  function w3tc_lightbox_support_us() {
178
  Lightbox.open( {
179
- width: 500,
180
  height: 200,
181
  url: 'options-general.php?page=w3-total-cache/w3-total-cache.php&w3tc_action=support_us',
182
  callback: function(lightbox) {
183
- jQuery('.link-tweet', lightbox.container).click(function(event) {
184
  lightbox.close();
185
  w3tc_lightbox_tweet();
186
  return false;
187
  });
188
 
 
 
 
 
189
  jQuery('form').submit(function() {
190
  if (jQuery('select :selected', this).val() == '') {
191
  alert('Please select link location!');
@@ -240,7 +244,7 @@ function w3tc_lightbox_tweet() {
240
  }
241
 
242
  jQuery(function($) {
243
- $('.link-tweet').click(function() {
244
  w3tc_lightbox_tweet();
245
  return false;
246
  });
176
 
177
  function w3tc_lightbox_support_us() {
178
  Lightbox.open( {
179
+ width: 590,
180
  height: 200,
181
  url: 'options-general.php?page=w3-total-cache/w3-total-cache.php&w3tc_action=support_us',
182
  callback: function(lightbox) {
183
+ jQuery('.button-tweet', lightbox.container).click(function(event) {
184
  lightbox.close();
185
  w3tc_lightbox_tweet();
186
  return false;
187
  });
188
 
189
+ jQuery('.button-rating', lightbox.container).click(function() {
190
+ window.open('http://wordpress.org/extend/plugins/w3-total-cache/', '_blank');
191
+ });
192
+
193
  jQuery('form').submit(function() {
194
  if (jQuery('select :selected', this).val() == '') {
195
  alert('Please select link location!');
244
  }
245
 
246
  jQuery(function($) {
247
+ $('.button-tweet').click(function() {
248
  w3tc_lightbox_tweet();
249
  return false;
250
  });
inc/js/options.js CHANGED
@@ -53,16 +53,16 @@ function file_validate() {
53
  var js = [], css = [], invalid_js = [], invalid_css = [], duplicate = false, query_js = [], query_css = [];
54
 
55
  jQuery('#js_files :text').each(function() {
56
- var v = jQuery(this).val();
57
  if (v != '') {
58
  for ( var i = 0; i < js.length; i++) {
59
- if (js[i] == v) {
60
  duplicate = true;
61
  break;
62
  }
63
  }
64
 
65
- js.push(v);
66
 
67
  var qindex = v.indexOf('?');
68
  if (qindex != -1) {
@@ -79,16 +79,16 @@ function file_validate() {
79
  });
80
 
81
  jQuery('#css_files :text').each(function() {
82
- var v = jQuery(this).val();
83
  if (v != '') {
84
  for ( var i = 0; i < css.length; i++) {
85
- if (css[i] == v) {
86
  duplicate = true;
87
  break;
88
  }
89
  }
90
 
91
- css.push(v);
92
 
93
  var qindex = v.indexOf('?');
94
  if (qindex != -1) {
@@ -252,6 +252,10 @@ jQuery(function($) {
252
  });
253
  });
254
 
 
 
 
 
255
  // minify page
256
  input_enable('.html_enabled', $('#html_enabled:checked').size());
257
  input_enable('.js_enabled', $('#js_enabled:checked').size());
@@ -270,8 +274,8 @@ jQuery(function($) {
270
  js_file_delete();
271
  css_file_delete();
272
 
273
- js_group('default');
274
- css_group('default');
275
 
276
  $('#js_file_add').click(function() {
277
  js_file_add($('#js_groups').val(), 'include', '');
53
  var js = [], css = [], invalid_js = [], invalid_css = [], duplicate = false, query_js = [], query_css = [];
54
 
55
  jQuery('#js_files :text').each(function() {
56
+ var v = jQuery(this).val(), n = jQuery(this).attr('name'), c = v + n;
57
  if (v != '') {
58
  for ( var i = 0; i < js.length; i++) {
59
+ if (js[i] == c) {
60
  duplicate = true;
61
  break;
62
  }
63
  }
64
 
65
+ js.push(c);
66
 
67
  var qindex = v.indexOf('?');
68
  if (qindex != -1) {
79
  });
80
 
81
  jQuery('#css_files :text').each(function() {
82
+ var v = jQuery(this).val(), n = jQuery(this).attr('name'), c = v + n;
83
  if (v != '') {
84
  for ( var i = 0; i < css.length; i++) {
85
+ if (css[i] == c) {
86
  duplicate = true;
87
  break;
88
  }
89
  }
90
 
91
+ css.push(c);
92
 
93
  var qindex = v.indexOf('?');
94
  if (qindex != -1) {
252
  });
253
  });
254
 
255
+ jQuery('.button-rating').click(function() {
256
+ window.open('http://wordpress.org/extend/plugins/w3-total-cache/', '_blank');
257
+ });
258
+
259
  // minify page
260
  input_enable('.html_enabled', $('#html_enabled:checked').size());
261
  input_enable('.js_enabled', $('#js_enabled:checked').size());
274
  js_file_delete();
275
  css_file_delete();
276
 
277
+ js_group($('#js_groups').val());
278
+ css_group($('#css_groups').val());
279
 
280
  $('#js_file_add').click(function() {
281
  js_file_add($('#js_groups').val(), 'include', '');
inc/js/popup.js CHANGED
@@ -64,7 +64,7 @@ var Cdn_Export_File = {
64
  },
65
 
66
  clear_log: function() {
67
- jQuery('#cdn_export_library_log').val('');
68
  },
69
 
70
  process: function() {
64
  },
65
 
66
  clear_log: function() {
67
+ jQuery('#cdn_export_file_log').html('');
68
  },
69
 
70
  process: function() {
inc/lightbox/support_us.phtml CHANGED
@@ -12,7 +12,7 @@
12
  <option value="<?php echo $support_id; ?>"><?php echo htmlspecialchars($support_name); ?></option>
13
  <?php endforeach; ?>
14
  </select>
15
- </label> (easy) or tell your friends with a <a href="#" class="link-tweet">tweet</a> (easiest).
16
  </p>
17
 
18
  <div style="text-align:center;">
12
  <option value="<?php echo $support_id; ?>"><?php echo htmlspecialchars($support_name); ?></option>
13
  <?php endforeach; ?>
14
  </select>
15
+ </label>, tell your friends with a <input type="button" class="button button-tweet" value="tweet" /> and give us a great <input type="button" class="button button-rating" value="rating" />.
16
  </p>
17
 
18
  <div style="text-align:center;">
inc/mime.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ return array(
4
+ 'jpg|jpeg|jpe' => 'image/jpeg',
5
+ 'gif' => 'image/gif',
6
+ 'png' => 'image/png',
7
+ 'bmp' => 'image/bmp',
8
+ 'tif|tiff' => 'image/tiff',
9
+ 'ico' => 'image/x-icon',
10
+ 'asf|asx|wax|wmv|wmx' => 'video/asf',
11
+ 'avi' => 'video/avi',
12
+ 'divx' => 'video/divx',
13
+ 'mov|qt' => 'video/quicktime',
14
+ 'mpeg|mpg|mpe' => 'video/mpeg',
15
+ 'txt|c|cc|h' => 'text/plain',
16
+ 'svg' => 'image/svg+xml',
17
+ 'rtx' => 'text/richtext',
18
+ 'css' => 'text/css',
19
+ 'xsl|xsd|xml' => 'text/xml',
20
+ 'htm|html' => 'text/html',
21
+ 'mp3|m4a' => 'audio/mpeg',
22
+ 'mp4|m4v' => 'video/mp4',
23
+ 'ra|ram' => 'audio/x-realaudio',
24
+ 'wav' => 'audio/wav',
25
+ 'ogg' => 'audio/ogg',
26
+ 'mid|midi' => 'audio/midi',
27
+ 'wma' => 'audio/wma',
28
+ 'rtf' => 'application/rtf',
29
+ 'js' => 'application/x-javascript',
30
+ 'pdf' => 'application/pdf',
31
+ 'doc|docx' => 'application/msword',
32
+ 'pot|pps|ppt|pptx' => 'application/vnd.ms-powerpoint',
33
+ 'wri' => 'application/vnd.ms-write',
34
+ 'xla|xls|xlsx|xlt|xlw' => 'application/vnd.ms-excel',
35
+ 'mdb' => 'application/vnd.ms-access',
36
+ 'mpp' => 'application/vnd.ms-project',
37
+ 'swf' => 'application/x-shockwave-flash',
38
+ 'class' => 'application/java',
39
+ 'tar' => 'application/x-tar',
40
+ 'zip' => 'application/zip',
41
+ 'gz|gzip' => 'application/x-gzip',
42
+ 'exe' => 'application/x-msdownload',
43
+ 'odt' => 'application/vnd.oasis.opendocument.text',
44
+ 'odp' => 'application/vnd.oasis.opendocument.presentation',
45
+ 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
46
+ 'odg' => 'application/vnd.oasis.opendocument.graphics',
47
+ 'odc' => 'application/vnd.oasis.opendocument.chart',
48
+ 'odb' => 'application/vnd.oasis.opendocument.database',
49
+ 'odf' => 'application/vnd.oasis.opendocument.formula'
50
+ );
inc/options/about.phtml CHANGED
@@ -3,39 +3,49 @@
3
  <div id="about">
4
  <h3>About</h3>
5
 
6
- <p>User experience is an important aspect of every web site and all web sites can benefit from effective caching and file size reduction. We have applied web site optimization methods typically used with high traffic sites and simplified their implementation. Coupling these methods either <a href="http://www.danga.com/memcached/" target="_blank">memcached</a> and/or <a href="http://pecl.php.net/package/APC" target="_blank"><acronym title="Alternative PHP Cache">APC</acronym></a> and the <acronym title="Content Delivery Network">CDN</acronym> of your choosing to provide the following features and benefits:</p>
 
7
  <ul>
 
8
  <li>Increased visitor time on site</li>
9
- <li>Optimized progressive render (pages appear to load instantly)</li>
10
  <li>Reduced <acronym title="Hypertext Transfer Protocol">HTTP</acronym> Transactions, <acronym title="Domain Name System">DNS</acronym> lookups and reduced document load time</li>
11
- <li>Bandwidth savings via Minify and <acronym title="Hypertext Transfer Protocol">HTTP</acronym> compression of <acronym title="Hypertext Markup Language">HTML</acronym>, <acronym title="Cascading Style Sheet">CSS</acronym>, JavaScript and <acronym title="Really Simple Syndication">RSS</acronym> feeds</li>
12
  <li>Increased web server concurrency and increased scale (easily sustain high traffic spikes)</li>
13
  <li>Transparent content delivery network (<acronym title="Content Delivery Network">CDN</acronym>) integration with Media Library, theme files and WordPress core</li>
14
  <li>Caching of pages / posts in memory or on disk</li>
15
  <li>Caching of (minified) <acronym title="Cascading Style Sheet">CSS</acronym> and JavaScript in memory, on disk or on <acronym title="Content Delivery Network">CDN</acronym></li>
16
- <li>Caching of database objects in memory</li>
17
- <li>Caching of <acronym title="Really Simple Syndication">RSS</acronym> (comments, page and site) feeds in memory or on disk</li>
18
  <li>Caching of search results pages (i.e. <acronym title="Uniform Resource Identifier">URI</acronym>s with query string variables) in memory or on disk</li>
19
- <li>Minification of posts / pages and <acronym title="Really Simple Syndication">RSS</acronym> feeds</li>
20
  <li>Minification (concatenation and white space removal) of inline, external or 3rd party JavaScript / <acronym title="Cascading Style Sheet">CSS</acronym> with automated updates</li>
21
  <li>Complete header management including <a href="http://en.wikipedia.org/wiki/HTTP_ETag">Etags</a></li>
22
  <li>JavaScript embedding group and location management</li>
23
  <li>Import post attachments directly into the Media Library (and <acronym title="Content Delivery Network">CDN</acronym>)</li>
24
  </ul>
25
- <p>Your users have less data to download, you can now server more visitors at once without upgrading your equipment and you don't have to change how you do anything; just set it and forget it.</p>
26
- <p><strong>Who do I thank for all of this?</strong><br />It's quite difficult to recall all of the innovators that have shared their thoughts, code and experiences in the blogosphere over the years, but here are some names to get you started:</p>
 
 
 
 
 
27
  <ul>
 
28
  <li><a href="http://mrclay.org/" target="_blank">Steve Clay</a></li>
29
  <li><a href="http://wonko.com/" target="_blank">Ryan Grove</a></li>
30
  <li><a href="http://www.nczonline.net/blog/2009/06/23/loading-javascript-without-blocking/" target="_blank">Nicholas Zakas</a> </li>
31
- <li><a href="http://stevesouders.com/" target="_blank">Steve Souders</a></li>
32
  <li><a href="http://rtdean.livejournal.com/" target="_blank">Ryan Dean</a></li>
33
  <li><a href="http://gravitonic.com/" target="_blank">Andrei Zmievski</a></li>
34
  <li>George Schlossnagle</li>
35
  <li>Daniel Cowgill</li>
36
  <li><a href="http://toys.lerdorf.com/" target="_blank">Rasmus Lerdorf</a></li>
37
  <li><a href="http://t3.dotgnu.info/" target="_blank">Gopal Vijayaraghavan</a></li>
 
 
38
  </ul>
 
39
  <p>Please reach out to all of these people and support their projects if you're so inclined.</p>
40
  </div>
41
 
3
  <div id="about">
4
  <h3>About</h3>
5
 
6
+ <p>User experience is an important aspect of every web site and all web sites can benefit from effective caching and file size reduction. We have applied web site optimization methods typically used with high traffic sites and simplified their implementation. Coupling these methods either <a href="http://www.danga.com/memcached/" target="_blank">memcached</a> and/or opcode caching and the <acronym title="Content Delivery Network">CDN</acronym> of your choosing to provide the following features and benefits:</p>
7
+
8
  <ul>
9
+ <li>Improved Google search engine ranking</li>
10
  <li>Increased visitor time on site</li>
11
+ <li>Optimized progressive render (pages appear to render immediately)</li>
12
  <li>Reduced <acronym title="Hypertext Transfer Protocol">HTTP</acronym> Transactions, <acronym title="Domain Name System">DNS</acronym> lookups and reduced document load time</li>
13
+ <li>Bandwidth savings via Minify and <acronym title="Hypertext Transfer Protocol">HTTP</acronym> compression of <acronym title="Hypertext Markup Language">HTML</acronym>, <acronym title="Cascading Style Sheet">CSS</acronym>, JavaScript and feeds</li>
14
  <li>Increased web server concurrency and increased scale (easily sustain high traffic spikes)</li>
15
  <li>Transparent content delivery network (<acronym title="Content Delivery Network">CDN</acronym>) integration with Media Library, theme files and WordPress core</li>
16
  <li>Caching of pages / posts in memory or on disk</li>
17
  <li>Caching of (minified) <acronym title="Cascading Style Sheet">CSS</acronym> and JavaScript in memory, on disk or on <acronym title="Content Delivery Network">CDN</acronym></li>
18
+ <li>Caching of database objects in memory or disk</li>
19
+ <li>Caching of feeds (site, categories, tags, comments) in memory or on disk</li>
20
  <li>Caching of search results pages (i.e. <acronym title="Uniform Resource Identifier">URI</acronym>s with query string variables) in memory or on disk</li>
21
+ <li>Minification of posts / pages and feeds</li>
22
  <li>Minification (concatenation and white space removal) of inline, external or 3rd party JavaScript / <acronym title="Cascading Style Sheet">CSS</acronym> with automated updates</li>
23
  <li>Complete header management including <a href="http://en.wikipedia.org/wiki/HTTP_ETag">Etags</a></li>
24
  <li>JavaScript embedding group and location management</li>
25
  <li>Import post attachments directly into the Media Library (and <acronym title="Content Delivery Network">CDN</acronym>)</li>
26
  </ul>
27
+
28
+ <p>Your users have less data to download, you can now server more visitors at once without upgrading your hardware and you don't have to change how you do anything; just set it and forget it.</p>
29
+
30
+ <h4>Who do I thank for all of this?</h4>
31
+
32
+ <p>It's quite difficult to recall all of the innovators that have shared their thoughts, code and experiences in the blogosphere over the years, but here are some names to get you started:</p>
33
+
34
  <ul>
35
+ <li><a href="http://stevesouders.com/" target="_blank">Steve Souders</a></li>
36
  <li><a href="http://mrclay.org/" target="_blank">Steve Clay</a></li>
37
  <li><a href="http://wonko.com/" target="_blank">Ryan Grove</a></li>
38
  <li><a href="http://www.nczonline.net/blog/2009/06/23/loading-javascript-without-blocking/" target="_blank">Nicholas Zakas</a> </li>
 
39
  <li><a href="http://rtdean.livejournal.com/" target="_blank">Ryan Dean</a></li>
40
  <li><a href="http://gravitonic.com/" target="_blank">Andrei Zmievski</a></li>
41
  <li>George Schlossnagle</li>
42
  <li>Daniel Cowgill</li>
43
  <li><a href="http://toys.lerdorf.com/" target="_blank">Rasmus Lerdorf</a></li>
44
  <li><a href="http://t3.dotgnu.info/" target="_blank">Gopal Vijayaraghavan</a></li>
45
+ <li><a href="http://eaccelerator.net/" target="_blank">Bart Vanbraban</a></li>
46
+ <li><a href="http://xcache.lighttpd.net/" target="_blank">mOo</a></li>
47
  </ul>
48
+
49
  <p>Please reach out to all of these people and support their projects if you're so inclined.</p>
50
  </div>
51
 
inc/options/cdn.phtml CHANGED
@@ -6,141 +6,176 @@
6
 
7
  <?php if ($cdn_mirror): ?>
8
  <p>
9
- You can use the <input id="cdn_rename_domain" class="button" type="button" value="domain rename tool" /> now.
 
10
  </p>
11
  <?php else: ?>
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; ?>
19
 
20
  <form action="options-general.php?page=<?php echo urldecode(W3TC_FILE); ?>&amp;tab=<?php echo $this->_tab; ?>" method="post">
21
- <?php
22
- switch ($cdn_engine) {
23
- case 'mirror':
24
- case 'ftp':
25
- case 's3':
26
- case 'cf':
27
- include W3TC_DIR . '/inc/options/cdn/' . $cdn_engine . '.phtml';
28
- break;
29
- }
30
- ?>
31
- <table class="form-table">
32
- <?php if (! $cdn_mirror): ?>
33
- <tr>
34
- <th><label for="cdn_limit_queue">Re-transfer cycle limit:</label></th>
35
- <td>
36
- <input id="cdn_limit_queue" type="text" name="cdn.limit.queue" value="<?php echo htmlspecialchars($this->_config->get_integer('cdn.limit.queue')); ?>" size="10" /><br />
37
- <span class="description">Number of files processed per upload attempt.</span>
38
- </td>
39
- </tr>
40
- <?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>
49
- <input class="button cdn_export" type="button" name="includes" value="Upload includes files" />
50
- </td>
51
- <?php endif; ?>
52
- </tr>
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>
61
- <input class="button cdn_export" type="button" name="theme" value="Upload theme files" />
62
- </td>
63
- <?php endif; ?>
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>
85
- <input class="button cdn_export" type="button" name="custom" value="Upload custom files" />
86
- </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>
94
- </td>
95
- </tr>
96
- <tr>
97
- <th><label for="cdn_theme_files">Theme file types to upload:</label></th>
98
- <td>
99
- <input id="cdn_theme_files" type="text" name="cdn.theme.files" value="<?php echo htmlspecialchars($this->_config->get_string('cdn.theme.files')); ?>" size="40" /><br />
100
- <span class="description">Specify the file types in the active theme to host with the <acronym title="Content Delivery Network">CDN</acronym>.</span>
101
- </td>
102
- </tr>
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'))); ?>