Version Description
- Improved error message notifications
- FAQ and installation instructions corrections/adjustments
- Added "Debug Mode" listing all settings and queries with statistics
- Resolved bug in minification of feeds
- Support for multiple wordpress installations added
- Improved cache stability for large objects
Download this release
Release Info
Developer | fredericktownes |
Plugin | ![]() |
Version | 0.6 |
Comparing to | |
See all releases |
Code changes from version 0.5 to 0.6
- inc/css/options.css +7 -6
- inc/css/popup.css +146 -142
- inc/define.php +172 -29
- inc/js/options.js +20 -7
- inc/js/popup.js +180 -27
- inc/options/about.phtml +30 -30
- inc/options/cdn.phtml +153 -141
- inc/options/common/footer.phtml +1 -1
- inc/options/common/header.phtml +31 -31
- inc/options/dbcache.phtml +22 -23
- inc/options/faq.phtml +450 -455
- inc/options/general.phtml +122 -112
- inc/options/install.phtml +162 -161
- inc/options/minify.phtml +112 -113
- inc/options/pgcache.phtml +71 -68
- inc/popup/cdn_export_file.phtml +38 -34
- inc/popup/cdn_export_library.phtml +34 -0
- inc/popup/cdn_export_table.phtml +0 -26
- inc/popup/cdn_import_library.phtml +54 -0
- inc/popup/cdn_queue.phtml +59 -59
- inc/popup/common/footer.phtml +2 -2
- inc/popup/common/header.phtml +42 -42
- lib/Minify/UPGRADING.txt +1 -1
- lib/Minify/min/README.txt +2 -2
- lib/Minify/min/builder/ocCheck.php +2 -2
- lib/Minify/min/index.php +5 -4
- lib/Minify/min/lib/HTTP/Encoder.php +24 -24
- lib/Minify/min/lib/Minify.php +1 -1
- lib/Minify/min/lib/Minify/CSS.php +75 -75
- lib/Minify/min/lib/Minify/CSS/Compressor.php +250 -250
- lib/Minify/min/lib/Minify/CSS/UriRewriter.php +10 -10
- lib/Minify/min/lib/Minify/Cache/File.php +33 -33
- lib/Minify/min/lib/Minify/Controller/Page.php +1 -1
- lib/Minify/min/lib/Minify/Javascript.php +0 -31
- lib/Minify/min/lib/Minify/Lines.php +4 -4
- lib/Minify/min/lib/MyMin.php +0 -289
- lib/Minify/min/pageBuffer.php +92 -0
- lib/Minify/min/pageConfig.php +82 -0
- lib/Minify/min/test/_inc.php +182 -0
- lib/Minify/min/test/index.php +161 -0
- lib/Minify/min/test/pageBuffer.php +96 -0
- lib/Minify/min_extras/README.txt +15 -0
- lib/Minify/min_extras/ab_tests/README.txt +10 -0
- lib/Minify/min_extras/ab_tests/_delimiter +3 -0
- lib/Minify/min_extras/ab_tests/ideal_php/before.php +25 -0
- lib/Minify/min_extras/ab_tests/minify/before.js +3408 -0
- lib/Minify/min_extras/ab_tests/minify/test_Files.php +15 -0
- lib/Minify/min_extras/ab_tests/minify/test_Files_Memcache.php +35 -0
- lib/Minify/min_extras/ab_tests/minify/test_Groups.php +15 -0
- lib/Minify/min_extras/ab_tests/minify/test_Version1.php +13 -0
- lib/Minify/min_extras/ab_tests/minify/test_memcache.php +19 -0
- lib/Minify/min_extras/ab_tests/mod_deflate/.htaccess-dev +30 -0
- lib/Minify/min_extras/ab_tests/mod_deflate/before.js +374 -0
- lib/Minify/min_extras/ab_tests/results_summary.txt +37 -0
- lib/Minify/min_extras/ab_tests/test_all.bat +67 -0
- lib/Minify/min_extras/ab_tests/test_memcache.bat +13 -0
- lib/Minify/min_extras/ab_tests/type-map/.htaccess-dev +40 -0
- lib/Minify/min_extras/ab_tests/type-map/before.js +374 -0
- lib/Minify/min_extras/ab_tests/type-map/before.js.var +14 -0
- lib/Minify/min_extras/ab_tests/type-map/before.js.zc +0 -0
- lib/Minify/min_extras/ab_tests/type-map/before.js.zd +0 -0
- lib/Minify/min_extras/ab_tests/type-map/before.js.zg +0 -0
- lib/Minify/min_extras/ab_tests/v1.0/minify.php +500 -0
- lib/Minify/min_extras/config.php +11 -0
- lib/Minify/min_extras/examples/1/_groupsSources.php +11 -0
- lib/Minify/min_extras/examples/1/index.php +50 -0
- lib/Minify/min_extras/examples/1/m.php +14 -0
- lib/Minify/min_extras/examples/2/_groupsSources.php +11 -0
- lib/Minify/min_extras/examples/2/index.php +94 -0
- lib/Minify/min_extras/examples/2/m.php +14 -0
- lib/Minify/min_extras/examples/index.php +3 -0
- lib/Minify/min_extras/examples/lib.js +6 -0
- lib/Minify/min_extras/examples/test space.js +5 -0
- lib/Minify/min_extras/examples/test.css +41 -0
- lib/Minify/min_extras/tools/encodeFile.php +34 -0
- lib/Minify/min_extras/tools/minifyFile.php +50 -0
- lib/Minify/min_extras/tools/minifyTextarea.php +98 -0
- lib/Minify/min_extras/tools/minifyUrl.php +166 -0
- lib/Minify/min_extras/tools/testRewriteUri.php +59 -0
- lib/Minify/min_unit_tests/HTTP_ConditionalGet/3.php +1 -1
- lib/Minify/min_unit_tests/HTTP_ConditionalGet/_include.php +1 -1
- lib/Minify/min_unit_tests/HTTP_ConditionalGet/index.php +1 -1
- lib/Minify/min_unit_tests/README.txt +4 -0
- lib/Minify/min_unit_tests/_test_files/css/hacks.css +66 -66
- lib/Minify/min_unit_tests/_test_files/css/issue62.css +889 -889
- lib/Minify/min_unit_tests/_test_files/css/paths_prepend.css +11 -11
- lib/Minify/min_unit_tests/_test_files/css/selectors.css +37 -37
- lib/Minify/min_unit_tests/_test_files/css/subsilver.css +433 -433
- lib/Minify/min_unit_tests/_test_files/css/unusual_strings.css +10 -10
- lib/Minify/min_unit_tests/_test_files/html/before.html +1 -1
- lib/Minify/min_unit_tests/_test_files/html/before2.html +1 -1
- lib/Minify/min_unit_tests/simpletest/HELP_MY_TESTS_DONT_WORK_ANYMORE +348 -0
- lib/Minify/min_unit_tests/simpletest/LICENSE +502 -0
- lib/Minify/min_unit_tests/simpletest/README +108 -0
- lib/Minify/min_unit_tests/simpletest/TODO.xml +176 -0
- lib/Minify/min_unit_tests/simpletest/VERSION +1 -0
- lib/Minify/min_unit_tests/simpletest/authentication.php +238 -0
- lib/Minify/min_unit_tests/simpletest/autorun.php +87 -0
- lib/Minify/min_unit_tests/simpletest/browser.php +1098 -0
- lib/Minify/min_unit_tests/simpletest/collector.php +122 -0
- lib/Minify/min_unit_tests/simpletest/compatibility.php +173 -0
- lib/Minify/min_unit_tests/simpletest/cookies.php +380 -0
- lib/Minify/min_unit_tests/simpletest/default_reporter.php +133 -0
- lib/Minify/min_unit_tests/simpletest/detached.php +96 -0
- lib/Minify/min_unit_tests/simpletest/docs/en/docs.css +121 -0
- lib/Minify/min_unit_tests/simpletest/docs/fr/docs.css +84 -0
- lib/Minify/min_unit_tests/simpletest/docs/lastcraft/README +1 -0
- lib/Minify/min_unit_tests/simpletest/docs/onpk/README +1 -0
- lib/Minify/min_unit_tests/simpletest/docs/pkg/README +1 -0
- lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/README +1 -0
- lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/favicon.ico +0 -0
- lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/book-domain-driven-design.jpg +0 -0
- lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/book-guide-to-php-design-patterns.jpg +0 -0
- lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/book-the-php-anthology-object-oriented-php-solutions.jpg +0 -0
- lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/quote.png +0 -0
- lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/simpletest-contribute.png +0 -0
- lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/simpletest-download.png +0 -0
- lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/simpletest-external-bottom.png +0 -0
- lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/simpletest-external-middle.png +0 -0
- lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/simpletest-external-top.png +0 -0
- lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/simpletest-internal-bottom.png +0 -0
- lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/simpletest-internal-middle.png +0 -0
- lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/simpletest-internal-top.png +0 -0
- lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/simpletest-logo.png +0 -0
- lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/simpletest-start-testing.png +0 -0
- lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/simpletest-support.png +0 -0
- lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/test-in-cli.png +0 -0
- lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/test-with-1-fail.png +0 -0
- lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/test-with-1-pass.png +0 -0
- lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/index.html +188 -0
- lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/js/jquery-1.2.1.pack.js +11 -0
- lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/js/jquery-speakers_coaches_consultants.js +30 -0
- lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/simpletest.css +39 -0
- lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/views/photos_stream.php +36 -0
- lib/Minify/min_unit_tests/simpletest/docs/source/en/about.xml +116 -0
- lib/Minify/min_unit_tests/simpletest/docs/source/en/authentication_documentation.xml +317 -0
- lib/Minify/min_unit_tests/simpletest/docs/source/en/books_website.xml +73 -0
- lib/Minify/min_unit_tests/simpletest/docs/source/en/boundary_classes_tutorial.xml +407 -0
- lib/Minify/min_unit_tests/simpletest/docs/source/en/browser_documentation.xml +263 -0
- lib/Minify/min_unit_tests/simpletest/docs/source/en/coding_standards.xml +82 -0
- lib/Minify/min_unit_tests/simpletest/docs/source/en/display_subclass_tutorial.xml +274 -0
- lib/Minify/min_unit_tests/simpletest/docs/source/en/download_website.xml +100 -0
- lib/Minify/min_unit_tests/simpletest/docs/source/en/expectation_documentation.xml +339 -0
- lib/Minify/min_unit_tests/simpletest/docs/source/en/experimental_autorun.xml +209 -0
- lib/Minify/min_unit_tests/simpletest/docs/source/en/experimental_dom_tester.xml +231 -0
- lib/Minify/min_unit_tests/simpletest/docs/source/en/experimental_intro.xml +54 -0
- lib/Minify/min_unit_tests/simpletest/docs/source/en/experimental_recorder.xml +170 -0
- lib/Minify/min_unit_tests/simpletest/docs/source/en/extension_eclipse.xml +279 -0
- lib/Minify/min_unit_tests/simpletest/docs/source/en/first_test_tutorial.xml +443 -0
- lib/Minify/min_unit_tests/simpletest/docs/source/en/form_testing_documentation.xml +299 -0
- lib/Minify/min_unit_tests/simpletest/docs/source/en/gain_control_tutorial.xml +296 -0
inc/css/options.css
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
#icon-w3tc-logo {
|
2 |
background:url(../images/logo.png) no-repeat;
|
3 |
float:left;
|
4 |
-
height:36px;
|
5 |
width:36px
|
6 |
}
|
7 |
.w3tc-options-menu-selected {
|
8 |
font-weight:bold
|
9 |
}
|
10 |
.w3tc-enabled {
|
11 |
-
color
|
12 |
font-weight:bold
|
13 |
}
|
14 |
.w3tc-disabled {
|
15 |
-
color
|
16 |
font-weight:bold
|
17 |
}
|
18 |
.w3tc-empty {
|
19 |
-
font-weight:bold;
|
20 |
font-style:italic
|
21 |
}
|
22 |
.w3tc-success {
|
@@ -35,7 +35,6 @@
|
|
35 |
list-style-type:disc;
|
36 |
list-style-position:inside
|
37 |
}
|
38 |
-
/* FAQ BEGIN */
|
39 |
#w3tc blockquote {
|
40 |
font-style:italic;
|
41 |
width:700px
|
@@ -84,4 +83,6 @@
|
|
84 |
padding:10px;
|
85 |
width:760px
|
86 |
}
|
87 |
-
|
|
|
|
1 |
#icon-w3tc-logo {
|
2 |
background:url(../images/logo.png) no-repeat;
|
3 |
float:left;
|
4 |
+
height: 36px;
|
5 |
width:36px
|
6 |
}
|
7 |
.w3tc-options-menu-selected {
|
8 |
font-weight:bold
|
9 |
}
|
10 |
.w3tc-enabled {
|
11 |
+
color: #090;
|
12 |
font-weight:bold
|
13 |
}
|
14 |
.w3tc-disabled {
|
15 |
+
color: #f00;
|
16 |
font-weight:bold
|
17 |
}
|
18 |
.w3tc-empty {
|
19 |
+
font-weight: bold;
|
20 |
font-style:italic
|
21 |
}
|
22 |
.w3tc-success {
|
35 |
list-style-type:disc;
|
36 |
list-style-position:inside
|
37 |
}
|
|
|
38 |
#w3tc blockquote {
|
39 |
font-style:italic;
|
40 |
width:700px
|
83 |
padding:10px;
|
84 |
width:760px
|
85 |
}
|
86 |
+
#w3tc #about, #w3tc #install {
|
87 |
+
width: 760px;
|
88 |
+
}
|
inc/css/popup.css
CHANGED
@@ -1,142 +1,146 @@
|
|
1 |
-
* {
|
2 |
-
margin: 0;
|
3 |
-
padding: 0;
|
4 |
-
color: #464646;
|
5 |
-
}
|
6 |
-
html,body {
|
7 |
-
height: 100%;
|
8 |
-
}
|
9 |
-
body {
|
10 |
-
line-height: 1;
|
11 |
-
background: #f9f9f9;
|
12 |
-
}
|
13 |
-
body,td,textarea,input,select {
|
14 |
-
font-family: "Lucida Grande", Verdana, Arial;
|
15 |
-
font-size: 13px;
|
16 |
-
}
|
17 |
-
p {
|
18 |
-
margin: 1em 0;
|
19 |
-
}
|
20 |
-
h1 {
|
21 |
-
font-family: Georgia, "Times New Roman", "Bitstream Charter";
|
22 |
-
font-size: 24px;
|
23 |
-
font-style: italic;
|
24 |
-
font-weight: normal;
|
25 |
-
line-height: 35px;
|
26 |
-
margin-bottom: 0.8em 0;
|
27 |
-
text-shadow: 0 1px 0 #fff;
|
28 |
-
}
|
29 |
-
a {
|
30 |
-
color: #21759B;
|
31 |
-
}
|
32 |
-
a:hover {
|
33 |
-
color: #D54E21;
|
34 |
-
}
|
35 |
-
#content {
|
36 |
-
padding: 40px 50px;
|
37 |
-
}
|
38 |
-
.clear {
|
39 |
-
clear: both;
|
40 |
-
}
|
41 |
-
.button,input[type="button"],input[type="submit"] {
|
42 |
-
font-size: 11px;
|
43 |
-
line-height: 16px;
|
44 |
-
background: #F2F2F2 url(/wp-admin/images/white-grad.png) repeat-x scroll
|
45 |
-
left top;
|
46 |
-
border: 1px solid #bbb;
|
47 |
-
color: #464646;
|
48 |
-
text-shadow: 0 1px 0 #fff;
|
49 |
-
cursor: pointer;
|
50 |
-
padding: 2px 8px;
|
51 |
-
-moz-background-clip: border;
|
52 |
-
-moz-background-inline-policy: continuous;
|
53 |
-
-moz-background-origin: padding;
|
54 |
-
-moz-border-radius: 11px;
|
55 |
-
-moz-box-sizing: content-box;
|
56 |
-
}
|
57 |
-
.button:hover,input[type="button"]:hover,input[type="submit"]:hover {
|
58 |
-
border-color: #666;
|
59 |
-
color: #000;
|
60 |
-
}
|
61 |
-
.button:active,input[type="button"]:active,input[type="submit"]:active {
|
62 |
-
background: #F2F2F2 url(/wp-admin/images/white-grad-active.png) repeat-x
|
63 |
-
scroll left top;
|
64 |
-
}
|
65 |
-
.progress {
|
66 |
-
background: #fff;
|
67 |
-
border: 1px solid #464646;
|
68 |
-
padding: 1px;
|
69 |
-
margin: 1em 0;
|
70 |
-
position: relative;
|
71 |
-
}
|
72 |
-
.progress-value {
|
73 |
-
position: absolute;
|
74 |
-
line-height: 30px;
|
75 |
-
font-size: 16px;
|
76 |
-
font-weight: bold;
|
77 |
-
color: #000;
|
78 |
-
text-align: center;
|
79 |
-
width: 100%;
|
80 |
-
}
|
81 |
-
.progress-bar {
|
82 |
-
float: left;
|
83 |
-
width: 0;
|
84 |
-
height: 30px;
|
85 |
-
background: #fc2;
|
86 |
-
}
|
87 |
-
.log {
|
88 |
-
border: 1px solid #464646;
|
89 |
-
height: 298px;
|
90 |
-
overflow: auto;
|
91 |
-
}
|
92 |
-
.log div {
|
93 |
-
padding: 3px;
|
94 |
-
border-bottom: 1px solid #464646;
|
95 |
-
}
|
96 |
-
.log-success {
|
97 |
-
background: #bfb;
|
98 |
-
}
|
99 |
-
.log-error {
|
100 |
-
background: #f99;
|
101 |
-
}
|
102 |
-
.empty {
|
103 |
-
font-weight: bold;
|
104 |
-
font-style: italic;
|
105 |
-
}
|
106 |
-
.table {
|
107 |
-
width: 100%;
|
108 |
-
border-collapse: collapse;
|
109 |
-
}
|
110 |
-
.table td,th {
|
111 |
-
border: 1px solid #ccc;
|
112 |
-
padding: 3px 2px;
|
113 |
-
}
|
114 |
-
.table th {
|
115 |
-
background: #eee;
|
116 |
-
}
|
117 |
-
.updated,.error {
|
118 |
-
-moz-border-radius-bottomleft: 3px;
|
119 |
-
-moz-border-radius-bottomright: 3px;
|
120 |
-
-moz-border-radius-topleft: 3px;
|
121 |
-
-moz-border-radius-topright: 3px;
|
122 |
-
border-style: solid;
|
123 |
-
border-width: 1px;
|
124 |
-
padding: 0 0.6em;
|
125 |
-
margin: 0.5em 0;
|
126 |
-
}
|
127 |
-
.updated {
|
128 |
-
background: #FFFFE0;
|
129 |
-
border-color: #E6DB55;
|
130 |
-
}
|
131 |
-
.error {
|
132 |
-
background-color: #FFEBE8;
|
133 |
-
border-color: #CC0000;
|
134 |
-
}
|
135 |
-
.updated p,.error p {
|
136 |
-
line-height: 1;
|
137 |
-
margin: 0.5em 0;
|
138 |
-
padding: 2px;
|
139 |
-
}
|
140 |
-
.tab-selected {
|
141 |
-
font-weight: bold;
|
142 |
-
}
|
|
|
|
|
|
|
|
1 |
+
* {
|
2 |
+
margin: 0;
|
3 |
+
padding: 0;
|
4 |
+
color: #464646;
|
5 |
+
}
|
6 |
+
html,body {
|
7 |
+
height: 100%;
|
8 |
+
}
|
9 |
+
body {
|
10 |
+
line-height: 1;
|
11 |
+
background: #f9f9f9;
|
12 |
+
}
|
13 |
+
body,td,textarea,input,select {
|
14 |
+
font-family: "Lucida Grande", Verdana, Arial;
|
15 |
+
font-size: 13px;
|
16 |
+
}
|
17 |
+
p {
|
18 |
+
margin: 1em 0;
|
19 |
+
}
|
20 |
+
h1 {
|
21 |
+
font-family: Georgia, "Times New Roman", "Bitstream Charter";
|
22 |
+
font-size: 24px;
|
23 |
+
font-style: italic;
|
24 |
+
font-weight: normal;
|
25 |
+
line-height: 35px;
|
26 |
+
margin-bottom: 0.8em 0;
|
27 |
+
text-shadow: 0 1px 0 #fff;
|
28 |
+
}
|
29 |
+
a {
|
30 |
+
color: #21759B;
|
31 |
+
}
|
32 |
+
a:hover {
|
33 |
+
color: #D54E21;
|
34 |
+
}
|
35 |
+
#content {
|
36 |
+
padding: 40px 50px;
|
37 |
+
}
|
38 |
+
.clear {
|
39 |
+
clear: both;
|
40 |
+
}
|
41 |
+
.button,input[type="button"],input[type="submit"] {
|
42 |
+
font-size: 11px;
|
43 |
+
line-height: 16px;
|
44 |
+
background: #F2F2F2 url(/wp-admin/images/white-grad.png) repeat-x scroll
|
45 |
+
left top;
|
46 |
+
border: 1px solid #bbb;
|
47 |
+
color: #464646;
|
48 |
+
text-shadow: 0 1px 0 #fff;
|
49 |
+
cursor: pointer;
|
50 |
+
padding: 2px 8px;
|
51 |
+
-moz-background-clip: border;
|
52 |
+
-moz-background-inline-policy: continuous;
|
53 |
+
-moz-background-origin: padding;
|
54 |
+
-moz-border-radius: 11px;
|
55 |
+
-moz-box-sizing: content-box;
|
56 |
+
}
|
57 |
+
.button:hover,input[type="button"]:hover,input[type="submit"]:hover {
|
58 |
+
border-color: #666;
|
59 |
+
color: #000;
|
60 |
+
}
|
61 |
+
.button:active,input[type="button"]:active,input[type="submit"]:active {
|
62 |
+
background: #F2F2F2 url(/wp-admin/images/white-grad-active.png) repeat-x
|
63 |
+
scroll left top;
|
64 |
+
}
|
65 |
+
.progress {
|
66 |
+
background: #fff;
|
67 |
+
border: 1px solid #464646;
|
68 |
+
padding: 1px;
|
69 |
+
margin: 1em 0;
|
70 |
+
position: relative;
|
71 |
+
}
|
72 |
+
.progress-value {
|
73 |
+
position: absolute;
|
74 |
+
line-height: 30px;
|
75 |
+
font-size: 16px;
|
76 |
+
font-weight: bold;
|
77 |
+
color: #000;
|
78 |
+
text-align: center;
|
79 |
+
width: 100%;
|
80 |
+
}
|
81 |
+
.progress-bar {
|
82 |
+
float: left;
|
83 |
+
width: 0;
|
84 |
+
height: 30px;
|
85 |
+
background: #fc2;
|
86 |
+
}
|
87 |
+
.log {
|
88 |
+
border: 1px solid #464646;
|
89 |
+
height: 298px;
|
90 |
+
overflow: auto;
|
91 |
+
}
|
92 |
+
.log div {
|
93 |
+
padding: 3px;
|
94 |
+
border-bottom: 1px solid #464646;
|
95 |
+
}
|
96 |
+
.log-success {
|
97 |
+
background: #bfb;
|
98 |
+
}
|
99 |
+
.log-error {
|
100 |
+
background: #f99;
|
101 |
+
}
|
102 |
+
.empty {
|
103 |
+
font-weight: bold;
|
104 |
+
font-style: italic;
|
105 |
+
}
|
106 |
+
.table {
|
107 |
+
width: 100%;
|
108 |
+
border-collapse: collapse;
|
109 |
+
}
|
110 |
+
.table td,th {
|
111 |
+
border: 1px solid #ccc;
|
112 |
+
padding: 3px 2px;
|
113 |
+
}
|
114 |
+
.table th {
|
115 |
+
background: #eee;
|
116 |
+
}
|
117 |
+
.updated,.error {
|
118 |
+
-moz-border-radius-bottomleft: 3px;
|
119 |
+
-moz-border-radius-bottomright: 3px;
|
120 |
+
-moz-border-radius-topleft: 3px;
|
121 |
+
-moz-border-radius-topright: 3px;
|
122 |
+
border-style: solid;
|
123 |
+
border-width: 1px;
|
124 |
+
padding: 0 0.6em;
|
125 |
+
margin: 0.5em 0;
|
126 |
+
}
|
127 |
+
.updated {
|
128 |
+
background: #FFFFE0;
|
129 |
+
border-color: #E6DB55;
|
130 |
+
}
|
131 |
+
.error {
|
132 |
+
background-color: #FFEBE8;
|
133 |
+
border-color: #CC0000;
|
134 |
+
}
|
135 |
+
.updated p,.error p {
|
136 |
+
line-height: 1;
|
137 |
+
margin: 0.5em 0;
|
138 |
+
padding: 2px;
|
139 |
+
}
|
140 |
+
.tab-selected {
|
141 |
+
font-weight: bold;
|
142 |
+
}
|
143 |
+
.rules {
|
144 |
+
width: 100%;
|
145 |
+
font-size: 9px;
|
146 |
+
}
|
inc/define.php
CHANGED
@@ -1,29 +1,172 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if (! defined('
|
4 |
-
define('
|
5 |
-
}
|
6 |
-
|
7 |
-
if (! defined('
|
8 |
-
define('
|
9 |
-
}
|
10 |
-
|
11 |
-
if (! defined('
|
12 |
-
define('
|
13 |
-
}
|
14 |
-
|
15 |
-
if (! defined('
|
16 |
-
define('
|
17 |
-
}
|
18 |
-
|
19 |
-
if (! defined('
|
20 |
-
define('
|
21 |
-
}
|
22 |
-
|
23 |
-
if (! defined('
|
24 |
-
define('
|
25 |
-
}
|
26 |
-
|
27 |
-
if (! defined('
|
28 |
-
define('
|
29 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if (! defined('W3_PLUGIN_VERSION')) {
|
4 |
+
define('W3_PLUGIN_VERSION', '0.6');
|
5 |
+
}
|
6 |
+
|
7 |
+
if (! defined('W3_PLUGIN_POWERED_BY')) {
|
8 |
+
define('W3_PLUGIN_POWERED_BY', 'W3 Total Cache/' . W3_PLUGIN_VERSION);
|
9 |
+
}
|
10 |
+
|
11 |
+
if (! defined('WP_CONTENT_DIR')) {
|
12 |
+
define('WP_CONTENT_DIR', dirname(__FILE__) . '/../../../');
|
13 |
+
}
|
14 |
+
|
15 |
+
if (! defined('W3_PLUGIN_DIR')) {
|
16 |
+
define('W3_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins/w3-total-cache');
|
17 |
+
}
|
18 |
+
|
19 |
+
if (! defined('W3_PLUGIN_CONTENT_DIR')) {
|
20 |
+
define('W3_PLUGIN_CONTENT_DIR', W3_PLUGIN_DIR . '/wp-content');
|
21 |
+
}
|
22 |
+
|
23 |
+
if (! defined('W3_PLUGIN_FILE')) {
|
24 |
+
define('W3_PLUGIN_FILE', 'w3-total-cache/w3-total-cache.php');
|
25 |
+
}
|
26 |
+
|
27 |
+
if (! defined('W3_CONFIG_PATH')) {
|
28 |
+
define('W3_CONFIG_PATH', WP_CONTENT_DIR . '/w3-total-cache-config.php');
|
29 |
+
}
|
30 |
+
|
31 |
+
if (! defined('W3_CONFIG_DEFAULT_PATH')) {
|
32 |
+
define('W3_CONFIG_DEFAULT_PATH', W3_PLUGIN_DIR . '/w3-total-cache-config-default.php');
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* W3 writable error
|
37 |
+
*
|
38 |
+
* @param string $path
|
39 |
+
* @param boolean $die
|
40 |
+
* @return string
|
41 |
+
*/
|
42 |
+
function w3_writable_error($path, $die = true)
|
43 |
+
{
|
44 |
+
$error = sprintf('<strong>%s</strong> could not be created, please run following command:<br /><strong style="color: #f00;">chmod 777 %s</strong><br />then re-activate plugin.', $path, dirname($path));
|
45 |
+
|
46 |
+
if ($die) {
|
47 |
+
die($error);
|
48 |
+
}
|
49 |
+
|
50 |
+
return $error;
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Returns current microtime
|
55 |
+
*
|
56 |
+
* @return float
|
57 |
+
*/
|
58 |
+
function w3_microtime()
|
59 |
+
{
|
60 |
+
list ($usec, $sec) = explode(" ", microtime());
|
61 |
+
return ((float) $usec + (float) $sec);
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Check if URL is valid
|
66 |
+
*
|
67 |
+
* @param string $url
|
68 |
+
* @return boolean
|
69 |
+
*/
|
70 |
+
function w3_is_url($url)
|
71 |
+
{
|
72 |
+
return preg_match('~^https?://~', $url);
|
73 |
+
}
|
74 |
+
|
75 |
+
if (! function_exists('gzdecode')) {
|
76 |
+
/**
|
77 |
+
* Decodes gzip-encoded string
|
78 |
+
*
|
79 |
+
* @param string $data
|
80 |
+
* @return string
|
81 |
+
*/
|
82 |
+
function gzdecode($data)
|
83 |
+
{
|
84 |
+
$flags = ord(substr($data, 3, 1));
|
85 |
+
$headerlen = 10;
|
86 |
+
$extralen = 0;
|
87 |
+
|
88 |
+
if ($flags & 4) {
|
89 |
+
$extralen = unpack('v', substr($data, 10, 2));
|
90 |
+
$extralen = $extralen[1];
|
91 |
+
$headerlen += 2 + $extralen;
|
92 |
+
}
|
93 |
+
|
94 |
+
if ($flags & 8) {
|
95 |
+
$headerlen = strpos($data, chr(0), $headerlen) + 1;
|
96 |
+
}
|
97 |
+
|
98 |
+
if ($flags & 16) {
|
99 |
+
$headerlen = strpos($data, chr(0), $headerlen) + 1;
|
100 |
+
}
|
101 |
+
|
102 |
+
if ($flags & 2) {
|
103 |
+
$headerlen += 2;
|
104 |
+
}
|
105 |
+
|
106 |
+
$unpacked = gzinflate(substr($data, $headerlen));
|
107 |
+
|
108 |
+
if ($unpacked === FALSE) {
|
109 |
+
$unpacked = $data;
|
110 |
+
}
|
111 |
+
|
112 |
+
return $unpacked;
|
113 |
+
}
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Creates thumbnail
|
118 |
+
*
|
119 |
+
* @param string $file
|
120 |
+
* @param integer $max_w
|
121 |
+
* @param integer $max_h
|
122 |
+
* @param boolean $crop
|
123 |
+
* @param string $suffix
|
124 |
+
* @param string $dest_path
|
125 |
+
* @param integer $jpeg_quality
|
126 |
+
* @return string
|
127 |
+
*/
|
128 |
+
function w3_create_thumbnail($file, $max_w, $max_h, $crop = false, $suffix = null, $dest_path = null, $jpeg_quality = 90)
|
129 |
+
{
|
130 |
+
$thumbpath = image_resize($file, $max_w, $max_h, $crop, $suffix, $dest_path, $jpeg_quality);
|
131 |
+
|
132 |
+
return apply_filters('wp_create_thumbnail', $thumbpath);
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* Recursive creates directory
|
137 |
+
*
|
138 |
+
* @param string $path
|
139 |
+
* @param integer $mask
|
140 |
+
* @return boolean
|
141 |
+
*/
|
142 |
+
function w3_mkdir($path, $mask = 0777)
|
143 |
+
{
|
144 |
+
$dirs = preg_split('~[\\/]+~', $path);
|
145 |
+
$curr_path = '';
|
146 |
+
foreach ($dirs as $dir) {
|
147 |
+
if (empty($dir)) {
|
148 |
+
return false;
|
149 |
+
}
|
150 |
+
$curr_path .= $dir;
|
151 |
+
if (! is_dir($curr_path)) {
|
152 |
+
if (@mkdir($curr_path, $mask)) {
|
153 |
+
@chmod($curr_path, $mask);
|
154 |
+
} else {
|
155 |
+
return false;
|
156 |
+
}
|
157 |
+
}
|
158 |
+
$curr_path .= DIRECTORY_SEPARATOR;
|
159 |
+
}
|
160 |
+
return true;
|
161 |
+
}
|
162 |
+
|
163 |
+
/**
|
164 |
+
* Check if content is HTML or XML
|
165 |
+
*
|
166 |
+
* @param string $content
|
167 |
+
* @return boolean
|
168 |
+
*/
|
169 |
+
function w3_is_xml($content)
|
170 |
+
{
|
171 |
+
return (stristr($content, '<?xml') !== false || stristr($content, '<html') !== false);
|
172 |
+
}
|
inc/js/options.js
CHANGED
@@ -1,6 +1,13 @@
|
|
1 |
-
function w3tc_popup(url, name)
|
2 |
{
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
}
|
5 |
|
6 |
jQuery(function($) {
|
@@ -32,11 +39,13 @@ jQuery(function($) {
|
|
32 |
if (enabled) {
|
33 |
$(this).next(':hidden').remove();
|
34 |
} else {
|
35 |
-
var me = $(this);
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
|
|
40 |
}
|
41 |
});
|
42 |
}
|
@@ -185,6 +194,10 @@ jQuery(function($) {
|
|
185 |
w3tc_popup('options-general.php?page=w3-total-cache/w3-total-cache.php&w3tc_action=cdn_export_library', 'cdn_export_library');
|
186 |
});
|
187 |
|
|
|
|
|
|
|
|
|
188 |
$('#cdn_queue').click(function() {
|
189 |
w3tc_popup('options-general.php?page=w3-total-cache/w3-total-cache.php&w3tc_action=cdn_queue', 'cdn_queue');
|
190 |
});
|
1 |
+
function w3tc_popup(url, name, width, height)
|
2 |
{
|
3 |
+
if (width === undefined) {
|
4 |
+
width = 800;
|
5 |
+
}
|
6 |
+
if (height === undefined) {
|
7 |
+
height = 600;
|
8 |
+
}
|
9 |
+
|
10 |
+
return window.open(url, name, 'width=' + width + ',height=' + height +',status=no,toolbar=no,menubar=no,scrollbars=yes');
|
11 |
}
|
12 |
|
13 |
jQuery(function($) {
|
39 |
if (enabled) {
|
40 |
$(this).next(':hidden').remove();
|
41 |
} else {
|
42 |
+
var me = $(this), t = me.attr('type');
|
43 |
+
if ((t != 'radio' && t != 'checkbox') || this.checked) {
|
44 |
+
me.after($('<input />').attr({
|
45 |
+
type: 'hidden',
|
46 |
+
name: me.attr('name')
|
47 |
+
}).val(me.val()));
|
48 |
+
}
|
49 |
}
|
50 |
});
|
51 |
}
|
194 |
w3tc_popup('options-general.php?page=w3-total-cache/w3-total-cache.php&w3tc_action=cdn_export_library', 'cdn_export_library');
|
195 |
});
|
196 |
|
197 |
+
$('#cdn_import_library').click(function() {
|
198 |
+
w3tc_popup('options-general.php?page=w3-total-cache/w3-total-cache.php&w3tc_action=cdn_import_library', 'cdn_import_library');
|
199 |
+
});
|
200 |
+
|
201 |
$('#cdn_queue').click(function() {
|
202 |
w3tc_popup('options-general.php?page=w3-total-cache/w3-total-cache.php&w3tc_action=cdn_queue', 'cdn_queue');
|
203 |
});
|
inc/js/popup.js
CHANGED
@@ -26,11 +26,16 @@ var Cdn_Export_File = {
|
|
26 |
jQuery('#cdn_export_file_start').val(text);
|
27 |
},
|
28 |
|
29 |
-
|
30 |
{
|
31 |
jQuery('#cdn_export_file_log').prepend('<div class="log-' + (result == 1 ? 'success' : 'error') + '">' + path + ' <strong>' + error + '</strong></div>');
|
32 |
},
|
33 |
|
|
|
|
|
|
|
|
|
|
|
34 |
process: function()
|
35 |
{
|
36 |
if (this.paused) {
|
@@ -59,7 +64,7 @@ var Cdn_Export_File = {
|
|
59 |
{
|
60 |
var failed = false;
|
61 |
for (var i = 0; i < data.results.length; i++) {
|
62 |
-
this.
|
63 |
if (data.results[i].result == -1) {
|
64 |
failed = true;
|
65 |
break;
|
@@ -87,7 +92,7 @@ var Cdn_Export_File = {
|
|
87 |
}
|
88 |
},
|
89 |
|
90 |
-
init: function(files) {
|
91 |
if (files === undefined) {
|
92 |
files = [];
|
93 |
}
|
@@ -101,6 +106,9 @@ var Cdn_Export_File = {
|
|
101 |
me.set_button_text('Resume');
|
102 |
me.set_status('paused');
|
103 |
} else {
|
|
|
|
|
|
|
104 |
me.paused = 0;
|
105 |
me.set_button_text('Pause');
|
106 |
me.set_status('processing');
|
@@ -109,43 +117,47 @@ var Cdn_Export_File = {
|
|
109 |
me.process();
|
110 |
});
|
111 |
}
|
112 |
-
}
|
113 |
|
114 |
-
var
|
115 |
-
action: '',
|
116 |
paused: 0,
|
117 |
limit: 25,
|
118 |
offset: 0,
|
119 |
|
120 |
set_progress: function(percent)
|
121 |
{
|
122 |
-
jQuery('#
|
123 |
-
jQuery('#
|
124 |
},
|
125 |
|
126 |
set_status: function(status)
|
127 |
{
|
128 |
-
jQuery('#
|
129 |
},
|
130 |
|
131 |
set_processed: function(processed)
|
132 |
{
|
133 |
-
jQuery('#
|
134 |
},
|
135 |
|
136 |
set_total: function(total)
|
137 |
{
|
138 |
-
jQuery('#
|
139 |
},
|
140 |
|
141 |
set_button_text: function(text)
|
142 |
{
|
143 |
-
jQuery('#
|
|
|
|
|
|
|
|
|
|
|
144 |
},
|
145 |
|
146 |
-
|
147 |
{
|
148 |
-
jQuery('#
|
149 |
},
|
150 |
|
151 |
process: function()
|
@@ -157,7 +169,7 @@ var Cdn_Export_Table = {
|
|
157 |
var me = this;
|
158 |
jQuery.post('options-general.php', {
|
159 |
page: 'w3-total-cache/w3-total-cache.php',
|
160 |
-
w3tc_action:
|
161 |
limit: this.limit,
|
162 |
offset: this.offset
|
163 |
}, function(data) {
|
@@ -175,7 +187,7 @@ var Cdn_Export_Table = {
|
|
175 |
|
176 |
var failed = false;
|
177 |
for (var i = 0; i < data.results.length; i++) {
|
178 |
-
this.
|
179 |
if (data.results[i].result == -1) {
|
180 |
failed = true;
|
181 |
break;
|
@@ -199,20 +211,166 @@ var Cdn_Export_Table = {
|
|
199 |
}
|
200 |
},
|
201 |
|
202 |
-
init: function(
|
203 |
-
|
204 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
205 |
}
|
206 |
|
207 |
-
this.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
208 |
|
209 |
var me = this;
|
210 |
-
jQuery('
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
if (this.value == 'Pause') {
|
212 |
me.paused = 1;
|
213 |
me.set_button_text('Resume');
|
214 |
me.set_status('paused');
|
215 |
} else {
|
|
|
|
|
|
|
|
|
216 |
me.paused = 0;
|
217 |
me.set_button_text('Pause');
|
218 |
me.set_status('processing');
|
@@ -221,7 +379,7 @@ var Cdn_Export_Table = {
|
|
221 |
me.process();
|
222 |
});
|
223 |
}
|
224 |
-
}
|
225 |
|
226 |
jQuery(function($) {
|
227 |
$('.tab').click(function() {
|
@@ -238,9 +396,4 @@ jQuery(function($) {
|
|
238 |
$('.cdn_queue_empty').click(function() {
|
239 |
return confirm('Are you sure you want to empty the queue?');
|
240 |
});
|
241 |
-
|
242 |
-
Cdn_Export_Table.init('cdn_export_library_process');
|
243 |
-
if (typeof files !== 'undefined') {
|
244 |
-
Cdn_Export_File.init(files);
|
245 |
-
}
|
246 |
});
|
26 |
jQuery('#cdn_export_file_start').val(text);
|
27 |
},
|
28 |
|
29 |
+
add_log: function(path, result, error)
|
30 |
{
|
31 |
jQuery('#cdn_export_file_log').prepend('<div class="log-' + (result == 1 ? 'success' : 'error') + '">' + path + ' <strong>' + error + '</strong></div>');
|
32 |
},
|
33 |
|
34 |
+
clear_log: function()
|
35 |
+
{
|
36 |
+
jQuery('#cdn_export_library_log').val('');
|
37 |
+
},
|
38 |
+
|
39 |
process: function()
|
40 |
{
|
41 |
if (this.paused) {
|
64 |
{
|
65 |
var failed = false;
|
66 |
for (var i = 0; i < data.results.length; i++) {
|
67 |
+
this.add_log(data.results[i].remote_path, data.results[i].result, data.results[i].error);
|
68 |
if (data.results[i].result == -1) {
|
69 |
failed = true;
|
70 |
break;
|
92 |
}
|
93 |
},
|
94 |
|
95 |
+
init: function(files, cdn_url) {
|
96 |
if (files === undefined) {
|
97 |
files = [];
|
98 |
}
|
106 |
me.set_button_text('Resume');
|
107 |
me.set_status('paused');
|
108 |
} else {
|
109 |
+
if (this.value == 'Start') {
|
110 |
+
me.clear_log();
|
111 |
+
}
|
112 |
me.paused = 0;
|
113 |
me.set_button_text('Pause');
|
114 |
me.set_status('processing');
|
117 |
me.process();
|
118 |
});
|
119 |
}
|
120 |
+
};
|
121 |
|
122 |
+
var Cdn_Export_Library = {
|
|
|
123 |
paused: 0,
|
124 |
limit: 25,
|
125 |
offset: 0,
|
126 |
|
127 |
set_progress: function(percent)
|
128 |
{
|
129 |
+
jQuery('#cdn_export_library_progress .progress-bar').width(percent + '%');
|
130 |
+
jQuery('#cdn_export_library_progress .progress-value').html(percent + '%');
|
131 |
},
|
132 |
|
133 |
set_status: function(status)
|
134 |
{
|
135 |
+
jQuery('#cdn_export_library_status').html(status);
|
136 |
},
|
137 |
|
138 |
set_processed: function(processed)
|
139 |
{
|
140 |
+
jQuery('#cdn_export_library_processed').html(processed);
|
141 |
},
|
142 |
|
143 |
set_total: function(total)
|
144 |
{
|
145 |
+
jQuery('#cdn_export_library_total').html(total);
|
146 |
},
|
147 |
|
148 |
set_button_text: function(text)
|
149 |
{
|
150 |
+
jQuery('#cdn_export_library_start').val(text);
|
151 |
+
},
|
152 |
+
|
153 |
+
add_log: function(path, result, error)
|
154 |
+
{
|
155 |
+
jQuery('#cdn_export_library_log').prepend('<div class="log-' + (result == 1 ? 'success' : 'error') + '">' + path + ' <strong>' + error + '</strong></div>');
|
156 |
},
|
157 |
|
158 |
+
clear_log: function()
|
159 |
{
|
160 |
+
jQuery('#cdn_export_library_log').html('');
|
161 |
},
|
162 |
|
163 |
process: function()
|
169 |
var me = this;
|
170 |
jQuery.post('options-general.php', {
|
171 |
page: 'w3-total-cache/w3-total-cache.php',
|
172 |
+
w3tc_action: 'cdn_export_library_process',
|
173 |
limit: this.limit,
|
174 |
offset: this.offset
|
175 |
}, function(data) {
|
187 |
|
188 |
var failed = false;
|
189 |
for (var i = 0; i < data.results.length; i++) {
|
190 |
+
this.add_log(data.results[i].remote_path, data.results[i].result, data.results[i].error);
|
191 |
if (data.results[i].result == -1) {
|
192 |
failed = true;
|
193 |
break;
|
211 |
}
|
212 |
},
|
213 |
|
214 |
+
init: function() {
|
215 |
+
var me = this;
|
216 |
+
jQuery('#cdn_export_library_start').click(function() {
|
217 |
+
if (this.value == 'Pause') {
|
218 |
+
me.paused = 1;
|
219 |
+
me.set_button_text('Resume');
|
220 |
+
me.set_status('paused');
|
221 |
+
} else {
|
222 |
+
if (this.value == 'Start') {
|
223 |
+
me.clear_log();
|
224 |
+
}
|
225 |
+
me.paused = 0;
|
226 |
+
me.set_button_text('Pause');
|
227 |
+
me.set_status('processing');
|
228 |
+
}
|
229 |
+
|
230 |
+
me.process();
|
231 |
+
});
|
232 |
+
}
|
233 |
+
};
|
234 |
+
|
235 |
+
var Cdn_Import_Library = {
|
236 |
+
paused: 0,
|
237 |
+
limit: 5,
|
238 |
+
offset: 0,
|
239 |
+
cdn_host: '',
|
240 |
+
|
241 |
+
set_progress: function(percent)
|
242 |
+
{
|
243 |
+
jQuery('#cdn_import_library_progress .progress-bar').width(percent + '%');
|
244 |
+
jQuery('#cdn_import_library_progress .progress-value').html(percent + '%');
|
245 |
+
},
|
246 |
+
|
247 |
+
set_status: function(status)
|
248 |
+
{
|
249 |
+
jQuery('#cdn_import_library_status').html(status);
|
250 |
+
},
|
251 |
+
|
252 |
+
set_processed: function(processed)
|
253 |
+
{
|
254 |
+
jQuery('#cdn_import_library_processed').html(processed);
|
255 |
+
},
|
256 |
+
|
257 |
+
set_total: function(total)
|
258 |
+
{
|
259 |
+
jQuery('#cdn_import_library_total').html(total);
|
260 |
+
},
|
261 |
+
|
262 |
+
set_button_text: function(text)
|
263 |
+
{
|
264 |
+
jQuery('#cdn_import_library_start').val(text);
|
265 |
+
},
|
266 |
+
|
267 |
+
is_redirect_permanent: function()
|
268 |
+
{
|
269 |
+
return (jQuery('#cdn_import_library_redirect_permanent:checked').size() > 0);
|
270 |
+
},
|
271 |
+
|
272 |
+
is_redirect_cdn: function()
|
273 |
+
{
|
274 |
+
return (jQuery('#cdn_import_library_redirect_cdn:checked').size() > 0);
|
275 |
+
},
|
276 |
+
|
277 |
+
add_log: function(path, result, error)
|
278 |
+
{
|
279 |
+
jQuery('#cdn_import_library_log').prepend('<div class="log-' + (result == 1 ? 'success' : 'error') + '">' + path + ' <strong>' + error + '</strong></div>');
|
280 |
+
},
|
281 |
+
|
282 |
+
clear_log: function()
|
283 |
+
{
|
284 |
+
jQuery('#cdn_import_library_log').html('');
|
285 |
+
},
|
286 |
+
|
287 |
+
add_rule: function(src, dst)
|
288 |
+
{
|
289 |
+
if (/^https?:\/\//.test(src)) {
|
290 |
+
return;
|
291 |
}
|
292 |
|
293 |
+
if (this.is_redirect_cdn()) {
|
294 |
+
dst = 'http://' + this.cdn_host + '/' + dst;
|
295 |
+
} else {
|
296 |
+
dst = '/' + dst;
|
297 |
+
}
|
298 |
+
|
299 |
+
var rules = jQuery('#cdn_import_library_rules');
|
300 |
+
rules.val(rules.val() + 'Redirect ' + (this.is_redirect_permanent() ? '302 ' : '') + '/' + src + ' ' + dst + '\r\n');
|
301 |
+
},
|
302 |
+
|
303 |
+
clear_rules: function()
|
304 |
+
{
|
305 |
+
jQuery('#cdn_import_library_rules').val('');
|
306 |
+
},
|
307 |
+
|
308 |
+
process: function()
|
309 |
+
{
|
310 |
+
if (this.paused) {
|
311 |
+
return;
|
312 |
+
}
|
313 |
|
314 |
var me = this;
|
315 |
+
jQuery.post('options-general.php', {
|
316 |
+
page: 'w3-total-cache/w3-total-cache.php',
|
317 |
+
w3tc_action: 'cdn_import_library_process',
|
318 |
+
limit: this.limit,
|
319 |
+
offset: this.offset
|
320 |
+
}, function(data) {
|
321 |
+
me.process_callback(data);
|
322 |
+
}, 'json');
|
323 |
+
},
|
324 |
+
|
325 |
+
process_callback: function(data)
|
326 |
+
{
|
327 |
+
this.offset += data.count;
|
328 |
+
|
329 |
+
this.set_total(data.total);
|
330 |
+
this.set_processed(this.offset);
|
331 |
+
this.set_progress((this.offset * 100 / data.total).toFixed(0));
|
332 |
+
|
333 |
+
var failed = false;
|
334 |
+
for (var i = 0; i < data.results.length; i++) {
|
335 |
+
this.add_log(data.results[i].src, data.results[i].result, data.results[i].error);
|
336 |
+
if (data.results[i].result == 1) {
|
337 |
+
this.add_rule(data.results[i].src, data.results[i].dst);
|
338 |
+
} else if (data.results[i].result == -1) {
|
339 |
+
failed = true;
|
340 |
+
break;
|
341 |
+
}
|
342 |
+
}
|
343 |
+
|
344 |
+
if (failed) {
|
345 |
+
this.offset = 0;
|
346 |
+
this.set_progress(0);
|
347 |
+
this.set_processed(1);
|
348 |
+
this.set_status('failed');
|
349 |
+
this.set_button_text('Start');
|
350 |
+
} else {
|
351 |
+
if (this.offset < data.total) {
|
352 |
+
this.process();
|
353 |
+
} else {
|
354 |
+
this.offset = 0;
|
355 |
+
this.set_status('done');
|
356 |
+
this.set_button_text('Start');
|
357 |
+
}
|
358 |
+
}
|
359 |
+
},
|
360 |
+
|
361 |
+
init: function(cdn_host) {
|
362 |
+
var me = this;
|
363 |
+
this.cdn_host = cdn_host;
|
364 |
+
jQuery('#cdn_import_library_start').click(function() {
|
365 |
if (this.value == 'Pause') {
|
366 |
me.paused = 1;
|
367 |
me.set_button_text('Resume');
|
368 |
me.set_status('paused');
|
369 |
} else {
|
370 |
+
if (this.value == 'Start') {
|
371 |
+
me.clear_log();
|
372 |
+
me.clear_rules();
|
373 |
+
}
|
374 |
me.paused = 0;
|
375 |
me.set_button_text('Pause');
|
376 |
me.set_status('processing');
|
379 |
me.process();
|
380 |
});
|
381 |
}
|
382 |
+
};
|
383 |
|
384 |
jQuery(function($) {
|
385 |
$('.tab').click(function() {
|
396 |
$('.cdn_queue_empty').click(function() {
|
397 |
return confirm('Are you sure you want to empty the queue?');
|
398 |
});
|
|
|
|
|
|
|
|
|
|
|
399 |
});
|
inc/options/about.phtml
CHANGED
@@ -1,31 +1,31 @@
|
|
1 |
-
<
|
2 |
-
<
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
</div>
|
1 |
+
<div id="about">
|
2 |
+
<h3>About</h3>
|
3 |
+
|
4 |
+
<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 benefits:</p>
|
5 |
+
<ul>
|
6 |
+
<li>Improved progressive render (non-blocking <acronym title="Cascading Style Sheet">CSS</acronym> and <acronym title="JavaScript">JS</acronym> embedding)</li>
|
7 |
+
<li>Transparent content delivery network (<acronym title="Content Delivery Network">CDN</acronym>) support with automated media library import</li>
|
8 |
+
<li>Bandwidth savings via Minify and <acronym title="Hypertext Transfer Protocol">HTTP</acronym> compression (<acronym title="GNU zip">gzip</acronym> / deflate) for <acronym title="Hypertext Markup Language">HTML</acronym>, <acronym title="Cascading Style Sheet">CSS</acronym> and <acronym title="JavaScript">JS</acronym></li>
|
9 |
+
<li>Minification (concatenation, white space removal) of inline, external or 3rd party <acronym title="JavaScript">JS</acronym> and <acronym title="Cascading Style Sheet">CSS</acronym> with scheduled updates</li>
|
10 |
+
<li>Caching of <acronym title="Really Simple Syndication">RSS</acronym>/Atom Feeds (comments, page and site), <acronym title="Uniform Resource Identifier">URI</acronym>s with query string variables (like search result pages), database objects, pages, posts, <acronym title="Cascading Style Sheet">CSS</acronym> and <acronym title="JavaScript">JS</acronym> in memory via <a href="http://pecl.php.net/apc">APC</a> or <a href="http://www.danga.com/memcached/">memcached</a> or both</li>
|
11 |
+
<li>Increased web server concurrency and reduced resource consumption, increased scale</li>
|
12 |
+
<li>Reduced <acronym title="Hypertext Transfer Protocol">HTTP</acronym> Transactions, <acronym title="Domain Name System">DNS</acronym> lookups, reduced document load time</li>
|
13 |
+
<li>Complete header management including <a href="http://en.wikipedia.org/wiki/HTTP_ETag">Etags</a></li>
|
14 |
+
<li>Optional embedding of <acronym title="JavaScript">JS</acronym> just above </body></li>
|
15 |
+
</ul>
|
16 |
+
<p>Your users have less data to download, you can now handle more requests with your existing equipment and you don't have to change how you do anything; just set it and forget it.</p>
|
17 |
+
<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>
|
18 |
+
<ul>
|
19 |
+
<li><a href="http://mrclay.org/" target="_blank">Steve Clay</a></li>
|
20 |
+
<li><a href="http://wonko.com/" target="_blank">Ryan Grove</a></li>
|
21 |
+
<li><a href="http://www.nczonline.net/blog/2009/06/23/loading-javascript-without-blocking/" target="_blank">Nicholas Zakas</a> </li>
|
22 |
+
<li><a href="http://stevesouders.com/" target="_blank">Steve Souders</a></li>
|
23 |
+
<li><a href="http://rtdean.livejournal.com/" target="_blank">Ryan Dean</a></li>
|
24 |
+
<li><a href="http://gravitonic.com/" target="_blank">Andrei Zmievski</a></li>
|
25 |
+
<li>George Schlossnagle</li>
|
26 |
+
<li>Daniel Cowgill</li>
|
27 |
+
<li><a href="http://toys.lerdorf.com/" target="_blank">Rasmus Lerdorf</a></li>
|
28 |
+
<li><a href="http://t3.dotgnu.info/" target="_blank">Gopal Vijayaraghavan</a></li>
|
29 |
+
</ul>
|
30 |
+
<p>Please reach out to all of these people and support their projects if you're so inclined.</p>
|
31 |
</div>
|
inc/options/cdn.phtml
CHANGED
@@ -1,143 +1,155 @@
|
|
1 |
<h3><acronym title="Content Delivery Network">CDN</acronym> Settings</h3>
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
-
<
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
<
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
<
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
<
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
</p>
|
142 |
-
</form>
|
143 |
-
</div>
|
1 |
<h3><acronym title="Content Delivery Network">CDN</acronym> Settings</h3>
|
2 |
+
|
3 |
+
<p><acronym title="Content Delivery Network">CDN</acronym> support is currently <span class="w3tc-<?php if ($config->get_boolean('cdn.enabled')): ?>enabled">enabled<?php else: ?>disabled">disabled<?php endif; ?></span>.</p>
|
4 |
+
|
5 |
+
<p>
|
6 |
+
You can
|
7 |
+
<input id="cdn_export_library" class="button" type="button" value="export media library to CDN" /> or
|
8 |
+
<input id="cdn_import_library" class="button" type="button" value="import post files to media library & CDN" /> or
|
9 |
+
<input id="cdn_queue" class="button" type="button" value="view unsuccessfull transfers" /> now.
|
10 |
+
</p>
|
11 |
+
|
12 |
+
<form action="options-general.php?page=<?php echo urldecode(W3_PLUGIN_FILE); ?>&tab=<?php echo $tab; ?>" method="post">
|
13 |
+
|
14 |
+
<!-- <p>
|
15 |
+
<a href="#cdn_ftp" class="w3tc-tab" rel="#cdn_ftp"><acronym title="File Transfer Protocol">FTP</acronym> settings</a> |
|
16 |
+
<a href="#cdn_cf" class="w3tc-tab" rel="#cdn_cf">Amazon CloudFront settings</a> |
|
17 |
+
<a href="#cdn_s3" class="w3tc-tab" rel="#cdn_s3">Amazon S3 settings</a>
|
18 |
+
</p> -->
|
19 |
|
20 |
+
<div id="cdn_ftp" class="w3tc-tab-content">
|
21 |
+
<table class="form-table">
|
22 |
+
<tr>
|
23 |
+
<th><label for="cdn_ftp_host"><acronym title="File Transfer Protocol">FTP</acronym> Hostname:</label></th>
|
24 |
+
<td>
|
25 |
+
<input id="cdn_ftp_host" type="text" name="cdn.ftp.host" value="<?php echo htmlspecialchars($config->get_string('cdn.ftp.host')); ?>" size="30" />
|
26 |
+
</td>
|
27 |
+
</tr>
|
28 |
+
<tr>
|
29 |
+
<th><label for="cdn_ftp_user"><acronym title="File Transfer Protocol">FTP</acronym> Username:</label></th>
|
30 |
+
<td>
|
31 |
+
<input id="cdn_ftp_user" type="text" name="cdn.ftp.user" value="<?php echo htmlspecialchars($config->get_string('cdn.ftp.user')); ?>" size="30" />
|
32 |
+
</td>
|
33 |
+
</tr>
|
34 |
+
<tr>
|
35 |
+
<th><label for="cdn_ftp_pass"><acronym title="File Transfer Protocol">FTP</acronym> Password:</label></th>
|
36 |
+
<td>
|
37 |
+
<input id="cdn_ftp_pass" type="text" name="cdn.ftp.pass" value="<?php echo htmlspecialchars($config->get_string('cdn.ftp.pass')); ?>" size="30" />
|
38 |
+
</td>
|
39 |
+
</tr>
|
40 |
+
<tr>
|
41 |
+
<th><label for="cdn_ftp_path"><acronym title="File Transfer Protocol">FTP</acronym> Path:</label></th>
|
42 |
+
<td>
|
43 |
+
<input id="cdn_ftp_path" type="text" name="cdn.ftp.path" value="<?php echo htmlspecialchars($config->get_string('cdn.ftp.path')); ?>" size="30" />
|
44 |
+
</td>
|
45 |
+
</tr>
|
46 |
+
<tr>
|
47 |
+
<th colspan="2">
|
48 |
+
<input type="hidden" name="cdn.ftp.pasv" value="0" />
|
49 |
+
<label><input type="checkbox" name="cdn.ftp.pasv" value="1"<?php checked($config->get_boolean('cdn.ftp.pasv')); ?> /> Use Passive <acronym title="File Transfer Protocol">FTP</acronym> Mode</label>
|
50 |
+
</th>
|
51 |
+
</tr>
|
52 |
+
</table>
|
53 |
+
<p>
|
54 |
+
<input id="test_ftp" class="button" type="button" value="Test FTP server" /> <span id="test_ftp_status" class="w3tc-cdn-status w3tc-process"></span>
|
55 |
+
</p>
|
56 |
+
</div>
|
57 |
+
<div id="cdn_cf" class="w3tc-tab-content" style="display: none;">
|
58 |
+
to do...
|
59 |
+
<p>
|
60 |
+
<input class="button" type="button" value="Test CloudFront server" />
|
61 |
+
</p>
|
62 |
+
</div>
|
63 |
+
<div id="cdn_s3" class="w3tc-tab-content" style="display: none;">
|
64 |
+
to do...
|
65 |
+
<p>
|
66 |
+
<input class="button" type="button" value="Test S3 server" />
|
67 |
+
</p>
|
68 |
+
</div>
|
69 |
+
|
70 |
+
<table class="form-table">
|
71 |
+
<tr>
|
72 |
+
<th style="width: 300px;"><label for="cdn_domain">Replace domain in <acronym title="Uniform Resource Locator">URL</acronym> with:</label></th>
|
73 |
+
<td>
|
74 |
+
<input id="cdn_domain" type="text" name="cdn.domain" value="<?php echo htmlspecialchars($config->get_string('cdn.domain')); ?>" size="40" />
|
75 |
+
</td>
|
76 |
+
</tr>
|
77 |
+
<tr>
|
78 |
+
<th><label for="cdn_limit_queue">Re-transfer cycle limit:</label></th>
|
79 |
+
<td>
|
80 |
+
<input id="cdn_limit_queue" type="text" name="cdn.limit.queue" value="<?php echo htmlspecialchars($config->get_integer('cdn.limit.queue')); ?>" size="10" /><br />
|
81 |
+
<span class="description">Number of files processed per cycle.</span>
|
82 |
+
</td>
|
83 |
+
</tr>
|
84 |
+
<tr>
|
85 |
+
<th>
|
86 |
+
<input type="hidden" name="cdn.includes.enable" value="0" />
|
87 |
+
<label><input type="checkbox" name="cdn.includes.enable" value="1"<?php checked($config->get_boolean('cdn.includes.enable')); ?> /> Host wp-includes/ files</label>
|
88 |
+
</th>
|
89 |
+
<td>
|
90 |
+
<input class="button cdn_export" type="button" name="includes" value="Upload includes files" />
|
91 |
+
</td>
|
92 |
+
</tr>
|
93 |
+
<tr>
|
94 |
+
<th>
|
95 |
+
<input type="hidden" name="cdn.theme.enable" value="0" />
|
96 |
+
<label><input type="checkbox" name="cdn.theme.enable" value="1"<?php checked($config->get_boolean('cdn.theme.enable')); ?> /> Host active theme files</label>
|
97 |
+
</th>
|
98 |
+
<td>
|
99 |
+
<input class="button cdn_export" type="button" name="theme" value="Upload theme files" />
|
100 |
+
</td>
|
101 |
+
</tr>
|
102 |
+
<tr>
|
103 |
+
<th>
|
104 |
+
<input type="hidden" name="cdn.minify.enable" value="0" />
|
105 |
+
<label><input type="checkbox" name="cdn.minify.enable" value="1"<?php checked($config->get_boolean('cdn.minify.enable')); ?> /> Host minified <acronym title="Cascading Style Sheets">CSS</acronym> and <acronym title="JavaScript">JS</acronym> files</label>
|
106 |
+
</th>
|
107 |
+
<td>
|
108 |
+
<input class="button cdn_export" type="button" name="minify" value="Upload minify files" />
|
109 |
+
</td>
|
110 |
+
</tr>
|
111 |
+
<tr>
|
112 |
+
<th>
|
113 |
+
<input type="hidden" name="cdn.custom.enable" value="0" />
|
114 |
+
<label><input type="checkbox" name="cdn.custom.enable" value="1"<?php checked($config->get_boolean('cdn.custom.enable')); ?> /> Host custom files</label>
|
115 |
+
</th>
|
116 |
+
<td>
|
117 |
+
<input class="button cdn_export" type="button" name="custom" value="Upload custom files" />
|
118 |
+
</td>
|
119 |
+
</tr>
|
120 |
+
<tr>
|
121 |
+
<th><label for="cdn_includes_files">Search wp-includes/ directory for files:</label></th>
|
122 |
+
<td>
|
123 |
+
<input id="cdn_includes_files" type="text" name="cdn.includes.files" value="<?php echo htmlspecialchars($config->get_string('cdn.includes.files')); ?>" size="40" />
|
124 |
+
</td>
|
125 |
+
</tr>
|
126 |
+
<tr>
|
127 |
+
<th><label for="cdn_theme_files">Search current theme directory for files:</label></th>
|
128 |
+
<td>
|
129 |
+
<input id="cdn_theme_files" type="text" name="cdn.theme.files" value="<?php echo htmlspecialchars($config->get_string('cdn.theme.files')); ?>" size="40" />
|
130 |
+
</td>
|
131 |
+
</tr>
|
132 |
+
<tr>
|
133 |
+
<th valign="top"><label for="cdn_custom_files">Custom file list:</label></th>
|
134 |
+
<td>
|
135 |
+
<textarea id="cdn_custom_files" name="cdn.custom.files" cols="30" rows="5"><?php echo htmlspecialchars(implode("\r\n", $config->get_array('cdn.custom.files'))); ?></textarea>
|
136 |
+
</td>
|
137 |
+
</tr>
|
138 |
+
<tr>
|
139 |
+
<th colspan="2">
|
140 |
+
<input type="hidden" name="cdn.import.external" value="0" />
|
141 |
+
<label><input type="checkbox" name="cdn.import.external" value="1"<?php checked($config->get_boolean('cdn.import.external')); ?> /> Import external files</label>
|
142 |
+
</th>
|
143 |
+
</tr>
|
144 |
+
<tr>
|
145 |
+
<th><label for="cdn_import_files">Import files:</label></th>
|
146 |
+
<td>
|
147 |
+
<input id="cdn_import_files" type="text" name="cdn.import.files" value="<?php echo htmlspecialchars($config->get_string('cdn.import.files')); ?>" size="40" />
|
148 |
+
</td>
|
149 |
+
</tr>
|
150 |
+
</table>
|
151 |
+
|
152 |
+
<p class="submit">
|
153 |
+
<input type="submit" name="Submit" class="button-primary" value="Save changes" />
|
154 |
+
</p>
|
155 |
+
</form>
|
|
|
|
|
|
inc/options/common/footer.phtml
CHANGED
@@ -1 +1 @@
|
|
1 |
-
</div>
|
1 |
+
</div>
|
inc/options/common/header.phtml
CHANGED
@@ -1,31 +1,31 @@
|
|
1 |
-
<div class="wrap">
|
2 |
-
<?php screen_icon('w3tc-logo'); ?>
|
3 |
-
|
4 |
-
<h2>W3 Total Cache</h2>
|
5 |
-
|
6 |
-
<?php if (count($errors)): ?>
|
7 |
-
<div id="message" class="error">
|
8 |
-
<?php foreach ($errors as $error): ?>
|
9 |
-
<p><?php echo $error; ?></p>
|
10 |
-
<?php endforeach; ?>
|
11 |
-
</div>
|
12 |
-
<?php endif; ?>
|
13 |
-
|
14 |
-
<?php if (count($notes)): ?>
|
15 |
-
<div id="message" class="updated fade">
|
16 |
-
<?php foreach ($notes as $note): ?>
|
17 |
-
<p><?php echo $note; ?></p>
|
18 |
-
<?php endforeach; ?>
|
19 |
-
</div>
|
20 |
-
<?php endif; ?>
|
21 |
-
|
22 |
-
<p id="w3tc-options-menu">
|
23 |
-
<a href="?page=<?php echo W3_PLUGIN_FILE; ?>&tab=general"<?php if ($tab == 'general'): ?> class="w3tc-options-menu-selected"<?php endif; ?>>General Settings</a> |
|
24 |
-
<a href="?page=<?php echo W3_PLUGIN_FILE; ?>&tab=pgcache"<?php if ($tab == 'pgcache'): ?> class="w3tc-options-menu-selected"<?php endif; ?>>Page Cache Settings</a> |
|
25 |
-
<a href="?page=<?php echo W3_PLUGIN_FILE; ?>&tab=minify"<?php if ($tab == 'minify'): ?> class="w3tc-options-menu-selected"<?php endif; ?>>Minify Settings</a> |
|
26 |
-
<a href="?page=<?php echo W3_PLUGIN_FILE; ?>&tab=dbcache"<?php if ($tab == 'dbcache'): ?> class="w3tc-options-menu-selected"<?php endif; ?>>Database Cache Settings</a> |
|
27 |
-
<a href="?page=<?php echo W3_PLUGIN_FILE; ?>&tab=cdn"<?php if ($tab == 'cdn'): ?> class="w3tc-options-menu-selected"<?php endif; ?>><acronym title="Content Delivery Network">CDN</acronym> Settings</a> |
|
28 |
-
<a href="?page=<?php echo W3_PLUGIN_FILE; ?>&tab=faq"<?php if ($tab == 'faq'): ?> class="w3tc-options-menu-selected"<?php endif; ?>><acronym title="Frequently Asked Questions">FAQ</acronym></a> |
|
29 |
-
<a href="?page=<?php echo W3_PLUGIN_FILE; ?>&tab=install"<?php if ($tab == 'install'): ?> class="w3tc-options-menu-selected"<?php endif; ?>>Installation</a> |
|
30 |
-
<a href="?page=<?php echo W3_PLUGIN_FILE; ?>&tab=about"<?php if ($tab == 'about'): ?> class="w3tc-options-menu-selected"<?php endif; ?>>About</a>
|
31 |
-
</p>
|
1 |
+
<div class="wrap" id="w3tc">
|
2 |
+
<?php screen_icon('w3tc-logo'); ?>
|
3 |
+
|
4 |
+
<h2>W3 Total Cache</h2>
|
5 |
+
|
6 |
+
<?php if (count($errors)): ?>
|
7 |
+
<div id="message" class="error">
|
8 |
+
<?php foreach ($errors as $error): ?>
|
9 |
+
<p><?php echo $error; ?></p>
|
10 |
+
<?php endforeach; ?>
|
11 |
+
</div>
|
12 |
+
<?php endif; ?>
|
13 |
+
|
14 |
+
<?php if (count($notes)): ?>
|
15 |
+
<div id="message" class="updated fade">
|
16 |
+
<?php foreach ($notes as $note): ?>
|
17 |
+
<p><?php echo $note; ?></p>
|
18 |
+
<?php endforeach; ?>
|
19 |
+
</div>
|
20 |
+
<?php endif; ?>
|
21 |
+
|
22 |
+
<p id="w3tc-options-menu">
|
23 |
+
<a href="?page=<?php echo W3_PLUGIN_FILE; ?>&tab=general"<?php if ($tab == 'general'): ?> class="w3tc-options-menu-selected"<?php endif; ?>>General Settings</a> |
|
24 |
+
<a href="?page=<?php echo W3_PLUGIN_FILE; ?>&tab=pgcache"<?php if ($tab == 'pgcache'): ?> class="w3tc-options-menu-selected"<?php endif; ?>>Page Cache Settings</a> |
|
25 |
+
<a href="?page=<?php echo W3_PLUGIN_FILE; ?>&tab=minify"<?php if ($tab == 'minify'): ?> class="w3tc-options-menu-selected"<?php endif; ?>>Minify Settings</a> |
|
26 |
+
<a href="?page=<?php echo W3_PLUGIN_FILE; ?>&tab=dbcache"<?php if ($tab == 'dbcache'): ?> class="w3tc-options-menu-selected"<?php endif; ?>>Database Cache Settings</a> |
|
27 |
+
<a href="?page=<?php echo W3_PLUGIN_FILE; ?>&tab=cdn"<?php if ($tab == 'cdn'): ?> class="w3tc-options-menu-selected"<?php endif; ?>><acronym title="Content Delivery Network">CDN</acronym> Settings</a> |
|
28 |
+
<a href="?page=<?php echo W3_PLUGIN_FILE; ?>&tab=faq"<?php if ($tab == 'faq'): ?> class="w3tc-options-menu-selected"<?php endif; ?>><acronym title="Frequently Asked Questions">FAQ</acronym></a> |
|
29 |
+
<a href="?page=<?php echo W3_PLUGIN_FILE; ?>&tab=install"<?php if ($tab == 'install'): ?> class="w3tc-options-menu-selected"<?php endif; ?>>Installation</a> |
|
30 |
+
<a href="?page=<?php echo W3_PLUGIN_FILE; ?>&tab=about"<?php if ($tab == 'about'): ?> class="w3tc-options-menu-selected"<?php endif; ?>>About</a>
|
31 |
+
</p>
|
inc/options/dbcache.phtml
CHANGED
@@ -1,24 +1,23 @@
|
|
1 |
<h3>Database Caching Settings</h3>
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
</div>
|
1 |
<h3>Database Caching Settings</h3>
|
2 |
+
|
3 |
+
<p>Database caching is currently <span class="w3tc-<?php if ($config->get_boolean('dbcache.enabled')): ?>enabled">enabled<?php else: ?>disabled">disabled<?php endif; ?></span>.</p>
|
4 |
+
|
5 |
+
<form action="options-general.php?page=<?php echo urldecode(W3_PLUGIN_FILE); ?>&tab=<?php echo $tab; ?>" method="post">
|
6 |
+
<table class="form-table">
|
7 |
+
<tr>
|
8 |
+
<th style="width: 250px;"><label for="dbcache_memcached_servers">Memcached Hostname:Port / IP:Port:</label></th>
|
9 |
+
<td>
|
10 |
+
<input id="dbcache_memcached_servers" type="text" name="dbcache.memcached.servers" value="<?php echo htmlspecialchars(implode(',', $config->get_array('dbcache.memcached.servers'))); ?>" size="100"<?php if ($config->get_string('dbcache.engine', 'memcached') != 'memcached'): ?> disabled="disabled"<?php endif; ?> /><br />
|
11 |
+
<span class="description">Multiple servers may be used and seperated by a comma; e.g. 192.168.1.100:11211, domain.com:22122</span>
|
12 |
+
</td>
|
13 |
+
</tr>
|
14 |
+
<tr>
|
15 |
+
<th><label for="dbcache_lifetime_default">Maximum lifetime of cache objects:</label></th>
|
16 |
+
<td><input id="dbcache_lifetime_default" type="text" name="dbcache.lifetime.default" value="<?php echo $config->get_integer('dbcache.lifetime.default'); ?>" size="8" /> seconds</td>
|
17 |
+
</tr>
|
18 |
+
</table>
|
19 |
+
|
20 |
+
<p class="submit">
|
21 |
+
<input type="submit" name="Submit" class="button-primary" value="Save changes" />
|
22 |
+
</p>
|
23 |
+
</form>
|
|
inc/options/faq.phtml
CHANGED
@@ -1,483 +1,478 @@
|
|
1 |
-
<h3
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
</
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
</
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
</
|
112 |
-
</
|
113 |
-
</
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
</
|
128 |
-
|
|
|
129 |
<p>As a practical matter, Akamai and JupiterResearch did a study on <a href="http://www.akamai.com/html/about/press/releases/2006/press_110606.html" target="_blank">acceptable wait time for retail web sites</a> to load back in late 2006 concluding that users may leave after 4 seconds of waiting. That was several years ago now, even before 3G was available for mobile devices, what do you think web users expect today? <a href="http://blogs.zdnet.com/BTL/?p=3925" target="_blank">According to Marissa Mayer</a> of Google, as she stated the same year as Akamai, improving the speed of sites/applications reduces the learning curve for applications and contributes to higher use. It's time to bring the performance major corporations enjoy to the blogosphere.</p>
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
<li>Bandwidth savings via <acronym title="Hypertext Transfer Protocol">HTTP</acronym> compression (<acronym title="GNU zip">gzip</acronym> / deflate) for <acronym title="Hypertext Markup Language">HTML</acronym>, <acronym title="Cascading Style Sheet">CSS</acronym> and <acronym title="JavaScript">JS</acronym></li>
|
140 |
-
|
141 |
-
|
142 |
<li>Support for caching pages, posts, feeds, database objects, <acronym title="Cascading Style Sheet">CSS</acronym>, <acronym title="JavaScript">JS</acronym> in memory with <acronym title="Alternative PHP Cache">APC</acronym> or memcached or both</li>
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
</
|
182 |
-
|
|
|
183 |
<p id="q13"><strong>Does this plugin work with WordPress <acronym title="Multi-User">MU</acronym>?</strong><br />
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
We'll just quote the fine folks at yahoo on this one:</p>
|
194 |
-
|
195 |
<p>"Minification is the practice of removing unnecessary characters from code to reduce its size thereby improving load times. When code is minified all comments are removed, as well as unneeded white space characters (space, newline, and tab). In the case of JavaScript, this improves response time performance because the size of the downloaded file is reduced. Two popular tools for minifying JavaScript code are <a href="http://www.crockford.com/javascript/jsmin.html" target="_blank"><acronym title="JavaScript">JS</acronym>Min</a> and <a href="http://developer.yahoo.com/yui/compressor/" target="_blank"><acronym title="Yahoo! User Interface">YUI</acronym> Compressor</a>. The <acronym title="Yahoo! User Interface">YUI</acronym> compressor can also minify <acronym title="Cascading Style Sheet">CSS</acronym>.</p>
|
196 |
-
|
197 |
<p>In addition to minifying external scripts and styles, inline <script> and <style> blocks can and should also be minified. Even if you <acronym title="GNU zip">gzip</acronym> your scripts and styles, minifying them will still reduce the size by 5% or more. As the use and size of JavaScript and <acronym title="Cascading Style Sheet">CSS</acronym> increases so will the savings gained by minifying your code."</p>
|
198 |
<cite><a href="http://developer.yahoo.com/performance/rules.html#minify" target="_blank">developer.yahoo.com</a></cite> </blockquote>
|
199 |
-
|
200 |
-
|
201 |
We use: <a href="http://code.google.com/p/minify/" target="_blank">minify</a> but may support various engines in the future. Based on <a href="http://ejohn.org/" target="_blank">John Resig's</a> suggestion we're currently looking at <a href="http://yuilibrary.com/projects/yuicompressor/wiki" target="_blank"><acronym title="Yahoo! User Interface">YUI</acronym> Compressor</a> also.</p>
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
Definitely. Removing white space from your files make <acronym title="GNU zip">gzip</acronym> and deflate (<acronym title="Hypertext Transfer Protocol">HTTP</acronym> compression) more effective.</p>
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
<p id="q31"><strong>Who in the world uses memcached or <acronym title="Alternative PHP Cache">APC</acronym> etc anyway?</strong><br />
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
Yes, especially if you have a cluster and many WordPress installations or a WordPress <acronym title="Multi-User">MU</acronym> installation, then plugin is for you. It will allow you to move easily from multiple installations to WordPress <acronym title="Multi-User">MU</acronym> and continue to use multiple <acronym title="Hypertext Transfer Protocol">HTTP</acronym>, Database, Network Attached Storage etc servers in any configuration you wish. You can also specify as many memcached servers as you wish, although you cannot yet delegate a memcached server to a specific type of caching, i.e. there's no pool management yet.</p>
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
<p>Fact of the matter, there was a time when the semantics and size of your <acronym title="Hypertext Markup Language">HTML</acronym> file (code-to-content ratio), was a factor in a more favorable ranking. <a href="http://microformats.org/wiki/posh" target="_blank"><acronym title="Plain Old Semantic HTML">POSH</acronym></a> <acronym title="Hypertext Markup Language">HTML</acronym> has always been preferred by search engines. In some markets this may still be true, so give the search engines what they want.</p>
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
Yes and no. In general, packed <acronym title="JavaScript">JS</acronym> cannot be minified reliably. Obfuscated <acronym title="JavaScript">JS</acronym> also is hit or miss. A minified and <acronym title="GNU zip">gzip</acronym>ped <acronym title="JavaScript">JS</acronym> file will be smaller than a packed file in any case, so using the (uncompressed, unpacked or un obfuscated) developer versions of your plugins is no longer a concern when using this plugin. Alternatively, you can use the non-blocking embed option to continue to use your packed or obfuscated file without minification.</p>
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
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>
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
<p><!--[if lte IE 8]><link rel="stylesheet" type="text/css" href="/wp-content/themes/default/lte.css" media="screen,projection" /><![endif]--></p>
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
<p id="q52" align="right"><a href="#toc">back to top</a></p>
|
327 |
<p><strong>I have some <acronym title="Cascading Style Sheet">CSS</acronym> classes with declarations being overwritten or <acronym title="JavaScript">JS</acronym> with dependencies, do I really have to copy and paste all my <acronym title="Cascading Style Sheet">CSS</acronym> and <acronym title="JavaScript">JS</acronym> file settings around?</strong><br />
|
328 |
No, you can drag and drop them into the desired order on the minify settings page.</p>-->
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
Right now we do not show the statistics in <acronym title="WordPress">WP</acronym> Admin, but soon we will provide graphs of: Page Cache Memory Use, Page Cache Hits/Misses, <acronym title="Database">DB</acronym> Cache Memory Use, <acronym title="Database">DB</acronym> Hits/Misses, Average Page Compression Savings, Average <acronym title="Cascading Style Sheet">CSS</acronym> Compression Savings, Average <acronym title="JavaScript">JS</acronym> Compression Savings, Average Requests per Second, and Average Page Execution Time.</p>
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
<p id="q62"><strong>Which features can I use if I haven't yet installed <acronym title="Alternative PHP Cache">APC</acronym> or memcached?</strong><br />
|
361 |
Memory caching will not be possible. However you will be able to use minify as well <acronym title="Content Delivery Network">CDN</acronym> functionality without issue. Remember that W3 Total Cache is not compatible with other caching plugins, so you'll want to install <acronym title="Alternative PHP Cache">APC</acronym> and/or memcached as soon as possible.</p>
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
</
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
<
|
409 |
-
|
410 |
-
<
|
411 |
-
<
|
412 |
-
|
413 |
-
<
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
</
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|