W3 Total Cache - Version 0.7.5

Version Description

  • Fixed issue with auto-download/upgrade and additional error checking
  • Improved handling of inline comments and JavaScript in HTML documents
  • Conditional CSS embeds are now minified leaving the conditional untouched
  • Memcached engine logic modified to better support clustering and multiple memcached instances
  • Added handling for magic_quotes set to on
  • Addressed privilege control issue
  • Resolved warnings thrown in various versions of WordPress
  • Fixed a bug preventing minify working properly if either CSS or JS minification was disabled
  • Improved handing of @import CSS embedding
  • Eliminated false negatives in a number of gzip/deflate compression analysis tools
  • Total plugin file size reduced
Download this release

Release Info

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

Code changes from version 0.7 to 0.7.5

Files changed (223) hide show
  1. inc/define.php +27 -48
  2. inc/options/cdn.phtml +7 -7
  3. inc/options/common/header.phtml +8 -8
  4. inc/options/dbcache.phtml +1 -1
  5. inc/options/faq.phtml +1 -1
  6. inc/options/general.phtml +10 -10
  7. inc/options/minify.phtml +16 -18
  8. inc/options/pgcache.phtml +6 -6
  9. inc/popup/cdn_queue.phtml +8 -8
  10. lib/Minify/{min/lib/FirePHP.php → FirePHP.php} +0 -0
  11. lib/Minify/HISTORY.txt +0 -75
  12. lib/Minify/{min/lib/HTTP → HTTP}/ConditionalGet.php +0 -0
  13. lib/Minify/{min/lib/HTTP → HTTP}/Encoder.php +0 -0
  14. lib/Minify/{min/lib/JSMin.php → JSMin.php} +0 -0
  15. lib/Minify/{min/lib/JSMinPlus.php → JSMinPlus.php} +0 -0
  16. lib/Minify/LICENSE.txt +0 -26
  17. lib/Minify/{min/lib/Minify.php → Minify.php} +0 -0
  18. lib/Minify/{min/lib/Minify → Minify}/Build.php +0 -0
  19. lib/Minify/{min/lib/Minify → Minify}/CSS.php +0 -0
  20. lib/Minify/{min/lib/Minify → Minify}/CSS/Compressor.php +0 -0
  21. lib/Minify/{min/lib/Minify → Minify}/CSS/UriRewriter.php +0 -0
  22. lib/Minify/{min/lib/Minify → Minify}/Cache/APC.php +0 -0
  23. lib/Minify/{min/lib/Minify → Minify}/Cache/File.php +0 -0
  24. lib/Minify/{min/lib/Minify → Minify}/Cache/Memcache.php +0 -0
  25. lib/Minify/{min/lib/Minify → Minify}/CommentPreserver.php +0 -0
  26. lib/Minify/{min/lib/Minify → Minify}/Controller/Base.php +0 -0
  27. lib/Minify/{min/lib/Minify → Minify}/Controller/Files.php +0 -0
  28. lib/Minify/{min/lib/Minify → Minify}/Controller/Groups.php +0 -0
  29. lib/Minify/{min/lib/Minify → Minify}/Controller/MinApp.php +0 -0
  30. lib/Minify/{min/lib/Minify → Minify}/Controller/Page.php +1 -1
  31. lib/Minify/{min/lib/Minify → Minify}/Controller/Version1.php +0 -0
  32. lib/Minify/{min/lib/Minify → Minify}/HTML.php +0 -0
  33. lib/Minify/{min/lib/Minify → Minify}/ImportProcessor.php +0 -0
  34. lib/Minify/{min/lib/Minify → Minify}/Lines.php +0 -0
  35. lib/Minify/{min/lib/Minify → Minify}/Logger.php +0 -0
  36. lib/Minify/{min/lib/Minify → Minify}/Packer.php +0 -0
  37. lib/Minify/{min/lib/Minify → Minify}/Source.php +0 -0
  38. lib/Minify/{min/lib/Minify → Minify}/YUICompressor.php +0 -0
  39. lib/Minify/README.txt +0 -53
  40. lib/Minify/{min/lib/Solar → Solar}/Dir.php +0 -0
  41. lib/Minify/UPGRADING.txt +0 -35
  42. lib/Minify/min/.htaccess +0 -4
  43. lib/Minify/min/README.txt +0 -132
  44. lib/Minify/min/builder/_index.js +0 -242
  45. lib/Minify/min/builder/bm.js +0 -36
  46. lib/Minify/min/builder/index.php +0 -182
  47. lib/Minify/min/builder/ocCheck.php +0 -36
  48. lib/Minify/min/builder/rewriteTest.js +0 -1
  49. lib/Minify/min/config.php +0 -156
  50. lib/Minify/min/groupsConfig.php +0 -34
  51. lib/Minify/min/index.php +0 -67
  52. lib/Minify/min/pageBuffer.php +0 -92
  53. lib/Minify/min/pageConfig.php +0 -82
  54. lib/Minify/min/test/_inc.php +0 -182
  55. lib/Minify/min/test/index.php +0 -161
  56. lib/Minify/min/test/pageBuffer.php +0 -96
  57. lib/Minify/min/utils.php +0 -90
  58. lib/Minify/min_extras/README.txt +0 -15
  59. lib/Minify/min_extras/ab_tests/README.txt +0 -10
  60. lib/Minify/min_extras/ab_tests/_delimiter +0 -3
  61. lib/Minify/min_extras/ab_tests/ideal_php/before.php +0 -25
  62. lib/Minify/min_extras/ab_tests/minify/before.js +0 -3408
  63. lib/Minify/min_extras/ab_tests/minify/test_Files.php +0 -15
  64. lib/Minify/min_extras/ab_tests/minify/test_Files_Memcache.php +0 -35
  65. lib/Minify/min_extras/ab_tests/minify/test_Groups.php +0 -15
  66. lib/Minify/min_extras/ab_tests/minify/test_Version1.php +0 -13
  67. lib/Minify/min_extras/ab_tests/minify/test_memcache.php +0 -19
  68. lib/Minify/min_extras/ab_tests/mod_deflate/.htaccess-dev +0 -30
  69. lib/Minify/min_extras/ab_tests/mod_deflate/before.js +0 -374
  70. lib/Minify/min_extras/ab_tests/results_summary.txt +0 -37
  71. lib/Minify/min_extras/ab_tests/test_all.bat +0 -67
  72. lib/Minify/min_extras/ab_tests/test_memcache.bat +0 -13
  73. lib/Minify/min_extras/ab_tests/type-map/.htaccess-dev +0 -40
  74. lib/Minify/min_extras/ab_tests/type-map/before.js +0 -374
  75. lib/Minify/min_extras/ab_tests/type-map/before.js.var +0 -14
  76. lib/Minify/min_extras/ab_tests/type-map/before.js.zc +0 -0
  77. lib/Minify/min_extras/ab_tests/type-map/before.js.zd +0 -0
  78. lib/Minify/min_extras/ab_tests/type-map/before.js.zg +0 -0
  79. lib/Minify/min_extras/ab_tests/v1.0/minify.php +0 -500
  80. lib/Minify/min_extras/config.php +0 -11
  81. lib/Minify/min_extras/examples/1/_groupsSources.php +0 -11
  82. lib/Minify/min_extras/examples/1/index.php +0 -50
  83. lib/Minify/min_extras/examples/1/m.php +0 -14
  84. lib/Minify/min_extras/examples/2/_groupsSources.php +0 -11
  85. lib/Minify/min_extras/examples/2/index.php +0 -94
  86. lib/Minify/min_extras/examples/2/m.php +0 -14
  87. lib/Minify/min_extras/examples/index.php +0 -3
  88. lib/Minify/min_extras/examples/lib.js +0 -6
  89. lib/Minify/min_extras/examples/test space.js +0 -5
  90. lib/Minify/min_extras/examples/test.css +0 -41
  91. lib/Minify/min_extras/tools/encodeFile.php +0 -34
  92. lib/Minify/min_extras/tools/minifyFile.php +0 -50
  93. lib/Minify/min_extras/tools/minifyTextarea.php +0 -98
  94. lib/Minify/min_extras/tools/minifyUrl.php +0 -166
  95. lib/Minify/min_extras/tools/testRewriteUri.php +0 -59
  96. lib/Minify/min_unit_tests/HTTP_ConditionalGet/2.php +0 -44
  97. lib/Minify/min_unit_tests/HTTP_ConditionalGet/3.php +0 -40
  98. lib/Minify/min_unit_tests/HTTP_ConditionalGet/4.php +0 -49
  99. lib/Minify/min_unit_tests/HTTP_ConditionalGet/5.php +0 -27
  100. lib/Minify/min_unit_tests/HTTP_ConditionalGet/_include.php +0 -64
  101. lib/Minify/min_unit_tests/HTTP_ConditionalGet/index.php +0 -36
  102. lib/Minify/min_unit_tests/HTTP_Encoder/green.png +0 -0
  103. lib/Minify/min_unit_tests/HTTP_Encoder/index.php +0 -60
  104. lib/Minify/min_unit_tests/README.txt +0 -4
  105. lib/Minify/min_unit_tests/_inc.php +0 -50
  106. lib/Minify/min_unit_tests/_test_files/css/comments.css +0 -9
  107. lib/Minify/min_unit_tests/_test_files/css/comments.min.css +0 -3
  108. lib/Minify/min_unit_tests/_test_files/css/hacks.css +0 -66
  109. lib/Minify/min_unit_tests/_test_files/css/hacks.min.css +0 -4
  110. lib/Minify/min_unit_tests/_test_files/css/issue62.css +0 -890
  111. lib/Minify/min_unit_tests/_test_files/css/issue62.min.css +0 -25
  112. lib/Minify/min_unit_tests/_test_files/css/paths_prepend.css +0 -12
  113. lib/Minify/min_unit_tests/_test_files/css/paths_prepend.min.css +0 -1
  114. lib/Minify/min_unit_tests/_test_files/css/paths_rewrite.css +0 -14
  115. lib/Minify/min_unit_tests/_test_files/css/paths_rewrite.min.css +0 -1
  116. lib/Minify/min_unit_tests/_test_files/css/readme.txt +0 -1
  117. lib/Minify/min_unit_tests/_test_files/css/selectors.css +0 -42
  118. lib/Minify/min_unit_tests/_test_files/css/selectors.min.css +0 -37
  119. lib/Minify/min_unit_tests/_test_files/css/styles.css +0 -31
  120. lib/Minify/min_unit_tests/_test_files/css/styles.min.css +0 -3
  121. lib/Minify/min_unit_tests/_test_files/css/subsilver.css +0 -434
  122. lib/Minify/min_unit_tests/_test_files/css/subsilver.min.css +0 -18
  123. lib/Minify/min_unit_tests/_test_files/css/unusual_strings.css +0 -10
  124. lib/Minify/min_unit_tests/_test_files/css/unusual_strings.min.css +0 -2
  125. lib/Minify/min_unit_tests/_test_files/css/vladmirated.css +0 -658
  126. lib/Minify/min_unit_tests/_test_files/css/vladmirated.min.css +0 -79
  127. lib/Minify/min_unit_tests/_test_files/css_uriRewriter/exp.css +0 -14
  128. lib/Minify/min_unit_tests/_test_files/css_uriRewriter/in.css +0 -14
  129. lib/Minify/min_unit_tests/_test_files/html/before.html +0 -96
  130. lib/Minify/min_unit_tests/_test_files/html/before.min.html +0 -36
  131. lib/Minify/min_unit_tests/_test_files/html/before2.html +0 -95
  132. lib/Minify/min_unit_tests/_test_files/html/before2.min.html +0 -36
  133. lib/Minify/min_unit_tests/_test_files/importProcessor/1/adjacent.css +0 -3
  134. lib/Minify/min_unit_tests/_test_files/importProcessor/1/tv.css +0 -4
  135. lib/Minify/min_unit_tests/_test_files/importProcessor/adjacent.css +0 -4
  136. lib/Minify/min_unit_tests/_test_files/importProcessor/input.css +0 -4
  137. lib/Minify/min_unit_tests/_test_files/importProcessor/output.css +0 -48
  138. lib/Minify/min_unit_tests/_test_files/js/before.js +0 -57
  139. lib/Minify/min_unit_tests/_test_files/js/before.min.js +0 -22
  140. lib/Minify/min_unit_tests/_test_files/js/before.min_plus.js +0 -22
  141. lib/Minify/min_unit_tests/_test_files/js/condcomm.js +0 -14
  142. lib/Minify/min_unit_tests/_test_files/js/condcomm.min_plus.js +0 -13
  143. lib/Minify/min_unit_tests/_test_files/js/issue74.js +0 -4
  144. lib/Minify/min_unit_tests/_test_files/js/issue74.min.js +0 -1
  145. lib/Minify/min_unit_tests/_test_files/js/issue74.min_plus.js +0 -1
  146. lib/Minify/min_unit_tests/_test_files/js/jquery-1.2.3.js +0 -3408
  147. lib/Minify/min_unit_tests/_test_files/minify/QueryString.js +0 -168
  148. lib/Minify/min_unit_tests/_test_files/minify/email.js +0 -24
  149. lib/Minify/min_unit_tests/_test_files/minify/issue73_1.js +0 -2
  150. lib/Minify/min_unit_tests/_test_files/minify/issue73_2.js +0 -3
  151. lib/Minify/min_unit_tests/_test_files/minify/issue89_1.css +0 -7
  152. lib/Minify/min_unit_tests/_test_files/minify/issue89_2.css +0 -7
  153. lib/Minify/min_unit_tests/_test_files/minify/issue89_out.min.css +0 -1
  154. lib/Minify/min_unit_tests/_test_files/minify/lines_bugs.js +0 -2
  155. lib/Minify/min_unit_tests/_test_files/minify/lines_output.js +0 -280
  156. lib/Minify/min_unit_tests/_test_files/minify/minified.css +0 -5
  157. lib/Minify/min_unit_tests/_test_files/minify/minified.js +0 -12
  158. lib/Minify/min_unit_tests/simpletest/HELP_MY_TESTS_DONT_WORK_ANYMORE +0 -348
  159. lib/Minify/min_unit_tests/simpletest/LICENSE +0 -502
  160. lib/Minify/min_unit_tests/simpletest/README +0 -108
  161. lib/Minify/min_unit_tests/simpletest/TODO.xml +0 -176
  162. lib/Minify/min_unit_tests/simpletest/VERSION +0 -1
  163. lib/Minify/min_unit_tests/simpletest/authentication.php +0 -238
  164. lib/Minify/min_unit_tests/simpletest/autorun.php +0 -87
  165. lib/Minify/min_unit_tests/simpletest/browser.php +0 -1098
  166. lib/Minify/min_unit_tests/simpletest/collector.php +0 -122
  167. lib/Minify/min_unit_tests/simpletest/compatibility.php +0 -173
  168. lib/Minify/min_unit_tests/simpletest/cookies.php +0 -380
  169. lib/Minify/min_unit_tests/simpletest/default_reporter.php +0 -133
  170. lib/Minify/min_unit_tests/simpletest/detached.php +0 -96
  171. lib/Minify/min_unit_tests/simpletest/docs/en/docs.css +0 -121
  172. lib/Minify/min_unit_tests/simpletest/docs/fr/docs.css +0 -84
  173. lib/Minify/min_unit_tests/simpletest/docs/lastcraft/README +0 -1
  174. lib/Minify/min_unit_tests/simpletest/docs/onpk/README +0 -1
  175. lib/Minify/min_unit_tests/simpletest/docs/pkg/README +0 -1
  176. lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/README +0 -1
  177. lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/favicon.ico +0 -0
  178. lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/book-domain-driven-design.jpg +0 -0
  179. lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/book-guide-to-php-design-patterns.jpg +0 -0
  180. lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/book-the-php-anthology-object-oriented-php-solutions.jpg +0 -0
  181. lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/quote.png +0 -0
  182. lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/simpletest-contribute.png +0 -0
  183. lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/simpletest-download.png +0 -0
  184. lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/simpletest-external-bottom.png +0 -0
  185. lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/simpletest-external-middle.png +0 -0
  186. lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/simpletest-external-top.png +0 -0
  187. lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/simpletest-internal-bottom.png +0 -0
  188. lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/simpletest-internal-middle.png +0 -0
  189. lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/simpletest-internal-top.png +0 -0
  190. lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/simpletest-logo.png +0 -0
  191. lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/simpletest-start-testing.png +0 -0
  192. lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/simpletest-support.png +0 -0
  193. lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/test-in-cli.png +0 -0
  194. lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/test-with-1-fail.png +0 -0
  195. lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/images/test-with-1-pass.png +0 -0
  196. lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/index.html +0 -188
  197. lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/js/jquery-1.2.1.pack.js +0 -11
  198. lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/js/jquery-speakers_coaches_consultants.js +0 -30
  199. lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/simpletest.css +0 -39
  200. lib/Minify/min_unit_tests/simpletest/docs/simpletest.org/views/photos_stream.php +0 -36
  201. lib/Minify/min_unit_tests/simpletest/docs/source/en/about.xml +0 -116
  202. lib/Minify/min_unit_tests/simpletest/docs/source/en/authentication_documentation.xml +0 -317
  203. lib/Minify/min_unit_tests/simpletest/docs/source/en/books_website.xml +0 -73
  204. lib/Minify/min_unit_tests/simpletest/docs/source/en/boundary_classes_tutorial.xml +0 -407
  205. lib/Minify/min_unit_tests/simpletest/docs/source/en/browser_documentation.xml +0 -263
  206. lib/Minify/min_unit_tests/simpletest/docs/source/en/coding_standards.xml +0 -82
  207. lib/Minify/min_unit_tests/simpletest/docs/source/en/display_subclass_tutorial.xml +0 -274
  208. lib/Minify/min_unit_tests/simpletest/docs/source/en/download_website.xml +0 -100
  209. lib/Minify/min_unit_tests/simpletest/docs/source/en/expectation_documentation.xml +0 -339
  210. lib/Minify/min_unit_tests/simpletest/docs/source/en/experimental_autorun.xml +0 -209
  211. lib/Minify/min_unit_tests/simpletest/docs/source/en/experimental_dom_tester.xml +0 -231
  212. lib/Minify/min_unit_tests/simpletest/docs/source/en/experimental_intro.xml +0 -54
  213. lib/Minify/min_unit_tests/simpletest/docs/source/en/experimental_recorder.xml +0 -170
  214. lib/Minify/min_unit_tests/simpletest/docs/source/en/extension_eclipse.xml +0 -279
  215. lib/Minify/min_unit_tests/simpletest/docs/source/en/first_test_tutorial.xml +0 -443
  216. lib/Minify/min_unit_tests/simpletest/docs/source/en/form_testing_documentation.xml +0 -299
  217. lib/Minify/min_unit_tests/simpletest/docs/source/en/gain_control_tutorial.xml +0 -308
  218. lib/Minify/min_unit_tests/simpletest/docs/source/en/group_test_documentation.xml +0 -332
  219. lib/Minify/min_unit_tests/simpletest/docs/source/en/group_test_tutorial.xml +0 -239
  220. lib/Minify/min_unit_tests/simpletest/docs/source/en/ideas.xml +0 -188
  221. lib/Minify/min_unit_tests/simpletest/docs/source/en/improving_design_tutorial.xml +0 -195
  222. lib/Minify/min_unit_tests/simpletest/docs/source/en/index.xml +0 -220
  223. lib/Minify/min_unit_tests/simpletest/docs/source/en/intro.xml +0 -28
inc/define.php CHANGED
@@ -1,42 +1,36 @@
1
  <?php
2
 
3
- $w3_blog_id = w3_get_blog_id();
 
 
 
4
 
5
- if (! defined('W3_PLUGIN_VERSION')) {
6
- define('W3_PLUGIN_VERSION', '0.7');
7
  }
8
 
9
- if (! defined('W3_PLUGIN_POWERED_BY')) {
10
- define('W3_PLUGIN_POWERED_BY', 'W3 Total Cache/' . W3_PLUGIN_VERSION);
11
- }
 
12
 
13
  if (! defined('WP_CONTENT_DIR')) {
14
- define('WP_CONTENT_DIR', dirname(__FILE__) . '/../../../');
15
- }
16
-
17
- if (! defined('W3_PLUGIN_DIR')) {
18
- define('W3_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins/w3-total-cache');
19
- }
20
-
21
- if (! defined('W3_PLUGIN_CONTENT_DIR')) {
22
- define('W3_PLUGIN_CONTENT_DIR', W3_PLUGIN_DIR . '/wp-content');
23
  }
24
 
25
- if (! defined('W3_PLUGIN_FILE')) {
26
- define('W3_PLUGIN_FILE', 'w3-total-cache/w3-total-cache.php');
27
- }
28
 
29
- if (! defined('W3_CONFIG_NAME')) {
30
- define('W3_CONFIG_NAME', 'w3-total-cache-config');
31
- }
32
 
33
- if (! defined('W3_CONFIG_PATH')) {
34
- define('W3_CONFIG_PATH', WP_CONTENT_DIR . '/' . W3_CONFIG_NAME . ($w3_blog_id != '' ? '-' . $w3_blog_id : '') . '.php');
35
- }
36
-
37
- if (! defined('W3_CONFIG_DEFAULT_PATH')) {
38
- define('W3_CONFIG_DEFAULT_PATH', W3_PLUGIN_DIR . '/w3-total-cache-config-default.php');
39
- }
40
 
41
  /**
42
  * W3 writable error
@@ -119,25 +113,6 @@ if (! function_exists('gzdecode')) {
119
  }
120
  }
121
 
122
- /**
123
- * Creates thumbnail
124
- *
125
- * @param string $file
126
- * @param integer $max_w
127
- * @param integer $max_h
128
- * @param boolean $crop
129
- * @param string $suffix
130
- * @param string $dest_path
131
- * @param integer $jpeg_quality
132
- * @return string
133
- */
134
- function w3_create_thumbnail($file, $max_w, $max_h, $crop = false, $suffix = null, $dest_path = null, $jpeg_quality = 90)
135
- {
136
- $thumbpath = image_resize($file, $max_w, $max_h, $crop, $suffix, $dest_path, $jpeg_quality);
137
-
138
- return apply_filters('wp_create_thumbnail', $thumbpath);
139
- }
140
-
141
  /**
142
  * Recursive creates directory
143
  *
@@ -280,8 +255,12 @@ function w3_get_site_url()
280
  {
281
  static $site_url = null;
282
 
283
- if (! $site_url) {
284
  $site_url = get_option('siteurl');
 
 
 
 
285
  }
286
 
287
  return $site_url;
1
  <?php
2
 
3
+ define('W3TC_VERSION', '0.7.5');
4
+ define('W3TC_POWERED_BY', 'W3 Total Cache/' . W3TC_VERSION);
5
+ define('W3TC_LINK_URL', 'http://www.w3-edge.com/wordpress-plugins/');
6
+ define('W3TC_LINK_NAME', 'WordPress Plugins');
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_CONTENT_DIR', W3TC_DIR . '/wp-content');
14
+ define('W3TC_LIB_W3_DIR', W3TC_DIR . '/lib/W3');
15
+ define('W3TC_LIB_MINIFY_DIR', W3TC_DIR . '/lib/Minify/');
16
 
17
  if (! defined('WP_CONTENT_DIR')) {
18
+ define('WP_CONTENT_DIR', realpath(W3TC_DIR . '/../..'));
 
 
 
 
 
 
 
 
19
  }
20
 
21
+ define('W3TC_CONFIG_NAME', 'w3-total-cache-config');
22
+ define('W3TC_CONFIG_PATH', WP_CONTENT_DIR . '/' . W3TC_CONFIG_NAME . (($w3_blog_id = w3_get_blog_id()) != '' ? '-' . $w3_blog_id : '') . '.php');
23
+ define('W3TC_CONFIG_DEFAULT_PATH', W3TC_DIR . '/w3-total-cache-config-default.php');
24
 
25
+ define('W3TC_MINIFY_DIR_NAME', 'wp-content/w3tc-cache');
26
+ define('W3TC_MINIFY_DIR', ABSPATH . W3TC_MINIFY_DIR_NAME);
27
+ define('W3TC_MINIFY_CONTENT_DIR', W3TC_DIR . '/' . W3TC_MINIFY_DIR_NAME);
28
 
29
+ define('W3TC_CDN_COMMAND_UPLOAD', 1);
30
+ define('W3TC_CDN_COMMAND_DELETE', 2);
31
+ define('W3TC_CDN_TABLE_QUEUE', 'w3tc_cdn_queue');
32
+ define('W3TC_CDN_THEMES_DIR', ABSPATH . 'wp-content/themes/');
33
+ define('W3TC_CDN_INCLUDES_DIR', ABSPATH . 'wp-includes/');
 
 
34
 
35
  /**
36
  * W3 writable error
113
  }
114
  }
115
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  /**
117
  * Recursive creates directory
118
  *
255
  {
256
  static $site_url = null;
257
 
258
+ if ($site_url === null) {
259
  $site_url = get_option('siteurl');
260
+
261
+ if (empty($site_url)) {
262
+ $site_url = sprintf('http://%s', $_SERVER['HTTP_HOST']);
263
+ }
264
  }
265
 
266
  return $site_url;
inc/options/cdn.phtml CHANGED
@@ -9,7 +9,7 @@
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); ?>&amp;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> |
@@ -46,7 +46,7 @@
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>
@@ -84,7 +84,7 @@
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" />
@@ -93,7 +93,7 @@
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" />
@@ -102,7 +102,7 @@
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" />
@@ -111,7 +111,7 @@
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" />
@@ -138,7 +138,7 @@
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>
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(W3TC_FILE); ?>&amp;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> |
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'), true); ?> /> Use Passive <acronym title="File Transfer Protocol">FTP</acronym> Mode</label>
50
  </th>
51
  </tr>
52
  </table>
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'), true); ?> /> Host wp-includes/ files</label>
88
  </th>
89
  <td>
90
  <input class="button cdn_export" type="button" name="includes" value="Upload includes files" />
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'), true); ?> /> Host active theme files</label>
97
  </th>
98
  <td>
99
  <input class="button cdn_export" type="button" name="theme" value="Upload theme files" />
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'), true); ?> /> 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" />
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'), true); ?> /> Host custom files</label>
115
  </th>
116
  <td>
117
  <input class="button cdn_export" type="button" name="custom" value="Upload custom files" />
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'), true); ?> /> Import external files</label>
142
  </th>
143
  </tr>
144
  <tr>
inc/options/common/header.phtml CHANGED
@@ -20,12 +20,12 @@
20
  <?php endif; ?>
21
 
22
  <p id="w3tc-options-menu">
23
- <a href="?page=<?php echo W3_PLUGIN_FILE; ?>&amp;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; ?>&amp;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; ?>&amp;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; ?>&amp;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; ?>&amp;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; ?>&amp;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; ?>&amp;tab=install"<?php if ($tab == 'install'): ?> class="w3tc-options-menu-selected"<?php endif; ?>>Installation</a> |
30
- <a href="?page=<?php echo W3_PLUGIN_FILE; ?>&amp;tab=about"<?php if ($tab == 'about'): ?> class="w3tc-options-menu-selected"<?php endif; ?>>About</a>
31
  </p>
20
  <?php endif; ?>
21
 
22
  <p id="w3tc-options-menu">
23
+ <a href="?page=<?php echo W3TC_FILE; ?>&amp;tab=general"<?php if ($tab == 'general'): ?> class="w3tc-options-menu-selected"<?php endif; ?>>General Settings</a> |
24
+ <a href="?page=<?php echo W3TC_FILE; ?>&amp;tab=pgcache"<?php if ($tab == 'pgcache'): ?> class="w3tc-options-menu-selected"<?php endif; ?>>Page Cache Settings</a> |
25
+ <a href="?page=<?php echo W3TC_FILE; ?>&amp;tab=minify"<?php if ($tab == 'minify'): ?> class="w3tc-options-menu-selected"<?php endif; ?>>Minify Settings</a> |
26
+ <a href="?page=<?php echo W3TC_FILE; ?>&amp;tab=dbcache"<?php if ($tab == 'dbcache'): ?> class="w3tc-options-menu-selected"<?php endif; ?>>Database Cache Settings</a> |
27
+ <a href="?page=<?php echo W3TC_FILE; ?>&amp;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 W3TC_FILE; ?>&amp;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 W3TC_FILE; ?>&amp;tab=install"<?php if ($tab == 'install'): ?> class="w3tc-options-menu-selected"<?php endif; ?>>Installation</a> |
30
+ <a href="?page=<?php echo W3TC_FILE; ?>&amp;tab=about"<?php if ($tab == 'about'): ?> class="w3tc-options-menu-selected"<?php endif; ?>>About</a>
31
  </p>
inc/options/dbcache.phtml CHANGED
@@ -2,7 +2,7 @@
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); ?>&amp;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>
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(W3TC_FILE); ?>&amp;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>
inc/options/faq.phtml CHANGED
@@ -429,7 +429,7 @@ No, you can drag and drop them into the desired order on the minify settings pag
429
  <p>If you're larger organization or a web hosting company, consider looking into solutions that exist like <a href="http://www.gear6.com/">Gear6</a> which could be useful now that you have a plugin that makes management memcached pain free.</p>
430
  <p align="right"><a href="#toc">back to top</a></p>
431
  <p id="q80"><strong>Is this plugin compatible with varnish or squid?</strong><br />
432
- We are still testing the performance of this plugin with <a href="http://varnish.projects.linpro.no/" target="_blank">varnish</a>. It currently appears that varnish is not necessary when this plugin fully utilized, even when using apache versus litespeed or lig<acronym title="Hypertext Transfer Protocol">HTTP</acronym>d due to the concurrency achieved by memory access for all objects required to handle requests. We have not tested <a href="http://www.squid-cache.org/" target="_blank">squid</a> with our plugin.</p>
433
  <p align="right"><a href="#toc">back to top</a></p>
434
  <p id="q81"><strong>My server is state of the art with 15,000 RPM RAID, why do I need to cache anything in memory?</strong><br />
435
  Even if your server was using an array of solid state disks (SSD), your server's <acronym title="Random Access Memory">RAM</acronym> is still going to be faster and introduce less overhead to access than even the fastest solid state drives on a PCIe bus. If you didn't invest in solid state disks for your server, then even worse off - at least an order of magnitude speed difference in read operations in <acronym title="Random Access Memory">RAM</acronym> versus HDD. For write operations delta the latency differences is even more pronounced. <acronym title="Random Access Memory">RAM</acronym> is the winner hands down. We won't even discuss the blocking and arbitration issues that happen with disk arrays under certain circumstances.</p>
429
  <p>If you're larger organization or a web hosting company, consider looking into solutions that exist like <a href="http://www.gear6.com/">Gear6</a> which could be useful now that you have a plugin that makes management memcached pain free.</p>
430
  <p align="right"><a href="#toc">back to top</a></p>
431
  <p id="q80"><strong>Is this plugin compatible with varnish or squid?</strong><br />
432
+ We are still testing the performance of this plugin with <a href="http://varnish.projects.linpro.no/" target="_blank">varnish</a>. It currently appears that varnish is not "necessary" when this plugin fully utilized due to the concurrency achieved via memory access for all objects required to handle requests. We have not tested <a href="http://www.squid-cache.org/" target="_blank">squid</a> with our plugin.</p>
433
  <p align="right"><a href="#toc">back to top</a></p>
434
  <p id="q81"><strong>My server is state of the art with 15,000 RPM RAID, why do I need to cache anything in memory?</strong><br />
435
  Even if your server was using an array of solid state disks (SSD), your server's <acronym title="Random Access Memory">RAM</acronym> is still going to be faster and introduce less overhead to access than even the fastest solid state drives on a PCIe bus. If you didn't invest in solid state disks for your server, then even worse off - at least an order of magnitude speed difference in read operations in <acronym title="Random Access Memory">RAM</acronym> versus HDD. For write operations delta the latency differences is even more pronounced. <acronym title="Random Access Memory">RAM</acronym> is the winner hands down. We won't even discuss the blocking and arbitration issues that happen with disk arrays under certain circumstances.</p>
inc/options/general.phtml CHANGED
@@ -13,11 +13,11 @@ $canEmptyDisk = ($config->get_string('minify.engine') == 'file');
13
 
14
  <p>The plugin is currently <span class="w3tc-<?php if ($enabled): ?>enabled">enabled<?php else: ?>disabled">disabled<?php endif; ?></span>. Changing any of the following settings will clear all caches. If an option is disabled it means that either your current installation is not compatible or installation is required.</p>
15
 
16
- <p><label><input id="enabled" type="checkbox" name="enabled" value="1"<?php checked($enabled); ?> /> Deselect this option to disable all caching functionality.</label></p>
17
 
18
  <form action="options-general.php">
19
  <p>You can
20
- <input type="hidden" name="page" value="<?php echo W3_PLUGIN_FILE; ?>" />
21
  <input class="button" type="submit" name="flush_all" value="empty all caches" /> at once or
22
  <input class="button" type="submit" name="flush_memcached" value="empty only the memcached cache"<?php if (! $canEmptyMemcache): ?> disabled="disabled"<?php endif; ?> /> or
23
  <input class="button" type="submit" name="flush_apc" value="empty only the APC cache"<?php if (! $canEmptyApc): ?> disabled="disabled"<?php endif; ?> /> or
@@ -27,13 +27,13 @@ $canEmptyDisk = ($config->get_string('minify.engine') == 'file');
27
 
28
  <p>Enable page caching to decrease the response time of your blog.</p>
29
 
30
- <form action="options-general.php?page=<?php echo urldecode(W3_PLUGIN_FILE); ?>&amp;tab=<?php echo $tab; ?>" method="post">
31
  <table class="form-table">
32
  <tr>
33
  <th valign="top">Page Caching:</th>
34
  <td>
35
  <input type="hidden" name="pgcache.enabled" value="0" />
36
- <label><input class="enabled" type="checkbox" name="pgcache.enabled" value="1"<?php checked($config->get_boolean('pgcache.enabled')); ?> />&nbsp;<strong>Enable</strong></label><br />
37
  <span class="description">Caching pages will reduce the response time of and increase the concurrency potential of your web server.</span>
38
  </td>
39
  </tr>
@@ -53,7 +53,7 @@ $canEmptyDisk = ($config->get_string('minify.engine') == 'file');
53
  <th valign="top">Minify:</th>
54
  <td>
55
  <input type="hidden" name="minify.enabled" value="0" />
56
- <label><input class="enabled" type="checkbox" name="minify.enabled" value="1"<?php checked($config->get_boolean('minify.enabled')); ?> />&nbsp;<strong>Enable</strong></label><br />
57
  <span class="description">Minification can decrease file size of <acronym title="Hypertext Markup Language">HTML</acronym>, <acronym title="Cascading Style Sheets">CSS</acronym> and <acronym title="JavaScript">JS</acronym> respectively by ~10% on average.</span>
58
  </td>
59
  </tr>
@@ -74,14 +74,14 @@ $canEmptyDisk = ($config->get_string('minify.engine') == 'file');
74
  <th valign="top">Database Caching:</th>
75
  <td>
76
  <input type="hidden" name="dbcache.enabled" value="0" />
77
- <label><input class="enabled" type="checkbox" name="dbcache.enabled" value="1"<?php checked($config->get_boolean('dbcache.enabled')); ?> />&nbsp;<strong>Enable</strong></label><br />
78
  <span class="description">Caching database objects will increase the response time of your blog by at least an order of magnitude in most cases.</span>
79
  </td>
80
  </tr>
81
  <tr>
82
  <th valign="top">Database Caching Method:</th>
83
  <td>
84
- <label><input type="radio" name="dbcache.engine" value="memcached"<?php checked($config->get_string('dbcache.engine', 'memcached')); ?> /> Memcached</label><br />
85
  <label><input type="radio" name="dbcache.engine" value="apc"<?php checked($config->get_string('dbcache.engine'), 'apc'); ?><?php if (! $check_apc): ?> disabled="disabled"<?php endif; ?> /> <acronym title="Alternative PHP Cache">APC</acronym></label><br />
86
  </td>
87
  </tr>
@@ -94,7 +94,7 @@ $canEmptyDisk = ($config->get_string('minify.engine') == 'file');
94
  <th><acronym title="Content Delivery Network">CDN</acronym>:</th>
95
  <td>
96
  <input type="hidden" name="cdn.enabled" value="0" />
97
- <label><input class="enabled" type="checkbox" name="cdn.enabled" value="1"<?php checked($config->get_boolean('cdn.enabled')); ?> />&nbsp;<strong>Enable</strong></label><br />
98
  </td>
99
  </tr>
100
  <tr>
@@ -115,7 +115,7 @@ $canEmptyDisk = ($config->get_string('minify.engine') == 'file');
115
  <th valign="top">Debug Mode:</th>
116
  <td>
117
  <input type="hidden" name="debug" value="0" />
118
- <label><input type="checkbox" name="debug" value="1"<?php checked($debug); ?> />&nbsp;<strong>Enable</strong></label>
119
  </td>
120
  </tr>
121
  </table>
@@ -123,7 +123,7 @@ $canEmptyDisk = ($config->get_string('minify.engine') == 'file');
123
  <h3>Support Us</h3>
124
 
125
  <p>If this plugin has saved you money, made your server more stable and/or improved user experience for the readers of your blog, support us with a link!</p>
126
- <p><input type="hidden" name="common.support" value="0" /><label><input type="checkbox" name="common.support"<?php checked($config->get_boolean('common.support')); ?> /> Yes, I'd love to support you guys, please add the link to my site's</label> <select name="common.support.type"><option value="blogroll"<?php if ($supportType == 'blogroll'): ?> selected="selected"<?php endif; ?>>blogroll</option><option value="footer"<?php if ($supportType == 'footer'): ?> selected="selected"<?php endif; ?>>footer</option></select>.</p>
127
  <p>If you want to place the link manually here is the code:</p>
128
  <p><textarea cols="100" rows="3">Performance Optimization &lt;a href=&quot;http://www.w3-edge.com/wordpress-plugins/&quot; rel=&quot;external&quot;&gt;WordPress Plugins&lt;/a&gt; by W3 EDGE</textarea></p>
129
 
13
 
14
  <p>The plugin is currently <span class="w3tc-<?php if ($enabled): ?>enabled">enabled<?php else: ?>disabled">disabled<?php endif; ?></span>. Changing any of the following settings will clear all caches. If an option is disabled it means that either your current installation is not compatible or installation is required.</p>
15
 
16
+ <p><label><input id="enabled" type="checkbox" name="enabled" value="1"<?php checked($enabled, true); ?> /> Deselect this option to disable all caching functionality.</label></p>
17
 
18
  <form action="options-general.php">
19
  <p>You can
20
+ <input type="hidden" name="page" value="<?php echo W3TC_FILE; ?>" />
21
  <input class="button" type="submit" name="flush_all" value="empty all caches" /> at once or
22
  <input class="button" type="submit" name="flush_memcached" value="empty only the memcached cache"<?php if (! $canEmptyMemcache): ?> disabled="disabled"<?php endif; ?> /> or
23
  <input class="button" type="submit" name="flush_apc" value="empty only the APC cache"<?php if (! $canEmptyApc): ?> disabled="disabled"<?php endif; ?> /> or
27
 
28
  <p>Enable page caching to decrease the response time of your blog.</p>
29
 
30
+ <form action="options-general.php?page=<?php echo urldecode(W3TC_FILE); ?>&amp;tab=<?php echo $tab; ?>" method="post">
31
  <table class="form-table">
32
  <tr>
33
  <th valign="top">Page Caching:</th>
34
  <td>
35
  <input type="hidden" name="pgcache.enabled" value="0" />
36
+ <label><input class="enabled" type="checkbox" name="pgcache.enabled" value="1"<?php checked($config->get_boolean('pgcache.enabled'), true); ?> />&nbsp;<strong>Enable</strong></label><br />
37
  <span class="description">Caching pages will reduce the response time of and increase the concurrency potential of your web server.</span>
38
  </td>
39
  </tr>
53
  <th valign="top">Minify:</th>
54
  <td>
55
  <input type="hidden" name="minify.enabled" value="0" />
56
+ <label><input class="enabled" type="checkbox" name="minify.enabled" value="1"<?php checked($config->get_boolean('minify.enabled'), true); ?> />&nbsp;<strong>Enable</strong></label><br />
57
  <span class="description">Minification can decrease file size of <acronym title="Hypertext Markup Language">HTML</acronym>, <acronym title="Cascading Style Sheets">CSS</acronym> and <acronym title="JavaScript">JS</acronym> respectively by ~10% on average.</span>
58
  </td>
59
  </tr>
74
  <th valign="top">Database Caching:</th>
75
  <td>
76
  <input type="hidden" name="dbcache.enabled" value="0" />
77
+ <label><input class="enabled" type="checkbox" name="dbcache.enabled" value="1"<?php checked($config->get_boolean('dbcache.enabled'), true); ?> />&nbsp;<strong>Enable</strong></label><br />
78
  <span class="description">Caching database objects will increase the response time of your blog by at least an order of magnitude in most cases.</span>
79
  </td>
80
  </tr>
81
  <tr>
82
  <th valign="top">Database Caching Method:</th>
83
  <td>
84
+ <label><input type="radio" name="dbcache.engine" value="memcached"<?php checked($config->get_string('dbcache.engine'), 'memcached'); ?> /> Memcached</label><br />
85
  <label><input type="radio" name="dbcache.engine" value="apc"<?php checked($config->get_string('dbcache.engine'), 'apc'); ?><?php if (! $check_apc): ?> disabled="disabled"<?php endif; ?> /> <acronym title="Alternative PHP Cache">APC</acronym></label><br />
86
  </td>
87
  </tr>
94
  <th><acronym title="Content Delivery Network">CDN</acronym>:</th>
95
  <td>
96
  <input type="hidden" name="cdn.enabled" value="0" />
97
+ <label><input class="enabled" type="checkbox" name="cdn.enabled" value="1"<?php checked($config->get_boolean('cdn.enabled'), true); ?> />&nbsp;<strong>Enable</strong></label><br />
98
  </td>
99
  </tr>
100
  <tr>
115
  <th valign="top">Debug Mode:</th>
116
  <td>
117
  <input type="hidden" name="debug" value="0" />
118
+ <label><input type="checkbox" name="debug" value="1"<?php checked($debug, true); ?> />&nbsp;<strong>Enable</strong></label>
119
  </td>
120
  </tr>
121
  </table>
123
  <h3>Support Us</h3>
124
 
125
  <p>If this plugin has saved you money, made your server more stable and/or improved user experience for the readers of your blog, support us with a link!</p>
126
+ <p><input type="hidden" name="common.support" value="0" /><label><input type="checkbox" name="common.support"<?php checked($config->get_boolean('common.support'), true); ?> /> Yes, I'd love to support you guys, please add the link to my site's</label> <select name="common.support.type"><option value="blogroll"<?php selected($supportType, 'blogroll'); ?>>blogroll</option><option value="footer"<?php selected($supportType, 'footer'); ?>>footer</option></select>.</p>
127
  <p>If you want to place the link manually here is the code:</p>
128
  <p><textarea cols="100" rows="3">Performance Optimization &lt;a href=&quot;http://www.w3-edge.com/wordpress-plugins/&quot; rel=&quot;external&quot;&gt;WordPress Plugins&lt;/a&gt; by W3 EDGE</textarea></p>
129
 
inc/options/minify.phtml CHANGED
@@ -29,7 +29,7 @@ foreach ($js_check_groups as $js_check_group) {
29
 
30
  <p>Minify is currently <span class="w3tc-<?php if ($config->get_boolean('minify.enabled')): ?>enabled">enabled<?php else: ?>disabled">disabled<?php endif; ?></span>.</p>
31
 
32
- <form id="minify_form" action="options-general.php?page=<?php echo urldecode(W3_PLUGIN_FILE); ?>&amp;tab=<?php echo $tab; ?>" method="post">
33
  <table class="form-table">
34
  <tr>
35
  <th style="width: 250px;"><label for="minify_memcached_servers">Memcached Hostname:Port / IP:Port:</label></th>
@@ -41,21 +41,21 @@ foreach ($js_check_groups as $js_check_group) {
41
  <tr>
42
  <th colspan="2">
43
  <input type="hidden" name="minify.compress" value="0" />
44
- <label><input type="checkbox" name="minify.compress" value="1"<?php checked($config->get_boolean('minify.compress')); ?> /> <acronym title="Hypertext Transfer Protocol">HTTP</acronym> compression (<acronym title="GNU zip">gzip</acronym> / deflate)</label><br />
45
  <span class="description">Reduce file size by utomatically detecting the user agent's supported compression method of any.</span>
46
  </th>
47
  </tr>
48
  <tr>
49
  <th colspan="2">
50
  <input type="hidden" name="minify.compress.ie6" value="0" />
51
- <label><input type="checkbox" name="minify.compress.ie6" value="1"<?php checked($config->get_boolean('minify.compress.ie6')); ?> /> <acronym title="Hypertext Transfer Protocol">HTTP</acronym> compression for <acronym title="Microsoft Internet Explorer">MSIE</acronym>6</label><br />
52
  <span class="description">Workaround for <acronym title="Microsoft Internet Explorer">MSIE</acronym>6 <acronym title="Service Pack">SP</acronym>2 compression bug.</span>
53
  </th>
54
  </tr>
55
  <tr>
56
  <th colspan="2">
57
  <input type="hidden" name="minify.rewrite" value="0" />
58
- <label><input type="checkbox" name="minify.rewrite" value="1"<?php checked($config->get_boolean('minify.rewrite')); ?> /> Rewrite <acronym title="Uniform Resource Locator">URL</acronym> Structure</label><br />
59
  <span class="description">If disabled, <acronym title="Cascading Style Sheets">CSS</acronym> and <acronym title="JavaScript">JS</acronym> embeddings will use of GET variables, enabling this option is recommended unless you really want to avoid the redirects.</span>
60
  </th>
61
  </tr>
@@ -69,12 +69,10 @@ foreach ($js_check_groups as $js_check_group) {
69
  <td>
70
  <input type="hidden" name="minify.html.enable" value="0" />
71
  <input type="hidden" name="minify.html.reject.admin" value="0" />
72
- <input type="hidden" name="minify.html.strip.comments" value="0" />
73
  <input type="hidden" name="minify.html.strip.crlf" value="0" />
74
- <label><input id="html_enabled" type="checkbox" name="minify.html.enable" value="1"<?php checked($config->get_boolean('minify.html.enable')); ?> /> Minify</label><br />
75
- <label><input class="html_enabled" type="checkbox" name="minify.html.reject.admin" value="1"<?php checked($config->get_boolean('minify.html.reject.admin')); ?> /> Don't Minify <acronym title="Hypertext Markup Language">HTML</acronym> for logged in administrators</label><br />
76
- <label><input class="html_enabled" type="checkbox" name="minify.html.strip.comments" value="1"<?php checked($config->get_boolean('minify.html.strip.comments')); ?> /> Comment removal</label><br />
77
- <label><input class="html_enabled" type="checkbox" name="minify.html.strip.crlf" value="1"<?php checked($config->get_boolean('minify.html.strip.crlf')); ?> /> Line break removal</label><br />
78
  </td>
79
  </tr>
80
  <tr>
@@ -84,10 +82,10 @@ foreach ($js_check_groups as $js_check_group) {
84
  <input type="hidden" name="minify.js.clean" value="0" />
85
  <input type="hidden" name="minify.js.strip.comments" value="0" />
86
  <input type="hidden" name="minify.js.strip.crlf" value="0" />
87
- <label><input id="js_enabled" type="checkbox" name="minify.js.enable" value="1"<?php checked($config->get_boolean('minify.js.enable')); ?> /> Minify</label><br />
88
- <label><input class="js_enabled" type="checkbox" name="minify.js.clean" value="1"<?php checked($config->get_boolean('minify.js.clean')); ?> /> Clean <acronym title="JavaScript">JS</acronym></label><br />
89
- <label><input class="js_enabled" type="checkbox" name="minify.js.strip.comments" value="1"<?php checked($config->get_boolean('minify.js.strip.comments')); ?> /> Comment removal</label><br />
90
- <label><input class="js_enabled" type="checkbox" name="minify.js.strip.crlf" value="1"<?php checked($config->get_boolean('minify.js.strip.crlf')); ?> /> Line break removal</label><br />
91
  </td>
92
  </tr>
93
  <tr>
@@ -97,10 +95,10 @@ foreach ($js_check_groups as $js_check_group) {
97
  <input type="hidden" name="minify.css.clean" value="0" />
98
  <input type="hidden" name="minify.css.strip.comments" value="0" />
99
  <input type="hidden" name="minify.css.strip.crlf" value="0" />
100
- <label><input id="css_enabled" type="checkbox" name="minify.css.enable" value="1"<?php checked($config->get_boolean('minify.css.enable')); ?> /> Minify</label><br />
101
- <label><input class="css_enabled" type="checkbox" name="minify.css.clean" value="1"<?php checked($config->get_boolean('minify.css.clean')); ?> /> Clean <acronym title="Cascading Style Sheets">CSS</acronym></label><br />
102
- <label><input class="css_enabled" type="checkbox" name="minify.css.strip.comments" value="1"<?php checked($config->get_boolean('minify.css.strip.comments')); ?> /> Comment removal</label><br />
103
- <label><input class="css_enabled" type="checkbox" name="minify.css.strip.crlf" value="1"<?php checked($config->get_boolean('minify.css.strip.crlf')); ?> /> Line break removal</label><br />
104
  </td>
105
  </tr>
106
  <tr>
@@ -109,7 +107,7 @@ foreach ($js_check_groups as $js_check_group) {
109
  <?php if (count($js_files)): ?>
110
  <ol id="js_files">
111
  <?php foreach($js_files as $js_file => $group): ?>
112
- <li><input class="js_enabled" type="text" name="js_files_<?php echo htmlspecialchars($group); ?>[]" value="<?php echo htmlspecialchars($js_file); ?>" size="100" />&nbsp;<select class="js_file_location js_enabled"><option value="include"<?php if ($group == 'include'): ?> selected="selected"<?php endif; ?>>Header</option><option value="include-nb"<?php if ($group == 'include-nb'): ?> selected="selected"<?php endif; ?>>Header (non-blocking)</option><option value="include-footer"<?php if ($group == 'include-footer'): ?> selected="selected"<?php endif; ?>>Footer</option><option value="include-footer-nb"<?php if ($group == 'include-footer-nb'): ?> selected="selected"<?php endif; ?>>Footer (non-blocking)</option></select>&nbsp;<input class="js_file_delete js_enabled button" type="button" value="Delete" />&nbsp;<input class="js_file_verify js_enabled button" type="button" value="Verify URI" /></li>
113
  <?php endforeach; ?>
114
  </ol>
115
  <?php else: ?>
29
 
30
  <p>Minify is currently <span class="w3tc-<?php if ($config->get_boolean('minify.enabled')): ?>enabled">enabled<?php else: ?>disabled">disabled<?php endif; ?></span>.</p>
31
 
32
+ <form id="minify_form" action="options-general.php?page=<?php echo urldecode(W3TC_FILE); ?>&amp;tab=<?php echo $tab; ?>" method="post">
33
  <table class="form-table">
34
  <tr>
35
  <th style="width: 250px;"><label for="minify_memcached_servers">Memcached Hostname:Port / IP:Port:</label></th>
41
  <tr>
42
  <th colspan="2">
43
  <input type="hidden" name="minify.compress" value="0" />
44
+ <label><input type="checkbox" name="minify.compress" value="1"<?php checked($config->get_boolean('minify.compress'), true); ?> /> <acronym title="Hypertext Transfer Protocol">HTTP</acronym> compression (<acronym title="GNU zip">gzip</acronym> / deflate)</label><br />
45
  <span class="description">Reduce file size by utomatically detecting the user agent's supported compression method of any.</span>
46
  </th>
47
  </tr>
48
  <tr>
49
  <th colspan="2">
50
  <input type="hidden" name="minify.compress.ie6" value="0" />
51
+ <label><input type="checkbox" name="minify.compress.ie6" value="1"<?php checked($config->get_boolean('minify.compress.ie6'), true); ?> /> <acronym title="Hypertext Transfer Protocol">HTTP</acronym> compression for <acronym title="Microsoft Internet Explorer">MSIE</acronym>6</label><br />
52
  <span class="description">Workaround for <acronym title="Microsoft Internet Explorer">MSIE</acronym>6 <acronym title="Service Pack">SP</acronym>2 compression bug.</span>
53
  </th>
54
  </tr>
55
  <tr>
56
  <th colspan="2">
57
  <input type="hidden" name="minify.rewrite" value="0" />
58
+ <label><input type="checkbox" name="minify.rewrite" value="1"<?php checked($config->get_boolean('minify.rewrite'), true); ?> /> Rewrite <acronym title="Uniform Resource Locator">URL</acronym> Structure</label><br />
59
  <span class="description">If disabled, <acronym title="Cascading Style Sheets">CSS</acronym> and <acronym title="JavaScript">JS</acronym> embeddings will use of GET variables, enabling this option is recommended unless you really want to avoid the redirects.</span>
60
  </th>
61
  </tr>
69
  <td>
70
  <input type="hidden" name="minify.html.enable" value="0" />
71
  <input type="hidden" name="minify.html.reject.admin" value="0" />
 
72
  <input type="hidden" name="minify.html.strip.crlf" value="0" />
73
+ <label><input id="html_enabled" type="checkbox" name="minify.html.enable" value="1"<?php checked($config->get_boolean('minify.html.enable'), true); ?> /> Minify</label><br />
74
+ <label><input class="html_enabled" type="checkbox" name="minify.html.reject.admin" value="1"<?php checked($config->get_boolean('minify.html.reject.admin'), true); ?> /> Don't Minify <acronym title="Hypertext Markup Language">HTML</acronym> for logged in administrators</label><br />
75
+ <label><input class="html_enabled" type="checkbox" name="minify.html.strip.crlf" value="1"<?php checked($config->get_boolean('minify.html.strip.crlf'), true); ?> /> Line break removal</label><br />
 
76
  </td>
77
  </tr>
78
  <tr>
82
  <input type="hidden" name="minify.js.clean" value="0" />
83
  <input type="hidden" name="minify.js.strip.comments" value="0" />
84
  <input type="hidden" name="minify.js.strip.crlf" value="0" />
85
+ <label><input id="js_enabled" type="checkbox" name="minify.js.enable" value="1"<?php checked($config->get_boolean('minify.js.enable'), true); ?> /> Minify</label><br />
86
+ <label><input class="js_enabled" type="checkbox" name="minify.js.clean" value="1"<?php checked($config->get_boolean('minify.js.clean'), true); ?> /> Clean <acronym title="JavaScript">JS</acronym></label><br />
87
+ <label><input class="js_enabled" type="checkbox" name="minify.js.strip.comments" value="1"<?php checked($config->get_boolean('minify.js.strip.comments'), true); ?> /> Comment removal</label><br />
88
+ <label><input class="js_enabled" type="checkbox" name="minify.js.strip.crlf" value="1"<?php checked($config->get_boolean('minify.js.strip.crlf'), true); ?> /> Line break removal</label><br />
89
  </td>
90
  </tr>
91
  <tr>
95
  <input type="hidden" name="minify.css.clean" value="0" />
96
  <input type="hidden" name="minify.css.strip.comments" value="0" />
97
  <input type="hidden" name="minify.css.strip.crlf" value="0" />
98
+ <label><input id="css_enabled" type="checkbox" name="minify.css.enable" value="1"<?php checked($config->get_boolean('minify.css.enable'), true); ?> /> Minify</label><br />
99
+ <label><input class="css_enabled" type="checkbox" name="minify.css.clean" value="1"<?php checked($config->get_boolean('minify.css.clean'), true); ?> /> Clean <acronym title="Cascading Style Sheets">CSS</acronym></label><br />
100
+ <label><input class="css_enabled" type="checkbox" name="minify.css.strip.comments" value="1"<?php checked($config->get_boolean('minify.css.strip.comments'), true); ?> /> Comment removal</label><br />
101
+ <label><input class="css_enabled" type="checkbox" name="minify.css.strip.crlf" value="1"<?php checked($config->get_boolean('minify.css.strip.crlf'), true); ?> /> Line break removal</label><br />
102
  </td>
103
  </tr>
104
  <tr>
107
  <?php if (count($js_files)): ?>
108
  <ol id="js_files">
109
  <?php foreach($js_files as $js_file => $group): ?>
110
+ <li><input class="js_enabled" type="text" name="js_files_<?php echo htmlspecialchars($group); ?>[]" value="<?php echo htmlspecialchars($js_file); ?>" size="100" />&nbsp;<select class="js_file_location js_enabled"><option value="include"<?php selected($group, 'include'); ?>>Header</option><option value="include-nb"<?php selected($group, 'include-nb'); ?>>Header (non-blocking)</option><option value="include-footer"<?php selected($group, 'include-footer'); ?>>Footer</option><option value="include-footer-nb"<?php selected($group, 'include-footer-nb'); ?>>Footer (non-blocking)</option></select>&nbsp;<input class="js_file_delete js_enabled button" type="button" value="Delete" />&nbsp;<input class="js_file_verify js_enabled button" type="button" value="Verify URI" /></li>
111
  <?php endforeach; ?>
112
  </ol>
113
  <?php else: ?>
inc/options/pgcache.phtml CHANGED
@@ -2,7 +2,7 @@
2
 
3
  <p>Page Caching is currently <span class="w3tc-<?php if ($config->get_boolean('pgcache.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); ?>&amp;tab=<?php echo $tab; ?>" method="post">
6
  <table class="form-table">
7
  <tr>
8
  <th style="width: 250px;"><label for="pgcache_memcached_servers">Memcached Hostname:Port / IP:Port:</label></th>
@@ -18,31 +18,31 @@
18
  <tr>
19
  <th colspan="2">
20
  <input type="hidden" name="pgcache.cache.logged" value="0" />
21
- <label><input type="checkbox" name="pgcache.cache.logged" value="1"<?php checked($config->get_boolean('pgcache.cache.logged')); ?> /> Cache pages for logged in users</label>
22
  </th>
23
  </tr>
24
  <tr>
25
  <th colspan="2">
26
  <input type="hidden" name="pgcache.compress" value="0" />
27
- <label><input type="checkbox" name="pgcache.compress" value="1"<?php checked($config->get_boolean('pgcache.compress')); ?> /> <acronym title="Hypertext Transfer Protocol">HTTP</acronym> compression (<acronym title="GNU zip">gzip</acronym> / deflate)</label>
28
  </th>
29
  </tr>
30
  <tr>
31
  <th colspan="2">
32
  <input type="hidden" name="pgcache.cache.home" value="0" />
33
- <label><input type="checkbox" name="pgcache.cache.home" value="1"<?php checked($config->get_boolean('pgcache.cache.home')); ?> /> Cache the home page</label>
34
  </th>
35
  </tr>
36
  <tr>
37
  <th colspan="2">
38
  <input type="hidden" name="pgcache.cache.feed" value="0" />
39
- <label><input type="checkbox" name="pgcache.cache.feed" value="1"<?php checked($config->get_boolean('pgcache.cache.feed')); ?> /> Cache <acronym title="Really Simple Syndication">RSS</acronym> feeds (site, post, post comments)</label>
40
  </th>
41
  </tr>
42
  <tr>
43
  <th colspan="2">
44
  <input type="hidden" name="pgcache.cache.query" value="0" />
45
- <label><input type="checkbox" name="pgcache.cache.query" value="1"<?php checked($config->get_boolean('pgcache.cache.query')); ?> /> Cache <acronym title="Uniform Resource Identifier">URI</acronym>s with query string variables</label>
46
  </th>
47
  </tr>
48
  <tr>
2
 
3
  <p>Page Caching is currently <span class="w3tc-<?php if ($config->get_boolean('pgcache.enabled')): ?>enabled">enabled<?php else: ?>disabled">disabled<?php endif; ?></span>.</p>
4
 
5
+ <form action="options-general.php?page=<?php echo urldecode(W3TC_FILE); ?>&amp;tab=<?php echo $tab; ?>" method="post">
6
  <table class="form-table">
7
  <tr>
8
  <th style="width: 250px;"><label for="pgcache_memcached_servers">Memcached Hostname:Port / IP:Port:</label></th>
18
  <tr>
19
  <th colspan="2">
20
  <input type="hidden" name="pgcache.cache.logged" value="0" />
21
+ <label><input type="checkbox" name="pgcache.cache.logged" value="1"<?php checked($config->get_boolean('pgcache.cache.logged'), true); ?> /> Cache pages for logged in users</label>
22
  </th>
23
  </tr>
24
  <tr>
25
  <th colspan="2">
26
  <input type="hidden" name="pgcache.compress" value="0" />
27
+ <label><input type="checkbox" name="pgcache.compress" value="1"<?php checked($config->get_boolean('pgcache.compress'), true); ?> /> <acronym title="Hypertext Transfer Protocol">HTTP</acronym> compression (<acronym title="GNU zip">gzip</acronym> / deflate)</label>
28
  </th>
29
  </tr>
30
  <tr>
31
  <th colspan="2">
32
  <input type="hidden" name="pgcache.cache.home" value="0" />
33
+ <label><input type="checkbox" name="pgcache.cache.home" value="1"<?php checked($config->get_boolean('pgcache.cache.home'), true); ?> /> Cache the home page</label>
34
  </th>
35
  </tr>
36
  <tr>
37
  <th colspan="2">
38
  <input type="hidden" name="pgcache.cache.feed" value="0" />
39
+ <label><input type="checkbox" name="pgcache.cache.feed" value="1"<?php checked($config->get_boolean('pgcache.cache.feed'), true); ?> /> Cache <acronym title="Really Simple Syndication">RSS</acronym> feeds (site, post, post comments)</label>
40
  </th>
41
  </tr>
42
  <tr>
43
  <th colspan="2">
44
  <input type="hidden" name="pgcache.cache.query" value="0" />
45
+ <label><input type="checkbox" name="pgcache.cache.query" value="1"<?php checked($config->get_boolean('pgcache.cache.query'), true); ?> /> Cache <acronym title="Uniform Resource Identifier">URI</acronym>s with query string variables</label>
46
  </th>
47
  </tr>
48
  <tr>
inc/popup/cdn_queue.phtml CHANGED
@@ -4,7 +4,7 @@
4
  </p>
5
 
6
  <div id="cdn_queue_upload" class="tab-content"<?php if ($cdn_queue_tab != 'upload'): ?> style="display: none;"<?php endif; ?>>
7
- <?php if (! empty($queue[W3_PLUGIN_CDN_COMMAND_UPLOAD])): ?>
8
  <table class="table queue">
9
  <tr>
10
  <th>Local Path</th>
@@ -13,20 +13,20 @@
13
  <th>Date</th>
14
  <th>Delete</th>
15
  </tr>
16
- <?php foreach ((array) $queue[W3_PLUGIN_CDN_COMMAND_UPLOAD] as $result): ?>
17
  <tr>
18
  <td><?php echo htmlspecialchars($result->local_path); ?></td>
19
  <td><?php echo htmlspecialchars($result->remote_path); ?></td>
20
  <td><?php echo htmlspecialchars($result->last_error); ?></td>
21
  <td align="center"><?php echo htmlspecialchars($result->date); ?></td>
22
  <td align="center">
23
- <a href="options-general.php?page=<?php echo W3_PLUGIN_FILE; ?>&amp;w3tc_action=cdn_queue&amp;cdn_queue_tab=upload&amp;cdn_queue_action=delete&amp;cdn_queue_id=<?php echo $result->id; ?>" class="cdn_queue_delete">Delete</a>
24
  </td>
25
  </tr>
26
  <?php endforeach; ?>
27
  </table>
28
  <p>
29
- <a href="options-general.php?page=<?php echo W3_PLUGIN_FILE; ?>&amp;w3tc_action=cdn_queue&amp;cdn_queue_tab=upload&amp;cdn_queue_action=empty&amp;cdn_queue_type=<?php echo W3_PLUGIN_CDN_COMMAND_UPLOAD; ?>" class="cdn_queue_empty">Empty upload queue</a>
30
  </p>
31
  <?php else: ?>
32
  <p class="empty">Upload queue is empty</p>
@@ -34,7 +34,7 @@
34
  </div>
35
 
36
  <div id="cdn_queue_delete" class="tab-content"<?php if ($cdn_queue_tab != 'delete'): ?> style="display: none;"<?php endif; ?>>
37
- <?php if (! empty($queue[W3_PLUGIN_CDN_COMMAND_DELETE])): ?>
38
  <table class="table queue">
39
  <tr>
40
  <th>Local Path</th>
@@ -43,20 +43,20 @@
43
  <th width="25%">Date</th>
44
  <th width="10%">Delete</th>
45
  </tr>
46
- <?php foreach ((array) $queue[W3_PLUGIN_CDN_COMMAND_DELETE] as $result): ?>
47
  <tr>
48
  <td><?php echo htmlspecialchars($result->local_path); ?></td>
49
  <td><?php echo htmlspecialchars($result->remote_path); ?></td>
50
  <td><?php echo htmlspecialchars($result->last_error); ?></td>
51
  <td align="center"><?php echo htmlspecialchars($result->date); ?></td>
52
  <td align="center">
53
- <a href="options-general.php?page=<?php echo W3_PLUGIN_FILE; ?>&amp;w3tc_action=cdn_queue&amp;cdn_queue_tab=delete&amp;cdn_queue_action=delete&amp;cdn_queue_id=<?php echo $result->id; ?>" class="cdn_queue_delete">Delete</a>
54
  </td>
55
  </tr>
56
  <?php endforeach; ?>
57
  </table>
58
  <p>
59
- <a href="options-general.php?page=<?php echo W3_PLUGIN_FILE; ?>&amp;w3tc_action=cdn_queue&amp;cdn_queue_tab=delete&amp;cdn_queue_action=empty&amp;cdn_queue_type=<?php echo W3_PLUGIN_CDN_COMMAND_DELETE; ?>" class="cdn_queue_empty">Empty upload queue</a>
60
  </p>
61
  <?php else: ?>
62
  <p class="empty">Delete queue is empty</p>
4
  </p>
5
 
6
  <div id="cdn_queue_upload" class="tab-content"<?php if ($cdn_queue_tab != 'upload'): ?> style="display: none;"<?php endif; ?>>
7
+ <?php if (! empty($queue[W3TC_CDN_COMMAND_UPLOAD])): ?>
8
  <table class="table queue">
9
  <tr>
10
  <th>Local Path</th>
13
  <th>Date</th>
14
  <th>Delete</th>
15
  </tr>
16
+ <?php foreach ((array) $queue[W3TC_CDN_COMMAND_UPLOAD] as $result): ?>
17
  <tr>
18
  <td><?php echo htmlspecialchars($result->local_path); ?></td>
19
  <td><?php echo htmlspecialchars($result->remote_path); ?></td>
20
  <td><?php echo htmlspecialchars($result->last_error); ?></td>
21
  <td align="center"><?php echo htmlspecialchars($result->date); ?></td>
22
  <td align="center">
23
+ <a href="options-general.php?page=<?php echo W3TC_FILE; ?>&amp;w3tc_action=cdn_queue&amp;cdn_queue_tab=upload&amp;cdn_queue_action=delete&amp;cdn_queue_id=<?php echo $result->id; ?>" class="cdn_queue_delete">Delete</a>
24
  </td>
25
  </tr>
26
  <?php endforeach; ?>
27
  </table>
28
  <p>
29
+ <a href="options-general.php?page=<?php echo W3TC_FILE; ?>&amp;w3tc_action=cdn_queue&amp;cdn_queue_tab=upload&amp;cdn_queue_action=empty&amp;cdn_queue_type=<?php echo W3TC_CDN_COMMAND_UPLOAD; ?>" class="cdn_queue_empty">Empty upload queue</a>
30
  </p>
31
  <?php else: ?>
32
  <p class="empty">Upload queue is empty</p>
34
  </div>
35
 
36
  <div id="cdn_queue_delete" class="tab-content"<?php if ($cdn_queue_tab != 'delete'): ?> style="display: none;"<?php endif; ?>>
37
+ <?php if (! empty($queue[W3TC_CDN_COMMAND_DELETE])): ?>
38
  <table class="table queue">
39
  <tr>
40
  <th>Local Path</th>
43
  <th width="25%">Date</th>
44
  <th width="10%">Delete</th>
45
  </tr>
46
+ <?php foreach ((array) $queue[W3TC_CDN_COMMAND_DELETE] as $result): ?>
47
  <tr>
48
  <td><?php echo htmlspecialchars($result->local_path); ?></td>
49
  <td><?php echo htmlspecialchars($result->remote_path); ?></td>
50
  <td><?php echo htmlspecialchars($result->last_error); ?></td>
51
  <td align="center"><?php echo htmlspecialchars($result->date); ?></td>
52
  <td align="center">
53
+ <a href="options-general.php?page=<?php echo W3TC_FILE; ?>&amp;w3tc_action=cdn_queue&amp;cdn_queue_tab=delete&amp;cdn_queue_action=delete&amp;cdn_queue_id=<?php echo $result->id; ?>" class="cdn_queue_delete">Delete</a>
54
  </td>
55
  </tr>
56
  <?php endforeach; ?>
57
  </table>
58
  <p>
59
+ <a href="options-general.php?page=<?php echo W3TC_FILE; ?>&amp;w3tc_action=cdn_queue&amp;cdn_queue_tab=delete&amp;cdn_queue_action=empty&amp;cdn_queue_type=<?php echo W3TC_CDN_COMMAND_DELETE; ?>" class="cdn_queue_empty">Empty upload queue</a>
60
  </p>
61
  <?php else: ?>
62
  <p class="empty">Delete queue is empty</p>
lib/Minify/{min/lib/FirePHP.php → FirePHP.php} RENAMED
File without changes
lib/Minify/HISTORY.txt DELETED
@@ -1,75 +0,0 @@
1
- Minify Release History
2
-
3
- Version 2.1.3
4
- * HTTP fixes
5
- * ETag generation now valid (different when gzipped)
6
- * Vary header always sent when Accept-Encoding is sniffed
7
- * Cache-Control no longer has "must-revalidate" due to webkit bug
8
- See: http://mrclay.org/index.php/2009/02/24/safari-4-beta-cache-controlmust-revalidate-bug/
9
- * Dropped deflate encoding. Browser and proxy support could be buggy.
10
- See: http://stackoverflow.com/questions/883841/
11
- * File cache now works w/o setting $min_cachePath
12
- * Allow setting contentType in Minify_Source objects
13
- * No more 5.3 deprecation warnings: split() removed
14
-
15
- Version 2.1.2
16
- * Javascript fixes
17
- * Debug mode no longer confused by "*/*" in strings/RegExps (jQuery)
18
- * quote characters inside RegExp literals no longer cause exception
19
- * files ending in single-line comments no longer cause code loss
20
- * CSS: data: URLs no longer mangled
21
- * Optional error logging to Firefox's FirePHP extension
22
- * Unit tests to check for common DOCUMENT_ROOT problems
23
- * DOCUMENT_ROOT no longer overwritten on IIS servers
24
- * Builder app doesn't fail on systems without gzdeflate()
25
- * APC caching class included
26
-
27
- Version 2.1.1
28
- * Bug fix release
29
- * Detection and workarounds for zlib.output_compression and non-PHP encoding modules
30
- * Zlib not required (mod_rewrite, et.al., can still be used for encoding)
31
- * HTML : More IE conditional comments preserved
32
- * Minify_groupUri() utility fixed
33
-
34
- Version 2.1.0
35
- * "min" default application for quick deployment
36
- * Minify URI Builder app & bookmarklet for quickly creating minify URIs
37
- * Relative URIs in CSS file are fixed automatically by default
38
- * "debug" mode for revealing original line #s in combined files
39
- * Better IIS support
40
- * Improved minifier classes:
41
- * JS: preserves IE conditional comments
42
- * CSS: smaller output, preserves more hacks and valid CSS syntax,
43
- shorter line lengths, other bug fixes
44
- * HTML: smaller output, shorter line lengths, other bug fixes
45
- * Default Cache-Control: max-age of 30 minutes
46
- * Conditional GETs supported even when max-age sent
47
- * Experimental memcache cache class (default is files)
48
- * Minify_Cache_File has flock()s (by default)
49
- * Workaround for Windows mtime reporting bug
50
-
51
- Version 2.0.2 beta (2008-06-24)
52
- * Fast new cache system. Cached files served almost 3x as fast.
53
- * Dropped support of compress encoding (though HTTP_Encoder still supports it)
54
-
55
- Version 2.0.1 (2008-05-31)
56
- * E_STRICT compliance (Cache_Lite_File).
57
-
58
- Version 2.0.0 (2008-05-22)
59
- * Complete code overhaul. Minify is now a PEAR-style class and toolkit
60
- for building customized minifying file servers.
61
- * Content-Encoding: deflate/gzip/compress, based on request headers
62
- * Expanded CSS and HTML minifiers with test cases
63
- * Easily plug-in 3rd-party minifiers (like Packer)
64
- * Plug-able front end controller allows changing the way files are chosen
65
- * Compression & encoding modules lazy-loaded as needed (304 responses use
66
- use minimal code)
67
- * Separate utility classes for HTTP encoding and cache control
68
-
69
- Version 1.0.1 (2007-05-05)
70
- * Fixed various problems resolving pathnames when hosted on an NFS mount.
71
- * Fixed 'undefined constant' notice.
72
- * Replaced old JSMin library with a much faster custom implementation.
73
-
74
- Version 1.0.0 (2007-05-02)
75
- * First release.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/Minify/{min/lib/HTTP → HTTP}/ConditionalGet.php RENAMED
File without changes
lib/Minify/{min/lib/HTTP → HTTP}/Encoder.php RENAMED
File without changes
lib/Minify/{min/lib/JSMin.php → JSMin.php} RENAMED
File without changes
lib/Minify/{min/lib/JSMinPlus.php → JSMinPlus.php} RENAMED
File without changes
lib/Minify/LICENSE.txt DELETED
@@ -1,26 +0,0 @@
1
- Copyright (c) 2008 Ryan Grove <ryan@wonko.com>
2
- Copyright (c) 2008 Steve Clay <steve@mrclay.org>
3
- All rights reserved.
4
-
5
- Redistribution and use in source and binary forms, with or without
6
- modification, are permitted provided that the following conditions are met:
7
-
8
- * Redistributions of source code must retain the above copyright notice,
9
- this list of conditions and the following disclaimer.
10
- * Redistributions in binary form must reproduce the above copyright notice,
11
- this list of conditions and the following disclaimer in the documentation
12
- and/or other materials provided with the distribution.
13
- * Neither the name of this project nor the names of its contributors may be
14
- used to endorse or promote products derived from this software without
15
- specific prior written permission.
16
-
17
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
21
- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/Minify/{min/lib/Minify.php → Minify.php} RENAMED
File without changes
lib/Minify/{min/lib/Minify → Minify}/Build.php RENAMED
File without changes
lib/Minify/{min/lib/Minify → Minify}/CSS.php RENAMED
File without changes
lib/Minify/{min/lib/Minify → Minify}/CSS/Compressor.php RENAMED
File without changes
lib/Minify/{min/lib/Minify → Minify}/CSS/UriRewriter.php RENAMED
File without changes
lib/Minify/{min/lib/Minify → Minify}/Cache/APC.php RENAMED
File without changes
lib/Minify/{min/lib/Minify → Minify}/Cache/File.php RENAMED
File without changes
lib/Minify/{min/lib/Minify → Minify}/Cache/Memcache.php RENAMED
File without changes
lib/Minify/{min/lib/Minify → Minify}/CommentPreserver.php RENAMED
File without changes
lib/Minify/{min/lib/Minify → Minify}/Controller/Base.php RENAMED
File without changes
lib/Minify/{min/lib/Minify → Minify}/Controller/Files.php RENAMED
File without changes
lib/Minify/{min/lib/Minify → Minify}/Controller/Groups.php RENAMED
File without changes
lib/Minify/{min/lib/Minify → Minify}/Controller/MinApp.php RENAMED
File without changes
lib/Minify/{min/lib/Minify → Minify}/Controller/Page.php RENAMED
@@ -33,13 +33,13 @@ class Minify_Controller_Page extends Minify_Controller_Base {
33
  * 'minifyAll': should all CSS and Javascript blocks be individually
34
  * minified? (default false)
35
  *
 
36
  */
37
  public function setupSources($options) {
38
  if (isset($options['file'])) {
39
  $sourceSpec = array(
40
  'filepath' => $options['file']
41
  );
42
- unset($options['file']);
43
  } else {
44
  // strip controller options
45
  $sourceSpec = array(
33
  * 'minifyAll': should all CSS and Javascript blocks be individually
34
  * minified? (default false)
35
  *
36
+ * @todo Add 'file' option to read HTML file.
37
  */
38
  public function setupSources($options) {
39
  if (isset($options['file'])) {
40
  $sourceSpec = array(
41
  'filepath' => $options['file']
42
  );
 
43
  } else {
44
  // strip controller options
45
  $sourceSpec = array(
lib/Minify/{min/lib/Minify → Minify}/Controller/Version1.php RENAMED
File without changes
lib/Minify/{min/lib/Minify → Minify}/HTML.php RENAMED
File without changes
lib/Minify/{min/lib/Minify → Minify}/ImportProcessor.php RENAMED
File without changes
lib/Minify/{min/lib/Minify → Minify}/Lines.php RENAMED
File without changes
lib/Minify/{min/lib/Minify → Minify}/Logger.php RENAMED
File without changes
lib/Minify/{min/lib/Minify → Minify}/Packer.php RENAMED
File without changes
lib/Minify/{min/lib/Minify → Minify}/Source.php RENAMED
File without changes
lib/Minify/{min/lib/Minify → Minify}/YUICompressor.php RENAMED
File without changes
lib/Minify/README.txt DELETED
@@ -1,53 +0,0 @@
1
- WELCOME TO MINIFY 2.1!
2
-
3
- Minify is an HTTP content server. It compresses sources of content
4
- (usually files), combines the result and serves it with appropriate
5
- HTTP headers. These headers can allow clients to perform conditional
6
- GETs (serving content only when clients do not have a valid cache)
7
- and tell clients to cache the file for a period of time.
8
- More info: http://code.google.com/p/minify/
9
-
10
-
11
- UPGRADING
12
-
13
- See UPGRADING.txt for instructions.
14
-
15
-
16
- INSTALLATION AND USAGE:
17
-
18
- 1. Place the /min/ directory as a child of your DOCUMENT_ROOT
19
- directory: i.e. you will have: /home/user/www/public_html/min
20
-
21
- 2. Open http://yourdomain/min/ in a web browser. This will forward
22
- you to the Minify URI Builder application, which will help you
23
- quickly start using Minify to serve content on your site.
24
-
25
-
26
- UNIT TESTING:
27
-
28
- 1. Place the /min_unit_tests/ directory as a child of your DOCUMENT_ROOT
29
- directory: i.e. you will have: /home/user/www/public_html/min_unit_tests
30
-
31
- 2. To run unit tests, access: http://yourdomain/min_unit_tests/test_all.php
32
-
33
- (If you wish, the other test_*.php files can be run to test individual
34
- components with more verbose output.)
35
-
36
- 3. Remove /min_unit_tests/ from your DOCUMENT_ROOT when you are done.
37
-
38
-
39
- EXTRAS:
40
-
41
- The min_extras folder contains files for benchmarking using Apache ab on Windows
42
- and a couple single-use tools. DO NOT place this on your production server.
43
-
44
-
45
- FILE ENCODINGS
46
-
47
- Minify *should* work fine with files encoded in UTF-8 or other 8-bit
48
- encodings like ISO 8859/Windows-1252. By default Minify appends
49
- ";charset=utf-8" to the Content-Type headers it sends.
50
-
51
- Leading UTF-8 BOMs are stripped from all sources to prevent
52
- duplication in output files, and files are converted to Unix newlines.
53
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/Minify/{min/lib/Solar → Solar}/Dir.php RENAMED
File without changes
lib/Minify/UPGRADING.txt DELETED
@@ -1,35 +0,0 @@
1
- Minify Upgrade Guide
2
-
3
- UPGRADING FROM 2.1.*
4
-
5
- 1. Rename the following files:
6
-
7
- /min/config.php --> /min/old_config.php
8
- /min/groupsConfig.php --> /min/old_groupsConfig.php
9
-
10
- 2. Overwrite all files in /min (and /min_unit_tests) with those from this zip.
11
-
12
- 3. Delete /min/groupsConfig.php
13
-
14
- 4. Rename /min/old_groupsConfig.php --> /min/groupsConfig.php
15
-
16
- 5. Merge your settings in old_config.php into config.php.
17
-
18
- * If you've set $_SERVER['DOCUMENT_ROOT'], instead set the new option
19
- $min_documentRoot. This is advantageous on IIS systems because Minify
20
- will no longer overwrite the path you specified.
21
-
22
- * $min_errorLogger adds the ability to enable FirePHP logging.
23
-
24
- 6. (optional) Delete /min/old_config.php and the Minify files from your cache
25
- directory (specified in $min_cachePath).
26
-
27
-
28
- INSTALLING FRESH
29
-
30
- See README.txt for instructions on installing this app for the first time.
31
-
32
-
33
- SUPPORT
34
-
35
- Send a message to http://groups.google.com/group/minify
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/Minify/min/.htaccess DELETED
@@ -1,4 +0,0 @@
1
- <IfModule mod_rewrite.c>
2
- RewriteEngine on
3
- RewriteRule ^([a-z]=.*) index.php?$1 [L,NE]
4
- </IfModule>
 
 
 
 
lib/Minify/min/README.txt DELETED
@@ -1,132 +0,0 @@
1
- The files in this directory represent the default Minify setup designed to ease
2
- integration with your site. This app will combine and minify your Javascript or
3
- CSS files and serve them with HTTP compression and cache headers.
4
-
5
-
6
- RECOMMENDED
7
-
8
- It's recommended to edit config.php to set $min_cachePath to a writeable
9
- (by PHP) directory on your system. This will improve performance.
10
-
11
-
12
- GETTING STARTED
13
-
14
- The quickest way to get started is to use the Minify URI Builder application
15
- on your website: http://example.com/min/builder/
16
-
17
-
18
- MINIFYING A SINGLE FILE
19
-
20
- Let's say you want to serve this file:
21
- http://example.com/wp-content/themes/default/default.css
22
-
23
- Here's the "Minify URL" for this file:
24
- http://example.com/min/?f=wp-content/themes/default/default.css
25
-
26
- In other words, the "f" argument is set to the file path from root without the
27
- initial "/". As CSS files may contain relative URIs, Minify will automatically
28
- "fix" these by rewriting them as root relative.
29
-
30
-
31
- COMBINING MULTIPLE FILES IN ONE DOWNLOAD
32
-
33
- Separate the paths given to "f" with commas.
34
-
35
- Let's say you have CSS files at these URLs:
36
- http://example.com/scripts/jquery-1.2.6.js
37
- http://example.com/scripts/site.js
38
-
39
- You can combine these files through Minify by requesting this URL:
40
- http://example.com/min/?f=scripts/jquery-1.2.6.js,scripts/site.js
41
-
42
-
43
- SIMPLIFYING URLS WITH A BASE PATH
44
-
45
- If you're combining files that share the same ancestor directory, you can use
46
- the "b" argument to set the base directory for the "f" argument. Do not include
47
- the leading or trailing "/" characters.
48
-
49
- E.g., the following URLs will serve the exact same content:
50
- http://example.com/min/?f=scripts/jquery-1.2.6.js,scripts/site.js,scripts/home.js
51
- http://example.com/min/?b=scripts&f=jquery-1.2.6.js,site.js,home.js
52
-
53
-
54
- MINIFY URLS IN HTML
55
-
56
- In (X)HTML files, don't forget to replace any "&" characters with "&amp;".
57
-
58
-
59
- SPECIFYING ALLOWED DIRECTORIES
60
-
61
- By default, Minify will serve any *.css/*.js files within the DOCUMENT_ROOT. If
62
- you'd prefer to limit Minify's access to certain directories, set the
63
- $min_serveOptions['minApp']['allowDirs'] array in config.php. E.g. to limit
64
- to the /js and /themes/default directories, use:
65
-
66
- $min_serveOptions['minApp']['allowDirs'] = array('//js', '//themes/default');
67
-
68
-
69
- GROUPS: FASTER PERFORMANCE AND BETTER URLS
70
-
71
- For the best performance, edit groupsConfig.php to pre-specify groups of files
72
- to be combined under preset keys. E.g., here's an example configuration in
73
- groupsConfig.php:
74
-
75
- return array(
76
- 'js' => array('//js/Class.js', '//js/email.js')
77
- );
78
-
79
- This pre-selects the following files to be combined under the key "js":
80
- http://example.com/js/Class.js
81
- http://example.com/js/email.js
82
-
83
- You can now serve these files with this simple URL:
84
- http://example.com/min/?g=js
85
-
86
-
87
- GROUPS: SPECIFYING FILES OUTSIDE THE DOC_ROOT
88
-
89
- In the groupsConfig.php array, the "//" in the file paths is a shortcut for
90
- the DOCUMENT_ROOT, but you can also specify paths from the root of the filesystem
91
- or relative to the DOC_ROOT:
92
-
93
- return array(
94
- 'js' => array(
95
- '//js/file.js' // file within DOC_ROOT
96
- ,'//../file.js' // file in parent directory of DOC_ROOT
97
- ,'C:/Users/Steve/file.js' // file anywhere on filesystem
98
- )
99
- );
100
-
101
-
102
- FAR-FUTURE EXPIRES HEADERS
103
-
104
- Minify can send far-future (one year) Expires headers. To enable this you must
105
- add a number to the querystring (e.g. /min/?g=js&1234 or /min/f=file.js&1234)
106
- and alter it whenever a source file is changed. If you have a build process you
107
- can use a build/source control revision number.
108
-
109
- If you serve files as a group, you can use the utility function Minify_groupUri()
110
- to get a "versioned" Minify URI for use in your HTML. E.g.:
111
-
112
- <?php
113
- // add /min/lib to your include_path first!
114
- require $_SERVER['DOCUMENT_ROOT'] . '/min/utils.php';
115
-
116
- $jsUri = Minify_groupUri('js');
117
- echo "<script type='text/javascript' src='{$jsUri}'></script>";
118
-
119
-
120
- DEBUG MODE
121
-
122
- In debug mode, instead of compressing files, Minify sends combined files with
123
- comments prepended to each line to show the line number in the original source
124
- file. To enable this, set $min_allowDebugFlag to true in config.php and append
125
- "&debug=1" to your URIs. E.g. /min/?f=script1.js,script2.js&debug=1
126
-
127
- Known issue: files with comment-like strings/regexps can cause problems in this mode.
128
-
129
-
130
- QUESTIONS?
131
-
132
- http://groups.google.com/group/minify
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/Minify/min/builder/_index.js DELETED
@@ -1,242 +0,0 @@
1
- var MUB = {
2
- _uid : 0
3
- ,_minRoot : '/min/?'
4
- ,checkRewrite : function () {
5
- var testUri = location.pathname.replace(/\/[^\/]*$/, '/rewriteTest.js').substr(1);
6
- function fail() {
7
- $('#minRewriteFailed')[0].className = 'topNote';
8
- };
9
- $.ajax({
10
- url : '../f=' + testUri + '&' + (new Date()).getTime()
11
- ,success : function (data) {
12
- if (data === '1') {
13
- MUB._minRoot = '/min/';
14
- $('span.minRoot').html('/min/');
15
- } else
16
- fail();
17
- }
18
- ,error : fail
19
- });
20
- }
21
- /**
22
- * Get markup for new source LI element
23
- */
24
- ,newLi : function () {
25
- return '<li id="li' + MUB._uid + '">http://' + location.host + '/<input type=text size=20>'
26
- + ' <button title="Remove">x</button> <button title="Include Earlier">&uarr;</button>'
27
- + ' <button title="Include Later">&darr;</button> <span></span></li>';
28
- }
29
- /**
30
- * Add new empty source LI and attach handlers to buttons
31
- */
32
- ,addLi : function () {
33
- $('#sources').append(MUB.newLi());
34
- var li = $('#li' + MUB._uid)[0];
35
- $('button[title=Remove]', li).click(function () {
36
- $('#results').hide();
37
- var hadValue = !!$('input', li)[0].value;
38
- $(li).remove();
39
- });
40
- $('button[title$=Earlier]', li).click(function () {
41
- $(li).prev('li').find('input').each(function () {
42
- $('#results').hide();
43
- // this = previous li input
44
- var tmp = this.value;
45
- this.value = $('input', li).val();
46
- $('input', li).val(tmp);
47
- MUB.updateAllTestLinks();
48
- });
49
- });
50
- $('button[title$=Later]', li).click(function () {
51
- $(li).next('li').find('input').each(function () {
52
- $('#results').hide();
53
- // this = next li input
54
- var tmp = this.value;
55
- this.value = $('input', li).val();
56
- $('input', li).val(tmp);
57
- MUB.updateAllTestLinks();
58
- });
59
- });
60
- ++MUB._uid;
61
- }
62
- /**
63
- * In the context of a source LI element, this will analyze the URI in
64
- * the INPUT and check the URL on the site.
65
- */
66
- ,liUpdateTestLink : function () { // call in context of li element
67
- if (! $('input', this)[0].value)
68
- return;
69
- var li = this;
70
- $('span', this).html('');
71
- var url = 'http://' + location.host + '/'
72
- + $('input', this)[0].value.replace(/^\//, '');
73
- $.ajax({
74
- url : url
75
- ,complete : function (xhr, stat) {
76
- if ('success' == stat)
77
- $('span', li).html('&#x2713;');
78
- else {
79
- $('span', li).html('<button><b>404! </b> recheck</button>')
80
- .find('button').click(function () {
81
- MUB.liUpdateTestLink.call(li);
82
- });
83
- }
84
- }
85
- ,dataType : 'text'
86
- });
87
- }
88
- /**
89
- * Check all source URLs
90
- */
91
- ,updateAllTestLinks : function () {
92
- $('#sources li').each(MUB.liUpdateTestLink);
93
- }
94
- /**
95
- * In a given array of strings, find the character they all have at
96
- * a particular index
97
- * @param Array arr array of strings
98
- * @param Number pos index to check
99
- * @return mixed a common char or '' if any do not match
100
- */
101
- ,getCommonCharAtPos : function (arr, pos) {
102
- var i
103
- ,l = arr.length
104
- ,c = arr[0].charAt(pos);
105
- if (c === '' || l === 1)
106
- return c;
107
- for (i = 1; i < l; ++i)
108
- if (arr[i].charAt(pos) !== c)
109
- return '';
110
- return c;
111
- }
112
- /**
113
- * Get the shortest URI to minify the set of source files
114
- * @param Array sources URIs
115
- */
116
- ,getBestUri : function (sources) {
117
- var pos = 0
118
- ,base = ''
119
- ,c;
120
- while (true) {
121
- c = MUB.getCommonCharAtPos(sources, pos);
122
- if (c === '')
123
- break;
124
- else
125
- base += c;
126
- ++pos;
127
- }
128
- base = base.replace(/[^\/]+$/, '');
129
- var uri = MUB._minRoot + 'f=' + sources.join(',');
130
- if (base.charAt(base.length - 1) === '/') {
131
- // we have a base dir!
132
- var basedSources = sources
133
- ,i
134
- ,l = sources.length;
135
- for (i = 0; i < l; ++i) {
136
- basedSources[i] = sources[i].substr(base.length);
137
- }
138
- base = base.substr(0, base.length - 1);
139
- var bUri = MUB._minRoot + 'b=' + base + '&f=' + basedSources.join(',');
140
- //window.console && console.log([uri, bUri]);
141
- uri = uri.length < bUri.length
142
- ? uri
143
- : bUri;
144
- }
145
- return uri;
146
- }
147
- /**
148
- * Create the Minify URI for the sources
149
- */
150
- ,update : function () {
151
- MUB.updateAllTestLinks();
152
- var sources = []
153
- ,ext = false
154
- ,fail = false;
155
- $('#sources input').each(function () {
156
- var m, val;
157
- if (! fail && this.value && (m = this.value.match(/\.(css|js)$/))) {
158
- var thisExt = m[1];
159
- if (ext === false)
160
- ext = thisExt;
161
- else if (thisExt !== ext) {
162
- fail = true;
163
- return alert('extensions must match!');
164
- }
165
- this.value = this.value.replace(/^\//, '');
166
- if (-1 != $.inArray(this.value, sources)) {
167
- fail = true;
168
- return alert('duplicate file!');
169
- }
170
- sources.push(this.value);
171
- }
172
- });
173
- if (fail || ! sources.length)
174
- return;
175
- $('#groupConfig').val(" 'keyName' => array('//" + sources.join("', '//") + "'),");
176
- var uri = MUB.getBestUri(sources)
177
- ,uriH = uri.replace(/</, '&lt;').replace(/>/, '&gt;').replace(/&/, '&amp;');
178
- $('#uriA').html(uriH)[0].href = uri;
179
- $('#uriHtml').val(
180
- ext === 'js'
181
- ? '<script type="text/javascript" src="' + uriH + '"></script>'
182
- : '<link type="text/css" rel="stylesheet" href="' + uriH + '" />'
183
- );
184
- $('#results').show();
185
- }
186
- /**
187
- * Handler for the "Add file +" button
188
- */
189
- ,addButtonClick : function () {
190
- $('#results').hide();
191
- MUB.addLi();
192
- MUB.updateAllTestLinks();
193
- $('#update').show().click(MUB.update);
194
- $('#sources li:last input')[0].focus();
195
- }
196
- /**
197
- * Runs on DOMready
198
- */
199
- ,init : function () {
200
- $('#app').show();
201
- $('#sources').html('');
202
- $('#add button').click(MUB.addButtonClick);
203
- // make easier to copy text out of
204
- $('#uriHtml, #groupConfig').click(function () {
205
- this.select();
206
- }).focus(function () {
207
- this.select();
208
- });
209
- $('a.ext').attr({target:'_blank'});
210
- if (location.hash) {
211
- // make links out of URIs from bookmarklet
212
- $('#getBm').hide();
213
- $('#bmUris').html('<p><strong>Found by bookmarklet:</strong> /<a href=#>'
214
- + location.hash.substr(1).split(',').join('</a> | /<a href=#>')
215
- + '</a></p>'
216
- );
217
- $('#bmUris a').click(function () {
218
- MUB.addButtonClick();
219
- $('#sources li:last input').val(this.innerHTML)
220
- MUB.liUpdateTestLink.call($('#sources li:last')[0]);
221
- $('#results').hide();
222
- return false;
223
- }).attr({title:'Add file +'});
224
- } else {
225
- // copy bookmarklet code into href
226
- var bmUri = location.pathname.replace(/\/[^\/]*$/, '/bm.js').substr(1);
227
- $.ajax({
228
- url : '../?f=' + bmUri
229
- ,success : function (code) {
230
- $('#bm')[0].href = code
231
- .replace('%BUILDER_URL%', location.href)
232
- .replace(/\n/g, ' ');
233
- }
234
- ,dataType : 'text'
235
- });
236
- $.browser.msie && $('#getBm p:last').append(' Sorry, not supported in MSIE!');
237
- MUB.addButtonClick();
238
- }
239
- MUB.checkRewrite();
240
- }
241
- };
242
- window.onload = MUB.init;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/Minify/min/builder/bm.js DELETED
@@ -1,36 +0,0 @@
1
- javascript:(function() {
2
- var d = document
3
- ,uris = []
4
- ,i = 0
5
- ,o
6
- ,home = (location + '').split('/').splice(0, 3).join('/') + '/';
7
- function add(uri) {
8
- return (0 === uri.indexOf(home))
9
- && (!/[\?&]/.test(uri))
10
- && uris.push(escape(uri.substr(home.length)));
11
- };
12
- function sheet(ss) {
13
- // we must check the domain with add() before accessing ss.cssRules
14
- // otherwise a security exception will be thrown
15
- if (ss.href && add(ss.href) && ss.cssRules) {
16
- var i = 0, r;
17
- while (r = ss.cssRules[i++])
18
- r.styleSheet && sheet(r.styleSheet);
19
- }
20
- };
21
- while (o = d.getElementsByTagName('script')[i++])
22
- o.src && !(o.type && /vbs/i.test(o.type)) && add(o.src);
23
- i = 0;
24
- while (o = d.styleSheets[i++])
25
- /* http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-DocumentStyle-styleSheets
26
- document.styleSheet is a list property where [0] accesses the 1st element and
27
- [outOfRange] returns null. In IE, styleSheets is a function, and also throws an
28
- exception when you check the out of bounds index. (sigh) */
29
- sheet(o);
30
- if (uris.length)
31
- window.open('%BUILDER_URL%#' + uris.join(','));
32
- else
33
- alert('No js/css files found with URLs within "'
34
- + home.split('/')[2]
35
- + '".\n(This tool is limited to URLs with the same domain.)');
36
- })();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/Minify/min/builder/index.php DELETED
@@ -1,182 +0,0 @@
1
- <?php
2
-
3
- if (phpversion() < 5) {
4
- exit('Minify requires PHP5 or greater.');
5
- }
6
-
7
- // check for auto-encoding
8
- $encodeOutput = (function_exists('gzdeflate')
9
- && !ini_get('zlib.output_compression'));
10
-
11
- require dirname(__FILE__) . '/../config.php';
12
-
13
- if (! $min_enableBuilder) {
14
- header('Location: /');
15
- exit();
16
- }
17
-
18
- ob_start();
19
- ?>
20
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
21
- <head>
22
- <meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
23
- <title>Minify URI Builder</title>
24
- <style type="text/css">
25
- body {margin:1em 60px;}
26
- h1, h2, h3 {margin-left:-25px; position:relative;}
27
- h1 {margin-top:0;}
28
- #sources {margin:0; padding:0;}
29
- #sources li {margin:0 0 0 40px}
30
- #sources li input {margin-left:2px}
31
- #add {margin:5px 0 1em 40px}
32
- .hide {display:none}
33
- #uriTable {border-collapse:collapse;}
34
- #uriTable td, #uriTable th {padding-top:10px;}
35
- #uriTable th {padding-right:10px;}
36
- #groupConfig {font-family:monospace;}
37
- b {color:#c00}
38
- .topNote {background: #ff9; display:inline-block; padding:.5em .6em; margin:0 0 1em;}
39
- .topWarning {background:#c00; color:#fff; padding:.5em .6em; margin:0 0 1em;}
40
- </style>
41
- </head>
42
-
43
- <?php if (! isset($min_cachePath)): ?>
44
- <p class=topNote><strong>Note:</strong> Please set <code>$min_cachePath</code>
45
- in /min/config.php to improve performance.</p>
46
- <?php endIf; ?>
47
-
48
- <p id=minRewriteFailed class="hide"><strong>Note:</strong> Your webserver does not seem to
49
- support mod_rewrite (used in /min/.htaccess). Your Minify URIs will contain "?", which
50
- <a href="http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/"
51
- >may reduce the benefit of proxy cache servers</a>.</p>
52
-
53
- <h1>Minify URI Builder</h1>
54
-
55
- <noscript><p class="topNote">Javascript and a browser supported by jQuery 1.2.6 is required
56
- for this application.</p></noscript>
57
-
58
- <div id=app class=hide>
59
-
60
- <p>Create a list of Javascript or CSS files (or 1 is fine) you'd like to combine
61
- and click [Update].</p>
62
-
63
- <ol id=sources><li></li></ol>
64
- <div id=add><button>Add file +</button></div>
65
-
66
- <div id=bmUris></div>
67
-
68
- <p><button id=update class=hide>Update</button></p>
69
-
70
- <div id=results class=hide>
71
-
72
- <h2>Minify URI</h2>
73
- <p>Place this URI in your HTML to serve the files above combined, minified, compressed and
74
- with cache headers.</p>
75
- <table id=uriTable>
76
- <tr><th>URI</th><td><a id=uriA class=ext>/min</a> <small>(opens in new window)</small></td></tr>
77
- <tr><th>HTML</th><td><input id=uriHtml type=text size=100 readonly></td></tr>
78
- </table>
79
-
80
- <h2>How to serve these files as a group</h2>
81
- <p>For the best performance you can serve these files as a pre-defined group with a URI
82
- like: <code><span class=minRoot>/min/?</span>g=keyName</code></p>
83
- <p>To do this, add a line like this to /min/groupsConfig.php:</p>
84
-
85
- <pre><code>return array(
86
- <span style="color:#666">... your existing groups here ...</span>
87
- <input id=groupConfig size=100 type=text readonly>
88
- );</code></pre>
89
-
90
- <p><em>Make sure to replace <code>keyName</code> with a unique key for this group.</em></p>
91
- </div>
92
-
93
- <div id=getBm>
94
- <h3>Find URIs on a Page</h3>
95
- <p>You can use the bookmarklet below to fetch all CSS &amp; Javascript URIs from a page
96
- on your site. When you active it, this page will open in a new window with a list of
97
- available URIs to add.</p>
98
-
99
- <p><a id=bm>Create Minify URIs</a> <small>(right-click, add to bookmarks)</small></p>
100
- </div>
101
-
102
- <h3>Combining CSS files that contain <code>@import</code></h3>
103
- <p>If your CSS files contain <code>@import</code> declarations, Minify will not
104
- remove them. Therefore, you will want to remove those that point to files already
105
- in your list, and move any others to the top of the first file in your list
106
- (imports below any styles will be ignored by browsers as invalid).</p>
107
- <p>If you desire, you can use Minify URIs in imports and they will not be touched
108
- by Minify. E.g. <code>@import "<span class=minRoot>/min/?</span>g=css2";</code></p>
109
-
110
- </div><!-- #app -->
111
-
112
- <hr>
113
- <p>Need help? Search or post to the <a class=ext
114
- href="http://groups.google.com/group/minify">Minify discussion list</a>.</p>
115
- <p><small>This app is minified :) <a class=ext
116
- href="http://code.google.com/p/minify/source/browse/trunk/min/builder/index.php">view
117
- source</a></small></p>
118
-
119
- <script type="text/javascript"
120
- src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
121
-
122
- <script type="text/javascript">
123