WP Super Cache - Version 0.9.7

Version Description

  • Fixed problem with blogs in folders.
  • Added cache file listing and delete links to admin page.
  • Added "Newest Cached Pages" listing in sidebox.
  • Made admin page translatable.
  • Added "How do I make certain parts of the page stay dynamic?" to FAQ.
  • Advanced: added "late init" feature so that plugin activates on "init". Set $wp_super_cache_late_init to true in config file to use.
  • Disable supercaching when GET parameters present instead of disabling all caching. Disable on POST (as normal) and preview.
  • Fixed problem with cron job and mutex filename.
  • Warn users they must enable mobile device support if rewrite rules detected. Better detection of when to warn that .htaccess rules must be updated (no need when rewrite rules not present)
  • Advanced: Added "wpsupercache_404" filter. Return true to cache 404 error pages.
  • Use the wordpress_test_cookie in the cache key.
  • Show correct number of cache files when compression off.
  • Fixed problem with PHP safe_mode detection.
  • Various bugfixes and documentation updates. See Changelog.txt
Download this release

Release Info

Developer donncha
Plugin Icon 128x128 WP Super Cache
Version 0.9.7
Comparing to
See all releases

Code changes from version 0.9.6.1 to 0.9.7

Files changed (7) hide show
  1. Changelog.txt +267 -0
  2. readme.txt +51 -5
  3. wp-cache-config-sample.php +2 -4
  4. wp-cache-phase1.php +112 -47
  5. wp-cache-phase2.php +167 -33
  6. wp-cache.php +434 -237
  7. wp-super-cache.pot +1095 -0
Changelog.txt CHANGED
@@ -1,3 +1,270 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  2009-07-29 17:26 donncha
2
 
3
  * readme.txt, wp-cache.php: Bump version to 0.9.6.1
1
+ 2009-10-02 21:40 donncha
2
+
3
+ * readme.txt, wp-cache.php: Bump version to 0.9.7
4
+
5
+ 2009-10-02 21:39 donncha
6
+
7
+ * Changelog.txt: Updated changelog
8
+
9
+ 2009-10-02 21:34 donncha
10
+
11
+ * wp-cache-phase2.php: Don't show "blank page", "404 not cached" or
12
+ "no html tag" warnings on output unless debugging enabled.
13
+
14
+ 2009-10-02 19:45 donncha
15
+
16
+ * Changelog.txt, readme.txt: Updated changelog and readme.txt
17
+ changes
18
+
19
+ 2009-10-02 13:14 donncha
20
+
21
+ * wp-super-cache.pot: Updated POT file
22
+
23
+ 2009-10-02 13:09 donncha
24
+
25
+ * wp-cache.php: Minor text change to bio text
26
+
27
+ 2009-10-01 20:47 donncha
28
+
29
+ * wp-cache-phase2.php, wp-cache.php: Added more debugging, on cache
30
+ cleanup
31
+
32
+ 2009-10-01 20:26 donncha
33
+
34
+ * wp-cache.php: Sort the file listing by newest first.
35
+ Hide a filemtime warning, props @reverbstudios
36
+
37
+ 2009-10-01 19:57 donncha
38
+
39
+ * wp-cache-phase1.php: Load wp-cache-phase2.php all the time
40
+
41
+ 2009-10-01 17:50 donncha
42
+
43
+ * readme.txt: Added "How do I make certain parts of the page stay
44
+ dynamic?" to FAQ
45
+
46
+ 2009-09-30 09:51 donncha
47
+
48
+ * wp-cache.php: Sort the stale from the fresh wp-cache files
49
+ properly
50
+
51
+ 2009-09-29 22:21 donncha
52
+
53
+ * wp-cache-config-sample.php: Added $wp_super_cache_late_init to
54
+ config page
55
+
56
+ 2009-09-29 10:17 donncha
57
+
58
+ * wp-cache.php: Add button to delete specific cache files.
59
+
60
+ 2009-09-29 09:14 donncha
61
+
62
+ * wp-cache.php: Count wp-cached cache files correctly
63
+
64
+ 2009-09-29 08:17 donncha
65
+
66
+ * wp-cache-config-sample.php: Added "Yandex" to list of rejected UA
67
+ for not caching
68
+
69
+ 2009-09-29 08:08 donncha
70
+
71
+ * wp-cache.php: Add anchors to each section of the admin page
72
+
73
+ 2009-09-29 07:47 donncha
74
+
75
+ * wp-cache-phase2.php: Don't cache wp-admin requests
76
+
77
+ 2009-09-29 07:43 donncha
78
+
79
+ * wp-cache-phase2.php: Disable supercaching when GET parameters
80
+ present instead of all caching. Disable on POST (as normal) and
81
+ preview
82
+
83
+ 2009-09-28 21:59 donncha
84
+
85
+ * wp-cache-phase1.php: Move cron code down so that cache variables
86
+ are set.
87
+
88
+ 2009-09-28 21:37 donncha
89
+
90
+ * wp-super-cache.pot: More translatable text
91
+
92
+ 2009-09-28 21:35 donncha
93
+
94
+ * wp-cache.php: More il8n mods
95
+
96
+ 2009-09-28 17:48 donncha
97
+
98
+ * wp-cache.php: More il8n mods
99
+
100
+ 2009-09-28 13:57 donncha
101
+
102
+ * wp-cache.php: Add positional anchors
103
+
104
+ 2009-09-28 13:52 donncha
105
+
106
+ * wp-cache.php: Improve listing of cache files
107
+
108
+ 2009-09-28 13:35 donncha
109
+
110
+ * wp-cache-phase1.php, wp-cache-phase2.php, wp-cache.php: Record
111
+ the cache key in the wp-cache meta file. Show that key on the
112
+ admin page file listings and add "wp_cache_meta" filter to modify
113
+ the cache meta data
114
+
115
+ 2009-09-28 13:12 donncha
116
+
117
+ * wp-cache.php: Warn users they must enable mobile device support
118
+ if rewrite rules detected. Better detect when to warn that
119
+ .htaccess rules must be updated (no need when rewrite rules not
120
+ present)
121
+
122
+ 2009-09-28 11:12 donncha
123
+
124
+ * wp-cache.php: Allow admin to list cached files.
125
+
126
+ 2009-09-28 09:43 donncha
127
+
128
+ * wp-cache.php: More il8n changes
129
+
130
+ 2009-09-24 20:45 donncha
131
+
132
+ * wp-cache.php: Forgot the fieldset, props thunderlounge!
133
+
134
+ 2009-09-24 11:43 donncha
135
+
136
+ * wp-cache.php, wp-super-cache.pot: Renamed text domain to
137
+ wp-super-cache
138
+ Added .pot file
139
+ Load text domain as described in
140
+ http://codex.wordpress.org/I18n_for_WordPress_Developers
141
+
142
+ 2009-09-24 11:27 donncha
143
+
144
+ * wp-cache.php: First stab at internationalising wp-super-cache
145
+
146
+ 2009-09-24 10:18 donncha
147
+
148
+ * wp-cache.php: Removed REQUEST_URI from form actions
149
+
150
+ 2009-09-20 21:13 donncha
151
+
152
+ * wp-cache-phase2.php, wp-cache.php: Added "Newest Cached Pages"
153
+ option to list 10 newest pages cached by the plugin.
154
+
155
+ 2009-09-20 19:10 donncha
156
+
157
+ * wp-cache-phase2.php: Added "wpsupercache_404" filter. Return true
158
+ to cache error 404 pages. Props simonwheatley, see
159
+ http://wordpress.org/support/topic/312672
160
+
161
+ 2009-09-18 20:37 donncha
162
+
163
+ * wp-cache-phase1.php: Include the wordpress_test_cookie in the
164
+ cache key for wp-cache files.
165
+
166
+ 2009-09-16 10:23 donncha
167
+
168
+ * wp-cache-phase1.php: Late Init. Don't do anything until "init"
169
+
170
+ 2009-09-16 10:21 donncha
171
+
172
+ * wp-cache-phase2.php: Better debug messages
173
+
174
+ 2009-09-15 10:58 donncha
175
+
176
+ * wp-cache-config-sample.php, wp-cache-phase1.php,
177
+ wp-cache-phase2.php, wp-cache.php: Check if logging enabled
178
+ before calling debug function (optimization)
179
+ Improve debug admin screen
180
+
181
+ 2009-09-10 10:12 donncha
182
+
183
+ * wp-cache.php: Generate the correct rules for users ins
184
+ directories
185
+
186
+ 2009-09-10 08:41 donncha
187
+
188
+ * wp-cache.php: When cache compression is off don't divide number
189
+ of cached files by 2 as no .gz files are created. Props dpark,
190
+ http://wordpress.org/support/topic/309443
191
+
192
+ 2009-09-09 16:29 donncha
193
+
194
+ * wp-cache-phase2.php: Improved output buffer error message
195
+
196
+ 2009-09-09 12:37 donncha
197
+
198
+ * wp-cache-phase1.php, wp-cache-phase2.php, wp-cache.php: Added
199
+ debug settings section on admin page.
200
+
201
+ 2009-09-09 09:11 donncha
202
+
203
+ * wp-cache.php: Check if safe_mode is 1 or "on",
204
+ http://wordpress.org/support/topic/239579?replies=9#post-1204927
205
+
206
+ 2009-09-03 11:06 donncha
207
+
208
+ * wp-cache-phase2.php: Don't cache GET requests earlier on before
209
+ OB is set up.
210
+
211
+ 2009-09-03 11:05 donncha
212
+
213
+ * wp-cache-phase1.php: If debugging is not set then return
214
+ immediately
215
+
216
+ 2009-09-03 11:02 donncha
217
+
218
+ * wp-cache-config-sample.php, wp-cache-phase1.php,
219
+ wp-cache-phase2.php: Added logging to a file and configurable log
220
+ level
221
+
222
+ 2009-09-01 09:31 donncha
223
+
224
+ * readme.txt: Updated description of "How to tell if a page is
225
+ cached"
226
+
227
+ 2009-09-01 09:26 donncha
228
+
229
+ * wp-cache.php: Tell user that compression is enabled in half-on
230
+ mode.
231
+
232
+ 2009-08-24 13:04 donncha
233
+
234
+ * readme.txt: Added http://redbot.org/ to FAQ (thanks Alex!)
235
+
236
+ 2009-08-24 12:14 donncha
237
+
238
+ * wp-cache.php: Send the Vary header to browsers
239
+
240
+ 2009-08-24 08:49 donncha
241
+
242
+ * readme.txt: Added FAQ about caching warnings at
243
+ ismyblogworking.com
244
+
245
+ 2009-08-21 16:52 donncha
246
+
247
+ * wp-cache.php: Minor fixes for rewrite rules.
248
+ http://wordpress.org/support/topic/301570?replies=14
249
+
250
+ 2009-08-19 08:44 donncha
251
+
252
+ * readme.txt: Added troubleshooting note to use half-on mode if
253
+ timestamp keeps updating.
254
+
255
+ 2009-08-06 10:55 donncha
256
+
257
+ * wp-cache-phase2.php, wp-cache.php: Added "Cached Page" counter.
258
+
259
+ 2009-07-30 08:24 donncha
260
+
261
+ * wp-cache-phase2.php, wp-cache.php: Add support for not caching
262
+ feeds and search pages.
263
+
264
+ 2009-07-29 17:28 donncha
265
+
266
+ * Changelog.txt: Updated changelog
267
+
268
  2009-07-29 17:26 donncha
269
 
270
  * readme.txt, wp-cache.php: Bump version to 0.9.6.1
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === WP Super Cache ===
2
  Contributors: donncha
3
  Tags: performance,caching,wp-cache,wp-super-cache,cache
4
- Tested up to: 2.8.2
5
- Stable tag: 0.9.6.1
6
  Requires at least: 2.6
7
- Donate link: http://ocaoimh.ie/wordpress-plugins/gifts-and-donations/
8
 
9
  A very fast caching engine for WordPress that produces static html files.
10
 
@@ -28,6 +28,23 @@ The [changelog](http://svn.wp-plugins.org/wp-super-cache/trunk/Changelog.txt) is
28
 
29
  == Changelog ==
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  = 0.9.6.1 =
32
  * Move "not logged in" message init below check for POST.
33
  * Add is_admin() check so plugin definitely can't cache the backend.
@@ -151,7 +168,8 @@ To manually uninstall:
151
 
152
  = How do I know my blog is being cached? =
153
 
154
- View the source of any page on your site. When a page is first created, you'll see the text "Dynamic page generated in XXXX seconds." and "Cached page generated by WP-Super-Cache on YYYY-MM-DD HH:MM:SS" at the end of the source code. On reload, a cached page will show the same timestamp so wait a few seconds before checking. If you have compression enabled, the text "Compression = gzip" will be added. If compression is disabled and the page is served as a static html file, the text "super cache" will be added. The only other way to check if your cached file was served by PHP script or from the static cache is by looking at the HTTP headers. WP-Cache (PHP) cached pages will have the header "WP-Super-Cache: WP-Cache". I used the <a href="https://addons.mozilla.org/en-US/firefox/addon/3829">Live HTTP Headers</a> extension for Firefox to examine the headers. You should also check your cache directory in wp-content/cache/supercache/hostname/ for static cache files.
 
155
 
156
  = Why is WP-Super-Cache better than WP-Cache? =
157
 
@@ -165,9 +183,27 @@ Comments will show as soon as they are moderated, depending on the comment polic
165
 
166
  No, it will do the opposite in fact. Super Cache files are compressed and stored that way so the heavy compression is done only once. These files are generally much smaller and are sent to a visitor's browser much more quickly than uncompressed html. As a result, your server spends less time talking over the network which saves CPU time and bandwidth, and can also serve the next request much more quickly.
167
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  = Why doesn't WP UserOnline, Popularity Contest, WP Postratings or plugin X not work or update on my blog now? =
169
 
170
- This plugin caches entire pages and some plugins think they can run PHP code every time a page loads. To fix this, the plugin needs to use Javascript or AJAX methods to update. If the plugin displays information on the page, that must be a Javascript request too.
171
 
172
  = Why doesn't the plugin cache requests by search engine bots by default? =
173
 
@@ -186,6 +222,15 @@ A tiny proportion of websites will have problems with the following configuratio
186
 
187
  Sometimes a category page is cached as the homepage of the site instead of the static page. I can't [replicate the problem](http://wordpress.org/support/topic/237415/page/2?replies=38) but a simple solution is to switch the plugin to half-on mode. For normal traffic you will see no difference in the speed of your site.
188
 
 
 
 
 
 
 
 
 
 
189
  = Troubleshooting =
190
 
191
  If things don't work when you installed the plugin here are a few things to check:
@@ -213,6 +258,7 @@ If things don't work when you installed the plugin here are a few things to chec
213
  A line like "127.0.0.1 localhost localhost.localdomain" is ok.
214
  17. If old pages are being served to your visitors via the supercache, you may be missing Apache modules (or their equivalents if you don't use Apache). 3 modules are required: mod_mime, mod_headers and mod_expires. The last two are especially important for making sure browsers load new versions of existing pages on your site.
215
  18. The error message, "WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed!" appears at the end of every page. Open the file wp-content/advanced-cache.php in your favourite editor. Is the path to wp-cache-phase1.php correct? If it is not the caching engine will not load.
 
216
 
217
  == Custom Caching ==
218
  It is now possible to hook into the caching process using the add_cacheaction() function.
1
  === WP Super Cache ===
2
  Contributors: donncha
3
  Tags: performance,caching,wp-cache,wp-super-cache,cache
4
+ Tested up to: 2.8.4
5
+ Stable tag: 0.9.7
6
  Requires at least: 2.6
7
+ Donate link: http://ocaoimh.ie/gad/
8
 
9
  A very fast caching engine for WordPress that produces static html files.
10
 
28
 
29
  == Changelog ==
30
 
31
+ = 0.9.7 =
32
+ * Fixed problem with blogs in folders.
33
+ * Added cache file listing and delete links to admin page.
34
+ * Added "Newest Cached Pages" listing in sidebox.
35
+ * Made admin page translatable.
36
+ * Added "How do I make certain parts of the page stay dynamic?" to FAQ.
37
+ * Advanced: added "late init" feature so that plugin activates on "init". Set $wp_super_cache_late_init to true in config file to use.
38
+ * Disable supercaching when GET parameters present instead of disabling all caching. Disable on POST (as normal) and preview.
39
+ * Fixed problem with cron job and mutex filename.
40
+ * Warn users they must enable mobile device support if rewrite rules detected. Better detection of when to warn that .htaccess rules must be updated (no need when rewrite rules not present)
41
+ * Advanced: Added "wpsupercache_404" filter. Return true to cache 404 error pages.
42
+ * Use the wordpress_test_cookie in the cache key.
43
+ * Show correct number of cache files when compression off.
44
+ * Fixed problem with PHP safe_mode detection.
45
+ * Various bugfixes and documentation updates. See Changelog.txt
46
+
47
+
48
  = 0.9.6.1 =
49
  * Move "not logged in" message init below check for POST.
50
  * Add is_admin() check so plugin definitely can't cache the backend.
168
 
169
  = How do I know my blog is being cached? =
170
 
171
+ View the source of any page on your site. When a page is first created, you'll see the text "Dynamic page generated in XXXX seconds." and "Cached page generated by WP-Super-Cache on YYYY-MM-DD HH:MM:SS" at the end of the source code. On reload, a cached page will show the same timestamp so wait a few seconds before checking.
172
+ In "HALF-ON" mode, if you have compression enabled, the text "Compression = gzip" will be added. If compression is disabled and the page is served as a static html file, the text "super cache" will be added. The only other way to check if your cached file was served by PHP script or from the static cache is by looking at the HTTP headers. WP-Cache (PHP) cached pages will have the header "WP-Super-Cache: WP-Cache". I used the <a href="https://addons.mozilla.org/en-US/firefox/addon/3829">Live HTTP Headers</a> extension for Firefox to examine the headers. You should also check your cache directory in wp-content/cache/supercache/hostname/ for static cache files.
173
 
174
  = Why is WP-Super-Cache better than WP-Cache? =
175
 
183
 
184
  No, it will do the opposite in fact. Super Cache files are compressed and stored that way so the heavy compression is done only once. These files are generally much smaller and are sent to a visitor's browser much more quickly than uncompressed html. As a result, your server spends less time talking over the network which saves CPU time and bandwidth, and can also serve the next request much more quickly.
185
 
186
+ = How do I make certain parts of the page stay dynamic? =
187
+
188
+ WP Super Cache retains the dynamic loading code of WP Cache but only works in "half on" mode.
189
+
190
+ There are two ways to do this, you can have functions that stay dynamic or you can include other files on every page load. To have a dynamic function in the cached PHP page use this syntax around the function:
191
+
192
+ `<!--mfunc function_name( 'parameter', 'another_parameter' ) -->
193
+ <?php function_name( 'parameter', 'another_parameter' ) ?>
194
+ <!--/mfunc-->`
195
+
196
+ The HTML comments around the mirrored PHP allow it to be executed in the static page. To include another file try this:
197
+
198
+ `<!--mclude file.php-->
199
+ <?php include_once( ABSPATH . 'file.php' ); ?>
200
+ <!--/mclude-->`
201
+
202
+ That will include file.php under the ABSPATH directory, which is the same as where your wp-config.php file is located.
203
+
204
  = Why doesn't WP UserOnline, Popularity Contest, WP Postratings or plugin X not work or update on my blog now? =
205
 
206
+ This plugin caches entire pages but some plugins think they can run PHP code every time a page loads. To fix this, the plugin needs to use Javascript/AJAX methods or the mfunc/mclude code described in the previous answer to update or display dynamic information.
207
 
208
  = Why doesn't the plugin cache requests by search engine bots by default? =
209
 
222
 
223
  Sometimes a category page is cached as the homepage of the site instead of the static page. I can't [replicate the problem](http://wordpress.org/support/topic/237415/page/2?replies=38) but a simple solution is to switch the plugin to half-on mode. For normal traffic you will see no difference in the speed of your site.
224
 
225
+ = Why do I get warnings about caching from http://ismyblogworking.com/ =
226
+
227
+ "Your blog doesn't support client caching (no 304 response to If-modified-since)."
228
+ "Your feed doesn't support caching (no 304 response to If-modified-since)"
229
+
230
+ Supercache doesn't support 304 header checks. This is caching done by your browser, not your server. It is a check your browser does to ask the server if an updated version of the current page is available. If not, it doesn't download the old version again.
231
+ The page is still cached by your server, just not by the browsers of your visitors. WordPress doesn't support 304 caching either so you're not losing out.
232
+ Try the Cacheability Engine at http://www.ircache.net/cgi-bin/cacheability.py or http://redbot.org/ for further analysis.
233
+
234
  = Troubleshooting =
235
 
236
  If things don't work when you installed the plugin here are a few things to check:
258
  A line like "127.0.0.1 localhost localhost.localdomain" is ok.
259
  17. If old pages are being served to your visitors via the supercache, you may be missing Apache modules (or their equivalents if you don't use Apache). 3 modules are required: mod_mime, mod_headers and mod_expires. The last two are especially important for making sure browsers load new versions of existing pages on your site.
260
  18. The error message, "WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed!" appears at the end of every page. Open the file wp-content/advanced-cache.php in your favourite editor. Is the path to wp-cache-phase1.php correct? If it is not the caching engine will not load.
261
+ 19. Caching doesn't work. The timestamp on my blog keeps changing when I reload. Check that the path in your .htaccess rules matches where the supercache directory is. You may have to hardcode it. Or use the plugin in Half-On mode.
262
 
263
  == Custom Caching ==
264
  It is now possible to hook into the caching process using the add_cacheaction() function.
wp-cache-config-sample.php CHANGED
@@ -42,13 +42,10 @@ if( defined( 'VHOST' ) ) {
42
  $cache_acceptable_files = array( 'wp-comments-popup.php', 'wp-links-opml.php', 'wp-locations.php' );
43
 
44
  $cache_rejected_uri = array('wp-.*\\.php', 'index\\.php');
45
- $cache_rejected_user_agent = array ( 0 => 'bot', 1 => 'ia_archive', 2 => 'slurp', 3 => 'crawl', 4 => 'spider');
46
 
47
  $cache_rebuild_files = 1;
48
 
49
- // DEBUG mode. Change this to your email address to be sent debug emails.
50
- // Remove comment (//) to enable and add back to disable.
51
- //$wp_cache_debug = "you@example.com";
52
 
53
  // Disable the file locking system.
54
  // If you are experiencing problems with clearing or creating cache files
@@ -72,4 +69,5 @@ $wp_cache_gzip_first = 0;
72
  $wp_cache_plugins_dir = WPCACHEHOME . 'plugins';
73
  // set to 1 to do garbage collection during normal process shutdown instead of wp-cron
74
  $wp_cache_shutdown_gc = 0;
 
75
  ?>
42
  $cache_acceptable_files = array( 'wp-comments-popup.php', 'wp-links-opml.php', 'wp-locations.php' );
43
 
44
  $cache_rejected_uri = array('wp-.*\\.php', 'index\\.php');
45
+ $cache_rejected_user_agent = array ( 0 => 'bot', 1 => 'ia_archive', 2 => 'slurp', 3 => 'crawl', 4 => 'spider', 5 => 'Yandex' );
46
 
47
  $cache_rebuild_files = 1;
48
 
 
 
 
49
 
50
  // Disable the file locking system.
51
  // If you are experiencing problems with clearing or creating cache files
69
  $wp_cache_plugins_dir = WPCACHEHOME . 'plugins';
70
  // set to 1 to do garbage collection during normal process shutdown instead of wp-cron
71
  $wp_cache_shutdown_gc = 0;
72
+ $wp_super_cache_late_init = 0;
73
  ?>
wp-cache-phase1.php CHANGED
@@ -16,11 +16,6 @@ if( $blogcacheid != '' ) {
16
  $blog_cache_dir = $cache_path;
17
  }
18
 
19
- if(defined('DOING_CRON')) {
20
- require_once( WPCACHEHOME . 'wp-cache-phase2.php');
21
- return true;
22
- }
23
-
24
  $mutex_filename = 'wp_cache_mutex.lock';
25
  $new_cache = false;
26
 
@@ -28,6 +23,9 @@ $new_cache = false;
28
 
29
  if( !isset( $wp_cache_plugins_dir ) )
30
  $wp_cache_plugins_dir = WPCACHEHOME . 'plugins';
 
 
 
31
  $plugins = glob( $wp_cache_plugins_dir . '/*.php' );
32
  if( is_array( $plugins ) ) {
33
  foreach ( $plugins as $plugin ) {
@@ -63,8 +61,6 @@ add_cacheaction( 'wp_cache_get_cookies_values', 'wp_cache_check_mobile' );
63
 
64
  $wp_cache_request_uri = $_SERVER[ 'REQUEST_URI' ]; // Cache this in case any plugin modifies it.
65
 
66
- $key = $blogcacheid . md5( do_cacheaction( 'wp_cache_key', $_SERVER['HTTP_HOST'].preg_replace('/#.*$/', '', str_replace( '/index.php', '/', $wp_cache_request_uri ) ).$wp_cache_gzip_encoding.wp_cache_get_cookies_values() ) );
67
-
68
  if( false == @is_dir( $blog_cache_dir ) ) {
69
  @mkdir( $cache_path . "blogs" );
70
  @mkdir( $blog_cache_dir );
@@ -74,55 +70,103 @@ if( false == @is_dir( $blog_cache_dir . 'meta' ) )
74
  @mkdir( $blog_cache_dir . 'meta' );
75
 
76
 
77
- $cache_filename = $file_prefix . $key . '.html';
78
- $meta_file = $file_prefix . $key . '.meta';
79
- $cache_file = realpath( $blog_cache_dir . $cache_filename );
80
- $meta_pathname = realpath( $blog_cache_dir . 'meta/' . $meta_file );
81
-
82
  $wp_start_time = microtime();
83
- if( file_exists( $cache_file ) && !wp_cache_user_agent_is_rejected() ) {
84
- if (! ($meta = unserialize(@file_get_contents($meta_pathname))) )
85
- return true;
86
- if( is_array( $meta ) == false ) {
87
- @unlink( $meta_pathname );
88
- @unlink( $cache_file );
89
- return true;
90
- }
91
- $cache_file = do_cacheaction( 'wp_cache_served_cache_file', $cache_file );
92
- // Sometimes the gzip headers are lost. If this is a gzip capable client, send those headers.
93
- if( $wp_cache_gzip_encoding && !in_array( 'Content-Encoding: ' . $wp_cache_gzip_encoding, $meta[ 'headers' ] ) ) {
94
- $meta[ 'headers' ][ 'Content-Encoding' ] = 'Content-Encoding: ' . $wp_cache_gzip_encoding;
95
- $meta[ 'headers' ][ 'Vary' ] = 'Vary: Accept-Encoding, Cookie';
96
- wp_cache_debug( "Had to add gzip headers to the page {$_SERVER[ 'REQUEST_URI' ]}." );
97
- }
98
- foreach ($meta[ 'headers' ] as $t => $header) {
99
- // godaddy fix, via http://blog.gneu.org/2008/05/wp-supercache-on-godaddy/ and http://www.littleredrails.com/blog/2007/09/08/using-wp-cache-on-godaddy-500-error/
100
- if( strpos( $header, 'Last-Modified:' ) === false )
101
- header($header);
102
- }
103
- header( 'WP-Super-Cache: WP-Cache' );
104
- if ( $meta[ 'dynamic' ] ) {
105
- include($cache_file);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  } else {
107
- readfile( $cache_file );
108
  }
109
- die();
 
 
 
 
 
 
 
 
110
  }
111
 
112
  function wp_cache_postload() {
113
- global $cache_enabled;
114
 
115
  if ( !$cache_enabled || isset( $_GET[ 'preview' ] ) )
116
  return true;
117
- require_once( WPCACHEHOME . 'wp-cache-phase2.php');
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  wp_cache_phase2();
119
  }
120
 
121
  function wp_cache_get_cookies_values() {
122
  $string = '';
123
  while ($key = key($_COOKIE)) {
124
- if ( preg_match( "/^wp-postpass|^wordpress|^comment_author_/", $key ) && $_COOKIE[ $key ] != 'WP Cookie check' ) {
125
- $string .= $_COOKIE[$key] . ",";
 
126
  }
127
  next($_COOKIE);
128
  }
@@ -162,6 +206,7 @@ function wp_cache_check_mobile( $cache_key ) {
162
  $whitelist = explode( ',', $wp_cache_mobile_whitelist );
163
  foreach ($whitelist as $browser) {
164
  if (strstr($_SERVER["HTTP_USER_AGENT"], trim($browser))) {
 
165
  return $cache_key;
166
  }
167
  }
@@ -169,18 +214,38 @@ function wp_cache_check_mobile( $cache_key ) {
169
  $browsers = explode( ',', $wp_cache_mobile_browsers );
170
  foreach ($browsers as $browser) {
171
  if (strstr($_SERVER["HTTP_USER_AGENT"], trim( $browser ))) {
 
172
  return $cache_key . $browser;
173
  }
174
  }
175
  return $cache_key;
176
  }
177
 
178
- function wp_cache_debug( $message ) {
179
- global $wp_cache_debug;
180
- if( !isset( $wp_cache_debug ) )
181
- return;
182
- $message .= "\n\nDisable these emails by commenting out or deleting the line containing\n\$wp_cache_debug in wp-content/wp-cache-config.php on your server.\n";
183
- mail( $wp_cache_debug, '[' . addslashes( $_SERVER[ 'HTTP_HOST' ] ) . "] WP Super Cache Debug", $message );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
  }
185
 
186
  function wp_cache_user_agent_is_rejected() {
16
  $blog_cache_dir = $cache_path;
17
  }
18
 
 
 
 
 
 
19
  $mutex_filename = 'wp_cache_mutex.lock';
20
  $new_cache = false;
21
 
23
 
24
  if( !isset( $wp_cache_plugins_dir ) )
25
  $wp_cache_plugins_dir = WPCACHEHOME . 'plugins';
26
+
27
+ require_once( WPCACHEHOME . 'wp-cache-phase2.php');
28
+
29
  $plugins = glob( $wp_cache_plugins_dir . '/*.php' );
30
  if( is_array( $plugins ) ) {
31
  foreach ( $plugins as $plugin ) {
61
 
62
  $wp_cache_request_uri = $_SERVER[ 'REQUEST_URI' ]; // Cache this in case any plugin modifies it.
63
 
 
 
64
  if( false == @is_dir( $blog_cache_dir ) ) {
65
  @mkdir( $cache_path . "blogs" );
66
  @mkdir( $blog_cache_dir );
70
  @mkdir( $blog_cache_dir . 'meta' );
71
 
72
 
 
 
 
 
 
73
  $wp_start_time = microtime();
74
+
75
+ function wp_super_cache_init() {
76
+ global $wp_cache_key, $key, $blogcacheid, $wp_cache_request_uri, $file_prefix, $blog_cache_dir, $meta_file, $cache_file, $cache_filename, $wp_super_cache_debug, $meta_pathname, $wp_cache_gzip_encoding, $meta;
77
+
78
+ $wp_cache_key = do_cacheaction( 'wp_cache_key', $_SERVER['HTTP_HOST'].preg_replace('/#.*$/', '', str_replace( '/index.php', '/', $wp_cache_request_uri ) ).$wp_cache_gzip_encoding.wp_cache_get_cookies_values() );
79
+ $key = $blogcacheid . md5( $wp_cache_key );
80
+ $wp_cache_key = $blogcacheid . $wp_cache_key;
81
+
82
+ $cache_filename = $file_prefix . $key . '.html';
83
+ $meta_file = $file_prefix . $key . '.meta';
84
+ $cache_file = realpath( $blog_cache_dir . $cache_filename );
85
+ $meta_pathname = realpath( $blog_cache_dir . 'meta/' . $meta_file );
86
+ return compact( 'key', 'cache_filename', 'meta_file', 'cache_file', 'meta_pathname' );
87
+ }
88
+
89
+ function wp_cache_serve_cache_file() {
90
+ global $key, $blogcacheid, $wp_cache_request_uri, $file_prefix, $blog_cache_dir, $meta_file, $cache_file, $cache_filename, $wp_super_cache_debug, $meta_pathname, $wp_cache_gzip_encoding, $meta;
91
+
92
+ extract( wp_super_cache_init() );
93
+
94
+ if ( file_exists( $cache_file ) && !wp_cache_user_agent_is_rejected() ) {
95
+ if ( isset( $wp_super_cache_debug ) && $wp_super_cache_debug ) wp_cache_debug( "wp-cache file exists", 5 );
96
+ if ( !( $meta = unserialize( @file_get_contents( $meta_pathname) ) ) ) {
97
+ if ( isset( $wp_super_cache_debug ) && $wp_super_cache_debug ) wp_cache_debug( "couldn't load wp-cache meta file", 5 );
98
+ return true;
99
+ }
100
+ if ( is_array( $meta ) == false ) {
101
+ if ( isset( $wp_super_cache_debug ) && $wp_super_cache_debug ) wp_cache_debug( "meta array corrupt, deleting $meta_pathname and $cache_file", 1 );
102
+ @unlink( $meta_pathname );
103
+ @unlink( $cache_file );
104
+ return true;
105
+ }
106
+ $cache_file = do_cacheaction( 'wp_cache_served_cache_file', $cache_file );
107
+ // Sometimes the gzip headers are lost. If this is a gzip capable client, send those headers.
108
+ if( $wp_cache_gzip_encoding && !in_array( 'Content-Encoding: ' . $wp_cache_gzip_encoding, $meta[ 'headers' ] ) ) {
109
+ $meta[ 'headers' ][ 'Content-Encoding' ] = 'Content-Encoding: ' . $wp_cache_gzip_encoding;
110
+ $meta[ 'headers' ][ 'Vary' ] = 'Vary: Accept-Encoding, Cookie';
111
+ if ( isset( $wp_super_cache_debug ) && $wp_super_cache_debug ) wp_cache_debug( "added gzip headers before serving.", 1 );
112
+ }
113
+ foreach ($meta[ 'headers' ] as $t => $header) {
114
+ // godaddy fix, via http://blog.gneu.org/2008/05/wp-supercache-on-godaddy/ and http://www.littleredrails.com/blog/2007/09/08/using-wp-cache-on-godaddy-500-error/
115
+ if( strpos( $header, 'Last-Modified:' ) === false )
116
+ header($header);
117
+ }
118
+ header( 'WP-Super-Cache: WP-Cache' );
119
+ if ( $meta[ 'dynamic' ] ) {
120
+ if ( isset( $wp_super_cache_debug ) && $wp_super_cache_debug ) wp_cache_debug( "Serving wp-cache dynamic file", 5 );
121
+ include($cache_file);
122
+ } else {
123
+ if ( isset( $wp_super_cache_debug ) && $wp_super_cache_debug ) wp_cache_debug( "Serving wp-cache static file", 5 );
124
+ readfile( $cache_file );
125
+ }
126
+ if ( isset( $wp_super_cache_debug ) && $wp_super_cache_debug ) wp_cache_debug( "exit request", 5 );
127
+ die();
128
  } else {
129
+ if ( isset( $wp_super_cache_debug ) && $wp_super_cache_debug ) wp_cache_debug( "No wp-cache file exists or user agent rejected.", 5 );
130
  }
131
+ }
132
+
133
+ if(defined('DOING_CRON')) {
134
+ extract( wp_super_cache_init() );
135
+ return true;
136
+ }
137
+
138
+ if ( !isset( $wp_super_cache_late_init ) || ( isset( $wp_super_cache_late_init ) && false == $wp_super_cache_late_init ) ) {
139
+ wp_cache_serve_cache_file();
140
  }
141
 
142
  function wp_cache_postload() {
143
+ global $cache_enabled, $wp_super_cache_late_init, $wp_super_cache_debug;
144
 
145
  if ( !$cache_enabled || isset( $_GET[ 'preview' ] ) )
146
  return true;
147
+
148
+ if ( isset( $wp_super_cache_late_init ) && true == $wp_super_cache_late_init ) {
149
+ if ( isset( $wp_super_cache_debug ) && $wp_super_cache_debug ) wp_cache_debug( "Supercache Late Init: add wp_cache_serve_cache_file to init", 3 );
150
+ add_action( 'init', 'wp_cache_late_loader', 9999 );
151
+ } else {
152
+ wp_super_cache_init();
153
+ wp_cache_phase2();
154
+ }
155
+ }
156
+
157
+ function wp_cache_late_loader() {
158
+ global $wp_super_cache_debug;
159
+ if ( isset( $wp_super_cache_debug ) && $wp_super_cache_debug ) wp_cache_debug( "Supercache Late Loader running on init", 3 );
160
+ wp_cache_serve_cache_file();
161
  wp_cache_phase2();
162
  }
163
 
164
  function wp_cache_get_cookies_values() {
165
  $string = '';
166
  while ($key = key($_COOKIE)) {
167
+ if ( preg_match( "/^wp-postpass|^wordpress|^comment_author_/", $key ) ) {
168
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Cookie detected: $key", 5 );
169
+ $string .= $_COOKIE[ $key ] . ",";
170
  }
171
  next($_COOKIE);
172
  }
206
  $whitelist = explode( ',', $wp_cache_mobile_whitelist );
207
  foreach ($whitelist as $browser) {
208
  if (strstr($_SERVER["HTTP_USER_AGENT"], trim($browser))) {
209
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "whitelst mobile browser detected: " . $_SERVER[ "HTTP_USER_AGENT" ], 5 );
210
  return $cache_key;
211
  }
212
  }
214
  $browsers = explode( ',', $wp_cache_mobile_browsers );
215
  foreach ($browsers as $browser) {
216
  if (strstr($_SERVER["HTTP_USER_AGENT"], trim( $browser ))) {
217
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "mobile browser detected: " . $_SERVER[ "HTTP_USER_AGENT" ], 5 );
218
  return $cache_key . $browser;
219
  }
220
  }
221
  return $cache_key;
222
  }
223
 
224
+ function wp_cache_debug( $message, $level = 1 ) {
225
+ global $wp_cache_debug_level, $wp_cache_debug_log, $wp_cache_debug_email, $cache_path, $wp_cache_debug_ip, $wp_super_cache_debug;
226
+
227
+ if ( isset( $wp_super_cache_debug ) && $wp_super_cache_debug == false )
228
+ return false;
229
+
230
+ if ( isset( $wp_cache_debug_email ) == false && isset( $wp_cache_debug_log ) == false )
231
+ return false;
232
+
233
+ if ( isset( $wp_cache_debug_level ) == false )
234
+ $wp_cache_debug_level = 1;
235
+ if ( $wp_cache_debug_level < $level )
236
+ return false;
237
+
238
+ if ( isset( $wp_cache_debug_ip ) && $wp_cache_debug_ip != '' && $wp_cache_debug_ip != $_SERVER[ 'REMOTE_ADDR' ] )
239
+ return false;
240
+
241
+ if ( isset( $wp_cache_debug_log ) && $wp_cache_debug_log != '' ) {
242
+ error_log( date( 'H:i:s' ) . " " . $_SERVER[ 'REQUEST_URI' ] . " " . $message . "\n", 3, $cache_path . str_replace( '/', '', str_replace( '..', '', $wp_cache_debug_log ) ) );
243
+ }
244
+
245
+ if ( isset( $wp_cache_debug_email ) && $wp_cache_debug_email != '' ) {
246
+ $message .= "\n\nDisable these emails by commenting out or deleting the line containing\n\$wp_cache_debug_email in wp-content/wp-cache-config.php on your server.\n";
247
+ mail( $wp_cache_debug_email, '[' . addslashes( $_SERVER[ 'HTTP_HOST' ] ) . "] WP Super Cache Debug", $message );
248
+ }
249
  }
250
 
251
  function wp_cache_user_agent_is_rejected() {
wp-cache-phase2.php CHANGED
@@ -2,13 +2,15 @@
2
 
3
  function wp_cache_phase2() {
4
  global $cache_filename, $cache_acceptable_files, $wp_cache_gzip_encoding, $super_cache_enabled, $cache_rebuild_files, $wp_cache_gmt_offset, $wp_cache_blog_charset, $wp_cache_last_gc;
5
- global $cache_max_time, $wp_cache_not_logged_in, $wp_cache_request_uri;
 
6
 
7
  $wp_cache_gmt_offset = get_option( 'gmt_offset' ); // caching for later use when wpdb is gone. http://wordpress.org/support/topic/224349
8
  $wp_cache_blog_charset = get_option( 'blog_charset' );
9
 
10
  wp_cache_mutex_init();
11
  if(function_exists('add_action') && ( !defined( 'WPLOCKDOWN' ) || ( defined( 'WPLOCKDOWN' ) && constant( 'WPLOCKDOWN' ) == '0' ) ) ) {
 
12
  // Post ID is received
13
  add_action('publish_post', 'wp_cache_post_edit', 0);
14
  add_action('edit_post', 'wp_cache_post_change', 0); // leaving a comment called edit_post
@@ -30,23 +32,47 @@ function wp_cache_phase2() {
30
  do_cacheaction( 'add_cacheaction' );
31
  }
32
 
33
- if( $_SERVER["REQUEST_METHOD"] == 'POST' || !empty( $_POST ) || get_option('gzipcompression'))
 
34
  return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
  if ( $wp_cache_not_logged_in && is_user_logged_in() && !is_feed() && !is_admin() ) {
 
37
  register_shutdown_function( 'wpcache_logged_in_message' );
38
  return false;
39
  }
40
 
41
  $script = basename($_SERVER['PHP_SELF']);
42
- if (!in_array($script, $cache_acceptable_files) && wp_cache_is_rejected($wp_cache_request_uri))
 
43
  return false;
44
- if (wp_cache_user_agent_is_rejected()) return;
 
 
 
 
45
  if($wp_cache_gzip_encoding)
46
  header('Vary: Accept-Encoding, Cookie');
47
  else
48
  header('Vary: Cookie');
49
  ob_start( 'wp_cache_ob_callback' );
 
50
 
51
  // restore old supercache file temporarily
52
  if( $super_cache_enabled && $cache_rebuild_files ) {
@@ -60,10 +86,12 @@ function wp_cache_phase2() {
60
  continue;
61
  $mtime = @filemtime($cache_file . '.needs-rebuild');
62
  if( $mtime && (time() - $mtime) < 30 ) {
 
63
  @rename( $cache_file . '.needs-rebuild', $cache_file );
64
  }
65
  // cleanup old files or if rename fails
66
  if( @file_exists( $cache_file . '.needs-rebuild' ) ) {
 
67
  @unlink( $cache_file . '.needs-rebuild' );
68
  }
69
  }
@@ -83,7 +111,10 @@ function wp_cache_phase2() {
83
 
84
  global $wp_cache_shutdown_gc;
85
  if( !isset( $wp_cache_shutdown_gc ) || $wp_cache_shutdown_gc == 0 ) {
86
- if(!wp_next_scheduled('wp_cache_gc')) wp_schedule_single_event(time() + 10 , 'wp_cache_gc');
 
 
 
87
  } else {
88
  global $time_to_gc_cache;
89
  $time_to_gc_cache = 1; // tell the "shutdown gc" to run!
@@ -142,7 +173,10 @@ function wp_cache_is_rejected($uri) {
142
  }
143
 
144
  function wp_cache_mutex_init() {
145
- global $use_flock, $mutex, $cache_path, $mutex_filename, $sem_id, $blog_cache_dir;
 
 
 
146
 
147
  if(!is_bool($use_flock)) {
148
  if(function_exists('sem_get'))
@@ -152,10 +186,13 @@ function wp_cache_mutex_init() {
152
  }
153
 
154
  $mutex = false;
155
- if ($use_flock)
 
156
  $mutex = @fopen($blog_cache_dir . $mutex_filename, 'w');
157
- else
 
158
  $mutex = @sem_get($sem_id, 1, 0644 | IPC_CREAT, 1);
 
159
  }
160
 
161
  function wp_cache_writers_entry() {
@@ -164,13 +201,18 @@ function wp_cache_writers_entry() {
164
  if( isset( $wp_cache_mutex_disabled ) && $wp_cache_mutex_disabled )
165
  return true;
166
 
167
- if( !$mutex )
 
168
  return false;
 
169
 
170
- if ($use_flock)
 
171
  flock($mutex, LOCK_EX);
172
- else
 
173
  sem_acquire($mutex);
 
174
 
175
  return true;
176
  }
@@ -181,13 +223,18 @@ function wp_cache_writers_exit() {
181
  if( isset( $wp_cache_mutex_disabled ) && $wp_cache_mutex_disabled )
182
  return true;
183
 
184
- if( !$mutex )
 
185
  return false;
 
186
 
187
- if ($use_flock)
 
188
  flock($mutex, LOCK_UN);
189
- else
 
190
  sem_release($mutex);
 
191
  }
192
 
193
  function get_current_url_supercache_dir() {
@@ -201,6 +248,7 @@ function get_current_url_supercache_dir() {
201
  $dir = trailingslashit( ABSPATH . $uri );
202
  }
203
  $dir = str_replace( '//', '/', $dir );
 
204
  return $dir;
205
  }
206
 
@@ -208,6 +256,7 @@ function wp_cache_ob_callback( $buffer ) {
208
  global $wp_cache_pages;
209
  if( defined( 'DONOTCACHEPAGE' ) )
210
  return $buffer;
 
211
 
212
  if ( isset( $wp_cache_pages[ 'single' ] ) && $wp_cache_pages[ 'single' ] == 1 && is_single() ) {
213
  return $buffer;
@@ -223,6 +272,10 @@ function wp_cache_ob_callback( $buffer ) {
223
  return $buffer;
224
  } elseif ( isset( $wp_cache_pages[ 'home' ] ) && $wp_cache_pages[ 'home' ] == 1 && is_home() ) {
225
  return $buffer;
 
 
 
 
226
  }
227
  $buffer = &wp_cache_get_ob( $buffer );
228
  wp_cache_shutdown_callback();
@@ -235,22 +288,39 @@ function wp_cache_get_ob(&$buffer) {
235
  global $new_cache, $wp_cache_meta, $file_expired, $blog_id, $cache_compression;
236
  global $wp_cache_gzip_encoding, $super_cache_enabled, $cached_direct_pages;
237
  global $wp_cache_404, $gzsize, $supercacheonly, $wp_cache_gzip_first, $wp_cache_gmt_offset;
238
- global $blog_cache_dir, $wp_cache_request_uri;
239
 
240
  $new_cache = true;
241
  $wp_cache_meta = '';
242
 
243
  /* Mode paranoic, check for closing tags
244
  * we avoid caching incomplete files */
245
- if( $wp_cache_404 ) {
246
  $new_cache = false;
247
- $buffer .= "\n<!-- Page not cached by WP Super Cache. 404. -->\n";
 
 
 
 
 
 
 
 
 
 
 
248
  }
249
 
250
  if (!preg_match('/(<\/html>|<\/rss>|<\/feed>)/i',$buffer) ) {
251
  $new_cache = false;
252
- if( false === strpos( $_SERVER[ 'REQUEST_URI' ], 'robots.txt' ) )
253
- $buffer .= "\n<!-- Page not cached by WP Super Cache. No closing HTML tag. Check your theme. -->\n";
 
 
 
 
 
 
254
  }
255
 
256
  if( !$new_cache )
@@ -262,25 +332,31 @@ function wp_cache_get_ob(&$buffer) {
262
 
263
  if( !wp_cache_writers_entry() ) {
264
  $buffer .= "\n<!-- Page not cached by WP Super Cache. Could not get mutex lock. -->\n";
 
265
  return $buffer;
266
  }
267
 
268
  $dir = get_current_url_supercache_dir();
269
  $supercachedir = $cache_path . 'supercache/' . preg_replace('/:.*$/', '', $_SERVER["HTTP_HOST"]);
270
- if( !empty( $_GET ) || is_feed() || ( $super_cache_enabled == true && is_dir( substr( $supercachedir, 0, -1 ) . '.disabled' ) ) )
 
271
  $super_cache_enabled = false;
 
272
 
273
  $tmp_wpcache_filename = $cache_path . uniqid( mt_rand(), true ) . '.tmp';
274
 
275
  // Don't create wp-cache files for anon users
276
  $supercacheonly = false;
277
- if( $super_cache_enabled && wp_cache_get_cookies_values() == '' )
 
278
  $supercacheonly = true;
 
279
 
280
  if( !$supercacheonly ) {
281
  if ( !@file_exists( $blog_cache_dir . $cache_filename ) || ( @file_exists( $blog_cache_dir . $cache_filename ) && ( time() - @filemtime( $blog_cache_dir . $cache_filename ) ) > 5 ) ) {
282
  $fr = @fopen($tmp_wpcache_filename, 'w');
283
  if (!$fr) {
 
284
  $buffer .= "<!-- File not cached! Super Cache Couldn't write to: " . str_replace( ABSPATH, '', $cache_path ) . $cache_filename . " -->\n";
285
  return $buffer;
286
  }
@@ -299,6 +375,7 @@ function wp_cache_get_ob(&$buffer) {
299
  if ( !@file_exists( $cache_fname ) || ( @file_exists( $cache_fname ) && ( time() - @filemtime( $cache_fname ) ) > 5 ) ) {
300
  $fr2 = @fopen( $tmp_cache_filename, 'w' );
301
  if (!$fr2) {
 
302
  $buffer .= "<!-- File not cached! Super Cache Couldn't write to: " . str_replace( ABSPATH, '', $tmp_cache_filename ) . " -->\n";
303
  @fclose( $fr );
304
  @unlink( $tmp_wpcache_filename );
@@ -306,6 +383,7 @@ function wp_cache_get_ob(&$buffer) {
306
  } elseif( $cache_compression ) {
307
  $gz = @fopen( $tmp_cache_filename . ".gz", 'w');
308
  if (!$gz) {
 
309
  $buffer .= "<!-- File not cached! Super Cache Couldn't write to: " . str_replace( ABSPATH, '', $tmp_cache_filename ) . ".gz -->\n";
310
  @fclose( $fr );
311
  @unlink( $tmp_wpcache_filename );
@@ -319,6 +397,7 @@ function wp_cache_get_ob(&$buffer) {
319
  }
320
 
321
  if (preg_match('/<!--mclude|<!--mfunc/', $buffer)) { //Dynamic content
 
322
  $store = preg_replace('|<!--mclude (.*?)-->(.*?)<!--/mclude-->|is',
323
  "<!--mclude-->\n<?php include_once('" . ABSPATH . "$1'); ?>\n<!--/mclude-->", $buffer);
324
  $store = preg_replace('|<!--mfunc (.*?)-->(.*?)<!--/mfunc-->|is',
@@ -339,6 +418,7 @@ function wp_cache_get_ob(&$buffer) {
339
  $buffer .= "<!-- Cached page generated by WP-Super-Cache on " . gmdate('Y-m-d H:i:s', (time() + ( $wp_cache_gmt_offset * 3600))) . " -->\n";
340
 
341
  if( $gz || $wp_cache_gzip_encoding ) {
 
342
  $gzdata = gzencode( $buffer . "<!-- Compression = gzip -->", 3, FORCE_GZIP );
343
  $gzsize = strlen($gzdata);
344
  }
@@ -346,20 +426,29 @@ function wp_cache_get_ob(&$buffer) {
346
  $wp_cache_meta[ 'headers' ][ 'Content-Encoding' ] = 'Content-Encoding: ' . $wp_cache_gzip_encoding;
347
  $wp_cache_meta[ 'headers' ][ 'Vary' ] = 'Vary: Accept-Encoding, Cookie';
348
  // Return uncompressed data & store compressed for later use
349
- if( $fr )
 
350
  fputs($fr, $gzdata);
 
351
  } else { // no compression
352
  $wp_cache_meta[ 'headers' ][ 'Vary' ] = 'Vary: Cookie';
353
- if( $fr )
 
354
  fputs($fr, $buffer);
 
355
  }
356
- if( $fr2 )
 
357
  fputs($fr2, $buffer . '<!-- super cache -->' );
358
- if( $gz )
 
 
359
  fwrite($gz, $gzdata );
 
360
  $buffer .= $log;
361
  }
362
  $new_cache = true;
 
363
  if( $fr ) {
364
  $supercacheonly = false;
365
  fclose($fr);
@@ -367,6 +456,8 @@ function wp_cache_get_ob(&$buffer) {
367
  unlink( $blog_cache_dir . $cache_filename );
368
  rename( $tmp_wpcache_filename, $blog_cache_dir . $cache_filename );
369
  }
 
 
370
  }
371
  if( $fr2 ) {
372
  fclose($fr2);
@@ -374,6 +465,8 @@ function wp_cache_get_ob(&$buffer) {
374
  @unlink( $cache_fname );
375
  @rename( $tmp_cache_filename, $cache_fname );
376
  }
 
 
377
  }
378
  if( $gz ) {
379
  fclose($gz);
@@ -381,14 +474,26 @@ function wp_cache_get_ob(&$buffer) {
381
  @unlink( $cache_fname . '.gz' );
382
  @rename( $tmp_cache_filename . '.gz', $cache_fname . '.gz' );
383
  }
 
 
 
 
 
 
 
 
 
 
384
  }
385
  wp_cache_writers_exit();
386
  if ( !headers_sent() && isset( $wp_cache_gzip_first ) && 1 == $wp_cache_gzip_first && $wp_cache_gzip_encoding && $gzdata) {
 
387
  header( 'Content-Encoding: ' . $wp_cache_gzip_encoding );
388
  header( 'Vary: Accept-Encoding, Cookie' );
389
  header( 'Content-Length: ' . $gzsize );
390
  return $gzdata;
391
  } else {
 
392
  return $buffer;
393
  }
394
  }
@@ -398,6 +503,7 @@ function wp_cache_phase2_clean_cache($file_prefix) {
398
 
399
  if( !wp_cache_writers_entry() )
400
  return false;
 
401
  if ( ( $handle = @opendir( $blog_cache_dir ) ) ) {
402
  while ( false !== ($file = @readdir($handle))) {
403
  if ( preg_match("/^$file_prefix/", $file) )
@@ -444,8 +550,10 @@ function prune_super_cache( $directory, $force = false, $rename = false ) {
444
  }
445
  if( $donotdelete )
446
  continue;
447
- if( !$rename )
448
  @rmdir( $entry );
 
 
449
  }
450
  }
451
  closedir($dh);
@@ -469,11 +577,14 @@ function wp_cache_rebuild_or_delete( $file ) {
469
  if( $cache_rebuild_files && substr( $file, -14 ) != '.needs-rebuild' ) {
470
  if( @rename($file, $file . '.needs-rebuild') ) {
471
  @touch( $file . '.needs-rebuild' );
 
472
  } else {
473
  @unlink( $file );
 
474
  }
475
  } else {
476
  @unlink( $file );
 
477
  }
478
  }
479
 
@@ -484,22 +595,27 @@ function wp_cache_phase2_clean_expired($file_prefix) {
484
  if( !wp_cache_writers_entry() )
485
  return false;
486
  $now = time();
 
487
  if ( ( $handle = @opendir( $blog_cache_dir ) ) ) {
488
  while ( false !== ($file = readdir($handle))) {
489
  if ( preg_match("/^$file_prefix/", $file) &&
490
  (@filemtime( $blog_cache_dir . $file) + $cache_max_time) <= $now ) {
491
  @unlink( $blog_cache_dir . $file );
492
  @unlink( $blog_cache_dir . 'meta/' . str_replace( '.html', '.meta', $file ) );
 
493
  continue;
494
  }
495
  if($file != '.' && $file != '..') {
496
  if( is_dir( $blog_cache_dir . $file ) == false && (@filemtime($blog_cache_dir . $file) + $cache_max_time) <= $now ) {
497
- if( substr( $file, -9 ) != '.htaccess' )
498
  @unlink($blog_cache_dir . $file);
 
 
499
  }
500
  }
501
  }
502
  closedir($handle);
 
503
  prune_super_cache( $cache_path . 'supercache' );
504
  }
505
 
@@ -509,11 +625,13 @@ function wp_cache_phase2_clean_expired($file_prefix) {
509
 
510
  function wp_cache_shutdown_callback() {
511
  global $cache_path, $cache_max_time, $file_expired, $file_prefix, $meta_file, $new_cache, $wp_cache_meta, $known_headers, $blog_id, $wp_cache_gzip_encoding, $gzsize, $cache_filename, $supercacheonly, $blog_cache_dir;
512
- global $wp_cache_blog_charset, $wp_cache_request_uri;
513
 
514
  $wp_cache_meta[ 'uri' ] = $_SERVER["SERVER_NAME"].preg_replace('/[ <>\'\"\r\n\t\(\)]/', '', $wp_cache_request_uri); // To avoid XSS attacks
515
  $wp_cache_meta[ 'blog_id' ] = $blog_id;
516
  $wp_cache_meta[ 'post' ] = wp_cache_post_id();
 
 
517
 
518
  $response = wp_cache_get_response_headers();
519
  foreach ($known_headers as $key) {
@@ -554,18 +672,21 @@ function wp_cache_shutdown_callback() {
554
  }
555
  $value .= "; charset=\"" . $wp_cache_blog_charset . "\"";
556
 
 
557
  @header("Content-Type: $value");
558
  $wp_cache_meta[ 'headers' ][ 'Content-Type' ] = "Content-Type: $value";
559
  }
560
 
561
  if ( ! $supercacheonly && $new_cache ) {
562
  if( $wp_cache_gzip_encoding && !in_array( 'Content-Encoding: ' . $wp_cache_gzip_encoding, $wp_cache_meta[ 'headers' ] ) ) {
 
563
  $wp_cache_meta[ 'headers' ][ 'Content-Encoding' ] = 'Content-Encoding: ' . $wp_cache_gzip_encoding;
564
  $wp_cache_meta[ 'headers' ][ 'Vary' ] = 'Vary: Accept-Encoding, Cookie';
565
  }
566
 
567
  $serial = serialize($wp_cache_meta);
568
  if( wp_cache_writers_entry() ) {
 
569
  $tmp_meta_filename = $blog_cache_dir . 'meta/' . uniqid( mt_rand(), true ) . '.tmp';
570
  $fr = @fopen( $tmp_meta_filename, 'w');
571
  if( !$fr )
@@ -582,8 +703,10 @@ function wp_cache_shutdown_callback() {
582
  }
583
  }
584
  global $time_to_gc_cache;
585
- if( isset( $time_to_gc_cache ) && $time_to_gc_cache == 1 )
 
586
  do_action( 'wp_cache_gc' );
 
587
  }
588
 
589
  function wp_cache_no_postid($id) {
@@ -598,25 +721,32 @@ function wp_cache_get_postid_from_comment($comment_id) {
598
  // http://ocaoimh.ie/2006/12/05/caching-wordpress-with-wp-cache-in-a-spam-filled-world
599
  if( !preg_match('/wp-admin\//', $wp_cache_request_uri) )
600
  if( $comment['comment_approved'] == 'spam' ) { // changed from 1 to "spam"
 
601
  return $postid;
602
  } elseif( $comment['comment_approved'] == '0' ) {
 
603
  $super_cache_enabled = 0; // don't remove the super cache static file until comment is approved
604
  }
605
  // We must check it up again due to WP bugs calling two different actions
606
  // for delete, for example both wp_set_comment_status and delete_comment
607
  // are called when deleting a comment
608
- if ($postid > 0)
 
609
  return wp_cache_post_change($postid);
610
- else
 
611
  return wp_cache_post_change(wp_cache_post_id());
 
612
  }
613
 
614
  function wp_cache_post_edit($post_id) {
615
  global $wp_cache_clear_on_post_edit, $cache_path, $blog_cache_dir;
616
  if( $wp_cache_clear_on_post_edit ) {
 
617
  prune_super_cache( $blog_cache_dir, true );
618
  prune_super_cache( $cache_path . 'supercache/', true );
619
  } else {
 
620
  wp_cache_post_change( $post_id );
621
  }
622
  }
@@ -630,8 +760,10 @@ function wp_cache_post_id_gc( $siteurl, $post_id ) {
630
 
631
  $permalink = trailingslashit( str_replace( get_option( 'home' ), '', post_permalink( $post_id ) ) );
632
  $dir = $cache_path . 'supercache/' . $siteurl;
 
633
  prune_super_cache( $dir . $permalink, true, true );
634
  @rmdir( $dir . $permalink );
 
635
  prune_super_cache( $dir . 'page/', true );
636
  }
637
 
@@ -648,6 +780,7 @@ function wp_cache_post_change($post_id) {
648
  if( $super_cache_enabled ) {
649
  $siteurl = trailingslashit( strtolower( preg_replace( '/:.*$/', '', str_replace( 'http://', '', get_option( 'home' ) ) ) ) );
650
  // make sure the front page has a rebuild file
 
651
  prune_super_cache( $cache_path . 'supercache/' . $siteurl . 'index.html', true, true );
652
  prune_super_cache( $cache_path . 'supercache/' . $siteurl . 'index.html.gz', true, true );
653
  wp_cache_post_id_gc( $siteurl, $post_id );
@@ -710,17 +843,18 @@ function wp_cache_post_id() {
710
 
711
  function wp_cache_gc_cron() {
712
  global $file_prefix, $cache_max_time;
 
713
 
714
  if( !isset( $cache_max_time ) )
715
  $cache_max_time = 600;
716
 
717
  $start = time();
718
  if( !wp_cache_phase2_clean_expired($file_prefix ) ) {
719
- wp_cache_debug( 'Cache Expiry cron job failed. Probably mutex locked.' );
720
  update_option( 'wpsupercache_gc_time', time() - ( $cache_max_time - 10 ) ); // if GC failed then run it again in one minute
721
  }
722
  if( time() - $start > 30 )
723
- wp_cache_debug( "Cache Expiry cron job took more than 30 seconds to execute.\nYou should reduce the Expiry Time in the WP Super Cache admin page\nas you probably have more cache files than your server can handle efficiently." );
724
  }
725
 
726
  ?>
2
 
3
  function wp_cache_phase2() {
4
  global $cache_filename, $cache_acceptable_files, $wp_cache_gzip_encoding, $super_cache_enabled, $cache_rebuild_files, $wp_cache_gmt_offset, $wp_cache_blog_charset, $wp_cache_last_gc;
5
+ global $cache_max_time, $wp_cache_not_logged_in, $wp_cache_request_uri, $super_cache_enabled;
6
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( 'In WP Cache Phase 2', 5 );
7
 
8
  $wp_cache_gmt_offset = get_option( 'gmt_offset' ); // caching for later use when wpdb is gone. http://wordpress.org/support/topic/224349
9
  $wp_cache_blog_charset = get_option( 'blog_charset' );
10
 
11
  wp_cache_mutex_init();
12
  if(function_exists('add_action') && ( !defined( 'WPLOCKDOWN' ) || ( defined( 'WPLOCKDOWN' ) && constant( 'WPLOCKDOWN' ) == '0' ) ) ) {
13
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( 'Setting up WordPress actions', 5 );
14
  // Post ID is received
15
  add_action('publish_post', 'wp_cache_post_edit', 0);
16
  add_action('edit_post', 'wp_cache_post_change', 0); // leaving a comment called edit_post
32
  do_cacheaction( 'add_cacheaction' );
33
  }
34
 
35
+ if ( is_admin() ) {
36
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( 'Not caching wp-admin requests.', 5 );
37
  return false;
38
+ }
39
+
40
+ if ( $_SERVER["REQUEST_METHOD"] == 'POST' || !empty( $_POST ) || get_option( 'gzipcompression' ) ) {
41
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( 'Not caching POST request.', 5 );
42
+ return false;
43
+ }
44
+
45
+ if ( isset( $_GET[ 'preview' ] ) ) {
46
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( 'Not caching preview post.', 2 );
47
+ return false;
48
+ }
49
+
50
+ if ( !empty( $_GET ) ) {
51
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( 'Supercache caching disabled. Non empty GET request.', 5 );
52
+ $super_cache_enabled = false;
53
+ }
54
 
55
  if ( $wp_cache_not_logged_in && is_user_logged_in() && !is_feed() && !is_admin() ) {
56
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( 'not caching for logged in user', 5 );
57
  register_shutdown_function( 'wpcache_logged_in_message' );
58
  return false;
59
  }
60
 
61
  $script = basename($_SERVER['PHP_SELF']);
62
+ if (!in_array($script, $cache_acceptable_files) && wp_cache_is_rejected($wp_cache_request_uri)) {
63
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( 'URI rejected. Not Caching', 2 );
64
  return false;
65
+ }
66
+ if (wp_cache_user_agent_is_rejected()) {
67
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "USER AGENT ({$_SERVER[ 'HTTP_USER_AGENT' ]}) rejected. Not Caching", 4 );
68
+ return;
69
+ }
70
  if($wp_cache_gzip_encoding)
71
  header('Vary: Accept-Encoding, Cookie');
72
  else
73
  header('Vary: Cookie');
74
  ob_start( 'wp_cache_ob_callback' );
75
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( 'Created output buffer', 4 );
76
 
77
  // restore old supercache file temporarily
78
  if( $super_cache_enabled && $cache_rebuild_files ) {
86
  continue;
87
  $mtime = @filemtime($cache_file . '.needs-rebuild');
88
  if( $mtime && (time() - $mtime) < 30 ) {
89
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Rebuild file renamed to cache file temporarily", 3 );
90
  @rename( $cache_file . '.needs-rebuild', $cache_file );
91
  }
92
  // cleanup old files or if rename fails
93
  if( @file_exists( $cache_file . '.needs-rebuild' ) ) {
94
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Rebuild file deleted", 3 );
95
  @unlink( $cache_file . '.needs-rebuild' );
96
  }
97
  }
111
 
112
  global $wp_cache_shutdown_gc;
113
  if( !isset( $wp_cache_shutdown_gc ) || $wp_cache_shutdown_gc == 0 ) {
114
+ if(!wp_next_scheduled('wp_cache_gc')) {
115
+ wp_schedule_single_event(time() + 10 , 'wp_cache_gc');
116
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( 'scheduled wp_cache_gc for 10 seconds time.', 5 );
117
+ }
118
  } else {
119
  global $time_to_gc_cache;
120
  $time_to_gc_cache = 1; // tell the "shutdown gc" to run!
173
  }
174
 
175
  function wp_cache_mutex_init() {
176
+ global $use_flock, $mutex, $cache_path, $mutex_filename, $sem_id, $blog_cache_dir, $wp_cache_mutex_disabled;
177
+
178
+ if( isset( $wp_cache_mutex_disabled ) && $wp_cache_mutex_disabled )
179
+ return true;
180
 
181
  if(!is_bool($use_flock)) {
182
  if(function_exists('sem_get'))
186
  }
187
 
188
  $mutex = false;
189
+ if ($use_flock) {
190
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Created mutex lock on filename: {$blog_cache_dir}{$mutex_filename}", 5 );
191
  $mutex = @fopen($blog_cache_dir . $mutex_filename, 'w');
192
+ } else {
193
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Created mutex lock on semaphore: $sem_id", 5 );
194
  $mutex = @sem_get($sem_id, 1, 0644 | IPC_CREAT, 1);
195
+ }
196
  }
197
 
198
  function wp_cache_writers_entry() {
201
  if( isset( $wp_cache_mutex_disabled ) && $wp_cache_mutex_disabled )
202
  return true;
203
 
204
+ if( !$mutex ) {
205
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "(writers entry) mutex lock not created. not caching.", 2 );
206
  return false;
207
+ }
208
 
209
+ if ($use_flock) {
210
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "grabbing lock using flock()", 5 );
211
  flock($mutex, LOCK_EX);
212
+ } else {
213
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "grabbing lock using sem_acquire()", 5 );
214
  sem_acquire($mutex);
215
+ }
216
 
217
  return true;
218
  }
223
  if( isset( $wp_cache_mutex_disabled ) && $wp_cache_mutex_disabled )
224
  return true;
225
 
226
+ if( !$mutex ) {
227
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "(writers exit) mutex lock not created. not caching.", 2 );
228
  return false;
229
+ }
230
 
231
+ if ($use_flock) {
232
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "releasing lock using flock()", 5 );
233
  flock($mutex, LOCK_UN);
234
+ } else {
235
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "releasing lock using sem_release()", 5 );
236
  sem_release($mutex);
237
+ }
238
  }
239
 
240
  function get_current_url_supercache_dir() {
248
  $dir = trailingslashit( ABSPATH . $uri );
249
  }
250
  $dir = str_replace( '//', '/', $dir );
251
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "supercache dir: $dir", 5 );
252
  return $dir;
253
  }
254
 
256
  global $wp_cache_pages;
257
  if( defined( 'DONOTCACHEPAGE' ) )
258
  return $buffer;
259
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( 'Output buffer callback', 4 );
260
 
261
  if ( isset( $wp_cache_pages[ 'single' ] ) && $wp_cache_pages[ 'single' ] == 1 && is_single() ) {
262
  return $buffer;
272
  return $buffer;
273
  } elseif ( isset( $wp_cache_pages[ 'home' ] ) && $wp_cache_pages[ 'home' ] == 1 && is_home() ) {
274
  return $buffer;
275
+ } elseif ( isset( $wp_cache_pages[ 'search' ] ) && $wp_cache_pages[ 'search' ] == 1 && is_search() ) {
276
+ return $buffer;
277
+ } elseif ( isset( $wp_cache_pages[ 'feed' ] ) && $wp_cache_pages[ 'feed' ] == 1 && is_feed() ) {
278
+ return $buffer;
279
  }
280
  $buffer = &wp_cache_get_ob( $buffer );
281
  wp_cache_shutdown_callback();
288
  global $new_cache, $wp_cache_meta, $file_expired, $blog_id, $cache_compression;
289
  global $wp_cache_gzip_encoding, $super_cache_enabled, $cached_direct_pages;
290
  global $wp_cache_404, $gzsize, $supercacheonly, $wp_cache_gzip_first, $wp_cache_gmt_offset;
291
+ global $blog_cache_dir, $wp_cache_request_uri, $wp_supercache_cache_list;
292
 
293
  $new_cache = true;
294
  $wp_cache_meta = '';
295
 
296
  /* Mode paranoic, check for closing tags
297
  * we avoid caching incomplete files */
298
+ if ( $buffer == '' ) {
299
  $new_cache = false;
300
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) {
301
+ wp_cache_debug( "Buffer is blank. Output buffer may have been corrupted by another plugin or this is a redirected URL. Look for text 'ob_start' in the files of your plugins directory.", 2 );
302
+ $buffer .= "\n<!-- Page not cached by WP Super Cache. Blank Page. Check output buffer usage by plugins. -->\n";
303
+ }
304
+ }
305
+
306
+ if ( $wp_cache_404 && false == apply_filters( 'wpsupercache_404', false ) ) {
307
+ $new_cache = false;
308
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) {
309
+ wp_cache_debug( "404 file not found not cached", 2 );
310
+ $buffer .= "\n<!-- Page not cached by WP Super Cache. 404. -->\n";
311
+ }
312
  }
313
 
314
  if (!preg_match('/(<\/html>|<\/rss>|<\/feed>)/i',$buffer) ) {
315
  $new_cache = false;
316
+ if( false === strpos( $_SERVER[ 'REQUEST_URI' ], 'robots.txt' ) ) {
317
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) {
318
+ wp_cache_debug( "No closing html tag. Not caching.", 2 );
319
+ $buffer .= "\n<!-- Page not cached by WP Super Cache. No closing HTML tag. Check your theme. -->\n";
320
+ }
321
+ } else {
322
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "robots.txt detected. Not caching.", 2 );
323
+ }
324
  }
325
 
326
  if( !$new_cache )
332
 
333
  if( !wp_cache_writers_entry() ) {
334
  $buffer .= "\n<!-- Page not cached by WP Super Cache. Could not get mutex lock. -->\n";
335
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Could not get mutex lock. Not caching.", 1 );
336
  return $buffer;
337
  }
338
 
339
  $dir = get_current_url_supercache_dir();
340
  $supercachedir = $cache_path . 'supercache/' . preg_replace('/:.*$/', '', $_SERVER["HTTP_HOST"]);
341
+ if( !empty( $_GET ) || is_feed() || ( $super_cache_enabled == true && is_dir( substr( $supercachedir, 0, -1 ) . '.disabled' ) ) ) {
342
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Supercache disabled: GET or feed detected or disabled by config.", 2 );
343
  $super_cache_enabled = false;
344
+ }
345
 
346
  $tmp_wpcache_filename = $cache_path . uniqid( mt_rand(), true ) . '.tmp';
347
 
348
  // Don't create wp-cache files for anon users
349
  $supercacheonly = false;
350
+ if( $super_cache_enabled && wp_cache_get_cookies_values() == '' ) {
351
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Anonymous user detected. Only creating Supercache file.", 3 );
352
  $supercacheonly = true;
353
+ }
354
 
355
  if( !$supercacheonly ) {
356
  if ( !@file_exists( $blog_cache_dir . $cache_filename ) || ( @file_exists( $blog_cache_dir . $cache_filename ) && ( time() - @filemtime( $blog_cache_dir . $cache_filename ) ) > 5 ) ) {
357
  $fr = @fopen($tmp_wpcache_filename, 'w');
358
  if (!$fr) {
359
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Error. Supercache could not write to " . str_replace( ABSPATH, '', $cache_path ) . $cache_filename, 1 );
360
  $buffer .= "<!-- File not cached! Super Cache Couldn't write to: " . str_replace( ABSPATH, '', $cache_path ) . $cache_filename . " -->\n";
361
  return $buffer;
362
  }
375
  if ( !@file_exists( $cache_fname ) || ( @file_exists( $cache_fname ) && ( time() - @filemtime( $cache_fname ) ) > 5 ) ) {
376
  $fr2 = @fopen( $tmp_cache_filename, 'w' );
377
  if (!$fr2) {
378
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Error. Supercache could not write to " . str_replace( ABSPATH, '', $tmp_cache_filename ), 1 );
379
  $buffer .= "<!-- File not cached! Super Cache Couldn't write to: " . str_replace( ABSPATH, '', $tmp_cache_filename ) . " -->\n";
380
  @fclose( $fr );
381
  @unlink( $tmp_wpcache_filename );
383
  } elseif( $cache_compression ) {
384
  $gz = @fopen( $tmp_cache_filename . ".gz", 'w');
385
  if (!$gz) {
386
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Error. Supercache could not write to " . str_replace( ABSPATH, '', $tmp_cache_filename ) . ".gz", 1 );
387
  $buffer .= "<!-- File not cached! Super Cache Couldn't write to: " . str_replace( ABSPATH, '', $tmp_cache_filename ) . ".gz -->\n";
388
  @fclose( $fr );
389
  @unlink( $tmp_wpcache_filename );
397
  }
398
 
399
  if (preg_match('/<!--mclude|<!--mfunc/', $buffer)) { //Dynamic content
400
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Dynamic content found in buffer.", 4 );
401
  $store = preg_replace('|<!--mclude (.*?)-->(.*?)<!--/mclude-->|is',
402
  "<!--mclude-->\n<?php include_once('" . ABSPATH . "$1'); ?>\n<!--/mclude-->", $buffer);
403
  $store = preg_replace('|<!--mfunc (.*?)-->(.*?)<!--/mfunc-->|is',
418
  $buffer .= "<!-- Cached page generated by WP-Super-Cache on " . gmdate('Y-m-d H:i:s', (time() + ( $wp_cache_gmt_offset * 3600))) . " -->\n";
419
 
420
  if( $gz || $wp_cache_gzip_encoding ) {
421
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Gzipping buffer.", 5 );
422
  $gzdata = gzencode( $buffer . "<!-- Compression = gzip -->", 3, FORCE_GZIP );
423
  $gzsize = strlen($gzdata);
424
  }
426
  $wp_cache_meta[ 'headers' ][ 'Content-Encoding' ] = 'Content-Encoding: ' . $wp_cache_gzip_encoding;
427
  $wp_cache_meta[ 'headers' ][ 'Vary' ] = 'Vary: Accept-Encoding, Cookie';
428
  // Return uncompressed data & store compressed for later use
429
+ if( $fr ) {
430
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Writing gzipped buffer to wp-cache cache file.", 5 );
431
  fputs($fr, $gzdata);
432
+ }
433
  } else { // no compression
434
  $wp_cache_meta[ 'headers' ][ 'Vary' ] = 'Vary: Cookie';
435
+ if( $fr ) {
436
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Writing non-gzipped buffer to wp-cache cache file.", 5 );
437
  fputs($fr, $buffer);
438
+ }
439
  }
440
+ if( $fr2 ) {
441
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Writing non-gzipped buffer to supercache file.", 5 );
442
  fputs($fr2, $buffer . '<!-- super cache -->' );
443
+ }
444
+ if( $gz ) {
445
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Writing gzipped buffer to supercache file.", 5 );
446
  fwrite($gz, $gzdata );
447
+ }
448
  $buffer .= $log;
449
  }
450
  $new_cache = true;
451
+ $added_cache = 0;
452
  if( $fr ) {
453
  $supercacheonly = false;
454
  fclose($fr);
456
  unlink( $blog_cache_dir . $cache_filename );
457
  rename( $tmp_wpcache_filename, $blog_cache_dir . $cache_filename );
458
  }
459
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Renamed temp wp-cache file to {$blog_cache_dir}$cache_filename", 5 );
460
+ $added_cache = 1;
461
  }
462
  if( $fr2 ) {
463
  fclose($fr2);
465
  @unlink( $cache_fname );
466
  @rename( $tmp_cache_filename, $cache_fname );
467
  }
468
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Renamed temp supercache file to $cache_fname", 5 );
469
+ $added_cache = 1;
470
  }
471
  if( $gz ) {
472
  fclose($gz);
474
  @unlink( $cache_fname . '.gz' );
475
  @rename( $tmp_cache_filename . '.gz', $cache_fname . '.gz' );
476
  }
477
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Renamed temp supercache gz file to {$cache_fname}.gz", 5 );
478
+ $added_cache = 1;
479
+ }
480
+ if ( $added_cache && isset( $wp_supercache_cache_list ) && $wp_supercache_cache_list ) {
481
+ update_option( 'wpsupercache_count', ( get_option( 'wpsupercache_count' ) + 1 ) );
482
+ $last_urls = (array)get_option( 'supercache_last_cached' );
483
+ if ( count( $last_urls ) >= 10 )
484
+ $last_urls = array_slice( $last_urls, 1, 9 );
485
+ $last_urls[] = array( 'url' => $_SERVER[ 'REQUEST_URI' ], 'date' => date( 'Y-m-d H:i:s' ) );
486
+ update_option( 'supercache_last_cached', $last_urls );
487
  }
488
  wp_cache_writers_exit();
489
  if ( !headers_sent() && isset( $wp_cache_gzip_first ) && 1 == $wp_cache_gzip_first && $wp_cache_gzip_encoding && $gzdata) {
490
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Writing gzip content headers. Sending buffer to browser", 5 );
491
  header( 'Content-Encoding: ' . $wp_cache_gzip_encoding );
492
  header( 'Vary: Accept-Encoding, Cookie' );
493
  header( 'Content-Length: ' . $gzsize );
494
  return $gzdata;
495
  } else {
496
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Sending buffer to browser", 5 );
497
  return $buffer;
498
  }
499
  }
503
 
504
  if( !wp_cache_writers_entry() )
505
  return false;
506
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Cleaning cache in $blog_cache_dir", 3 );
507
  if ( ( $handle = @opendir( $blog_cache_dir ) ) ) {
508
  while ( false !== ($file = @readdir($handle))) {
509
  if ( preg_match("/^$file_prefix/", $file) )
550
  }
551
  if( $donotdelete )
552
  continue;
553
+ if( !$rename ) {
554
  @rmdir( $entry );
555
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "gc: deleted $entry", 2 );
556
+ }
557
  }
558
  }
559
  closedir($dh);
577
  if( $cache_rebuild_files && substr( $file, -14 ) != '.needs-rebuild' ) {
578
  if( @rename($file, $file . '.needs-rebuild') ) {
579
  @touch( $file . '.needs-rebuild' );
580
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "rebuild_or_gc: rename to {$file}.needs-rebuild", 2 );
581
  } else {
582
  @unlink( $file );
583
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "rebuild_or_gc: deleted $file", 2 );
584
  }
585
  } else {
586
  @unlink( $file );
587
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "rebuild_or_gc: deleted $file", 2 );
588
  }
589
  }
590
 
595
  if( !wp_cache_writers_entry() )
596
  return false;
597
  $now = time();
598
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Cleaning expired cache files in $blog_cache_dir", 2 );
599
  if ( ( $handle = @opendir( $blog_cache_dir ) ) ) {
600
  while ( false !== ($file = readdir($handle))) {
601
  if ( preg_match("/^$file_prefix/", $file) &&
602
  (@filemtime( $blog_cache_dir . $file) + $cache_max_time) <= $now ) {
603
  @unlink( $blog_cache_dir . $file );
604
  @unlink( $blog_cache_dir . 'meta/' . str_replace( '.html', '.meta', $file ) );
605
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Deleting $blog_cache_dir{$file} (plus meta)", 5 );
606
  continue;
607
  }
608
  if($file != '.' && $file != '..') {
609
  if( is_dir( $blog_cache_dir . $file ) == false && (@filemtime($blog_cache_dir . $file) + $cache_max_time) <= $now ) {
610
+ if( substr( $file, -9 ) != '.htaccess' ) {
611
  @unlink($blog_cache_dir . $file);
612
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Deleting $blog_cache_dir{$file}", 5 );
613
+ }
614
  }
615
  }
616
  }
617
  closedir($handle);
618
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Doing GC on supercache dir: {$cache_path}supercache", 2 );
619
  prune_super_cache( $cache_path . 'supercache' );
620
  }
621
 
625
 
626
  function wp_cache_shutdown_callback() {
627
  global $cache_path, $cache_max_time, $file_expired, $file_prefix, $meta_file, $new_cache, $wp_cache_meta, $known_headers, $blog_id, $wp_cache_gzip_encoding, $gzsize, $cache_filename, $supercacheonly, $blog_cache_dir;
628
+ global $wp_cache_blog_charset, $wp_cache_request_uri, $wp_cache_key;
629
 
630
  $wp_cache_meta[ 'uri' ] = $_SERVER["SERVER_NAME"].preg_replace('/[ <>\'\"\r\n\t\(\)]/', '', $wp_cache_request_uri); // To avoid XSS attacks
631
  $wp_cache_meta[ 'blog_id' ] = $blog_id;
632
  $wp_cache_meta[ 'post' ] = wp_cache_post_id();
633
+ $wp_cache_meta[ 'key' ] = $wp_cache_key;
634
+ $wp_cache_meta = apply_filters( 'wp_cache_meta', $wp_cache_meta );
635
 
636
  $response = wp_cache_get_response_headers();
637
  foreach ($known_headers as $key) {
672
  }
673
  $value .= "; charset=\"" . $wp_cache_blog_charset . "\"";
674
 
675
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Sending 'Content-Type: $value' header.", 2 );
676
  @header("Content-Type: $value");
677
  $wp_cache_meta[ 'headers' ][ 'Content-Type' ] = "Content-Type: $value";
678
  }
679
 
680
  if ( ! $supercacheonly && $new_cache ) {
681
  if( $wp_cache_gzip_encoding && !in_array( 'Content-Encoding: ' . $wp_cache_gzip_encoding, $wp_cache_meta[ 'headers' ] ) ) {
682
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Sending gzip headers.", 2 );
683
  $wp_cache_meta[ 'headers' ][ 'Content-Encoding' ] = 'Content-Encoding: ' . $wp_cache_gzip_encoding;
684
  $wp_cache_meta[ 'headers' ][ 'Vary' ] = 'Vary: Accept-Encoding, Cookie';
685
  }
686
 
687
  $serial = serialize($wp_cache_meta);
688
  if( wp_cache_writers_entry() ) {
689
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Writing meta file: {$blog_cache_dir}meta/{$meta_file}", 2 );
690
  $tmp_meta_filename = $blog_cache_dir . 'meta/' . uniqid( mt_rand(), true ) . '.tmp';
691
  $fr = @fopen( $tmp_meta_filename, 'w');
692
  if( !$fr )
703
  }
704
  }
705
  global $time_to_gc_cache;
706
+ if( isset( $time_to_gc_cache ) && $time_to_gc_cache == 1 ) {
707
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Executing wp_cache_gc action.", 3 );
708
  do_action( 'wp_cache_gc' );
709
+ }
710
  }
711
 
712
  function wp_cache_no_postid($id) {
721
  // http://ocaoimh.ie/2006/12/05/caching-wordpress-with-wp-cache-in-a-spam-filled-world
722
  if( !preg_match('/wp-admin\//', $wp_cache_request_uri) )
723
  if( $comment['comment_approved'] == 'spam' ) { // changed from 1 to "spam"
724
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Spam comment. Don't delete any cache files.", 4 );
725
  return $postid;
726
  } elseif( $comment['comment_approved'] == '0' ) {
727
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Moderated comment. Don't delete supercache file until comment approved.", 4 );
728
  $super_cache_enabled = 0; // don't remove the super cache static file until comment is approved
729
  }
730
  // We must check it up again due to WP bugs calling two different actions
731
  // for delete, for example both wp_set_comment_status and delete_comment
732
  // are called when deleting a comment
733
+ if ($postid > 0) {
734
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Post $postid changed. Update cache.", 4 );
735
  return wp_cache_post_change($postid);
736
+ } else {
737
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Unknown post changed. Update cache.", 4 );
738
  return wp_cache_post_change(wp_cache_post_id());
739
+ }
740
  }
741
 
742
  function wp_cache_post_edit($post_id) {
743
  global $wp_cache_clear_on_post_edit, $cache_path, $blog_cache_dir;
744
  if( $wp_cache_clear_on_post_edit ) {
745
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Clearing cache $blog_cache_dir and {$cache_path}supercache/ on post edit per config.", 2 );
746
  prune_super_cache( $blog_cache_dir, true );
747
  prune_super_cache( $cache_path . 'supercache/', true );
748
  } else {
749
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Clearing cache for post $post_id on post edit.", 2 );
750
  wp_cache_post_change( $post_id );
751
  }
752
  }
760
 
761
  $permalink = trailingslashit( str_replace( get_option( 'home' ), '', post_permalink( $post_id ) ) );
762
  $dir = $cache_path . 'supercache/' . $siteurl;
763
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "wp_cache_post_id_gc clearing cache in $dir{$permalink}.", 4 );
764
  prune_super_cache( $dir . $permalink, true, true );
765
  @rmdir( $dir . $permalink );
766
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "wp_cache_post_id_gc clearing cache in {$dir}page/.", 4 );
767
  prune_super_cache( $dir . 'page/', true );
768
  }
769
 
780
  if( $super_cache_enabled ) {
781
  $siteurl = trailingslashit( strtolower( preg_replace( '/:.*$/', '', str_replace( 'http://', '', get_option( 'home' ) ) ) ) );
782
  // make sure the front page has a rebuild file
783
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Post change: deleting cache files in " . $cache_path . 'supercache/' . $siteurl, 4 );
784
  prune_super_cache( $cache_path . 'supercache/' . $siteurl . 'index.html', true, true );
785
  prune_super_cache( $cache_path . 'supercache/' . $siteurl . 'index.html.gz', true, true );
786
  wp_cache_post_id_gc( $siteurl, $post_id );
843
 
844
  function wp_cache_gc_cron() {
845
  global $file_prefix, $cache_max_time;
846
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( 'Cache garbage collection.', 5 );
847
 
848
  if( !isset( $cache_max_time ) )
849
  $cache_max_time = 600;
850
 
851
  $start = time();
852
  if( !wp_cache_phase2_clean_expired($file_prefix ) ) {
853
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( 'Cache Expiry cron job failed. Probably mutex locked.', 1 );
854
  update_option( 'wpsupercache_gc_time', time() - ( $cache_max_time - 10 ) ); // if GC failed then run it again in one minute
855
  }
856
  if( time() - $start > 30 )
857
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Cache Expiry cron job took more than 30 seconds to execute.\nYou should reduce the Expiry Time in the WP Super Cache admin page\nas you probably have more cache files than your server can handle efficiently.", 1 );
858
  }
859
 
860
  ?>
wp-cache.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Super Cache
4
  Plugin URI: http://ocaoimh.ie/wp-super-cache/
5
  Description: Very fast caching plugin for WordPress.
6
- Version: 0.9.6.1
7
  Author: Donncha O Caoimh
8
  Author URI: http://ocaoimh.ie/
9
  */
@@ -48,6 +48,10 @@ $wp_cache_file = WPCACHEHOME . 'advanced-cache.php';
48
 
49
  include(WPCACHEHOME . 'wp-cache-base.php');
50
 
 
 
 
 
51
 
52
  // from legolas558 d0t users dot sf dot net at http://www.php.net/is_writable
53
  function is_writeable_ACLSafe($path) {
@@ -76,7 +80,7 @@ function get_wpcachehome() {
76
  } elseif( is_file( dirname(__FILE__) . '/wp-super-cache/wp-cache-config-sample.php' ) ) {
77
  define( 'WPCACHEHOME', dirname(__FILE__) . '/wp-super-cache/' );
78
  } else {
79
- die( 'Please create ' . WP_CONTENT_DIR . '/wp-cache-config.php from wp-super-cache/wp-cache-config-sample.php' );
80
  }
81
  }
82
  }
@@ -100,7 +104,7 @@ register_deactivation_hook( __FILE__, 'wpsupercache_deactivate' );
100
  function wp_cache_add_pages() {
101
  if( function_exists( 'is_site_admin' ) ) {
102
  if( is_site_admin() ) {
103
- add_submenu_page('wpmu-admin.php', __('WP Super Cache'), __('WP Super Cache'), 'manage_options', 'wpsupercache', 'wp_cache_manager');
104
  add_options_page('WP Super Cache', 'WP Super Cache', 'manage_options', 'wpsupercache', 'wp_cache_manager');
105
  }
106
  } else {
@@ -112,7 +116,7 @@ add_action('admin_menu', 'wp_cache_add_pages');
112
  function wp_cache_manager() {
113
  global $wp_cache_config_file, $valid_nonce, $supercachedir, $cache_path, $cache_enabled, $cache_compression, $super_cache_enabled, $wp_cache_hello_world;
114
  global $wp_cache_clear_on_post_edit, $cache_rebuild_files, $wp_cache_mutex_disabled, $wp_cache_mobile_enabled, $wp_cache_mobile_whitelist, $wp_cache_mobile_browsers;
115
- global $wp_cache_cron_check, $wp_cache_debug, $wp_cache_hide_donation, $wp_cache_not_logged_in;
116
 
117
  if( function_exists( 'is_site_admin' ) )
118
  if( !is_site_admin() )
@@ -154,24 +158,25 @@ jQuery(document).ready(function(){
154
  <?php
155
  echo '<div class="wrap">';
156
  echo "<h2>WP Super Cache Manager</h2>\n";
157
- if( ini_get( 'safe_mode' ) ) {
158
- ?><h3>Warning! PHP Safe Mode Enabled!</h3>
159
- <p>You may experience problems running this plugin because SAFE MODE is enabled. <?php
160
  if( !ini_get( 'safe_mode_gid' ) ) {
161
- ?>Your server is set up to check the owner of PHP scripts before allowing them to read and write files.</p><p>You or an administrator may be able to make it work by changing the group owner of the plugin scripts to match that of the web server user. The group owner of the <?php echo WP_CONTENT_DIR; ?>/cache/ directory must also be changed. See the <a href='http://php.net/features.safe-mode'>safe mode manual page</a> for further details.</p><?php
 
162
  } else {
163
- ?>You or an administrator must disable this. See the <a href='http://php.net/features.safe-mode'>safe mode manual page</a> for further details. This cannot be disabled in a .htaccess file unfortunately. It must be done in the php.ini config file.</p><?php
164
  }
165
  }
166
  if(isset($_REQUEST['wp_restore_config']) && $valid_nonce) {
167
  unlink($wp_cache_config_file);
168
- echo '<strong>Configuration file changed, some values might be wrong. Load the page again from the "Settings" menu to reset them.</strong>';
169
  }
170
 
171
  if ( !wp_cache_check_link() ||
172
  !wp_cache_verify_config_file() ||
173
  !wp_cache_verify_cache_dir() ) {
174
- echo "Cannot continue... fix previous problems and retry.";
175
  echo "</div>\n";
176
  return;
177
  }
@@ -187,10 +192,10 @@ jQuery(document).ready(function(){
187
  $hostname = substr( $hostname, 0, strpos( $hostname, '/' ) );
188
  $ip = gethostbyname( $hostname );
189
  if( substr( $ip, 0, 3 ) == '127' || substr( $ip, 0, 7 ) == '192.168' ) {
190
- ?><h3>Warning! Your hostname "<?php echo $hostname; ?>" resolves to <?php echo $ip; ?></h3>
191
  <div style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'>
192
- <p>Your server thinks your hostname resolves to <?php echo $ip; ?>. Some services such as garbage collection by this plugin, and WordPress scheduled posts may not operate correctly.</p>
193
- <p>Please see entry 16 in the <a href="http://wordpress.org/extend/plugins/wp-super-cache/faq/">Troubleshooting section</a> of the readme.txt</p>
194
  </div>
195
  <?php
196
  } else {
@@ -203,8 +208,8 @@ jQuery(document).ready(function(){
203
  if( $cron[ 'response' ][ 'code' ] == '404' ) {
204
  ?><h3>Warning! wp-cron.php not found!</h3>
205
  <div style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'>
206
- <p>Unfortunately WordPress cannot find the file wp-cron.php. This script is required for the the correct operation of garbage collection by this plugin, WordPress scheduled posts as well as other critical activities.</p>
207
- <p>Please see entry 16 in the <a href="http://wordpress.org/extend/plugins/wp-super-cache/faq/">Troubleshooting section</a> of the readme.txt</p>
208
  </div>
209
  <?php
210
  } else {
@@ -215,18 +220,18 @@ jQuery(document).ready(function(){
215
  }
216
 
217
  if( $cache_enabled == true && $super_cache_enabled == true && !got_mod_rewrite() ) {
218
- ?><h4 style='color: #a00'>Mod rewrite may not be installed!</h4>
219
- <p>It appears that mod_rewrite is not installed. Sometimes this check isn't 100% reliable, especially if you are not using Apache. Please verify that the mod_rewrite module is loaded. It is required for serving Super Cache static files. You will still be able to use WP-Cache.</p><?php
220
  }
221
 
222
  if( !is_writeable_ACLSafe($wp_cache_config_file) ) {
223
  define( "SUBMITDISABLED", 'disabled style="color: #aaa" ' );
224
- ?><h4 style='text-align:center; color: #a00'>Read Only Mode. Configuration cannot be changed. <a href="javascript:toggleLayer('readonlywarning');" title="Why your configuration may not be changed">Why</a></h4>
225
  <div id='readonlywarning' style='border: 1px solid #aaa; margin: 2px; padding: 2px; display: none;'>
226
- <p>The WP Super Cache configuration file is <code><?php echo WP_CONTENT_DIR; ?>/wp-cache-config.php</code> and cannot be modified. The file <?php echo WP_CONTENT_DIR; ?>/wp-cache-config.php must be writeable by the webserver to make any changes.
227
- A simple way of doing that is by changing the permissions temporarily using the CHMOD command or through your ftp client. Make sure it's globally writeable and it should be fine.
228
- Writeable: <code>chmod 666 <?php echo WP_CONTENT_DIR; ?>/wp-cache-config.php</code>
229
- Readonly: <code>chmod 644 <?php echo WP_CONTENT_DIR; ?>/wp-cache-config.php</code></p>
230
  </div><?php
231
  } else {
232
  define( "SUBMITDISABLED", ' ' );
@@ -238,8 +243,8 @@ jQuery(document).ready(function(){
238
  $wp_content_stat = stat(WP_CONTENT_DIR . '/');
239
  $wp_content_mode = ($wp_content_stat['mode'] & 0777);
240
  if( $wp_content_mode != 0755 ) {
241
- ?><h4 style='text-align:center; color: #a00'>Warning! <?php echo WP_CONTENT_DIR; ?> is writeable!</h4>
242
- <p>You should change the permissions on <?php echo WP_CONTENT_DIR; ?> and make it more restrictive. Use your ftp client, or the following command to fix things:<code>chmod 755 <?php echo WP_CONTENT_DIR; ?>/</code></p><?php
243
  }
244
  }
245
 
@@ -257,6 +262,10 @@ jQuery(document).ready(function(){
257
  wp_cache_replace_line('^ *\$wp_cache_mobile_browsers', "\$wp_cache_mobile_browsers = 'Android, 2.0 MMP, 240x320, AvantGo, BlackBerry, Blazer, Cellphone, Danger, DoCoMo, Elaine/3.0, EudoraWeb, hiptop, IEMobile, iPhone, iPod, KYOCERA/WX310K, LG/U990, MIDP-2.0, MMEF20, MOT-V, NetFront, Newt, Nintendo Wii, Nitro, Nokia, Opera Mini, Palm, Playstation Portable, portalmmm, Proxinet, ProxiNet, SHARP-TQ-GX10, Small, SonyEricsson, Symbian OS, SymbianOS, TS21i-10, UP.Browser, UP.Link, Windows CE, WinWAP';", $wp_cache_config_file);
258
  }
259
  wp_cache_replace_line('^ *\$wp_cache_mobile_enabled', "\$wp_cache_mobile_enabled = " . $wp_cache_mobile_enabled . ";", $wp_cache_config_file);
 
 
 
 
260
  switch( $_POST[ 'wp_cache_status' ] ) {
261
  case 'all':
262
  wp_cache_enable();
@@ -323,51 +332,57 @@ jQuery(document).ready(function(){
323
  }
324
  }
325
 
 
326
  ?>
327
  <table><td><fieldset class="options" id="show-this-fieldset">
328
- <h3>WP Super Cache Status</h3><?php
329
- echo '<form name="wp_manager" action="'. $_SERVER["REQUEST_URI"] . '" method="post">';
330
  ?>
331
- <label><input type='radio' name='wp_cache_status' value='all' <?php if( $cache_enabled == true && $super_cache_enabled == true ) { echo 'checked=checked'; } ?>> <strong>ON</strong> <span class="setting-description">WP Cache and Super Cache enabled</span></label><br />
332
- <label><input type='radio' name='wp_cache_status' value='wpcache' <?php if( $cache_enabled == true && $super_cache_enabled == false ) { echo 'checked=checked'; } ?>> <strong>HALF ON</strong> <span class="setting-description">Super Cache Disabled, only legacy WP-Cache caching.</span></label><br />
333
- <label><input type='radio' name='wp_cache_status' value='none' <?php if( $cache_enabled == false ) { echo 'checked=checked'; } ?>> <strong>OFF</strong> <span class="setting-description">WP Cache and Super Cache disabled</span></label><br />
334
- <p><label><input type='checkbox' name='wp_cache_not_logged_in' <?php if( $wp_cache_not_logged_in ) echo "checked"; ?> value='1'> Don't cache pages for logged in users.</label></p>
335
- <p><label><input type='checkbox' name='wp_cache_hello_world' <?php if( $wp_cache_hello_world ) echo "checked"; ?> value='1'> Proudly tell the world your server is Digg proof! (places a message in your blog's footer)</label></p>
336
- <p><label><input type='checkbox' name='wp_cache_clear_on_post_edit' <?php if( $wp_cache_clear_on_post_edit ) echo "checked"; ?> value='1'> Clear all cache files when a post or page is published. (This may significantly slow down saving of posts.)</label></p>
337
- <p><label><input type='checkbox' name='cache_rebuild_files' <?php if( $cache_rebuild_files ) echo "checked"; ?> value='1'> Cache rebuild. Serve a supercache file to anonymous users while a new file is being generated. Recommended for <em>very</em> busy websites with lots of comments. Makes "directly cached pages" and "Lockdown mode" obsolete.</label></p>
338
  <?php if( false == defined( 'WPSC_DISABLE_LOCKING' ) ) { ?>
339
- <p><label><input type='checkbox' name='wp_cache_mutex_disabled' <?php if( !$wp_cache_mutex_disabled ) echo "checked"; ?> value='0'> Coarse file locking. You probably don't need this but it may help if your server is underpowered. Warning! <em>May cause your server to lock up in very rare cases!</em></label></p>
340
  <?php } ?>
341
- <p><label><input type='checkbox' name='wp_cache_mobile_enabled' <?php if( $wp_cache_mobile_enabled ) echo "checked"; ?> value='1'> Mobile device support.</label>
 
342
  <?php
343
  $home_path = trailingslashit( get_home_path() );
344
- if ( false === strpos( implode( "\n", extract_from_markers( $home_path.'.htaccess', 'WPSuperCache' ) ), 'SHARP-TQ-GX10' ) ) { // we don't have the rewrite rules
 
 
 
 
345
  ?>
346
- <blockquote><p>Mobile support requires extra rules in your .htaccess file, or you can set the plugin to half-on mode. Here's your options (in order of difficulty):
347
- <ol><li> 1. Set the plugin to half on mode and enable mobile support.</li>
348
- <li> 2. Delete the plugin mod_rewrite rules in <?php echo $home_path; ?>.htaccess enclosed by <code># BEGIN WPSuperCache</code> and <code># END WPSuperCache</code> and let the plugin regenerate them by reloading this page.</li>
349
- <li> 3. Add the rules yourself. Edit <?php echo $home_path; ?>.htaccess and find the block of code enclosed by the lines <code># BEGIN WPSuperCache</code> and <code># END WPSuperCache</code>. There are two sections that look very similar. Just below the line <code>%{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$</code> add this line: (do it twice, once for each section)</p>
350
- <div style='border: 1px solid #333; width:400px; overflow: scroll'><pre>RewriteCond %{HTTP_user_agent} !^.*(Android|2.0\ MMP|240x320|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|hiptop|IEMobile|iPhone|iPod|KYOCERA/WX310K|LG/U990|MIDP-2.0|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|Playstation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|Windows\ CE|WinWAP).*</pre></div></li></ol></blockquote>
351
- <?php } ?>
352
- <p><strong>Note:</strong> If uninstalling this plugin, make sure the directory <em><?php echo WP_CONTENT_DIR; ?></em> is writeable by the webserver so the files <em>advanced-cache.php</em> and <em>cache-config.php</em> can be deleted automatically. (Making sure those files are writeable too is probably a good idea!)</p>
353
- <p>Uninstall using the <a href="<?php echo WP_PLUGIN_URL; ?>/wp-super-cache/uninstall.php">uninstall script</a> to remove files and directories created by the plugin. (Please see <a href="<?php echo WP_PLUGIN_URL; ?>/wp-super-cache/readme.txt">readme.txt</a> for instructions on uninstalling this script.)</p>
354
  <?php
355
- echo "<div class='submit'><input type='submit' " . SUBMITDISABLED . " value='Update Status &raquo;' /></div>";
356
  wp_nonce_field('wp-cache');
357
  ?>
358
  </form>
359
  <?php
360
  if( $super_cache_enabled && function_exists( 'apache_get_modules' ) ) {
361
  $mods = apache_get_modules();
362
- $required_modules = array( 'mod_mime' => 'Required to serve compressed supercache files properly.', 'mod_headers' => 'Required to set caching information on supercache pages. IE7 users will see old pages without this module.', 'mod_expires' => 'Set the expiry date on supercached pages. Visitors may not see new pages when they refresh or leave comments without this module.' );
363
  foreach( $required_modules as $req => $desc ) {
364
  if( !in_array( $req, $mods ) ) {
365
  $missing_mods[ $req ] = $desc;
366
  }
367
  }
368
  if( isset( $missing_mods) && is_array( $missing_mods ) ) {
369
- echo "<h3>Missing Apache Modules</h3>";
370
- echo "<p>The following Apache modules are missing. The plugin will work in half-on mode without them. In full Supercache mode, your visitors may see corrupted pages or out of date content however.</p>";
371
  echo "<ul>";
372
  foreach( $missing_mods as $req => $desc ) {
373
  echo "<li> $req - $desc</li>";
@@ -379,12 +394,12 @@ jQuery(document).ready(function(){
379
  </fieldset>
380
  </td><td valign='top'>
381
  <div style='background: #ffc; border: 1px solid #333; margin: 2px; padding: 5px'>
382
- <h3 align='center'>Make WordPress Faster</h3>
383
  <?php if( $wp_cache_hide_donation != 1 ) { ?>
384
- <p><a href="http://ocaoimh.ie/wp-super-cache/?r=wpsc">WP Super Cache</a> really makes your blog go faster. Make it go faster<sup>*</sup> by buying me an <a href="http://ocaoimh.ie/agc">Amazon gift card</a>! Make it out to "donncha@ocaoimh.ie". A £10 card would be nice but it's up to you how much you think this plugin is worth to you.</p>
385
- <p>If Amazon isn't your thing, there's also PayPal. Click the "Donate" button below or take a quick peek at my <a href="http://ocaoimh.ie/wish">wishlist</a>.</p>
386
- <p>Thanks in advance!<br />Donncha<br />
387
- <small>* Ok, it won't go any faster but you'll make this plugin author very happy!</small></p>
388
  <div align='center'>
389
  <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
390
  <input type="hidden" name="cmd" value="_s-xclick"/>
@@ -392,12 +407,38 @@ jQuery(document).ready(function(){
392
  <input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_donate_SM.gif" border="0" name="submit" alt=""/>
393
  <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"/><br />
394
  </form>
395
- <p>Don't show me this again. <form action="<?php echo $_SERVER["REQUEST_URI"]; ?>" method="post"><input type='hidden' name='wp_cache_hide_donation' value='1' /><input type='submit' value='Hide' /><?php wp_nonce_field('wp-cache'); ?></form></p>
396
  </div>
397
  <?php } else { ?>
398
- <p><a href="http://ocaoimh.ie/wp-super-cache/?r=supercache">WP Super Cache</a> is maintained and developed by <a href="http://ocaoimh.ie/?r=supercache">Donncha O Caoimh</a> with contributions from many others.</p>
399
- <p>He blogs at <a href="http://ocaoimh.ie/?r=supercache">Holy Shmoly</a>, posts photos at <a href="http://inphotos.org/?r=supercache">In Photos.org</a> and <a href="http://ocaoimh.ie/gad">wishes</a> he had more time to read and relax.</p><p>Please say hi to him on <a href="http://twitter.com/donncha/">Twitter</a> too!</p>
400
- <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
401
  </div>
402
 
403
  </td></table>
@@ -409,7 +450,7 @@ jQuery(document).ready(function(){
409
 
410
  wp_cache_edit_max_time();
411
 
412
- echo '<a name="files"></a><fieldset class="options"><h3>Accepted Filenames &amp; Rejected URIs</h3>';
413
  wp_cache_edit_rejected_pages();
414
  echo "\n";
415
  wp_cache_edit_rejected();
@@ -419,6 +460,7 @@ jQuery(document).ready(function(){
419
 
420
  wp_cache_edit_rejected_ua();
421
 
 
422
 
423
  wp_lock_down();
424
 
@@ -433,7 +475,7 @@ jQuery(document).ready(function(){
433
  $out = ob_get_contents();
434
  ob_end_clean();
435
  if( SUBMITDISABLED == ' ' && $out != '' ) {
436
- echo '<fieldset class="options"><h3>Cache Plugins</h3>';
437
  echo $out;
438
  echo '</fieldset>';
439
  }
@@ -442,24 +484,31 @@ jQuery(document).ready(function(){
442
  }
443
 
444
  function wsc_mod_rewrite() {
445
- global $super_cache_enabled, $cache_compression, $cache_compression_changed, $valid_nonce, $cache_path;
446
- if( $super_cache_enabled == false )
 
 
 
447
  return;
 
 
 
448
  if( false == defined( 'WPSC_DISABLE_COMPRESSION' ) ) {
449
  ?>
 
450
  <fieldset class="options">
451
- <h3>Super Cache Compression</h3>
452
- <form name="wp_manager" action="<?php echo $_SERVER["REQUEST_URI"]; ?>" method="post">
453
- <label><input type="radio" name="cache_compression" value="1" <?php if( $cache_compression ) { echo "checked=checked"; } ?>> Enabled</label>
454
- <label><input type="radio" name="cache_compression" value="0" <?php if( !$cache_compression ) { echo "checked=checked"; } ?>> Disabled</label>
455
- <p>Compression is disabled by default because some hosts have problems with compressed files. Switching this on and off clears the cache.</p>
456
  <?php
457
  if( isset( $cache_compression_changed ) && isset( $_POST[ 'cache_compression' ] ) && !$cache_compression ) {
458
- ?><p><strong>Super Cache compression is now disabled.</strong></p> <?php
459
  } elseif( isset( $cache_compression_changed ) && isset( $_POST[ 'cache_compression' ] ) && $cache_compression ) {
460
- ?><p><strong>Super Cache compression is now enabled.</strong></p><?php
461
  }
462
- echo '<div class="submit"><input ' . SUBMITDISABLED . 'type="submit" value="Update Compression &raquo;" /></div>';
463
  wp_nonce_field('wp-cache');
464
  echo "</form>\n";
465
  ?></fieldset>
@@ -476,7 +525,6 @@ function wsc_mod_rewrite() {
476
  }
477
  $home_path = get_home_path();
478
  $home_root = parse_url(get_bloginfo('url'));
479
- $home_root = trailingslashit($home_root['path']);
480
  $home_root = isset( $home_root['path'] ) ? trailingslashit( $home_root['path'] ) : '/';
481
  $inst_root = str_replace( '//', '/', '/' . trailingslashit( str_replace( $document_root, '', str_replace( '\\', '/', WP_CONTENT_DIR ) ) ) );
482
  $wprules = implode( "\n", extract_from_markers( $home_path.'.htaccess', 'WordPress' ) );
@@ -488,10 +536,10 @@ function wsc_mod_rewrite() {
488
  $condition_rules[] = "RewriteCond %{REQUEST_URI} !^.*[^/]$";
489
  $condition_rules[] = "RewriteCond %{REQUEST_URI} !^.*//.*$";
490
  }
491
- $condition_rules[] = "RewriteCond %{REQUEST_METHOD} !=POST";
492
  $condition_rules[] = "RewriteCond %{QUERY_STRING} !.*=.*";
493
- $condition_rules[] = "RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$";
494
- $condition_rules[] = "RewriteCond %{HTTP_user_agent} !^.*(Android|2.0\\ MMP|240x320|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|hiptop|IEMobile|iPhone|iPod|KYOCERA/WX310K|LG/U990|MIDP-2.0|MMEF20|MOT-V|NetFront|Newt|Nintendo\\ Wii|Nitro|Nokia|Opera\\ Mini|Palm|Playstation\\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|Small|SonyEricsson|Symbian\\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|Windows\\ CE|WinWAP).*";
495
  $condition_rules = apply_filters( 'supercacherewriteconditions', $condition_rules );
496
 
497
  $rules = "<IfModule mod_rewrite.c>\n";
@@ -514,23 +562,22 @@ function wsc_mod_rewrite() {
514
 
515
  $dohtaccess = true;
516
  if( function_exists( 'is_site_admin' ) ) {
517
- echo "<h4 style='color: #a00'>WordPress MU Detected</h4><p>Unfortunately the rewrite rules cannot be updated automatically when running WordPress MU. Please open your .htaccess and add the following mod_rewrite rules above any other rules in that file.</p>";
518
  } elseif( !$wprules || $wprules == '' ) {
519
- echo "<h4 style='color: #a00'>Mod Rewrite rules cannot be updated!</h4>";
520
- echo "<p>You must have <strong>BEGIN</strong> and <strong>END</strong> markers in {$home_path}.htaccess for the auto update to work. They look like this and surround the main WordPress mod_rewrite rules:
521
- <blockquote><pre><em># BEGIN WordPress</em>\n RewriteCond %{REQUEST_FILENAME} !-f\n RewriteCond %{REQUEST_FILENAME} !-d\n RewriteRule . /index.php [L]\n <em># END WordPress</em></pre></blockquote>
522
- Refresh this page when you have updated your .htaccess file.";
523
  echo "</fieldset></div>";
524
  return;
525
  } elseif( strpos( $wprules, 'wordpressuser' ) ) { // Need to clear out old mod_rewrite rules
526
- echo "<p><strong>Thank you for upgrading.</strong> The mod_rewrite rules changed since you last installed this plugin. Unfortunately you must remove the old supercache rules before the new ones are updated. Refresh this page when you have edited your .htaccess file. If you wish to manually upgrade, change the following line: <blockquote><code>RewriteCond %{HTTP_COOKIE} !^.*wordpressuser.*\$</code></blockquote> so it looks like this: <blockquote><code>RewriteCond %{HTTP:Cookie} !^.*wordpress.*\$</code></blockquote> The only changes are 'HTTP_COOKIE' becomes 'HTTP:Cookie' and 'wordpressuser' becomes 'wordpress'. This is a WordPress 2.5 change but it's backwards compatible with older versions if you're brave enough to use them.</p>";
527
  echo "</fieldset></div>";
528
  return;
529
  } elseif( $scrules != '' && strpos( $scrules, '%{REQUEST_URI} !^.*[^/]$' ) === false && substr( get_option( 'permalink_structure' ), -1 ) == '/' ) { // permalink structure has a trailing slash, need slash check in rules.
530
- echo "<div style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'><h4>Trailing slash check required.</h4><p>It looks like your blog has URLs that end with a '/'. Unfortunately since you installed this plugin a duplicate content bug has been found where URLs not ending in a '/' end serve the same content as those with the '/' and do not redirect to the proper URL.";
531
- echo "To fix, you must edit your .htaccess file and add these two rules to the two groups of Super Cache rules:</p>";
532
  echo "<blockquote><code>RewriteCond %{REQUEST_URI} !^.*[^/]$RewriteCond %{REQUEST_URI} !^.*//.*$</code></blockquote>";
533
- echo "<p>You can see where the rules go and examine the complete rules by clicking the 'View mod_rewrite rules' link below.</p></div>";
534
  $dohtaccess = false;
535
  } elseif( strpos( $scrules, 'supercache' ) || strpos( $wprules, 'supercache' ) ) { // only write the rules once
536
  $dohtaccess = false;
@@ -538,27 +585,27 @@ function wsc_mod_rewrite() {
538
  // cache/.htaccess rules
539
  $gziprules = "<IfModule mod_mime.c>\n <FilesMatch \"\\.html\\.gz\$\">\n ForceType text/html\n FileETag None\n </FilesMatch>\n AddEncoding gzip .gz\n AddType text/html .gz\n</IfModule>\n";
540
  $gziprules .= "<IfModule mod_deflate.c>\n SetEnvIfNoCase Request_URI \.gz$ no-gzip\n</IfModule>\n";
541
- $gziprules .= "<IfModule mod_headers.c>\n Header set Cache-Control 'max-age=300, must-revalidate'\n</IfModule>\n";
542
  $gziprules .= "<IfModule mod_expires.c>\n ExpiresActive On\n ExpiresByType text/html A300\n</IfModule>\n";
543
  if( $dohtaccess && !$_POST[ 'updatehtaccess' ] ) {
544
  if( !is_writeable_ACLSafe( $home_path . ".htaccess" ) ) {
545
- echo "<div style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'><h4>Cannot update .htaccess</h4><p>The file <code>{$home_path}.htaccess</code> cannot be modified by the web server. Please correct this using the chmod command or your ftp client.</p><p>Refresh this page when the file permissions have been modified.</p><p>Alternatively, you can edit your <code>{$home_path}.htaccess</code> file manually and add the following code (before any WordPress rules):</p>";
546
  echo "<p><pre># BEGIN WPSuperCache\n" . wp_specialchars( $rules ) . "# END WPSuperCache</pre></p></div>";
547
  } else {
548
- echo "<div style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'><p>To serve static html files your server must have the correct mod_rewrite rules added to a file called <code>{$home_path}.htaccess</code> ";
549
  if( !function_exists( 'is_site_admin' ) ) {
550
- echo "You must edit the file yourself add the following rules.";
551
  } else {
552
- echo "You can edit the file yourself add the following rules.";
553
  }
554
- echo " Make sure they appear before any existing WordPress rules.</p>";
555
  echo "<pre># BEGIN WPSuperCache\n" . wp_specialchars( $rules ) . "# END WPSuperCache</pre></p>";
556
- echo "<p>Rules must be added to " . WP_CONTENT_DIR . "/cache/.htaccess too:</p>";
557
  echo "<pre># BEGIN supercache\n" . wp_specialchars( $gziprules ) . "# END supercache</pre></p>";
558
  if( !function_exists( 'is_site_admin' ) ) {
559
- echo '<form name="updatehtaccess" action="'. $_SERVER["REQUEST_URI"] . '#modrewrite" method="post">';
560
  echo '<input type="hidden" name="updatehtaccess" value="1" />';
561
- echo '<div class="submit"><input type="submit" ' . SUBMITDISABLED . 'id="updatehtaccess" value="Update Mod_Rewrite Rules &raquo;" /></div>';
562
  wp_nonce_field('wp-cache');
563
  echo "</form></div>\n";
564
  }
@@ -567,17 +614,17 @@ function wsc_mod_rewrite() {
567
  wpsc_remove_marker( $home_path.'.htaccess', 'WordPress' ); // remove original WP rules so SuperCache rules go on top
568
  echo "<div style='padding:0 8px;color:#4f8a10;background-color:#dff2bf;border:1px solid #4f8a10;'>";
569
  if( insert_with_markers( $home_path.'.htaccess', 'WPSuperCache', explode( "\n", $rules ) ) && insert_with_markers( $home_path.'.htaccess', 'WordPress', explode( "\n", $wprules ) ) ) {
570
- echo "<h4>Mod Rewrite rules updated!</h4>";
571
- echo "<p><strong>{$home_path}.htaccess has been updated with the necessary mod_rewrite rules. Please verify they are correct. They should look like this:</strong></p>\n";
572
  } else {
573
- echo "<h4>Mod Rewrite rules must be updated!</h4>";
574
- echo "<p><strong> Your {$home_path}.htaccess is not writable by the webserver and must be updated with the necessary mod_rewrite rules. The new rules go above the regular WordPress rules as shown in the code below:</strong></p>\n";
575
  }
576
  echo "<p><pre>" . wp_specialchars( $rules ) . "</pre></p>\n</div>";
577
  } else {
578
  ?>
579
- <p>WP Super Cache mod rewrite rules were detected in your <?php echo $home_path ?>.htaccess file.<br /> Click the following link to see the lines added to that file. If you have upgraded the plugin make sure these rules match.<br /><br />
580
- <a href="javascript:toggleLayer('rewriterules');" class="button">View Mod_Rewrite Rules</a>
581
  <div id='rewriterules' style='display: none;'>
582
  <?php echo "<p><pre># BEGIN WPSuperCache\n" . wp_specialchars( $rules ) . "# END WPSuperCache</pre></p>\n";
583
  echo "<p>Rules must be added to " . WP_CONTENT_DIR ."/cache/.htaccess too:</p>";
@@ -588,17 +635,17 @@ function wsc_mod_rewrite() {
588
  // http://allmybrain.com/2007/11/08/making-wp-super-cache-gzip-compression-work/
589
  if( !is_file( $cache_path . '.htaccess' ) ) {
590
  $gziprules = insert_with_markers( $cache_path . '.htaccess', 'supercache', explode( "\n", $gziprules ) );
591
- echo "<h4>Gzip encoding rules in {$cache_path}.htaccess created.</h4>";
592
  }
593
 
594
  ?></fieldset><?php
595
  }
596
 
597
  function wp_cache_restore() {
598
- echo '<fieldset class="options"><h3>Fix Configuration</h3>';
599
- echo '<form name="wp_restore" action="'. $_SERVER["REQUEST_URI"] . '" method="post">';
600
  echo '<input type="hidden" name="wp_restore_config" />';
601
- echo '<div class="submit"><input type="submit" ' . SUBMITDISABLED . 'id="deletepost" value="Restore Default Configuration &raquo;" /></div>';
602
  wp_nonce_field('wp-cache');
603
  echo "</form>\n";
604
  echo '</fieldset>';
@@ -606,7 +653,7 @@ function wp_cache_restore() {
606
  }
607
 
608
  function comment_form_lockdown_message() {
609
- ?><p><?php _e( "Comment moderation is enabled. Your comment may take some time to appear." ); ?></p><?php
610
  }
611
  if( defined( 'WPLOCKDOWN' ) && constant( 'WPLOCKDOWN' ) )
612
  add_action( 'comment_form', 'comment_form_lockdown_message' );
@@ -628,31 +675,33 @@ function wp_lock_down() {
628
  $wp_lock_down = '0';
629
  }
630
  }
631
- ?><fieldset class="options">
632
- <h3>Lock Down: <?php echo $wp_lock_down == '0' ? '<span style="color:red">Disabled</span>' : '<span style="color:green">Enabled</span>'; ?></h3>
633
- <p>Prepare your server for an expected spike in traffic by enabling the lock down. When this is enabled, new comments on a post will not refresh the cached static files.</p>
634
- <p>Developers: Make your plugin lock down compatible by checking the 'WPLOCKDOWN' constant. The following code will make sure your plugin respects the WPLOCKDOWN setting.
 
635
  <blockquote><code>if( defined( 'WPLOCKDOWN' ) && constant( 'WPLOCKDOWN' ) ) {
636
- &nbsp;&nbsp;&nbsp;&nbsp;echo "Sorry. My blog is locked down. Updates will appear shortly";
637
  }</code></blockquote>
638
  <?php
639
  if( $wp_lock_down == '1' ) {
640
- ?><p>WordPress is locked down. Super Cache static files will not be deleted when new comments are made.</p><?php
641
  } else {
642
- ?><p>WordPress is not locked down. New comments will refresh Super Cache static files as normal.</p><?php
643
  }
644
  $new_lockdown = $wp_lock_down == '1' ? '0' : '1';
645
- $new_lockdown_desc = $wp_lock_down == '1' ? 'Disable' : 'Enable';
646
- echo '<form name="wp_lock_down" action="'. $_SERVER["REQUEST_URI"] . '" method="post">';
647
  echo "<input type='hidden' name='wp_lock_down' value='{$new_lockdown}' />";
648
- echo "<div class='submit'><input type='submit' " . SUBMITDISABLED . " value='{$new_lockdown_desc} Lock Down &raquo;' /></div>";
649
  wp_nonce_field('wp-cache');
650
  echo "</form>\n";
651
 
652
  ?></fieldset><?php
653
  if( $cache_enabled == true && $super_cache_enabled == true ) {
654
- ?><fieldset class="options">
655
- <h3>Directly Cached Files</h3><?php
 
656
 
657
  $out = '';
658
  if( $valid_nonce && is_array( $_POST[ 'direct_pages' ] ) && !empty( $_POST[ 'direct_pages' ] ) ) {
@@ -710,7 +759,7 @@ function wp_lock_down() {
710
  @unlink( $pagefile );
711
  @unlink( $pagefile . '.gz' );
712
  RecursiveFolderDelete( $firstfolder );
713
- echo "<strong>$pagefile removed!</strong>";
714
  prune_super_cache( $cache_path, true );
715
  }
716
  }
@@ -718,11 +767,11 @@ function wp_lock_down() {
718
  $readonly = '';
719
  if( !is_writeable_ACLSafe( ABSPATH ) ) {
720
  $readonly = 'READONLY';
721
- ?><p style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'><strong>Warning!</strong> You must make <?php echo ABSPATH ?> writable to enable this feature. As this is a security risk please make it readonly after your page is generated.</p><?php
722
  } else {
723
- ?><p style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'><strong>Warning!</strong> <?php echo ABSPATH ?> is writable. Please make it readonly after your page is generated as this is a security risk.</p><?php
724
  }
725
- echo '<form name="direct_page" action="'. $_SERVER["REQUEST_URI"] . '" method="post">';
726
  if( is_array( $cached_direct_pages ) ) {
727
  $out = '';
728
  foreach( $cached_direct_pages as $page ) {
@@ -734,22 +783,22 @@ function wp_lock_down() {
734
  $out .= "<tr><td><input type='text' $readonly name='direct_pages[]' size='30' value='$page' /></td><td>$generated</td></tr>";
735
  }
736
  if( $out != '' ) {
737
- ?><table><tr><th>Existing direct page</th><th>Delete cached file</th></tr><?php
738
  echo "$out</table>";
739
  }
740
  }
741
  if( $readonly != 'READONLY' )
742
- echo "Add direct page: <input type='text' $readonly name='new_direct_page' size='30' value='' />";
743
 
744
- echo "<p>Directly cached files are files created directly off " . ABSPATH . " where your blog lives. This feature is only useful if you are expecting a major Digg or Slashdot level of traffic to one post or page.</p>";
745
  if( $readonly != 'READONLY' ) {
746
- echo "<p>For example: to cache <em>'" . trailingslashit( get_option( 'siteurl' ) ) . "about/'</em>, you would enter '" . trailingslashit( get_option( 'siteurl' ) ) . "about/' or '/about/'. The cached file will be generated the next time an anonymous user visits that page.</p>";
747
- echo "<p>Make the textbox blank to remove it from the list of direct pages and delete the cached file.</p>";
748
  }
749
 
750
  wp_nonce_field('wp-cache');
751
  if( $readonly != 'READONLY' )
752
- echo "<div class='submit'><input type='submit' ' . SUBMITDISABLED . 'value='Update Direct Pages &raquo;' /></div>";
753
  echo "</form>\n";
754
  ?></fieldset><?php
755
  } // if $super_cache_enabled
@@ -788,13 +837,14 @@ function wp_cache_edit_max_time () {
788
  }
789
  }
790
  ?><fieldset class="options">
791
- <h3>Expiry Time &amp; Garbage Collection</h3><?php
792
- echo '<form name="wp_edit_max_time" action="'. $_SERVER["REQUEST_URI"] . '" method="post">';
793
- echo '<label for="wp_max_time">Expire time:</label> ';
794
- echo "<input type=\"text\" size=6 name=\"wp_max_time\" value=\"$cache_max_time\" /> seconds";
795
- echo "<h4>Garbage Collection</h4><p>If expiry time is more than 1800 seconds (half an hour), garbage collection will be done every 10 minutes, otherwise it will happen 10 seconds after the expiry time above.</p>";
796
- echo "<p>Checking for and deleting expired files is expensive, but it's expensive leaving them there too. On a very busy site you should set the expiry time to <em>300 seconds</em>. Experiment with different values and visit this page to see how many expired files remain at different times during the day. Aim to have less than 500 cached files if possible.</p>";
797
- echo '<div class="submit"><input type="submit" ' . SUBMITDISABLED . 'value="Change Expiration &raquo;" /></div>';
 
798
  wp_nonce_field('wp-cache');
799
  echo "</form>\n";
800
  ?></fieldset><?php
@@ -833,17 +883,15 @@ function wp_cache_edit_rejected_ua() {
833
  wp_cache_replace_line('^ *\$cache_rejected_user_agent', "\$cache_rejected_user_agent = $text;", $wp_cache_config_file);
834
  }
835
 
836
- echo '<a name="user-agents"></a><fieldset class="options"><h3>Rejected User Agents</h3>';
837
- echo "<p>Strings in the HTTP 'User Agent' header that prevent WP-Cache from
838
- caching bot, spiders, and crawlers' requests.
839
- Note that super cached files are still sent to these agents if they already exists.</p>\n";
840
- echo '<form name="wp_edit_rejected_user_agent" action="'. $_SERVER["REQUEST_URI"] . '" method="post">';
841
  echo '<textarea name="wp_rejected_user_agent" cols="40" rows="4" style="width: 50%; font-size: 12px;" class="code">';
842
  foreach ($cache_rejected_user_agent as $ua) {
843
  echo wp_specialchars($ua) . "\n";
844
  }
845
  echo '</textarea> ';
846
- echo '<div class="submit"><input type="submit" ' . SUBMITDISABLED . 'value="Save UA Strings &raquo;" /></div>';
847
  wp_nonce_field('wp-cache');
848
  echo '</form>';
849
  echo "</fieldset>\n";
@@ -853,7 +901,7 @@ function wp_cache_edit_rejected_pages() {
853
  global $wp_cache_config_file, $valid_nonce, $wp_cache_pages;
854
 
855
  if ( isset( $_POST[ 'wp_edit_rejected_pages' ] ) && $valid_nonce ) {
856
- $pages = array( 'single', 'pages', 'archives', 'tag', 'frontpage', 'home', 'category' );
857
  foreach( $pages as $page ) {
858
  if ( isset( $_POST[ 'wp_cache_pages' ][ $page ] ) ) {
859
  $value = 1;
@@ -865,18 +913,21 @@ function wp_cache_edit_rejected_pages() {
865
  }
866
  }
867
 
868
- echo '<p>Do not cache the following page types. See the <a href="http://codex.wordpress.org/Conditional_Tags">Conditional Tags</a> documentation for a complete discussion on each type.</p>';
869
- echo '<form name="wp_edit_rejected_pages" action="'. $_SERVER["REQUEST_URI"] . '" method="post">';
 
870
  echo '<input type="hidden" name="wp_edit_rejected_pages" value="1" />';
871
- echo '<label><input type="checkbox" value="1" name="wp_cache_pages[single]" ' . checked( 1, $wp_cache_pages[ 'single' ], false ) . ' /> Single Posts (is_single)</label><br />';
872
- echo '<label><input type="checkbox" value="1" name="wp_cache_pages[pages]" ' . checked( 1, $wp_cache_pages[ 'pages' ], false ) . ' /> Pages (is_page)</label><br />';
873
- echo '<label><input type="checkbox" value="1" name="wp_cache_pages[frontpage]" ' . checked( 1, $wp_cache_pages[ 'frontpage' ], false ) . ' /> Front Page (is_front_page)</label><br />';
874
- echo '&nbsp;&nbsp;<label><input type="checkbox" value="1" name="wp_cache_pages[home]" ' . checked( 1, $wp_cache_pages[ 'home' ], false ) . ' /> Home (is_home)</label><br />';
875
- echo '<label><input type="checkbox" value="1" name="wp_cache_pages[archives]" ' . checked( 1, $wp_cache_pages[ 'archives' ], false ) . ' /> Archives (is_archive)</label><br />';
876
- echo '&nbsp;&nbsp;<label><input type="checkbox" value="1" name="wp_cache_pages[tag]" ' . checked( 1, $wp_cache_pages[ 'tag' ], false ) . ' /> Tags (is_tag)</label><br />';
877
- echo '&nbsp;&nbsp;<label><input type="checkbox" value="1" name="wp_cache_pages[category]" ' . checked( 1, $wp_cache_pages[ 'category' ], false ) . ' /> Category (is_category)</label><br />';
878
-
879
- echo '<div class="submit"><input type="submit" ' . SUBMITDISABLED . 'value="Save &raquo;" /></div>';
 
 
880
  wp_nonce_field('wp-cache');
881
  echo "</form>\n";
882
 
@@ -891,14 +942,15 @@ function wp_cache_edit_rejected() {
891
  }
892
 
893
 
894
- echo '<form name="wp_edit_rejected" action="'. $_SERVER["REQUEST_URI"] . '" method="post">';
895
- echo "<p>Add here strings (not a filename) that forces a page not to be cached. For example, if your URLs include year and you dont want to cache last year posts, it's enough to specify the year, i.e. '/2004/'. WP-Cache will search if that string is part of the URI and if so, it will not cache that page.</p>\n";
 
896
  echo '<textarea name="wp_rejected_uri" cols="40" rows="4" style="width: 50%; font-size: 12px;" class="code">';
897
  foreach ($cache_rejected_uri as $file) {
898
  echo wp_specialchars( $file ) . "\n";
899
  }
900
  echo '</textarea> ';
901
- echo '<div class="submit"><input type="submit" ' . SUBMITDISABLED . 'value="Save Strings &raquo;" /></div>';
902
  wp_nonce_field('wp-cache');
903
  echo "</form>\n";
904
  }
@@ -912,23 +964,85 @@ function wp_cache_edit_accepted() {
912
  }
913
 
914
 
915
- echo '<div style="clear:both"></div><form name="wp_edit_accepted" action="'. $_SERVER["REQUEST_URI"] . '" method="post">';
916
- echo "<p>Add here those filenames that can be cached, even if they match one of the rejected substring specified above.</p>\n";
 
917
  echo '<textarea name="wp_accepted_files" cols="40" rows="8" style="width: 50%; font-size: 12px;" class="code">';
918
  foreach ($cache_acceptable_files as $file) {
919
  echo wp_specialchars($file) . "\n";
920
  }
921
  echo '</textarea> ';
922
- echo '<div class="submit"><input type="submit" ' . SUBMITDISABLED . 'value="Save Files &raquo;" /></div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
923
  wp_nonce_field('wp-cache');
924
  echo "</form>\n";
 
925
  }
926
 
927
  function wp_cache_enable() {
928
  global $wp_cache_config_file, $cache_enabled, $supercachedir;
929
 
930
  if(get_option('gzipcompression')) {
931
- echo "<strong>Error: GZIP compression is enabled, disable it if you want to enable wp-cache.</strong>";
932
  return false;
933
  }
934
  if( wp_cache_replace_line('^ *\$cache_enabled', '$cache_enabled = true;', $wp_cache_config_file) ) {
@@ -976,7 +1090,7 @@ function wp_cache_is_enabled() {
976
  global $wp_cache_config_file;
977
 
978
  if(get_option('gzipcompression')) {
979
- echo "<strong>Warning</strong>: GZIP compression is enabled in Wordpress, wp-cache will be bypassed until you disable gzip compression.";
980
  return false;
981
  }
982
  $lines = file($wp_cache_config_file);
@@ -1034,12 +1148,12 @@ function wp_cache_verify_cache_dir() {
1034
  $dir = dirname($cache_path);
1035
  if ( !file_exists($cache_path) ) {
1036
  if ( !is_writeable_ACLSafe( $dir ) || !($dir = mkdir( $cache_path ) ) ) {
1037
- echo "<strong>Error:</strong> Your cache directory (<strong>$cache_path</strong>) did not exist and couldn't be created by the web server. Check $dir permissions.";
1038
  return false;
1039
  }
1040
  }
1041
  if ( !is_writeable_ACLSafe($cache_path)) {
1042
- echo "<strong>Error:</strong> Your cache directory (<strong>$cache_path</strong>) or <strong>$dir</strong> need to be writable for this plugin to work. Double-check it.";
1043
  return false;
1044
  }
1045
 
@@ -1071,18 +1185,18 @@ function wp_cache_verify_config_file() {
1071
  if( is_writeable_ACLSafe( $wp_cache_config_file ) ) {
1072
  @unlink( $wp_cache_config_file );
1073
  } else {
1074
- echo "<strong>Error:</strong> Your WP-Cache config file (<strong>$wp_cache_config_file</strong>) is out of date and not writable by the Web server.Please delete it and refresh this page.";
1075
  return false;
1076
  }
1077
  }
1078
  } elseif( !is_writeable_ACLSafe($dir)) {
1079
- echo "<strong>Error:</strong> Configuration file missing and " . WP_CONTENT_DIR . " directory (<strong>$dir</strong>) is not writable by the Web server.Check its permissions.";
1080
  return false;
1081
  }
1082
 
1083
  if ( !file_exists($wp_cache_config_file) ) {
1084
  if ( !file_exists($wp_cache_config_file_sample) ) {
1085
- echo "<strong>Error:</strong> Sample WP-Cache config file (<strong>$wp_cache_config_file_sample</strong>) does not exist.Verify you installation.";
1086
  return false;
1087
  }
1088
  copy($wp_cache_config_file_sample, $wp_cache_config_file);
@@ -1138,12 +1252,12 @@ function wp_cache_check_link() {
1138
  }
1139
 
1140
  if( false == $ret ) {
1141
- echo "<h3>Warning! <em>" . constant( 'WP_CONTENT_DIR' ) . "/advanced-cache.php</em> does not exist or cannot be updated.</h3>";
1142
- echo "<p><ul><li>1. If it already exists please delete the file first.</li>";
1143
- echo "<li>2. Make " . constant( 'WP_CONTENT_DIR' ) . " writable using the chmod command through your ftp or server software. (<em>chmod 777 " . constant( 'WP_CONTENT_DIR' ) . "</em>) and refresh this page. This is only a temporary measure and you'll have to make it read only afterwards again. (Change 777 to 755 in the previous command)</li>";
1144
- echo "<li>3. Refresh this page to update <em>" . constant( 'WP_CONTENT_DIR' ) . "/advanced-cache.php</em></li></ul>";
1145
- echo "If that doesn't work, make sure the file <em>" . constant( 'WP_CONTENT_DIR' ) . "/advanced-cache.php</em> doesn't exist:<ol>";
1146
- echo "<li>1. Open <em>$wp_cache_file</em> in a text editor.</li><li>2. Change the text <em>CACHEHOME</em> to <em>" . constant( 'WPCACHEHOME' ) . "</em></li><li>3. Save the file and copy it to <em>$wp_cache_link</em> and refresh this page.</li>";
1147
  return false;
1148
  }
1149
  return true;
@@ -1159,7 +1273,7 @@ function wp_cache_check_global_config() {
1159
  $global = dirname(ABSPATH) . '/wp-config.php';
1160
  }
1161
 
1162
- $howtoenable = "Edit <code>$global</code> and add the following line: <code>define('WP_CACHE', true);</code>Otherwise, <strong>WP-Cache will not be executed</strong> by Wordpress core. ";
1163
  $lines = file($global);
1164
  foreach($lines as $line) {
1165
  if (preg_match('/^\s*define\s*\(\s*\'WP_CACHE\'\s*,\s*(?i:TRUE|1)\s*\)\s*;/', $line)) {
@@ -1169,7 +1283,7 @@ function wp_cache_check_global_config() {
1169
  }
1170
  $line = 'define(\'WP_CACHE\', true);';
1171
  if (!is_writeable_ACLSafe($global) || !wp_cache_replace_line('define *\( *\'WP_CACHE\'', $line, $global) ) {
1172
- echo "<strong>Error: WP_CACHE is not enabled</strong> in your <code>wp-config.php</code> file and I couldn't modify it.";
1173
  echo $howtoenable;
1174
  return false;
1175
  }
@@ -1177,7 +1291,7 @@ function wp_cache_check_global_config() {
1177
  }
1178
 
1179
  function wp_cache_files() {
1180
- global $cache_path, $file_prefix, $cache_max_time, $valid_nonce, $supercachedir, $cache_enabled, $super_cache_enabled, $blog_cache_dir;
1181
 
1182
  if ( '/' != substr($cache_path, -1)) {
1183
  $cache_path .= '/';
@@ -1187,26 +1301,12 @@ function wp_cache_files() {
1187
  if(isset($_REQUEST['wp_delete_cache'])) {
1188
  wp_cache_clean_cache($file_prefix);
1189
  }
1190
- if(isset($_REQUEST['wp_delete_cache_file'])) {
1191
- wp_cache_clean_cache($_REQUEST['wp_delete_cache_file']);
1192
- }
1193
  if(isset($_REQUEST['wp_delete_expired'])) {
1194
  wp_cache_clean_expired($file_prefix);
1195
  }
1196
  }
1197
- if(isset($_REQUEST['wp_list_cache'])) {
1198
- $list_files = true;
1199
- $list_mess = "Update list";
1200
- } else
1201
- $list_mess = "List files";
1202
-
1203
  echo '<fieldset class="options" id="show-this-fieldset"><h3>Cache Contents</h3>';
1204
- /*
1205
- echo '<form name="wp_cache_content_list" action="'. $_SERVER["REQUEST_URI"] . '" method="post">';
1206
- echo '<input type="hidden" name="wp_list_cache" />';
1207
- echo '<div class="submit"><input type="submit" ' . SUBMITDISABLED . 'value="'.$list_mess.' &raquo;" /></div>';
1208
- echo "</form>\n";
1209
- */
1210
 
1211
  $list_files = false; // it doesn't list supercached files, and removing single pages is buggy
1212
  $count = 0;
@@ -1215,40 +1315,53 @@ function wp_cache_files() {
1215
  if ( ($handle = @opendir( $blog_cache_dir . 'meta/' )) ) {
1216
  if ($list_files) echo "<table cellspacing=\"0\" cellpadding=\"5\">";
1217
  $wp_cache_fsize = 0;
1218
- while ( false !== ($file = readdir($handle))) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1219
  if ( preg_match("/^$file_prefix.*\.meta/", $file) ) {
1220
- $this_expired = false;
1221
  $content_file = preg_replace("/meta$/", "html", $file);
1222
  $mtime = filemtime( $blog_cache_dir . 'meta/' . $file );
1223
  if ( ! ( $fsize = @filesize( $blog_cache_dir . $content_file ) ) )
1224
  continue; // .meta does not exists
1225
- $wp_cache_fsize += $fsize;
1226
- $fsize = intval($fsize/1024);
1227
  $age = $now - $mtime;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1228
  if ( $age > $cache_max_time ) {
1229
  $expired++;
1230
- $this_expired = true;
1231
- }
1232
- $count++;
1233
- /*
1234
- if ($list_files) {
1235
- $meta = new CacheMeta;
1236
- $meta = unserialize(file_get_contents($cache_path . 'meta/' . $file));
1237
- echo $flip ? '<tr style="background: #EAEAEA;">' : '<tr>';
1238
- $flip = !$flip;
1239
- echo '<td><a href="http://' . $meta->uri . '" target="_blank" >';
1240
- echo $meta->uri . "</a></td>";
1241
- if ($this_expired) echo "<td><span style='color:red'>$age secs</span></td>";
1242
- else echo "<td>$age secs</td>";
1243
- echo "<td>$fsize KB</td>";
1244
- echo '<td><form name="wp_delete_cache_file" action="'. $_SERVER["REQUEST_URI"] . '" method="post">';
1245
- echo '<input type="hidden" name="wp_list_cache" />';
1246
- echo '<input type="hidden" name="wp_delete_cache_file" value="'.preg_replace("/^(.*)\.meta$/", "$1", $file).'" />';
1247
- echo '<div class="submit"><input id="deletepost" ' . SUBMITDISABLED . 'type="submit" value="Remove" /></div>';
1248
- wp_nonce_field('wp-cache');
1249
- echo "</form></td></tr>\n";
1250
  }
1251
- */
 
1252
  }
1253
  }
1254
  closedir($handle);
@@ -1268,7 +1381,7 @@ function wp_cache_files() {
1268
  }
1269
  if( $cache_enabled == true && $super_cache_enabled == true ) {
1270
  $now = time();
1271
- $sizes = array( 'expired' => 0, 'cached' => 0, 'ts' => 0 );
1272
 
1273
  if (is_dir($supercachedir)) {
1274
  if( $dh = opendir( $supercachedir ) ) {
@@ -1280,15 +1393,22 @@ function wp_cache_files() {
1280
  closedir($dh);
1281
  }
1282
  } else {
1283
- if(is_file($supercachedir) && filemtime( $supercachedir ) + $cache_max_time <= $now )
 
1284
  $sizes[ 'expired' ] ++;
1285
- }
 
 
 
 
 
 
1286
  $sizes[ 'ts' ] = time();
1287
  }
1288
 
1289
- echo "<p><strong>WP-Cache ({$wp_cache_fsize})</strong></p>";
1290
- echo "<ul><li>$count Cached Pages</li>";
1291
- echo "<li>$expired Expired Pages</li></ul>";
1292
  if( $cache_enabled == true && $super_cache_enabled == true ) {
1293
  $fsize = $sizes[ 'fsize' ] / 1024;
1294
  if( $fsize > 1024 ) {
@@ -1298,29 +1418,101 @@ function wp_cache_files() {
1298
  } else {
1299
  $fsize = "0KB";
1300
  }
1301
- echo "<p><strong>WP-Super-Cache ({$fsize})</strong></p>";
1302
- echo "<ul><li>" . intval($sizes['cached']/2) . " Cached Pages</li>";
 
1303
  $age = intval(($now - $sizes['ts'])/60);
1304
- echo "<li>" . intval($sizes['expired']/2) . " Expired Pages</li></ul>";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1305
  }
1306
  $last_gc = get_option( "wpsupercache_gc_time" );
1307
  if( $last_gc ) {
1308
  $next_gc = $cache_max_time < 1800 ? $cache_max_time : 600;
1309
  $next_gc_mins = ( time() - $last_gc );
1310
- echo "<p><strong>Garbage Collection</strong><br />Last GC was <strong>" . date( 'i:s', $next_gc_mins ) . "</strong> minutes ago<br />";
1311
- echo "Next GC in <strong>" . date( 'i:s', $next_gc - $next_gc_mins ) . "</strong> minutes</p>";
1312
  }
1313
 
1314
- echo "<p>Expired files are files older than $cache_max_time seconds. They are still used by the plugin and are deleted periodically.</p>";
1315
- echo '<form name="wp_cache_content_expired" action="'. $_SERVER["REQUEST_URI"] . '" method="post">';
1316
  echo '<input type="hidden" name="wp_delete_expired" />';
1317
- echo '<div class="submit" style="float:left"><input type="submit" ' . SUBMITDISABLED . 'value="Delete Expired &raquo;" /></div>';
1318
  wp_nonce_field('wp-cache');
1319
  echo "</form>\n";
1320
 
1321
- echo '<form name="wp_cache_content_delete" action="'. $_SERVER["REQUEST_URI"] . '" method="post">';
1322
  echo '<input type="hidden" name="wp_delete_cache" />';
1323
- echo '<div class="submit" style="float:left;margin-left:10px"><input id="deletepost" type="submit" ' . SUBMITDISABLED . 'value="Delete Cache &raquo;" /></div>';
1324
  wp_nonce_field('wp-cache');
1325
  echo "</form>\n";
1326
 
@@ -1334,12 +1526,12 @@ function delete_cache_dashboard() {
1334
  if( function_exists('current_user_can') && !current_user_can('manage_options') )
1335
  return false;
1336
 
1337
- echo "<li><a href='" . wp_nonce_url( 'options-general.php?page=wpsupercache&wp_delete_cache=1', 'wp-cache' ) . "' target='_blank' title='Delete Super Cache cached files (opens in new window)'>Delete Cache</a></li>";
1338
  }
1339
  add_action( 'dashmenu', 'delete_cache_dashboard' );
1340
 
1341
  function wpsc_dirsize($directory, $sizes) {
1342
- global $cache_max_time;
1343
  $now = time();
1344
 
1345
  if (is_dir($directory)) {
@@ -1353,10 +1545,15 @@ function wpsc_dirsize($directory, $sizes) {
1353
  }
1354
  } else {
1355
  if(is_file($directory) ) {
1356
- if( filemtime( $directory ) + $cache_max_time <= $now ) {
 
1357
  $sizes[ 'expired' ]+=1;
 
 
1358
  } else {
1359
  $sizes[ 'cached' ]+=1;
 
 
1360
  }
1361
  if ( ! isset( $sizes[ 'fsize' ] ) )
1362
  $sizes[ 'fsize' ] = @filesize( $directory );
@@ -1381,9 +1578,9 @@ function wp_cache_clean_cache($file_prefix) {
1381
  }
1382
  prune_super_cache( $cache_path, true );
1383
  $_POST[ 'super_cache_stats' ] = 1; // regenerate super cache stats;
1384
- }
1385
  return wp_cache_phase2_clean_cache($file_prefix);
1386
- }
1387
 
1388
  $expr = "/^$file_prefix/";
1389
  if ( ($handle = @opendir( $blog_cache_dir )) ) {
@@ -1461,7 +1658,7 @@ function wpsc_remove_marker( $filename, $marker ) {
1461
  }
1462
 
1463
  function wp_super_cache_footer() {
1464
- ?><p id='supercache'><?php bloginfo('name'); ?> is Digg proof thanks to caching by <a href="http://ocaoimh.ie/wp-super-cache/">WP Super Cache</a>!</p><?php
1465
  }
1466
  if( isset( $wp_cache_hello_world ) && $wp_cache_hello_world )
1467
  add_action( 'wp_footer', 'wp_super_cache_footer' );
@@ -1485,7 +1682,7 @@ function wp_cache_favorite_action( $actions ) {
1485
  if( function_exists('current_user_can') && !current_user_can('manage_options') )
1486
  return $actions;
1487
 
1488
- $actions[ wp_nonce_url( 'options-general.php?page=wpsupercache&wp_delete_cache=1', 'wp-cache' ) ] = array( __( 'Delete Cache' ), 'manage_options' );
1489
 
1490
  return $actions;
1491
  }
@@ -1494,7 +1691,7 @@ add_filter( 'favorite_actions', 'wp_cache_favorite_action' );
1494
  function wp_cache_plugin_notice( $plugin ) {
1495
  global $cache_enabled;
1496
  if( $plugin == 'wp-super-cache/wp-cache.php' && !$cache_enabled && function_exists( "admin_url" ) )
1497
- echo '<td colspan="5" class="plugin-update">WP Super Cache must be configured. Go to <a href="' . admin_url( 'options-general.php?page=wpsupercache' ) . '">the admin page</a> to enable and configure the plugin.</td>';
1498
  }
1499
  add_action( 'after_plugin_row', 'wp_cache_plugin_notice' );
1500
 
@@ -1510,7 +1707,7 @@ add_filter( 'plugin_action_links', 'wp_cache_plugin_actions', 10, 2 );
1510
  function wp_cache_admin_notice() {
1511
  global $cache_enabled;
1512
  if( substr( $_SERVER["PHP_SELF"], -11 ) == 'plugins.php' && !$cache_enabled && function_exists( "admin_url" ) )
1513
- echo '<div class="error"><p><strong>' . sprintf( __('WP Super Cache is disabled. Please go to the <a href="%s">plugin admin page</a> to enable caching.' ), admin_url( 'options-general.php?page=wpsupercache' ) ) . '</strong></p></div>';
1514
  }
1515
  add_action( 'admin_notices', 'wp_cache_admin_notice' );
1516
  ?>
3
  Plugin Name: WP Super Cache
4
  Plugin URI: http://ocaoimh.ie/wp-super-cache/
5
  Description: Very fast caching plugin for WordPress.
6
+ Version: 0.9.7
7
  Author: Donncha O Caoimh
8
  Author URI: http://ocaoimh.ie/
9
  */
48
 
49
  include(WPCACHEHOME . 'wp-cache-base.php');
50
 
51
+ function wp_super_cache_text_domain() {
52
+ load_plugin_textdomain( 'wp-super-cache', WPCACHEHOME, basename( dirname( __FILE__ ) ) );
53
+ }
54
+ add_action( 'init', 'wp_super_cache_text_domain' );
55
 
56
  // from legolas558 d0t users dot sf dot net at http://www.php.net/is_writable
57
  function is_writeable_ACLSafe($path) {
80
  } elseif( is_file( dirname(__FILE__) . '/wp-super-cache/wp-cache-config-sample.php' ) ) {
81
  define( 'WPCACHEHOME', dirname(__FILE__) . '/wp-super-cache/' );
82
  } else {
83
+ die( sprintf( __( 'Please create %s /wp-cache-config.php from wp-super-cache/wp-cache-config-sample.php', 'wp-super-cache' ), WP_CONTENT_DIR ) );
84
  }
85
  }
86
  }
104
  function wp_cache_add_pages() {
105
  if( function_exists( 'is_site_admin' ) ) {
106
  if( is_site_admin() ) {
107
+ add_submenu_page('wpmu-admin.php', 'WP Super Cache', 'WP Super Cache', 'manage_options', 'wpsupercache', 'wp_cache_manager');
108
  add_options_page('WP Super Cache', 'WP Super Cache', 'manage_options', 'wpsupercache', 'wp_cache_manager');
109
  }
110
  } else {
116
  function wp_cache_manager() {
117
  global $wp_cache_config_file, $valid_nonce, $supercachedir, $cache_path, $cache_enabled, $cache_compression, $super_cache_enabled, $wp_cache_hello_world;
118
  global $wp_cache_clear_on_post_edit, $cache_rebuild_files, $wp_cache_mutex_disabled, $wp_cache_mobile_enabled, $wp_cache_mobile_whitelist, $wp_cache_mobile_browsers;
119
+ global $wp_cache_cron_check, $wp_cache_debug, $wp_cache_hide_donation, $wp_cache_not_logged_in, $wp_supercache_cache_list;
120
 
121
  if( function_exists( 'is_site_admin' ) )
122
  if( !is_site_admin() )
158
  <?php
159
  echo '<div class="wrap">';
160
  echo "<h2>WP Super Cache Manager</h2>\n";
161
+ if( 1 == ini_get( 'safe_mode' ) || "on" == strtolower( ini_get( 'safe_mode' ) ) ) {
162
+ ?><h3><?php _e( 'Warning! PHP Safe Mode Enabled!', 'wp-super-cache' ); ?></h3>
163
+ <p><?php _e( 'You may experience problems running this plugin because SAFE MODE is enabled.', 'wp-super-cache' );
164
  if( !ini_get( 'safe_mode_gid' ) ) {
165
+ echo __( 'Your server is set up to check the owner of PHP scripts before allowing them to read and write files.', 'wp-super-cache' ) . "</p><p>";
166
+ echo sprintf( __( 'You or an administrator may be able to make it work by changing the group owner of the plugin scripts to match that of the web server user. The group owner of the %s/cache/ directory must also be changed. See the <a href="http://php.net/features.safe-mode">safe mode manual page</a> for further details.', 'wp-super-cache' ), WP_CONTENT_DIR ) . "</p>";
167
  } else {
168
+ echo __( 'You or an administrator must disable this. See the <a href="http://php.net/features.safe-mode">safe mode manual page</a> for further details. This cannot be disabled in a .htaccess file unfortunately. It must be done in the php.ini config file.', 'wp-super-cache' ) . "</p>";
169
  }
170
  }
171
  if(isset($_REQUEST['wp_restore_config']) && $valid_nonce) {
172
  unlink($wp_cache_config_file);
173
+ echo '<strong>' . __( 'Configuration file changed, some values might be wrong. Load the page again from the "Settings" menu to reset them.', 'wp-super-cache' ) . '</strong>';
174
  }
175
 
176
  if ( !wp_cache_check_link() ||
177
  !wp_cache_verify_config_file() ||
178
  !wp_cache_verify_cache_dir() ) {
179
+ echo '<p>' . __( "Cannot continue... fix previous problems and retry.", 'wp-super-cache' ) . '</p>';
180
  echo "</div>\n";
181
  return;
182
  }
192
  $hostname = substr( $hostname, 0, strpos( $hostname, '/' ) );
193
  $ip = gethostbyname( $hostname );
194
  if( substr( $ip, 0, 3 ) == '127' || substr( $ip, 0, 7 ) == '192.168' ) {
195
+ ?><h3><?php printf( __( 'Warning! Your hostname "%s" resolves to %s', 'wp-super-cache' ), $hostname, $ip ); ?></h3>
196
  <div style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'>
197
+ <p><?php printf( __( 'Your server thinks your hostname resolves to %s. Some services such as garbage collection by this plugin, and WordPress scheduled posts may not operate correctly.', 'wp-super-cache' ), $ip ); ?></p>
198
+ <p><?php printf( __( 'Please see entry 16 in the <a href="%s">Troubleshooting section</a> of the readme.txt', 'wp-super-cache' ), 'http://wordpress.org/extend/plugins/wp-super-cache/faq/' ); ?></p>
199
  </div>
200
  <?php
201
  } else {
208
  if( $cron[ 'response' ][ 'code' ] == '404' ) {
209
  ?><h3>Warning! wp-cron.php not found!</h3>
210
  <div style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'>
211
+ <p><?php _e( 'Unfortunately WordPress cannot find the file wp-cron.php. This script is required for the the correct operation of garbage collection by this plugin, WordPress scheduled posts as well as other critical activities.', 'wp-super-cache' ); ?></p>
212
+ <p><?php printf( __( 'Please see entry 16 in the <a href="%s">Troubleshooting section</a> of the readme.txt', 'wp-super-cache' ), 'http://wordpress.org/extend/plugins/wp-super-cache/faq/' ); ?></p>
213
  </div>
214
  <?php
215
  } else {
220
  }
221
 
222
  if( $cache_enabled == true && $super_cache_enabled == true && !got_mod_rewrite() ) {
223
+ ?><h4 style='color: #a00'><?php _e( 'Mod rewrite may not be installed!', 'wp-super-cache' ); ?></h4>
224
+ <p><?php _e( 'It appears that mod_rewrite is not installed. Sometimes this check isn&#8217;t 100% reliable, especially if you are not using Apache. Please verify that the mod_rewrite module is loaded. It is required for serving Super Cache static files. You will still be able to use half-on mode.', 'wp-super-cache' ); ?></p><?php
225
  }
226
 
227
  if( !is_writeable_ACLSafe($wp_cache_config_file) ) {
228
  define( "SUBMITDISABLED", 'disabled style="color: #aaa" ' );
229
+ ?><h4 style='text-align:center; color: #a00'><?php _e( 'Read Only Mode. Configuration cannot be changed.', 'wp-super-cache' ); ?> <a href="javascript:toggleLayer('readonlywarning');" title="<?php _e( 'Why your configuration may not be changed', 'wp-super-cache' ); ?>"><?php _e( 'Why', 'wp-super-cache' ); ?></a></h4>
230
  <div id='readonlywarning' style='border: 1px solid #aaa; margin: 2px; padding: 2px; display: none;'>
231
+ <p><?php printf( __( 'The WP Super Cache configuration file is <code>%s/wp-cache-config.php</code> and cannot be modified. That file must be writeable by the webserver to make any changes.', 'wp-super-cache' ), WP_CONTENT_DIR ); ?>
232
+ <?php _e( 'A simple way of doing that is by changing the permissions temporarily using the CHMOD command or through your ftp client. Make sure it&#8217;s globally writeable and it should be fine.', 'wp-super-cache' ); ?></p>
233
+ <?php _e( 'Writeable:', 'wp-super-cache' ); ?> <code>chmod 666 <?php echo WP_CONTENT_DIR; ?>/wp-cache-config.php</code>
234
+ <?php _e( 'Readonly:', 'wp-super-cache' ); ?> <code>chmod 644 <?php echo WP_CONTENT_DIR; ?>/wp-cache-config.php</code></p>
235
  </div><?php
236
  } else {
237
  define( "SUBMITDISABLED", ' ' );
243
  $wp_content_stat = stat(WP_CONTENT_DIR . '/');
244
  $wp_content_mode = ($wp_content_stat['mode'] & 0777);
245
  if( $wp_content_mode != 0755 ) {
246
+ ?><h4 style='text-align:center; color: #a00'><?php printf( __( 'Warning! %s is writeable!', 'wp-super-cache' ), WP_CONTENT_DIR ); ?></h4>
247
+ <p><?php printf( __( 'You should change the permissions on %s and make it more restrictive. Use your ftp client, or the following command to fix things:', 'wp-super-cache' ), WP_CONTENT_DIR ); ?><code>chmod 755 <?php echo WP_CONTENT_DIR; ?>/</code></p><?php
248
  }
249
  }
250
 
262
  wp_cache_replace_line('^ *\$wp_cache_mobile_browsers', "\$wp_cache_mobile_browsers = 'Android, 2.0 MMP, 240x320, AvantGo, BlackBerry, Blazer, Cellphone, Danger, DoCoMo, Elaine/3.0, EudoraWeb, hiptop, IEMobile, iPhone, iPod, KYOCERA/WX310K, LG/U990, MIDP-2.0, MMEF20, MOT-V, NetFront, Newt, Nintendo Wii, Nitro, Nokia, Opera Mini, Palm, Playstation Portable, portalmmm, Proxinet, ProxiNet, SHARP-TQ-GX10, Small, SonyEricsson, Symbian OS, SymbianOS, TS21i-10, UP.Browser, UP.Link, Windows CE, WinWAP';", $wp_cache_config_file);
263
  }
264
  wp_cache_replace_line('^ *\$wp_cache_mobile_enabled', "\$wp_cache_mobile_enabled = " . $wp_cache_mobile_enabled . ";", $wp_cache_config_file);
265
+
266
+ $wp_supercache_cache_list = $_POST[ 'wp_supercache_cache_list' ] == 1 ? 1 : 0;
267
+ wp_cache_replace_line('^ *\$wp_supercache_cache_list', "\$wp_supercache_cache_list = " . $wp_supercache_cache_list . ";", $wp_cache_config_file);
268
+
269
  switch( $_POST[ 'wp_cache_status' ] ) {
270
  case 'all':
271
  wp_cache_enable();
332
  }
333
  }
334
 
335
+ echo '<a name="top"></a>';
336
  ?>
337
  <table><td><fieldset class="options" id="show-this-fieldset">
338
+ <h3><?php _e( 'WP Super Cache Status', 'wp-super-cache' ); ?></h3><?php
339
+ echo '<form name="wp_manager" action="#top" method="post">';
340
  ?>
341
+ <label><input type='radio' name='wp_cache_status' value='all' <?php if( $cache_enabled == true && $super_cache_enabled == true ) { echo 'checked=checked'; } ?>> <strong><?php _e( 'ON', 'wp-super-cache' ); ?></strong> <span class="setting-description"><?php _e( 'WP Cache and Super Cache enabled', 'wp-super-cache' ); ?></span></label><br />
342
+ <label><input type='radio' name='wp_cache_status' value='wpcache' <?php if( $cache_enabled == true && $super_cache_enabled == false ) { echo 'checked=checked'; } ?>> <strong><?php _e( 'HALF ON', 'wp-super-cache' ); ?></strong> <span class="setting-description"><?php _e( 'Super Cache Disabled, only legacy WP-Cache caching.', 'wp-super-cache' ); ?></span></label><br />
343
+ <label><input type='radio' name='wp_cache_status' value='none' <?php if( $cache_enabled == false ) { echo 'checked=checked'; } ?>> <strong><?php _e( 'OFF', 'wp-super-cache' ); ?></strong> <span class="setting-description"><?php _e( 'WP Cache and Super Cache disabled', 'wp-super-cache' ); ?></span></label><br />
344
+ <p><label><input type='checkbox' name='wp_cache_not_logged_in' <?php if( $wp_cache_not_logged_in ) echo "checked"; ?> value='1'> <?php _e( 'Don&#8217;t cache pages for logged in users.', 'wp-super-cache' ); ?></label></p>
345
+ <p><label><input type='checkbox' name='wp_cache_hello_world' <?php if( $wp_cache_hello_world ) echo "checked"; ?> value='1'> <?php _e( 'Proudly tell the world your server is Digg proof! (places a message in your blog&#8217;s footer)', 'wp-super-cache' ); ?></label></p>
346
+ <p><label><input type='checkbox' name='wp_cache_clear_on_post_edit' <?php if( $wp_cache_clear_on_post_edit ) echo "checked"; ?> value='1'> <?php _e( 'Clear all cache files when a post or page is published. (This may significantly slow down saving of posts.)' ); ?></label></p>
347
+ <p><label><input type='checkbox' name='cache_rebuild_files' <?php if( $cache_rebuild_files ) echo "checked"; ?> value='1'> <?php _e( 'Cache rebuild. Serve a supercache file to anonymous users while a new file is being generated. Recommended for <em>very</em> busy websites with lots of comments. Makes "directly cached pages" and "Lockdown mode" obsolete.' ); ?></label></p>
348
  <?php if( false == defined( 'WPSC_DISABLE_LOCKING' ) ) { ?>
349
+ <p><label><input type='checkbox' name='wp_cache_mutex_disabled' <?php if( !$wp_cache_mutex_disabled ) echo "checked"; ?> value='0'> <?php _e( 'Coarse file locking. You probably don&#8217;t need this but it may help if your server is underpowered. Warning! <em>May cause your server to lock up in very rare cases!</em>', 'wp-super-cache' ); ?></label></p>
350
  <?php } ?>
351
+ <p><label><input type='checkbox' name='wp_supercache_cache_list' <?php if( $wp_supercache_cache_list ) echo "checked"; ?> value='1'> <?php _e( 'List the newest cached pages (may be expensive to run on busy sites, use with caution.)', 'wp-super-cache' ); ?></label>
352
+ <p><label><input type='checkbox' name='wp_cache_mobile_enabled' <?php if( $wp_cache_mobile_enabled ) echo "checked"; ?> value='1'> <?php _e( 'Mobile device support.', 'wp-super-cache' ); ?></label>
353
  <?php
354
  $home_path = trailingslashit( get_home_path() );
355
+ $scrules = implode( "\n", extract_from_markers( $home_path.'.htaccess', 'WPSuperCache' ) );
356
+ if ( !$wp_cache_mobile_enabled && strpos( $scrules, '240x320|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo' ) ) {
357
+ echo "<blockquote style='background-color:#feefb3; padding: 5px; margin: 5px;'><h4>" . __( 'Mobile rewrite rules detected', 'wp-super-cache' ) . "</h4>";
358
+ echo "<p>" . __( 'For best performance you should enable "Mobile device support" or delete the mobile rewrite rules in your .htaccess. Look for the 2 lines with the text "Android|2.0\ MMP|240x320|AvantGo|BlackBerry|Blazer|Cellphone" and delete those.', 'wp-super-cache' ) . "</p><p>" . __( 'This will have no affect on ordinary users but mobile users will see uncached pages.', 'wp-super-cache' ) . "</p></blockquote>";
359
+ } elseif ( $wp_cache_mobile_enabled && $scrules != '' && false === strpos( $scrules, '240x320|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo' ) ) {
360
  ?>
361
+ <blockquote style='background-color:#fefeb3; padding: 5px; margin: 5px;'><p><?php _e( 'Mobile support requires extra rules in your .htaccess file, or you can set the plugin to half-on mode. Here are your options (in order of difficulty):', 'wp-super-cache' ); ?>
362
+ <ol><li> 1. <?php _e( 'Set the plugin to half on mode and enable mobile support.', 'wp-super-cache' ); ?></li>
363
+ <li> 2. <?php printf( __( 'Delete the plugin mod_rewrite rules in %s.htaccess enclosed by <code># BEGIN WPSuperCache</code> and <code># END WPSuperCache</code> and let the plugin regenerate them by reloading this page.', 'wp-super-cache' ), $home_path ); ?></li>
364
+ <li> 3. <?php printf( __( 'Add the rules yourself. Edit %s.htaccess and find the block of code enclosed by the lines <code># BEGIN WPSuperCache</code> and <code># END WPSuperCache</code>. There are two sections that look very similar. Just below the line <code>%{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$</code> add this line: (do it twice, once for each section)', 'wp-super-cache' ), $home_path ); ?></p>
365
+ <div style='padding: 2px; margin: 2px; border: 1px solid #333; width:400px; overflow: scroll'><pre>RewriteCond %{HTTP_user_agent} !^.*(Android|2.0\ MMP|240x320|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|hiptop|IEMobile|iPhone|iPod|KYOCERA/WX310K|LG/U990|MIDP-2.0|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|Playstation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|Windows\ CE|WinWAP).*</pre></div></li></ol></blockquote>
366
+ <?php } ?>
367
+ <p><strong><?php _e( 'Note:', 'wp-super-cache' ); ?></strong> <?php printf( __( 'If uninstalling this plugin, make sure the directory <em>%s</em> is writeable by the webserver so the files <em>advanced-cache.php</em> and <em>cache-config.php</em> can be deleted automatically. (Making sure those files are writeable too is probably a good idea!)', 'wp-super-cache' ), WP_CONTENT_DIR ); ?></p>
368
+ <p><?php printf( __( 'Uninstall using the <a href="%1$s/wp-super-cache/uninstall.php">uninstall script</a> to remove files and directories created by the plugin. (Please see <a href="%1$s/wp-super-cache/readme.txt">readme.txt</a> for instructions on uninstalling this script.)', 'wp-super-cache' ), WP_PLUGIN_URL ); ?></p>
369
  <?php
370
+ echo "<div class='submit'><input type='submit' " . SUBMITDISABLED . " value='" . __( 'Update Status', 'wp-super-cache' ) . " &raquo;' /></div>";
371
  wp_nonce_field('wp-cache');
372
  ?>
373
  </form>
374
  <?php
375
  if( $super_cache_enabled && function_exists( 'apache_get_modules' ) ) {
376
  $mods = apache_get_modules();
377
+ $required_modules = array( 'mod_mime' => __( 'Required to serve compressed supercache files properly.', 'wp-super-cache' ), 'mod_headers' => __( 'Required to set caching information on supercache pages. IE7 users will see old pages without this module.', 'wp-super-cache' ), 'mod_expires' => __( 'Set the expiry date on supercached pages. Visitors may not see new pages when they refresh or leave comments without this module.', 'wp-super-cache' ) );
378
  foreach( $required_modules as $req => $desc ) {
379
  if( !in_array( $req, $mods ) ) {
380
  $missing_mods[ $req ] = $desc;
381
  }
382
  }
383
  if( isset( $missing_mods) && is_array( $missing_mods ) ) {
384
+ echo "<h3>" . __( 'Missing Apache Modules', 'wp-super-cache' ) . "</h3>";
385
+ echo "<p>" . __( 'The following Apache modules are missing. The plugin will work in half-on mode without them. In full Supercache mode, your visitors may see corrupted pages or out of date content however.', 'wp-super-cache' ) . "</p>";
386
  echo "<ul>";
387
  foreach( $missing_mods as $req => $desc ) {
388
  echo "<li> $req - $desc</li>";
394
  </fieldset>
395
  </td><td valign='top'>
396
  <div style='background: #ffc; border: 1px solid #333; margin: 2px; padding: 5px'>
397
+ <h3 align='center'><?php _e( 'Make WordPress Faster', 'wp-super-cache' ); ?></h3>
398
  <?php if( $wp_cache_hide_donation != 1 ) { ?>
399
+ <p><?php printf( __( '%1$s really makes your blog go faster. Make it go faster<sup>*</sup> by buying me an <a href="%2$s">Amazon gift card</a>! Make it out to "%3$s" for whatever amount you want. Every penny helps!', 'wp-super-cache' ), '<a href="http://ocaoimh.ie/wp-super-cache/?r=wpsc">WP Super Cache</a>', 'http://ocaoimh.ie/agc', 'donncha@ocaoimh.ie' ) ?>;</p>
400
+ <p><?php printf( __( 'If Amazon isn&#8217;t your thing, there&#8217;s also PayPal. Click the "Donate" button below or take a quick peek at my <a href="%s">wishlist</a>.', 'wp-super-cache' ), 'http://ocaoimh.ie/wish' ); ?></p>
401
+ <p><?php _e( 'Thanks in advance!', 'wp-super-cache' ); ?><br />Donncha<br />
402
+ <small>* <?php _e( 'Ok, it won&#8217;t go any faster but you&#8217;ll make this plugin author very happy!' ); ?></small></p>
403
  <div align='center'>
404
  <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
405
  <input type="hidden" name="cmd" value="_s-xclick"/>
407
  <input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_donate_SM.gif" border="0" name="submit" alt=""/>
408
  <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"/><br />
409
  </form>
410
+ <p>Don't show me this again. <form action="#top" method="post"><input type='hidden' name='wp_cache_hide_donation' value='1' /><input type='submit' value='Hide' /><?php wp_nonce_field('wp-cache'); ?></form></p>
411
  </div>
412
  <?php } else { ?>
413
+ <p><?php printf( __( '%1$s is maintained and developed by %2$s with contributions from many others.', 'wp-super-cache' ), '<a href="http://ocaoimh.ie/wp-super-cache/?r=supercache">WP Super Cache</a>', '<a href="http://ocaoimh.ie/?r=supercache">Donncha O Caoimh</a>' ); ?></p>
414
+ <p><?php printf( __( 'He blogs at %1$s, posts photos at %2$s and %3$s he had more time to read and relax.', 'wp-super-cache' ), '<a href="http://ocaoimh.ie/?r=supercache">Holy Shmoly</a>', '<a href="http://inphotos.org/?r=supercache">In Photos.org</a>', '<a href="http://ocaoimh.ie/gad">wishes</a>' ); ?></p>
415
+ <p><?php printf( __( 'Please say hi to him on %s too!', 'wp-super-cache' ), '<a href="http://twitter.com/donncha/">Twitter</a>' ); ?></p>
416
+ <?php
417
+ }
418
+ if ( isset( $wp_supercache_cache_list ) && $wp_supercache_cache_list ) {
419
+ $start_date = get_option( 'wpsupercache_start' );
420
+ if ( !$start_date ) {
421
+ $start_date = time();
422
+ }
423
+ ?>
424
+ <p><?php printf( __( 'Cached pages since %1$s : <strong>%2$s</strong>', 'wp-super-cache' ), date( 'M j, Y', $start_date ), number_format( get_option( 'wpsupercache_count' ) ) ); ?></p>
425
+ <p><?php _e( 'Newest Cached Pages:' ); ?><ol>
426
+ <?php
427
+ foreach( array_reverse( (array)get_option( 'supercache_last_cached' ) ) as $url ) {
428
+ $since = time() - strtotime( $url[ 'date' ] );
429
+ echo "<li><a title='" . sprintf( __( 'Cached %s seconds ago', 'wp-super-cache' ), $since ) . "' href='" . site_url( $url[ 'url' ] ) . "'>{$url[ 'url' ]}</a></li>\n";
430
+ }
431
+ ?></ol>
432
+ <small><?php _e( '(may not always be accurate on busy sites)' ); ?></small>
433
+ </p><?php
434
+ } else {
435
+ $start_date = get_option( 'wpsupercache_start' );
436
+ if ( $start_date ) {
437
+ update_option( 'wpsupercache_start', $start_date );
438
+ update_option( 'wpsupercache_count', 0 );
439
+ }
440
+ }
441
+ ?>
442
  </div>
443
 
444
  </td></table>
450
 
451
  wp_cache_edit_max_time();
452
 
453
+ echo '<a name="files"></a><fieldset class="options"><h3>' . __( 'Accepted Filenames &amp; Rejected URIs' ) . '</h3>';
454
  wp_cache_edit_rejected_pages();
455
  echo "\n";
456
  wp_cache_edit_rejected();
460
 
461
  wp_cache_edit_rejected_ua();
462
 
463
+ wp_cache_debug_settings();
464
 
465
  wp_lock_down();
466
 
475
  $out = ob_get_contents();
476
  ob_end_clean();
477
  if( SUBMITDISABLED == ' ' && $out != '' ) {
478
+ echo '<fieldset class="options"><h3>' . __( 'Cache Plugins', 'wp-super-cache' ) . '</h3>';
479
  echo $out;
480
  echo '</fieldset>';
481
  }
484
  }
485
 
486
  function wsc_mod_rewrite() {
487
+ global $cache_enabled, $super_cache_enabled, $cache_compression, $cache_compression_changed, $valid_nonce, $cache_path;
488
+ if( $super_cache_enabled == false && $cache_enabled == true ) {
489
+ ?><h3><?php _e( 'Super Cache Compression', 'wp-super-cache' ); ?></h3>
490
+ <p><?php _e( 'Compression is enabled by default when in <em>HALF ON</em> mode.', 'wp-super-cache' ); ?></p>
491
+ <?php
492
  return;
493
+ } elseif ( $super_cache_enabled == false ) {
494
+ return;
495
+ }
496
  if( false == defined( 'WPSC_DISABLE_COMPRESSION' ) ) {
497
  ?>
498
+ <a name='rewrite'></a>
499
  <fieldset class="options">
500
+ <h3><?php _e( 'Super Cache Compression', 'wp-super-cache' ); ?></h3>
501
+ <form name="wp_manager" action="#rewrite" method="post">
502
+ <label><input type="radio" name="cache_compression" value="1" <?php if( $cache_compression ) { echo "checked=checked"; } ?>> <?php _e( 'Enabled', 'wp-super-cache' ); ?></label>
503
+ <label><input type="radio" name="cache_compression" value="0" <?php if( !$cache_compression ) { echo "checked=checked"; } ?>> <?php _e( 'Disabled', 'wp-super-cache' ); ?></label>
504
+ <p><?php _e( 'Compression is disabled by default because some hosts have problems with compressed files. Switching this on and off clears the cache.', 'wp-super-cache' ); ?></p>
505
  <?php
506
  if( isset( $cache_compression_changed ) && isset( $_POST[ 'cache_compression' ] ) && !$cache_compression ) {
507
+ ?><p><strong><?php _e( 'Super Cache compression is now disabled.', 'wp-super-cache' ); ?></strong></p> <?php
508
  } elseif( isset( $cache_compression_changed ) && isset( $_POST[ 'cache_compression' ] ) && $cache_compression ) {
509
+ ?><p><strong><?php _e( 'Super Cache compression is now enabled.', 'wps-uper-cache' ); ?></strong></p><?php
510
  }
511
+ echo '<div class="submit"><input ' . SUBMITDISABLED . 'type="submit" value="' . __( 'Update Compression', 'wp-super-cache' ) . ' &raquo;" /></div>';
512
  wp_nonce_field('wp-cache');
513
  echo "</form>\n";
514
  ?></fieldset>
525
  }
526
  $home_path = get_home_path();
527
  $home_root = parse_url(get_bloginfo('url'));
 
528
  $home_root = isset( $home_root['path'] ) ? trailingslashit( $home_root['path'] ) : '/';
529
  $inst_root = str_replace( '//', '/', '/' . trailingslashit( str_replace( $document_root, '', str_replace( '\\', '/', WP_CONTENT_DIR ) ) ) );
530
  $wprules = implode( "\n", extract_from_markers( $home_path.'.htaccess', 'WordPress' ) );
536
  $condition_rules[] = "RewriteCond %{REQUEST_URI} !^.*[^/]$";
537
  $condition_rules[] = "RewriteCond %{REQUEST_URI} !^.*//.*$";
538
  }
539
+ $condition_rules[] = "RewriteCond %{REQUEST_METHOD} !POST";
540
  $condition_rules[] = "RewriteCond %{QUERY_STRING} !.*=.*";
541
+ $condition_rules[] = "RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$";
542
+ $condition_rules[] = "RewriteCond %{HTTP_USER_AGENT} !^.*(Android|2.0\\ MMP|240x320|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|hiptop|IEMobile|iPhone|iPod|KYOCERA/WX310K|LG/U990|MIDP-2.0|MMEF20|MOT-V|NetFront|Newt|Nintendo\\ Wii|Nitro|Nokia|Opera\\ Mini|Palm|Playstation\\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|Small|SonyEricsson|Symbian\\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|Windows\\ CE|WinWAP).*";
543
  $condition_rules = apply_filters( 'supercacherewriteconditions', $condition_rules );
544
 
545
  $rules = "<IfModule mod_rewrite.c>\n";
562
 
563
  $dohtaccess = true;
564
  if( function_exists( 'is_site_admin' ) ) {
565
+ echo "<h4 style='color: #a00'>" . __( 'WordPress MU Detected', 'wp-super-cache' ) . "</h4><p>" . __( "Unfortunately the rewrite rules cannot be updated automatically when running WordPress MU. Please open your .htaccess and add the following mod_rewrite rules above any other rules in that file.", 'wp-super-cache' ) . "</p>";
566
  } elseif( !$wprules || $wprules == '' ) {
567
+ echo "<h4 style='color: #a00'>" . __( 'Mod Rewrite rules cannot be updated!', 'wp-super-cache' ) . "</h4>";
568
+ echo "<p>" . sprintf( __( "You must have <strong>BEGIN</strong> and <strong>END</strong> markers in %s.htaccess for the auto update to work. They look like this and surround the main WordPress mod_rewrite rules:", 'wp-super-cache' ), $home_path );
569
+ echo "<blockquote><pre><em># BEGIN WordPress</em>\n RewriteCond %{REQUEST_FILENAME} !-f\n RewriteCond %{REQUEST_FILENAME} !-d\n RewriteRule . /index.php [L]\n <em># END WordPress</em></pre></blockquote>";
570
+ _e( 'Refresh this page when you have updated your .htaccess file.', 'wp-super-cache' );
571
  echo "</fieldset></div>";
572
  return;
573
  } elseif( strpos( $wprules, 'wordpressuser' ) ) { // Need to clear out old mod_rewrite rules
574
+ echo "<p><strong>" . __( 'Thank you for upgrading.', 'wp-super-cache' ) . "</strong> " . sprintf( __( 'The mod_rewrite rules changed since you last installed this plugin. Unfortunately you must remove the old supercache rules before the new ones are updated. Refresh this page when you have edited your .htaccess file. If you wish to manually upgrade, change the following line: %1$s so it looks like this: %2$s The only changes are "HTTP_COOKIE" becomes "HTTP:Cookie" and "wordpressuser" becomes "wordpress". This is a WordPress 2.5 change but it&#8217;s backwards compatible with older versions if you&#8217;re brave enough to use them.', 'wp-super-cache' ), '<blockquote><code>RewriteCond %{HTTP_COOKIE} !^.*wordpressuser.*$</code></blockquote>', '<blockquote><code>RewriteCond %{HTTP:Cookie} !^.*wordpress.*$</code></blockquote>' ) . "</p>";
575
  echo "</fieldset></div>";
576
  return;
577
  } elseif( $scrules != '' && strpos( $scrules, '%{REQUEST_URI} !^.*[^/]$' ) === false && substr( get_option( 'permalink_structure' ), -1 ) == '/' ) { // permalink structure has a trailing slash, need slash check in rules.
578
+ echo "<div style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'><h4>" . __( 'Trailing slash check required.', 'wp-super-cache' ) . "</h4><p>" . __( 'It looks like your blog has URLs that end with a "/". Unfortunately since you installed this plugin a duplicate content bug has been found where URLs not ending in a "/" end serve the same content as those with the "/" and do not redirect to the proper URL. To fix, you must edit your .htaccess file and add these two rules to the two groups of Super Cache rules:', 'wp-super-cache' ) . "</p>";
 
579
  echo "<blockquote><code>RewriteCond %{REQUEST_URI} !^.*[^/]$RewriteCond %{REQUEST_URI} !^.*//.*$</code></blockquote>";
580
+ echo "<p>" . __( 'You can see where the rules go and examine the complete rules by clicking the "View mod_rewrite rules" link below.', 'wp-super-cache' ) . "</p></div>";
581
  $dohtaccess = false;
582
  } elseif( strpos( $scrules, 'supercache' ) || strpos( $wprules, 'supercache' ) ) { // only write the rules once
583
  $dohtaccess = false;
585
  // cache/.htaccess rules
586
  $gziprules = "<IfModule mod_mime.c>\n <FilesMatch \"\\.html\\.gz\$\">\n ForceType text/html\n FileETag None\n </FilesMatch>\n AddEncoding gzip .gz\n AddType text/html .gz\n</IfModule>\n";
587
  $gziprules .= "<IfModule mod_deflate.c>\n SetEnvIfNoCase Request_URI \.gz$ no-gzip\n</IfModule>\n";
588
+ $gziprules .= "<IfModule mod_headers.c>\n Header set Vary \"Accept-Encoding, Cookie\"\n Header set Cache-Control 'max-age=300, must-revalidate'\n</IfModule>\n";
589
  $gziprules .= "<IfModule mod_expires.c>\n ExpiresActive On\n ExpiresByType text/html A300\n</IfModule>\n";
590
  if( $dohtaccess && !$_POST[ 'updatehtaccess' ] ) {
591
  if( !is_writeable_ACLSafe( $home_path . ".htaccess" ) ) {
592
+ echo "<div style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'><h4>" . __( 'Cannot update .htaccess', 'wp-super-cache' ) . "</h4><p>" . sprintf( __( 'The file <code>%s.htaccess</code> cannot be modified by the web server. Please correct this using the chmod command or your ftp client.', 'wp-super-cache' ), $home_path ) . "</p><p>" . __( 'Refresh this page when the file permissions have been modified.' ) . "</p><p>" . sprintf( __( 'Alternatively, you can edit your <code>%s.htaccess</code> file manually and add the following code (before any WordPress rules):', 'wp-super-cache' ), $home_path ) . "</p>";
593
  echo "<p><pre># BEGIN WPSuperCache\n" . wp_specialchars( $rules ) . "# END WPSuperCache</pre></p></div>";
594
  } else {
595
+ echo "<div style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'><p>" . sprintf( __( 'To serve static html files your server must have the correct mod_rewrite rules added to a file called <code>%s.htaccess</code>', 'wp-super-cache' ), $home_path ) . " ";
596
  if( !function_exists( 'is_site_admin' ) ) {
597
+ _e( "You must edit the file yourself add the following rules.", 'wp-super-cache' );
598
  } else {
599
+ _e( "You can edit the file yourself add the following rules.", 'wp-super-cache' );
600
  }
601
+ echo __( " Make sure they appear before any existing WordPress rules. ", 'wp-super-cache' ) . "</p>";
602
  echo "<pre># BEGIN WPSuperCache\n" . wp_specialchars( $rules ) . "# END WPSuperCache</pre></p>";
603
+ echo "<p>" . sprintf( __( 'Rules must be added to %s too:', 'wp-super-cache' ), WP_CONTENT_DIR . "/cache/.htaccess" ) . "</p>";
604
  echo "<pre># BEGIN supercache\n" . wp_specialchars( $gziprules ) . "# END supercache</pre></p>";
605
  if( !function_exists( 'is_site_admin' ) ) {
606
+ echo '<form name="updatehtaccess" action="#modrewrite" method="post">';
607
  echo '<input type="hidden" name="updatehtaccess" value="1" />';
608
+ echo '<div class="submit"><input type="submit" ' . SUBMITDISABLED . 'id="updatehtaccess" value="' . __( 'Update Mod_Rewrite Rules', 'wp-super-cache' ) . ' &raquo;" /></div>';
609
  wp_nonce_field('wp-cache');
610
  echo "</form></div>\n";
611
  }
614
  wpsc_remove_marker( $home_path.'.htaccess', 'WordPress' ); // remove original WP rules so SuperCache rules go on top
615
  echo "<div style='padding:0 8px;color:#4f8a10;background-color:#dff2bf;border:1px solid #4f8a10;'>";
616
  if( insert_with_markers( $home_path.'.htaccess', 'WPSuperCache', explode( "\n", $rules ) ) && insert_with_markers( $home_path.'.htaccess', 'WordPress', explode( "\n", $wprules ) ) ) {
617
+ echo "<h4>" . __( 'Mod Rewrite rules updated!', 'wp-super-cache' ) . "</h4>";
618
+ echo "<p><strong>" . sprintf( __( '%s.htaccess has been updated with the necessary mod_rewrite rules. Please verify they are correct. They should look like this:', 'wp-super-cache' ), $home_path ) . "</strong></p>\n";
619
  } else {
620
+ echo "<h4>" . __( 'Mod Rewrite rules must be updated!', 'wp-super-cache' ) . "</h4>";
621
+ echo "<p><strong>" . sprintf( __( 'Your %s.htaccess is not writable by the webserver and must be updated with the necessary mod_rewrite rules. The new rules go above the regular WordPress rules as shown in the code below:', 'wp-super-cache' ), $home_path ) . "</strong></p>\n";
622
  }
623
  echo "<p><pre>" . wp_specialchars( $rules ) . "</pre></p>\n</div>";
624
  } else {
625
  ?>
626
+ <p><?php printf( __( 'WP Super Cache mod rewrite rules were detected in your %s.htaccess file.<br /> Click the following link to see the lines added to that file. If you have upgraded the plugin make sure these rules match.', 'wp-super-cache' ), $home_path ); ?><br /><br />
627
+ <a href="javascript:toggleLayer('rewriterules');" class="button"><?php _e( 'View Mod_Rewrite Rules' ); ?></a>
628
  <div id='rewriterules' style='display: none;'>
629
  <?php echo "<p><pre># BEGIN WPSuperCache\n" . wp_specialchars( $rules ) . "# END WPSuperCache</pre></p>\n";
630
  echo "<p>Rules must be added to " . WP_CONTENT_DIR ."/cache/.htaccess too:</p>";
635
  // http://allmybrain.com/2007/11/08/making-wp-super-cache-gzip-compression-work/
636
  if( !is_file( $cache_path . '.htaccess' ) ) {
637
  $gziprules = insert_with_markers( $cache_path . '.htaccess', 'supercache', explode( "\n", $gziprules ) );
638
+ echo "<h4>" . sprintf( __( 'Gzip encoding rules in %s.htaccess created.', 'wp-super-cache' ), $cache_path ) . "</h4>";
639
  }
640
 
641
  ?></fieldset><?php
642
  }
643
 
644
  function wp_cache_restore() {
645
+ echo '<fieldset class="options"><h3>' . __( 'Fix Configuration', 'wp-super-cache' ) . '</h3>';
646
+ echo '<form name="wp_restore" action="#top" method="post">';
647
  echo '<input type="hidden" name="wp_restore_config" />';
648
+ echo '<div class="submit"><input type="submit" ' . SUBMITDISABLED . 'id="deletepost" value="' . __( 'Restore Default Configuration', 'wp-super-cache' ) . ' &raquo;" /></div>';
649
  wp_nonce_field('wp-cache');
650
  echo "</form>\n";
651
  echo '</fieldset>';
653
  }
654
 
655
  function comment_form_lockdown_message() {
656
+ ?><p><?php _e( "Comment moderation is enabled. Your comment may take some time to appear.", 'wp-super-cache' ); ?></p><?php
657
  }
658
  if( defined( 'WPLOCKDOWN' ) && constant( 'WPLOCKDOWN' ) )
659
  add_action( 'comment_form', 'comment_form_lockdown_message' );
675
  $wp_lock_down = '0';
676
  }
677
  }
678
+ ?><a name='lockdown'></a>
679
+ <fieldset class="options">
680
+ <h3><?php _e( 'Lock Down:', 'wp-super-cache' ); ?> <?php echo $wp_lock_down == '0' ? '<span style="color:red">' . __( 'Disabled', 'wp-super-cache' ) . '</span>' : '<span style="color:green">' . __( 'Enabled', 'wp-super-cache' ) . '</span>'; ?></h3>
681
+ <p><?php _e( 'Prepare your server for an expected spike in traffic by enabling the lock down. When this is enabled, new comments on a post will not refresh the cached static files.', 'wp-super-cache' ); ?></p>
682
+ <p><?php _e( 'Developers: Make your plugin lock down compatible by checking the "WPLOCKDOWN" constant. The following code will make sure your plugin respects the WPLOCKDOWN setting.', 'wp-super-cache' ); ?>
683
  <blockquote><code>if( defined( 'WPLOCKDOWN' ) && constant( 'WPLOCKDOWN' ) ) {
684
+ &nbsp;&nbsp;&nbsp;&nbsp;echo "<?php _e( 'Sorry. My blog is locked down. Updates will appear shortly', 'wp-super-cache' ); ?>";
685
  }</code></blockquote>
686
  <?php
687
  if( $wp_lock_down == '1' ) {
688
+ ?><p><?php _e( 'WordPress is locked down. Super Cache static files will not be deleted when new comments are made.', 'wp-super-cache' ); ?></p><?php
689
  } else {
690
+ ?><p><?php _e( 'WordPress is not locked down. New comments will refresh Super Cache static files as normal.', 'wp-super-cache' ); ?></p><?php
691
  }
692
  $new_lockdown = $wp_lock_down == '1' ? '0' : '1';
693
+ $new_lockdown_desc = $wp_lock_down == '1' ? __( 'Disable', 'wp-super-cache' ) : __( 'Enable', 'wp-super-cache' );
694
+ echo '<form name="wp_lock_down" action="#lockdown" method="post">';
695
  echo "<input type='hidden' name='wp_lock_down' value='{$new_lockdown}' />";
696
+ echo "<div class='submit'><input type='submit' " . SUBMITDISABLED . " value='{$new_lockdown_desc} " . __( 'Lock Down', 'wp-super-cache' ) . " &raquo;' /></div>";
697
  wp_nonce_field('wp-cache');
698
  echo "</form>\n";
699
 
700
  ?></fieldset><?php
701
  if( $cache_enabled == true && $super_cache_enabled == true ) {
702
+ ?><a name='direct'></a>
703
+ <fieldset class="options">
704
+ <h3><?php _e( 'Directly Cached Files', 'wp-super-cache' ); ?></h3><?php
705
 
706
  $out = '';
707
  if( $valid_nonce && is_array( $_POST[ 'direct_pages' ] ) && !empty( $_POST[ 'direct_pages' ] ) ) {
759
  @unlink( $pagefile );
760
  @unlink( $pagefile . '.gz' );
761
  RecursiveFolderDelete( $firstfolder );
762
+ echo "<strong>" . sprintf( __( '%s removed!', 'wp-super-cache' ), $pagefile ) . "</strong>";
763
  prune_super_cache( $cache_path, true );
764
  }
765
  }
767
  $readonly = '';
768
  if( !is_writeable_ACLSafe( ABSPATH ) ) {
769
  $readonly = 'READONLY';
770
+ ?><p style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'><strong><?php _e( 'Warning!', 'wp-super-cache' ); ?></strong> <?php printf( __( 'You must make %s writable to enable this feature. As this is a security risk please make it readonly after your page is generated.', 'wp-super-cache' ), ABSPATH ); ?></p><?php
771
  } else {
772
+ ?><p style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'><strong><?php _e( 'Warning!', 'wp-super-cache' ); ?></strong> <?php printf( __( '%s is writable. Please make it readonly after your page is generated as this is a security risk.', 'wp-super-cache' ), ABSPATH ); ?></p><?php
773
  }
774
+ echo '<form name="direct_page" action="#direct" method="post">';
775
  if( is_array( $cached_direct_pages ) ) {
776
  $out = '';
777
  foreach( $cached_direct_pages as $page ) {
783
  $out .= "<tr><td><input type='text' $readonly name='direct_pages[]' size='30' value='$page' /></td><td>$generated</td></tr>";
784
  }
785
  if( $out != '' ) {
786
+ ?><table><tr><th><?php _e( 'Existing direct page', 'wp-super-cache' ); ?></th><th><?php _e( 'Delete cached file', 'wp-super-cache' ); ?></th></tr><?php
787
  echo "$out</table>";
788
  }
789
  }
790
  if( $readonly != 'READONLY' )
791
+ echo __( "Add direct page:", 'wp-super-cache' ) . "<input type='text' $readonly name='new_direct_page' size='30' value='' />";
792
 
793
+ echo "<p>" . sprintf( __( "Directly cached files are files created directly off %s where your blog lives. This feature is only useful if you are expecting a major Digg or Slashdot level of traffic to one post or page.", 'wp-super-cache' ), ABSPATH ) . "</p>";
794
  if( $readonly != 'READONLY' ) {
795
+ echo "<p>" . sprintf( __( 'For example: to cache <em>%1$sabout/</em>, you would enter %1$sabout/ or /about/. The cached file will be generated the next time an anonymous user visits that page.', 'wp-super-cache' ), trailingslashit( get_option( 'siteurl' ) ) ) . "</p>";
796
+ echo "<p>" . __( 'Make the textbox blank to remove it from the list of direct pages and delete the cached file.', 'wp-super-cache' ) . "</p>";
797
  }
798
 
799
  wp_nonce_field('wp-cache');
800
  if( $readonly != 'READONLY' )
801
+ echo "<div class='submit'><input type='submit' ' . SUBMITDISABLED . 'value='" . __( 'Update Direct Pages', 'wp-super-cache' ) . " &raquo;' /></div>";
802
  echo "</form>\n";
803
  ?></fieldset><?php
804
  } // if $super_cache_enabled
837
  }
838
  }
839
  ?><fieldset class="options">
840
+ <a name='expirytime'></a>
841
+ <h3><?php _e( 'Expiry Time &amp; Garbage Collection', 'wp-super-cache' ); ?></h3><?php
842
+ echo '<form name="wp_edit_max_time" action="#expirytime" method="post">';
843
+ echo '<label for="wp_max_time">' . __( 'Expire time:', 'wp-super-cache' ) . '</label> ';
844
+ echo "<input type=\"text\" size=6 name=\"wp_max_time\" value=\"$cache_max_time\" /> " . __( "seconds", 'wp-super-cache' );
845
+ echo "<h4>" . __( 'Garbage Collection', 'wp-super-cache' ) . "</h4><p>" . __( 'If expiry time is more than 1800 seconds (half an hour), garbage collection will be done every 10 minutes, otherwise it will happen 10 seconds after the expiry time above.' ) . "</p>";
846
+ echo "<p>" . __( 'Checking for and deleting expired files is expensive, but it&#8217;s expensive leaving them there too. On a very busy site you should set the expiry time to <em>300 seconds</em>. Experiment with different values and visit this page to see how many expired files remain at different times during the day. Aim to have less than 500 cached files if possible.', 'wp-super-cache' ) . "</p>";
847
+ echo '<div class="submit"><input type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Change Expiration', 'wp-super-cache' ) . ' &raquo;" /></div>';
848
  wp_nonce_field('wp-cache');
849
  echo "</form>\n";
850
  ?></fieldset><?php
883
  wp_cache_replace_line('^ *\$cache_rejected_user_agent', "\$cache_rejected_user_agent = $text;", $wp_cache_config_file);
884
  }
885
 
886
+ echo '<a name="useragents"></a><fieldset class="options"><h3>' . __( 'Rejected User Agents', 'wp-super-cache' ) . '</h3>';
887
+ echo "<p>" . __( 'Strings in the HTTP &#8217;User Agent&#8217; header that prevent WP-Cache from caching bot, spiders, and crawlers&#8217; requests. Note that super cached files are still sent to these agents if they already exists.', 'wp-super-cache' ) . "</p>\n";
888
+ echo '<form name="wp_edit_rejected_user_agent" action="#useragents" method="post">';
 
 
889
  echo '<textarea name="wp_rejected_user_agent" cols="40" rows="4" style="width: 50%; font-size: 12px;" class="code">';
890
  foreach ($cache_rejected_user_agent as $ua) {
891
  echo wp_specialchars($ua) . "\n";
892
  }
893
  echo '</textarea> ';
894
+ echo '<div class="submit"><input type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Save UA Strings', 'wp-super-cache' ) . ' &raquo;" /></div>';
895
  wp_nonce_field('wp-cache');
896
  echo '</form>';
897
  echo "</fieldset>\n";
901
  global $wp_cache_config_file, $valid_nonce, $wp_cache_pages;
902
 
903
  if ( isset( $_POST[ 'wp_edit_rejected_pages' ] ) && $valid_nonce ) {
904
+ $pages = array( 'single', 'pages', 'archives', 'tag', 'frontpage', 'home', 'category', 'feed', 'search' );
905
  foreach( $pages as $page ) {
906
  if ( isset( $_POST[ 'wp_cache_pages' ][ $page ] ) ) {
907
  $value = 1;
913
  }
914
  }
915
 
916
+ echo '<a name="rejectpages"></a>';
917
+ echo '<p>' . __( 'Do not cache the following page types. See the <a href="http://codex.wordpress.org/Conditional_Tags">Conditional Tags</a> documentation for a complete discussion on each type.', 'wp-super-cache' ) . '</p>';
918
+ echo '<form name="wp_edit_rejected_pages" action="#rejectpages" method="post">';
919
  echo '<input type="hidden" name="wp_edit_rejected_pages" value="1" />';
920
+ echo '<label><input type="checkbox" value="1" name="wp_cache_pages[single]" ' . checked( 1, $wp_cache_pages[ 'single' ], false ) . ' /> ' . __( 'Single Posts', 'wp-super-cache' ) . ' (is_single)</label><br />';
921
+ echo '<label><input type="checkbox" value="1" name="wp_cache_pages[pages]" ' . checked( 1, $wp_cache_pages[ 'pages' ], false ) . ' /> ' . __( 'Pages', 'wp-super-cache' ) . ' (is_page)</label><br />';
922
+ echo '<label><input type="checkbox" value="1" name="wp_cache_pages[frontpage]" ' . checked( 1, $wp_cache_pages[ 'frontpage' ], false ) . ' /> ' . __( 'Front Page', 'wp-super-cache' ) . ' (is_front_page)</label><br />';
923
+ echo '&nbsp;&nbsp;<label><input type="checkbox" value="1" name="wp_cache_pages[home]" ' . checked( 1, $wp_cache_pages[ 'home' ], false ) . ' /> ' . __( 'Home', 'wp-super-cache' ) . ' (is_home)</label><br />';
924
+ echo '<label><input type="checkbox" value="1" name="wp_cache_pages[archives]" ' . checked( 1, $wp_cache_pages[ 'archives' ], false ) . ' /> ' . __( 'Archives', 'wp-super-cache' ) . ' (is_archive)</label><br />';
925
+ echo '&nbsp;&nbsp;<label><input type="checkbox" value="1" name="wp_cache_pages[tag]" ' . checked( 1, $wp_cache_pages[ 'tag' ], false ) . ' /> ' . __( 'Tags', 'wp-super-cache' ) . ' (is_tag)</label><br />';
926
+ echo '&nbsp;&nbsp;<label><input type="checkbox" value="1" name="wp_cache_pages[category]" ' . checked( 1, $wp_cache_pages[ 'category' ], false ) . ' /> ' . __( 'Category', 'wp-super-cache' ) . ' (is_category)</label><br />';
927
+ echo '<label><input type="checkbox" value="1" name="wp_cache_pages[feed]" ' . checked( 1, $wp_cache_pages[ 'feed' ], false ) . ' /> ' . __( 'Feeds', 'wp-super-cache' ) . ' (is_feed)</label><br />';
928
+ echo '<label><input type="checkbox" value="1" name="wp_cache_pages[search]" ' . checked( 1, $wp_cache_pages[ 'search' ], false ) . ' /> ' . __( 'Search Pages', 'wp-super-cache' ) . ' (is_search)</label><br />';
929
+
930
+ echo '<div class="submit"><input type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Save' ) . ' &raquo;" /></div>';
931
  wp_nonce_field('wp-cache');
932
  echo "</form>\n";
933
 
942
  }
943
 
944
 
945
+ echo '<a name="rejecturi"></a>';
946
+ echo '<form name="wp_edit_rejected" action="#rejecturi" method="post">';
947
+ echo "<p>" . __( 'Add here strings (not a filename) that forces a page not to be cached. For example, if your URLs include year and you dont want to cache last year posts, it&#8217;s enough to specify the year, i.e. &#8217;/2004/&#8217;. WP-Cache will search if that string is part of the URI and if so, it will not cache that page.', 'wp-super-cache' ) . "</p>\n";
948
  echo '<textarea name="wp_rejected_uri" cols="40" rows="4" style="width: 50%; font-size: 12px;" class="code">';
949
  foreach ($cache_rejected_uri as $file) {
950
  echo wp_specialchars( $file ) . "\n";
951
  }
952
  echo '</textarea> ';
953
+ echo '<div class="submit"><input type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Save Strings', 'wp-super-cache' ) . ' &raquo;" /></div>';
954
  wp_nonce_field('wp-cache');
955
  echo "</form>\n";
956
  }
964
  }
965
 
966
 
967
+ echo '<a name="cancache"></a>';
968
+ echo '<div style="clear:both"></div><form name="wp_edit_accepted" action="#cancache" method="post">';
969
+ echo "<p>" . __( 'Add here those filenames that can be cached, even if they match one of the rejected substring specified above.', 'wp-super-cache' ) . "</p>\n";
970
  echo '<textarea name="wp_accepted_files" cols="40" rows="8" style="width: 50%; font-size: 12px;" class="code">';
971
  foreach ($cache_acceptable_files as $file) {
972
  echo wp_specialchars($file) . "\n";
973
  }
974
  echo '</textarea> ';
975
+ echo '<div class="submit"><input type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Save Files', 'wp-super-cache' ) . ' &raquo;" /></div>';
976
+ wp_nonce_field('wp-cache');
977
+ echo "</form>\n";
978
+ }
979
+
980
+ function wp_cache_debug_settings() {
981
+ global $wp_super_cache_debug, $wp_cache_debug_email, $wp_cache_debug_log, $wp_cache_debug_level, $wp_cache_debug_ip, $cache_path, $valid_nonce, $wp_cache_config_file, $wp_cache_debug_to_file;
982
+
983
+ if ( !isset( $wp_cache_debug_level ) )
984
+ $wp_cache_debug_level = 1;
985
+ if ( isset( $_POST[ 'wp_cache_debug' ] ) && $valid_nonce ) {
986
+ $wp_super_cache_debug = intval( $_POST[ 'wp_super_cache_debug' ] );
987
+ wp_cache_replace_line('^ *\$wp_super_cache_debug', "\$wp_super_cache_debug = '$wp_super_cache_debug';", $wp_cache_config_file);
988
+ $wp_cache_debug_email = wp_specialchars( $_POST[ 'wp_cache_debug_email' ] );
989
+ wp_cache_replace_line('^ *\$wp_cache_debug_email', "\$wp_cache_debug_email = '$wp_cache_debug_email';", $wp_cache_config_file);
990
+ $wp_cache_debug_to_file = intval( $_POST[ 'wp_cache_debug_to_file' ] );
991
+ if ( $wp_cache_debug_to_file && ( ( isset( $wp_cache_debug_log ) && $wp_cache_debug_log == '' ) || !isset( $wp_cache_debug_log ) ) ) {
992
+ $wp_cache_debug_log = md5( time() ) . ".txt";
993
+ } elseif( $wp_cache_debug_to_file == false ) {
994
+ $wp_cache_debug_log = "";
995
+ }
996
+ wp_cache_replace_line('^ *\$wp_cache_debug_to_file', "\$wp_cache_debug_to_file = '$wp_cache_debug_to_file';", $wp_cache_config_file);
997
+ wp_cache_replace_line('^ *\$wp_cache_debug_log', "\$wp_cache_debug_log = '$wp_cache_debug_log';", $wp_cache_config_file);
998
+ $wp_cache_debug_ip = wp_specialchars( $_POST[ 'wp_cache_debug_ip' ] );
999
+ wp_cache_replace_line('^ *\$wp_cache_debug_ip', "\$wp_cache_debug_ip = '$wp_cache_debug_ip';", $wp_cache_config_file);
1000
+ $wp_cache_debug_level = (int)$_POST[ 'wp_cache_debug_level' ];
1001
+ wp_cache_replace_line('^ *\$wp_cache_debug_level', "\$wp_cache_debug_level = '$wp_cache_debug_level';", $wp_cache_config_file);
1002
+ }
1003
+
1004
+ echo '<a name="debug"></a>';
1005
+ echo '<fieldset class="options">';
1006
+ echo "<h3>Debug Settings</h3>";
1007
+ if ( ( isset( $wp_cache_debug_log ) && $wp_cache_debug_log != '' ) || ( isset( $wp_cache_debug_email ) && $wp_cache_debug_email != '' ) ) {
1008
+ echo "<p>Currently logging to: ";
1009
+ if ( isset( $wp_cache_debug_log ) && $wp_cache_debug_log != '' ) {
1010
+ $url = str_replace( ABSPATH, '', "{$cache_path}{$wp_cache_debug_log}" );
1011
+ echo "<a href='" . site_url( $url ) . "'>$cache_path{$wp_cache_debug_log}</a> ";
1012
+
1013
+ }
1014
+ if ( isset( $wp_cache_debug_email ) )
1015
+ echo " $wp_cache_debug_email ";
1016
+ echo "</p>";
1017
+ }
1018
+ echo '<p>' . __( 'Fix problems with the plugin by debugging it here. It can send you debug emails or log them to a file in your cache directory.', 'wp-super-cache' ) . '</p>';
1019
+ echo '<p>' . __( 'Logging to a file is easier but faces the problem that clearing the cache will clear the log file.', 'wp-super-cache' ) . '</p>';
1020
+ echo '<div style="clear:both"></div><form name="wp_cache_debug" action="#debug" method="post">';
1021
+ echo "<input type='hidden' name='wp_cache_debug' value='1' /><br />";
1022
+ echo "<table class='form-table'>";
1023
+ echo "<tr><td>" . __( 'Debugging', 'wp-super-cache' ) . "</td><td><input type='checkbox' name='wp_super_cache_debug' value='1' " . checked( 1, $wp_super_cache_debug, false ) . " /> " . __( 'enabled', 'wp-super-cache' ) . "</td></tr>";
1024
+ echo "<tr><td valign='top' rowspan='2'>Logging Type</td><td> " . __( 'Email', 'wp-super-cache' ) . ": <input type='text' size='30' name='wp_cache_debug_email' value='{$wp_cache_debug_email}' /></td></tr>";
1025
+ echo "<tr><td><input type='checkbox' name='wp_cache_debug_to_file' value='1' " . checked( 1, $wp_cache_debug_to_file, false ) . " /> " . __( 'file', 'wp-super-cache' ) . "</td></tr>";
1026
+ echo "<tr><td>" . __( 'IP Address', 'wp-super-cache' ) . "</td><td> <input type='text' size='20' name='wp_cache_debug_ip' value='{$wp_cache_debug_ip}' /> " . sprintf( __( '(only log requests from this IP address. Your IP is %s)', 'wp-super-cache' ), $_SERVER[ 'REMOTE_ADDR' ] ) . "</td></tr>";
1027
+ echo "<tr><td>Log level</td><td> ";
1028
+ for( $t = 1; $t <= 5; $t++ ) {
1029
+ echo "<input type='radio' name='wp_cache_debug_level' value='$t' ";
1030
+ echo $wp_cache_debug_level == $t ? "checked='checked' " : '';
1031
+ echo "/> $t ";
1032
+ }
1033
+ echo " " . __( '(1 = less, 5 = more, may cause severe server load.)', 'wp-super-cache' ) . "</td></tr></table>";
1034
+
1035
+ echo '<div class="submit"><input type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Save', 'wp-super-cache' ) . ' &raquo;" /></div>';
1036
  wp_nonce_field('wp-cache');
1037
  echo "</form>\n";
1038
+ echo '</fieldset>';
1039
  }
1040
 
1041
  function wp_cache_enable() {
1042
  global $wp_cache_config_file, $cache_enabled, $supercachedir;
1043
 
1044
  if(get_option('gzipcompression')) {
1045
+ echo "<strong>" . __( 'Error: GZIP compression is enabled, disable it if you want to enable wp-cache.', 'wp-super-cache' ) . "</strong>";
1046
  return false;
1047
  }
1048
  if( wp_cache_replace_line('^ *\$cache_enabled', '$cache_enabled = true;', $wp_cache_config_file) ) {
1090
  global $wp_cache_config_file;
1091
 
1092
  if(get_option('gzipcompression')) {
1093
+ echo "<strong>" . __( 'Warning', 'wp-super-cache' ) . "</strong>: " . __( "GZIP compression is enabled in Wordpress, wp-cache will be bypassed until you disable gzip compression.", 'wp-super-cache' );
1094
  return false;
1095
  }
1096
  $lines = file($wp_cache_config_file);
1148
  $dir = dirname($cache_path);
1149
  if ( !file_exists($cache_path) ) {
1150
  if ( !is_writeable_ACLSafe( $dir ) || !($dir = mkdir( $cache_path ) ) ) {
1151
+ echo "<strong>" . __( 'Error', 'wp-super-cache' ) . ":</strong> " . sprintf( __( 'Your cache directory (<strong>$cache_path</strong>) did not exist and couldn&#8217;t be created by the web server. Check %s permissions.', 'wp-super-cache' ), $dir );
1152
  return false;
1153
  }
1154
  }
1155
  if ( !is_writeable_ACLSafe($cache_path)) {
1156
+ echo "<strong>" . __( 'Error', 'wp-super-cache' ) . ":</strong> " . sprintf( __( 'Your cache directory (<strong>%1$s</strong>) or <strong>%2$s</strong> need to be writable for this plugin to work. Double-check it.', 'wp-super-cache' ), $cache_path, $dir );
1157
  return false;
1158
  }
1159
 
1185
  if( is_writeable_ACLSafe( $wp_cache_config_file ) ) {
1186
  @unlink( $wp_cache_config_file );
1187
  } else {
1188
+ echo "<strong>" . __( 'Error', 'wp-super-cache' ) . ":</strong> " . sprintf( __( 'Your WP-Cache config file (<strong>%s</strong>) is out of date and not writable by the Web server.Please delete it and refresh this page.', 'wp-super-cache' ), $wp_cache_config_file );
1189
  return false;
1190
  }
1191
  }
1192
  } elseif( !is_writeable_ACLSafe($dir)) {
1193
+ echo "<strong>" . __( 'Error', 'wp-super-cache' ) . ":</strong> " . sprintf( __( 'Configuration file missing and %1$s directory (<strong>%2$s</strong>) is not writable by the Web server.Check its permissions.', 'wp-super-cache' ), WP_CONTENT_DIR, $dir );
1194
  return false;
1195
  }
1196
 
1197
  if ( !file_exists($wp_cache_config_file) ) {
1198
  if ( !file_exists($wp_cache_config_file_sample) ) {
1199
+ echo "<strong>" . __( 'Error', 'wp-super-cache' ) . ":</strong> " . sprintf( __( 'Sample WP-Cache config file (<strong>%s</strong>) does not exist.Verify you installation.', 'wp-super-cache' ), $wp_cache_config_file_sample );
1200
  return false;
1201
  }
1202
  copy($wp_cache_config_file_sample, $wp_cache_config_file);
1252
  }
1253
 
1254
  if( false == $ret ) {
1255
+ echo "<h3>" . __( 'Warning', 'wp-super-cache' ) . "! <em>" . sprintf( __( '%s/advanced-cache.php</em> does not exist or cannot be updated.', 'wp-super-cache' ), WP_CONTENT_DIR ) . "</h3>";
1256
+ echo "<p><ul><li>" . __( '1. If it already exists please delete the file first.', 'wp-super-cache' ) . "</li>";
1257
+ echo "<li>" . sprintf( __( '2. Make %1$s writable using the chmod command through your ftp or server software. (<em>chmod 777 %1$s</em>) and refresh this page. This is only a temporary measure and you&#8217;ll have to make it read only afterwards again. (Change 777 to 755 in the previous command)', 'wp-super-cache' ), WP_CONTENT_DIR ) . "</li>";
1258
+ echo "<li>" . sprintf( __( '3. Refresh this page to update <em>%s/advanced-cache.php</em>', 'wp-super-cache' ), WP_CONTENT_DIR ) . "</li></ul>";
1259
+ echo sprintf( __( 'If that doesn&#8217;t work, make sure the file <em>%s/advanced-cache.php</em> doesn&#8217;t exist:', 'wp-super-cache' ), WP_CONTENT_DIR ) . "<ol>";
1260
+ printf( __( '<li>1. Open <em>%1$s$wp_cache_file</em> in a text editor.</li><li>2. Change the text <em>CACHEHOME</em> to <em>%2$s</em></li><li>3. Save the file and copy it to <em>%3$s</em> and refresh this page.</li>', 'wp-super-cache' ), $wp_cache_file, WPCACHEHOME, $wp_cache_link );
1261
  return false;
1262
  }
1263
  return true;
1273
  $global = dirname(ABSPATH) . '/wp-config.php';
1274
  }
1275
 
1276
+ $howtoenable = sprintf( __( "Edit <code>%s</code> and add the following line: <code>define('WP_CACHE', true);</code>Otherwise, <strong>WP-Cache will not be executed</strong> by Wordpress core. ", 'wp-super-cache' ), $global );
1277
  $lines = file($global);
1278
  foreach($lines as $line) {
1279
  if (preg_match('/^\s*define\s*\(\s*\'WP_CACHE\'\s*,\s*(?i:TRUE|1)\s*\)\s*;/', $line)) {
1283
  }
1284
  $line = 'define(\'WP_CACHE\', true);';
1285
  if (!is_writeable_ACLSafe($global) || !wp_cache_replace_line('define *\( *\'WP_CACHE\'', $line, $global) ) {
1286
+ _e( "<strong>Error: WP_CACHE is not enabled</strong> in your <code>wp-config.php</code> file and I couldn&#8217;t modify it.", 'wp-super-cache' );
1287
  echo $howtoenable;
1288
  return false;
1289
  }
1291
  }
1292
 
1293
  function wp_cache_files() {
1294
+ global $cache_path, $file_prefix, $cache_max_time, $valid_nonce, $supercachedir, $cache_enabled, $super_cache_enabled, $blog_cache_dir, $cache_compression;
1295
 
1296
  if ( '/' != substr($cache_path, -1)) {
1297
  $cache_path .= '/';
1301
  if(isset($_REQUEST['wp_delete_cache'])) {
1302
  wp_cache_clean_cache($file_prefix);
1303
  }
 
 
 
1304
  if(isset($_REQUEST['wp_delete_expired'])) {
1305
  wp_cache_clean_expired($file_prefix);
1306
  }
1307
  }
1308
+ echo "<a name='listfiles'></a>";
 
 
 
 
 
1309
  echo '<fieldset class="options" id="show-this-fieldset"><h3>Cache Contents</h3>';
 
 
 
 
 
 
1310
 
1311
  $list_files = false; // it doesn't list supercached files, and removing single pages is buggy
1312
  $count = 0;
1315
  if ( ($handle = @opendir( $blog_cache_dir . 'meta/' )) ) {
1316
  if ($list_files) echo "<table cellspacing=\"0\" cellpadding=\"5\">";
1317
  $wp_cache_fsize = 0;
1318
+ if ( $valid_nonce && isset( $_GET[ 'action' ] ) && $_GET[ 'action' ] == 'deletewpcache' ) {
1319
+ $deleteuri = preg_replace( '/[ <>\'\"\r\n\t\(\)]/', '', str_replace( '/index.php', '/', str_replace( '..', '', preg_replace("/(\?.*)?$/", '', base64_decode( $_GET[ 'uri' ] ) ) ) ) );
1320
+ $deleteuri = str_replace( '\\', '', $deleteuri );
1321
+ } else {
1322
+ $deleteuri = '';
1323
+ }
1324
+
1325
+ if ( $valid_nonce && isset( $_GET[ 'action' ] ) && $_GET[ 'action' ] == 'deletesupercache' ) {
1326
+ $supercacheuri = preg_replace( '/[ <>\'\"\r\n\t\(\)]/', '', str_replace( '/index.php', '/', str_replace( '..', '', preg_replace("/(\?.*)?$/", '', base64_decode( $_GET[ 'uri' ] ) ) ) ) );
1327
+ $supercacheuri = trailingslashit( str_replace( '\\', '', $supercacheuri ) );
1328
+ printf( __( "Deleting supercache file: <strong>%s</strong><br />", 'wp-super-cache' ), $supercacheuri );
1329
+ @unlink( $cache_path . 'supercache/' . $supercacheuri . 'index.html' );
1330
+ @unlink( $cache_path . 'supercache/' . $supercacheuri . 'index.html.gz' );
1331
+ prune_super_cache( $cache_path . 'supercache/' . $supercacheuri . 'page', true );
1332
+ @rmdir( $cache_path . 'supercache/' . $supercacheuri );
1333
+ }
1334
+ while( false !== ($file = readdir($handle))) {
1335
  if ( preg_match("/^$file_prefix.*\.meta/", $file) ) {
 
1336
  $content_file = preg_replace("/meta$/", "html", $file);
1337
  $mtime = filemtime( $blog_cache_dir . 'meta/' . $file );
1338
  if ( ! ( $fsize = @filesize( $blog_cache_dir . $content_file ) ) )
1339
  continue; // .meta does not exists
1340
+
 
1341
  $age = $now - $mtime;
1342
+ if ( $valid_nonce && $_GET[ 'listfiles' ] ) {
1343
+ $meta = unserialize( file_get_contents( $cache_path . 'meta/' . $file ) );
1344
+ if ( $deleteuri != '' && $meta[ 'uri' ] == $deleteuri ) {
1345
+ printf( __( "Deleting wp-cache file: <strong>%s</strong><br />", 'wp-super-cache' ), $deleteuri );
1346
+ @unlink( $cache_path . 'meta/' . $file );
1347
+ @unlink( $cache_path . $content_file );
1348
+ continue;
1349
+ }
1350
+ $meta[ 'age' ] = $age;
1351
+ if ( $age > $cache_max_time ) {
1352
+ $expired_list[ $age ][] = $meta;
1353
+ } else {
1354
+ $cached_list[ $age ][] = $meta;
1355
+ }
1356
+ }
1357
+
1358
  if ( $age > $cache_max_time ) {
1359
  $expired++;
1360
+ } else {
1361
+ $count++;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1362
  }
1363
+ $wp_cache_fsize += $fsize;
1364
+ $fsize = intval($fsize/1024);
1365
  }
1366
  }
1367
  closedir($handle);
1381
  }
1382
  if( $cache_enabled == true && $super_cache_enabled == true ) {
1383
  $now = time();
1384
+ $sizes = array( 'expired' => 0, 'expired_list' => array(), 'cached' => 0, 'cached_list' => array(), 'ts' => 0 );
1385
 
1386
  if (is_dir($supercachedir)) {
1387
  if( $dh = opendir( $supercachedir ) ) {
1393
  closedir($dh);
1394
  }
1395
  } else {
1396
+ $filem = @filemtime( $supercachedir );
1397
+ if(is_file($supercachedir) && $filem + $cache_max_time <= $now ) {
1398
  $sizes[ 'expired' ] ++;
1399
+ if ( $valid_nonce && $_GET[ 'listfiles' ] )
1400
+ $sizes[ 'expired_list' ][ str_replace( $cache_path . 'supercache/' , '', $supercachedir ) ] = $now - $filem;
1401
+ } else {
1402
+ if ( $valid_nonce && $_GET[ 'listfiles' ] && $filem )
1403
+ $sizes[ 'cached_list' ][ str_replace( $cache_path . 'supercache/' , '', $supercachedir ) ] = $now - $filem;
1404
+ }
1405
+ }
1406
  $sizes[ 'ts' ] = time();
1407
  }
1408
 
1409
+ echo "<p><strong>" . __( 'WP-Cache', 'wp-super-cache' ) . " ({$wp_cache_fsize})</strong></p>";
1410
+ echo "<ul><li>" . sprintf( __( '%s Cached Pages', 'wp-super-cache' ), $count ) . "</li>";
1411
+ echo "<li>" . sprintf( __( '%s Expired Pages', 'wp-super-cache' ), $expired ) . "</li></ul>";
1412
  if( $cache_enabled == true && $super_cache_enabled == true ) {
1413
  $fsize = $sizes[ 'fsize' ] / 1024;
1414
  if( $fsize > 1024 ) {
1418
  } else {
1419
  $fsize = "0KB";
1420
  }
1421
+ $divisor = $cache_compression == 1 ? 2 : 1;
1422
+ echo "<p><strong>" . __( 'WP-Super-Cache', 'wp-super-cache' ) . " ({$fsize})</strong></p>";
1423
+ echo "<ul><li>" . sprintf( __( '%s Cached Pages', 'wp-super-cache' ), intval( $sizes[ 'cached' ] / $divisor ) ) . "</li>";
1424
  $age = intval(($now - $sizes['ts'])/60);
1425
+ echo "<li>" . sprintf( __( '%s Expired Pages', 'wp-super-cache' ), intval( $sizes[ 'expired' ] / $divisor ) ) . "</li></ul>";
1426
+ }
1427
+ if ( $valid_nonce && $_GET[ 'listfiles' ] ) {
1428
+ echo "<div style='padding: 10px; border: 1px solid #333; height: 400px; width: 70%; overflow: auto'>";
1429
+ if ( is_array( $cached_list ) && !empty( $cached_list ) ) {
1430
+ echo "<h4>" . __( 'Fresh WP-Cached Files', 'wp-super-cache' ) . "</h4>";
1431
+ echo "<table class='widefat'><tr><th>#</th><th>" . __( 'URI' ) . "</th><th>" . __( 'Key' ) . "</th><th>" . __( 'Age' ) . "</th><th>" . __( 'Delete' ) . "</th></tr>";
1432
+ $c = 1;
1433
+ $flip = 1;
1434
+ ksort( $cached_list );
1435
+ foreach( $cached_list as $age => $d ) {
1436
+ foreach( $d as $details ) {
1437
+ $bg = $flip ? 'style="background: #EAEAEA;"' : '';
1438
+ echo "<tr $bg><td>$c</td><td> <a href='http://{$details[ 'uri' ]}'>" . $details[ 'uri' ] . "</a></td><td> " . str_replace( $details[ 'uri' ], '', $details[ 'key' ] ) . "</td><td> {$age}</td><td><a href='" . wp_nonce_url( add_query_arg( array( 'page' => 'wpsupercache', 'action' => 'deletewpcache', 'uri' => base64_encode( $details[ 'uri' ] ) ) ), 'wp-cache' ) . "#listfiles'>X</a></td></tr>\n";
1439
+ $flip = !$flip;
1440
+ $c++;
1441
+ }
1442
+ }
1443
+ echo "</table>";
1444
+ }
1445
+ if ( is_array( $expired_list ) && !empty( $expired_list ) ) {
1446
+ echo "<h4>" . __( 'Stale WP-Cached Files', 'wp-super-cache' ) . "</h4>";
1447
+ echo "<table class='widefat'><tr><th>#</th><th>" . __( 'URI' ) . "</th><th>" . __( 'Key' ) . "</th><th>" . __( 'Age' ) . "</th><th>" . __( 'Delete' ) . "</th></tr>";
1448
+ $c = 1;
1449
+ $flip = 1;
1450
+ ksort( $expired_list );
1451
+ foreach( $expired_list as $age => $d ) {
1452
+ foreach( $d as $details ) {
1453
+ $bg = $flip ? 'style="background: #EAEAEA;"' : '';
1454
+ echo "<tr $bg><td>$c</td><td> <a href='http://{$details[ 'uri' ]}'>" . $details[ 'uri' ] . "</a></td><td> " . str_replace( $details[ 'uri' ], '', $details[ 'key' ] ) . "</td><td> {$age}</td><td><a href='" . wp_nonce_url( add_query_arg( array( 'page' => 'wpsupercache', 'action' => 'deletewpcache', 'uri' => base64_encode( $details[ 'uri' ] ) ) ), 'wp-cache' ) . "#listfiles'>X</a></td></tr>\n";
1455
+ $flip = !$flip;
1456
+ $c++;
1457
+ }
1458
+ }
1459
+ echo "</table>";
1460
+ }
1461
+ if ( is_array( $sizes[ 'cached_list' ] ) & !empty( $sizes[ 'cached_list' ] ) ) {
1462
+ echo "<h4>" . __( 'Fresh Super Cached Files', 'wp-super-cache' ) . "</h4>";
1463
+ echo "<table class='widefat'><tr><th>#</th><th>" . __( 'URI' ) . "</th><th>" . __( 'Age' ) . "</th><th>" . __( 'Delete' ) . "</th></tr>";
1464
+ $c = 1;
1465
+ $flip = 1;
1466
+ ksort( $sizes[ 'cached_list' ] );
1467
+ foreach( $sizes[ 'cached_list' ] as $age => $d ) {
1468
+ foreach( $d as $uri => $n ) {
1469
+ $bg = $flip ? 'style="background: #EAEAEA;"' : '';
1470
+ echo "<tr $bg><td>$c</td><td> <a href='http://{$uri}'>" . $uri . "</a></td><td>$age</td><td><a href='" . wp_nonce_url( add_query_arg( array( 'page' => 'wpsupercache', 'action' => 'deletesupercache', 'uri' => base64_encode( $uri ) ) ), 'wp-cache' ) . "#listfiles'>X</a></td></tr>\n";
1471
+ $flip = !$flip;
1472
+ $c++;
1473
+ }
1474
+ }
1475
+ echo "</table>";
1476
+ }
1477
+ if ( is_array( $sizes[ 'expired_list' ] ) && !empty( $sizes[ 'expired_list' ] ) ) {
1478
+ echo "<h4>" . __( 'Stale Super Cached Files', 'wp-super-cache' ) . "</h4>";
1479
+ echo "<table class='widefat'><tr><th>#</th><th>" . __( 'URI' ) . "</th><th>" . __( 'Age' ) . "</th><th>" . __( 'Delete' ) . "</th></tr>";
1480
+ $c = 1;
1481
+ $flip = 1;
1482
+ ksort( $sizes[ 'expired_list' ] );
1483
+ foreach( $sizes[ 'expired_list' ] as $age => $d ) {
1484
+ foreach( $d as $uri => $n ) {
1485
+ $bg = $flip ? 'style="background: #EAEAEA;"' : '';
1486
+ echo "<tr $bg><td>$c</td><td> <a href='http://{$uri}'>" . $uri . "</a></td><td>$age</td><td><a href='" . wp_nonce_url( add_query_arg( array( 'page' => 'wpsupercache', 'action' => 'deletesupercache', 'uri' => base64_encode( $uri ) ) ), 'wp-cache' ) . "#listfiles'>X</a></td></tr>\n";
1487
+ $flip = !$flip;
1488
+ $c++;
1489
+ }
1490
+ }
1491
+ echo "</table>";
1492
+ }
1493
+ echo "</div>";
1494
+ echo "<p><a href='?page=wpsupercache#top'>" . __( 'Hide file list', 'wp-super-cache' ) . "</a></p>";
1495
+ } else {
1496
+ echo "<p><a href='" . wp_nonce_url( add_query_arg( array( 'page' => 'wpsupercache', 'listfiles' => '1' ) ), 'wp-cache' ) . "#listfiles'>" . __( 'List all cached files', 'wp-super-cache' ) . "</a></p>";
1497
  }
1498
  $last_gc = get_option( "wpsupercache_gc_time" );
1499
  if( $last_gc ) {
1500
  $next_gc = $cache_max_time < 1800 ? $cache_max_time : 600;
1501
  $next_gc_mins = ( time() - $last_gc );
1502
+ echo "<p>" . sprintf( __( '<strong>Garbage Collection</strong><br />Last GC was <strong>%s</strong> minutes ago<br />', 'wp-super-cache' ), date( 'i:s', $next_gc_mins ) );
1503
+ printf( __( "Next GC in <strong>%s</strong> minutes", 'wp-super-cache' ), date( 'i:s', $next_gc - $next_gc_mins ) ) . "</p>";
1504
  }
1505
 
1506
+ echo "<p>" . sprintf( __( 'Expired files are files older than %s seconds. They are still used by the plugin and are deleted periodically.', 'wp-super-cache' ), $cache_max_time ) . "</p>";
1507
+ echo '<form name="wp_cache_content_expired" action="#listfiles" method="post">';
1508
  echo '<input type="hidden" name="wp_delete_expired" />';
1509
+ echo '<div class="submit" style="float:left"><input type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Delete Expired', 'wp-super-cache' ) . ' &raquo;" /></div>';
1510
  wp_nonce_field('wp-cache');
1511
  echo "</form>\n";
1512
 
1513
+ echo '<form name="wp_cache_content_delete" action="#listfiles" method="post">';
1514
  echo '<input type="hidden" name="wp_delete_cache" />';
1515
+ echo '<div class="submit" style="float:left;margin-left:10px"><input id="deletepost" type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Delete Cache', 'wp-super-cache' ) . ' &raquo;" /></div>';
1516
  wp_nonce_field('wp-cache');
1517
  echo "</form>\n";
1518
 
1526
  if( function_exists('current_user_can') && !current_user_can('manage_options') )
1527
  return false;
1528
 
1529
+ echo "<li><a href='" . wp_nonce_url( 'options-general.php?page=wpsupercache&wp_delete_cache=1', 'wp-cache' ) . "' target='_blank' title='" . __( 'Delete Super Cache cached files (opens in new window)', 'wp-super-cache' ) . "'>" . __( 'Delete Cache', 'wp-super-cache' ) . "</a></li>";
1530
  }
1531
  add_action( 'dashmenu', 'delete_cache_dashboard' );
1532
 
1533
  function wpsc_dirsize($directory, $sizes) {
1534
+ global $cache_max_time, $cache_path, $valid_nonce;
1535
  $now = time();
1536
 
1537
  if (is_dir($directory)) {
1545
  }
1546
  } else {
1547
  if(is_file($directory) ) {
1548
+ $filem = filemtime( $directory );
1549
+ if( $filem + $cache_max_time <= $now ) {
1550
  $sizes[ 'expired' ]+=1;
1551
+ if ( $valid_nonce && $_GET[ 'listfiles' ] )
1552
+ $sizes[ 'expired_list' ][ $now - $filem ][ str_replace( $cache_path . 'supercache/' , '', str_replace( 'index.html', '', str_replace( 'index.html.gz', '', $directory ) ) ) ] = 1;
1553
  } else {
1554
  $sizes[ 'cached' ]+=1;
1555
+ if ( $valid_nonce && $_GET[ 'listfiles' ] )
1556
+ $sizes[ 'cached_list' ][ $now - $filem ][ str_replace( $cache_path . 'supercache/' , '', str_replace( 'index.html', '', str_replace( 'index.html.gz', '', $directory ) ) ) ] = 1;
1557
  }
1558
  if ( ! isset( $sizes[ 'fsize' ] ) )
1559
  $sizes[ 'fsize' ] = @filesize( $directory );
1578
  }
1579
  prune_super_cache( $cache_path, true );
1580
  $_POST[ 'super_cache_stats' ] = 1; // regenerate super cache stats;
1581
+ } elseif ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( 'Warning! prune_super_cache() not found in wp-cache.php', 1 );
1582
  return wp_cache_phase2_clean_cache($file_prefix);
1583
+ } elseif ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( 'Warning! wp_cache_phase2_clean_cache() not found in wp-cache.php', 1 );
1584
 
1585
  $expr = "/^$file_prefix/";
1586
  if ( ($handle = @opendir( $blog_cache_dir )) ) {
1658
  }
1659
 
1660
  function wp_super_cache_footer() {
1661
+ ?><p id='supercache'><?php printf( __( '%1$s is Digg proof thanks to caching by %2$s', 'wp-super-cache' ), bloginfo( 'name' ), '<a href="http://ocaoimh.ie/wp-super-cache/">WP Super Cache</a>' ); ?></p><?php
1662
  }
1663
  if( isset( $wp_cache_hello_world ) && $wp_cache_hello_world )
1664
  add_action( 'wp_footer', 'wp_super_cache_footer' );
1682
  if( function_exists('current_user_can') && !current_user_can('manage_options') )
1683
  return $actions;
1684
 
1685
+ $actions[ wp_nonce_url( 'options-general.php?page=wpsupercache&wp_delete_cache=1', 'wp-cache' ) ] = array( __( 'Delete Cache', 'wp-super-cache' ), 'manage_options' );
1686
 
1687
  return $actions;
1688
  }
1691
  function wp_cache_plugin_notice( $plugin ) {
1692
  global $cache_enabled;
1693
  if( $plugin == 'wp-super-cache/wp-cache.php' && !$cache_enabled && function_exists( "admin_url" ) )
1694
+ echo '<td colspan="5" class="plugin-update">' . sprintf( __( 'WP Super Cache must be configured. Go to <a href="%s">the admin page</a> to enable and configure the plugin.' ), admin_url( 'options-general.php?page=wpsupercache' ) ) . '</td>';
1695
  }
1696
  add_action( 'after_plugin_row', 'wp_cache_plugin_notice' );
1697
 
1707
  function wp_cache_admin_notice() {
1708
  global $cache_enabled;
1709
  if( substr( $_SERVER["PHP_SELF"], -11 ) == 'plugins.php' && !$cache_enabled && function_exists( "admin_url" ) )
1710
+ echo '<div class="error"><p><strong>' . sprintf( __('WP Super Cache is disabled. Please go to the <a href="%s">plugin admin page</a> to enable caching.', 'wp-super-cache' ), admin_url( 'options-general.php?page=wpsupercache' ) ) . '</strong></p></div>';
1711
  }
1712
  add_action( 'admin_notices', 'wp_cache_admin_notice' );
1713
  ?>
wp-super-cache.pot ADDED
@@ -0,0 +1,1095 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # WP Super Cache Translation File
2
+ # GPL
3
+ # Donncha O Caoimh, http://ocaoimh.ie/
4
+ #
5
+ #, fuzzy
6
+ msgid ""
7
+ msgstr ""
8
+ "Project-Id-Version: PACKAGE VERSION\n"
9
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-super-cache\n"
10
+ "POT-Creation-Date: 2009-10-02 13:11+0000\n"
11
+ "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
+ "MIME-Version: 1.0\n"
15
+ "Content-Type: text/plain; charset=CHARSET\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+
18
+ #: wp-cache.php:83
19
+ #, php-format
20
+ msgid ""
21
+ "Please create %s /wp-cache-config.php from wp-super-cache/wp-cache-config-"
22
+ "sample.php"
23
+ msgstr ""
24
+
25
+ #: wp-cache.php:162
26
+ msgid "Warning! PHP Safe Mode Enabled!"
27
+ msgstr ""
28
+
29
+ #: wp-cache.php:163
30
+ msgid ""
31
+ "You may experience problems running this plugin because SAFE MODE is enabled."
32
+ msgstr ""
33
+
34
+ #: wp-cache.php:165
35
+ msgid ""
36
+ "Your server is set up to check the owner of PHP scripts before allowing them "
37
+ "to read and write files."
38
+ msgstr ""
39
+
40
+ #: wp-cache.php:166
41
+ #, php-format
42
+ msgid ""
43
+ "You or an administrator may be able to make it work by changing the group "
44
+ "owner of the plugin scripts to match that of the web server user. The group "
45
+ "owner of the %s/cache/ directory must also be changed. See the <a href="
46
+ "\"http://php.net/features.safe-mode\">safe mode manual page</a> for further "
47
+ "details."
48
+ msgstr ""
49
+
50
+ #: wp-cache.php:168
51
+ msgid ""
52
+ "You or an administrator must disable this. See the <a href=\"http://php.net/"
53
+ "features.safe-mode\">safe mode manual page</a> for further details. This "
54
+ "cannot be disabled in a .htaccess file unfortunately. It must be done in the "
55
+ "php.ini config file."
56
+ msgstr ""
57
+
58
+ #: wp-cache.php:173
59
+ msgid ""
60
+ "Configuration file changed, some values might be wrong. Load the page again "
61
+ "from the \"Settings\" menu to reset them."
62
+ msgstr ""
63
+
64
+ #: wp-cache.php:179
65
+ msgid "Cannot continue... fix previous problems and retry."
66
+ msgstr ""
67
+
68
+ #: wp-cache.php:195
69
+ #, php-format
70
+ msgid "Warning! Your hostname \"%s\" resolves to %s"
71
+ msgstr ""
72
+
73
+ #: wp-cache.php:197
74
+ #, php-format
75
+ msgid ""
76
+ "Your server thinks your hostname resolves to %s. Some services such as "
77
+ "garbage collection by this plugin, and WordPress scheduled posts may not "
78
+ "operate correctly."
79
+ msgstr ""
80
+
81
+ #: wp-cache.php:198 wp-cache.php:212
82
+ #, php-format
83
+ msgid ""
84
+ "Please see entry 16 in the <a href=\"%s\">Troubleshooting section</a> of the "
85
+ "readme.txt"
86
+ msgstr ""
87
+
88
+ #: wp-cache.php:211
89
+ msgid ""
90
+ "Unfortunately WordPress cannot find the file wp-cron.php. This script is "
91
+ "required for the the correct operation of garbage collection by this plugin, "
92
+ "WordPress scheduled posts as well as other critical activities."
93
+ msgstr ""
94
+
95
+ #: wp-cache.php:223
96
+ msgid "Mod rewrite may not be installed!"
97
+ msgstr ""
98
+
99
+ #: wp-cache.php:224
100
+ msgid ""
101
+ "It appears that mod_rewrite is not installed. Sometimes this check isn&#8217;"
102
+ "t 100% reliable, especially if you are not using Apache. Please verify that "
103
+ "the mod_rewrite module is loaded. It is required for serving Super Cache "
104
+ "static files. You will still be able to use half-on mode."
105
+ msgstr ""
106
+
107
+ #: wp-cache.php:229
108
+ msgid "Read Only Mode. Configuration cannot be changed."
109
+ msgstr ""
110
+
111
+ #: wp-cache.php:229
112
+ msgid "Why your configuration may not be changed"
113
+ msgstr ""
114
+
115
+ #: wp-cache.php:229
116
+ msgid "Why"
117
+ msgstr ""
118
+
119
+ #: wp-cache.php:231
120
+ #, php-format
121
+ msgid ""
122
+ "The WP Super Cache configuration file is <code>%s/wp-cache-config.php</code> "
123
+ "and cannot be modified. That file must be writeable by the webserver to make "
124
+ "any changes."
125
+ msgstr ""
126
+
127
+ #: wp-cache.php:232
128
+ msgid ""
129
+ "A simple way of doing that is by changing the permissions temporarily using "
130
+ "the CHMOD command or through your ftp client. Make sure it&#8217;s globally "
131
+ "writeable and it should be fine."
132
+ msgstr ""
133
+
134
+ #: wp-cache.php:233
135
+ msgid "Writeable:"
136
+ msgstr ""
137
+
138
+ #: wp-cache.php:234
139
+ msgid "Readonly:"
140
+ msgstr ""
141
+
142
+ #: wp-cache.php:246
143
+ #, php-format
144
+ msgid "Warning! %s is writeable!"
145
+ msgstr ""
146
+
147
+ #: wp-cache.php:247
148
+ #, php-format
149
+ msgid ""
150
+ "You should change the permissions on %s and make it more restrictive. Use "
151
+ "your ftp client, or the following command to fix things:"
152
+ msgstr ""
153
+
154
+ #: wp-cache.php:338
155
+ msgid "WP Super Cache Status"
156
+ msgstr ""
157
+
158
+ #: wp-cache.php:341
159
+ msgid "ON"
160
+ msgstr ""
161
+
162
+ #: wp-cache.php:341
163
+ msgid "WP Cache and Super Cache enabled"
164
+ msgstr ""
165
+
166
+ #: wp-cache.php:342
167
+ msgid "HALF ON"
168
+ msgstr ""
169
+
170
+ #: wp-cache.php:342
171
+ msgid "Super Cache Disabled, only legacy WP-Cache caching."
172
+ msgstr ""
173
+
174
+ #: wp-cache.php:343
175
+ msgid "OFF"
176
+ msgstr ""
177
+
178
+ #: wp-cache.php:343
179
+ msgid "WP Cache and Super Cache disabled"
180
+ msgstr ""
181
+
182
+ #: wp-cache.php:344
183
+ msgid "Don&#8217;t cache pages for logged in users."
184
+ msgstr ""
185
+
186
+ #: wp-cache.php:345
187
+ msgid ""
188
+ "Proudly tell the world your server is Digg proof! (places a message in your "
189
+ "blog&#8217;s footer)"
190
+ msgstr ""
191
+
192
+ #: wp-cache.php:346
193
+ msgid ""
194
+ "Clear all cache files when a post or page is published. (This may "
195
+ "significantly slow down saving of posts.)"
196
+ msgstr ""
197
+
198
+ #: wp-cache.php:347
199
+ msgid ""
200
+ "Cache rebuild. Serve a supercache file to anonymous users while a new file "
201
+ "is being generated. Recommended for <em>very</em> busy websites with lots of "
202
+ "comments. Makes \"directly cached pages\" and \"Lockdown mode\" obsolete."
203
+ msgstr ""
204
+
205
+ #: wp-cache.php:349
206
+ msgid ""
207
+ "Coarse file locking. You probably don&#8217;t need this but it may help if "
208
+ "your server is underpowered. Warning! <em>May cause your server to lock up "
209
+ "in very rare cases!</em>"
210
+ msgstr ""
211
+
212
+ #: wp-cache.php:351
213
+ msgid ""
214
+ "List the newest cached pages (may be expensive to run on busy sites, use "
215
+ "with caution.)"
216
+ msgstr ""
217
+
218
+ #: wp-cache.php:352
219
+ msgid "Mobile device support."
220
+ msgstr ""
221
+
222
+ #: wp-cache.php:357
223
+ msgid "Mobile rewrite rules detected"
224
+ msgstr ""
225
+
226
+ #: wp-cache.php:358
227
+ msgid ""
228
+ "For best performance you should enable \"Mobile device support\" or delete "
229
+ "the mobile rewrite rules in your .htaccess. Look for the 2 lines with the "
230
+ "text \"Android|2.0\\ MMP|240x320|AvantGo|BlackBerry|Blazer|Cellphone\" and "
231
+ "delete those."
232
+ msgstr ""
233
+
234
+ #: wp-cache.php:358
235
+ msgid ""
236
+ "This will have no affect on ordinary users but mobile users will see "
237
+ "uncached pages."
238
+ msgstr ""
239
+
240
+ #: wp-cache.php:361
241
+ msgid ""
242
+ "Mobile support requires extra rules in your .htaccess file, or you can set "
243
+ "the plugin to half-on mode. Here are your options (in order of difficulty):"
244
+ msgstr ""
245
+
246
+ #: wp-cache.php:362
247
+ msgid "Set the plugin to half on mode and enable mobile support."
248
+ msgstr ""
249
+
250
+ #: wp-cache.php:363
251
+ #, php-format
252
+ msgid ""
253
+ "Delete the plugin mod_rewrite rules in %s.htaccess enclosed by <code># BEGIN "
254
+ "WPSuperCache</code> and <code># END WPSuperCache</code> and let the plugin "
255
+ "regenerate them by reloading this page."
256
+ msgstr ""
257
+
258
+ #: wp-cache.php:364
259
+ msgid ""
260
+ "Add the rules yourself. Edit %s.htaccess and find the block of code enclosed "
261
+ "by the lines <code># BEGIN WPSuperCache</code> and <code># END WPSuperCache</"
262
+ "code>. There are two sections that look very similar. Just below the line "
263
+ "<code>%{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$</code> "
264
+ "add this line: (do it twice, once for each section)"
265
+ msgstr ""
266
+
267
+ #: wp-cache.php:367
268
+ msgid "Note:"
269
+ msgstr ""
270
+
271
+ #: wp-cache.php:367
272
+ #, php-format
273
+ msgid ""
274
+ "If uninstalling this plugin, make sure the directory <em>%s</em> is "
275
+ "writeable by the webserver so the files <em>advanced-cache.php</em> and "
276
+ "<em>cache-config.php</em> can be deleted automatically. (Making sure those "
277
+ "files are writeable too is probably a good idea!)"
278
+ msgstr ""
279
+
280
+ #: wp-cache.php:368
281
+ #, php-format
282
+ msgid ""
283
+ "Uninstall using the <a href=\"%1$s/wp-super-cache/uninstall.php\">uninstall "
284
+ "script</a> to remove files and directories created by the plugin. (Please "
285
+ "see <a href=\"%1$s/wp-super-cache/readme.txt\">readme.txt</a> for "
286
+ "instructions on uninstalling this script.)"
287
+ msgstr ""
288
+
289
+ #: wp-cache.php:370
290
+ msgid "Update Status"
291
+ msgstr ""
292
+
293
+ #: wp-cache.php:377
294
+ msgid "Required to serve compressed supercache files properly."
295
+ msgstr ""
296
+
297
+ #: wp-cache.php:377
298
+ msgid ""
299
+ "Required to set caching information on supercache pages. IE7 users will see "
300
+ "old pages without this module."
301
+ msgstr ""
302
+
303
+ #: wp-cache.php:377
304
+ msgid ""
305
+ "Set the expiry date on supercached pages. Visitors may not see new pages "
306
+ "when they refresh or leave comments without this module."
307
+ msgstr ""
308
+
309
+ #: wp-cache.php:384
310
+ msgid "Missing Apache Modules"
311
+ msgstr ""
312
+
313
+ #: wp-cache.php:385
314
+ msgid ""
315
+ "The following Apache modules are missing. The plugin will work in half-on "
316
+ "mode without them. In full Supercache mode, your visitors may see corrupted "
317
+ "pages or out of date content however."
318
+ msgstr ""
319
+
320
+ #: wp-cache.php:397
321
+ msgid "Make WordPress Faster"
322
+ msgstr ""
323
+
324
+ #: wp-cache.php:399
325
+ #, php-format
326
+ msgid ""
327
+ "%1$s really makes your blog go faster. Make it go faster<sup>*</sup> by "
328
+ "buying me an <a href=\"%2$s\">Amazon gift card</a>! Make it out to \"%3$s\" "
329
+ "for whatever amount you want. Every penny helps!"
330
+ msgstr ""
331
+
332
+ #: wp-cache.php:400
333
+ #, php-format
334
+ msgid ""
335
+ "If Amazon isn&#8217;t your thing, there&#8217;s also PayPal. Click the "
336
+ "\"Donate\" button below or take a quick peek at my <a href=\"%s\">wishlist</"
337
+ "a>."
338
+ msgstr ""
339
+
340
+ #: wp-cache.php:401
341
+ msgid "Thanks in advance!"
342
+ msgstr ""
343
+
344
+ #: wp-cache.php:402
345
+ msgid ""
346
+ "Ok, it won&#8217;t go any faster but you&#8217;ll make this plugin author "
347
+ "very happy!"
348
+ msgstr ""
349
+
350
+ #: wp-cache.php:413
351
+ #, php-format
352
+ msgid ""
353
+ "%1$s is maintained and developed by %2$s with contributions from many others."
354
+ msgstr ""
355
+
356
+ #: wp-cache.php:414
357
+ #, php-format
358
+ msgid ""
359
+ "He blogs at %1$s, posts photos at %2$s and %3$s he had more time to read and "
360
+ "relax."
361
+ msgstr ""
362
+
363
+ #: wp-cache.php:415
364
+ #, php-format
365
+ msgid "Please say hi to him on %s too!"
366
+ msgstr ""
367
+
368
+ #: wp-cache.php:424
369
+ #, php-format
370
+ msgid "Cached pages since %1$s : <strong>%2$s</strong>"
371
+ msgstr ""
372
+
373
+ #: wp-cache.php:425
374
+ msgid "Newest Cached Pages:"
375
+ msgstr ""
376
+
377
+ #: wp-cache.php:429
378
+ #, php-format
379
+ msgid "Cached %s seconds ago"
380
+ msgstr ""
381
+
382
+ #: wp-cache.php:432
383
+ msgid "(may not always be accurate on busy sites)"
384
+ msgstr ""
385
+
386
+ #: wp-cache.php:453
387
+ msgid "Accepted Filenames &amp; Rejected URIs"
388
+ msgstr ""
389
+
390
+ #: wp-cache.php:478
391
+ msgid "Cache Plugins"
392
+ msgstr ""
393
+
394
+ #: wp-cache.php:489 wp-cache.php:500
395
+ msgid "Super Cache Compression"
396
+ msgstr ""
397
+
398
+ #: wp-cache.php:490
399
+ msgid "Compression is enabled by default when in <em>HALF ON</em> mode."
400
+ msgstr ""
401
+
402
+ #: wp-cache.php:502 wp-cache.php:680
403
+ msgid "Enabled"
404
+ msgstr ""
405
+
406
+ #: wp-cache.php:503 wp-cache.php:680
407
+ msgid "Disabled"
408
+ msgstr ""
409
+
410
+ #: wp-cache.php:504
411
+ msgid ""
412
+ "Compression is disabled by default because some hosts have problems with "
413
+ "compressed files. Switching this on and off clears the cache."
414
+ msgstr ""
415
+
416
+ #: wp-cache.php:507
417
+ msgid "Super Cache compression is now disabled."
418
+ msgstr ""
419
+
420
+ #: wp-cache.php:509
421
+ msgid "Super Cache compression is now enabled."
422
+ msgstr ""
423
+
424
+ #: wp-cache.php:511
425
+ msgid "Update Compression"
426
+ msgstr ""
427
+
428
+ #: wp-cache.php:565
429
+ msgid "WordPress MU Detected"
430
+ msgstr ""
431
+
432
+ #: wp-cache.php:565
433
+ msgid ""
434
+ "Unfortunately the rewrite rules cannot be updated automatically when running "
435
+ "WordPress MU. Please open your .htaccess and add the following mod_rewrite "
436
+ "rules above any other rules in that file."
437
+ msgstr ""
438
+
439
+ #: wp-cache.php:567
440
+ msgid "Mod Rewrite rules cannot be updated!"
441
+ msgstr ""
442
+
443
+ #: wp-cache.php:568
444
+ #, php-format
445
+ msgid ""
446
+ "You must have <strong>BEGIN</strong> and <strong>END</strong> markers in %s."
447
+ "htaccess for the auto update to work. They look like this and surround the "
448
+ "main WordPress mod_rewrite rules:"
449
+ msgstr ""
450
+
451
+ #: wp-cache.php:570
452
+ msgid "Refresh this page when you have updated your .htaccess file."
453
+ msgstr ""
454
+
455
+ #: wp-cache.php:574
456
+ msgid "Thank you for upgrading."
457
+ msgstr ""
458
+
459
+ #: wp-cache.php:574
460
+ #, php-format
461
+ msgid ""
462
+ "The mod_rewrite rules changed since you last installed this plugin. "
463
+ "Unfortunately you must remove the old supercache rules before the new ones "
464
+ "are updated. Refresh this page when you have edited your .htaccess file. If "
465
+ "you wish to manually upgrade, change the following line: %1$s so it looks "
466
+ "like this: %2$s The only changes are \"HTTP_COOKIE\" becomes \"HTTP:Cookie\" "
467
+ "and \"wordpressuser\" becomes \"wordpress\". This is a WordPress 2.5 change "
468
+ "but it&#8217;s backwards compatible with older versions if you&#8217;re "
469
+ "brave enough to use them."
470
+ msgstr ""
471
+
472
+ #: wp-cache.php:578
473
+ msgid "Trailing slash check required."
474
+ msgstr ""
475
+
476
+ #: wp-cache.php:578
477
+ msgid ""
478
+ "It looks like your blog has URLs that end with a \"/\". Unfortunately since "
479
+ "you installed this plugin a duplicate content bug has been found where URLs "
480
+ "not ending in a \"/\" end serve the same content as those with the \"/\" and "
481
+ "do not redirect to the proper URL. To fix, you must edit your .htaccess file "
482
+ "and add these two rules to the two groups of Super Cache rules:"
483
+ msgstr ""
484
+
485
+ #: wp-cache.php:580
486
+ msgid ""
487
+ "You can see where the rules go and examine the complete rules by clicking "
488
+ "the \"View mod_rewrite rules\" link below."
489
+ msgstr ""
490
+
491
+ #: wp-cache.php:592
492
+ msgid "Cannot update .htaccess"
493
+ msgstr ""
494
+
495
+ #: wp-cache.php:592
496
+ #, php-format
497
+ msgid ""
498
+ "The file <code>%s.htaccess</code> cannot be modified by the web server. "
499
+ "Please correct this using the chmod command or your ftp client."
500
+ msgstr ""
501
+
502
+ #: wp-cache.php:592
503
+ msgid "Refresh this page when the file permissions have been modified."
504
+ msgstr ""
505
+
506
+ #: wp-cache.php:592
507
+ #, php-format
508
+ msgid ""
509
+ "Alternatively, you can edit your <code>%s.htaccess</code> file manually and "
510
+ "add the following code (before any WordPress rules):"
511
+ msgstr ""
512
+
513
+ #: wp-cache.php:595
514
+ #, php-format
515
+ msgid ""
516
+ "To serve static html files your server must have the correct mod_rewrite "
517
+ "rules added to a file called <code>%s.htaccess</code>"
518
+ msgstr ""
519
+
520
+ #: wp-cache.php:597
521
+ msgid "You must edit the file yourself add the following rules."
522
+ msgstr ""
523
+
524
+ #: wp-cache.php:599
525
+ msgid "You can edit the file yourself add the following rules."
526
+ msgstr ""
527
+
528
+ #: wp-cache.php:601
529
+ msgid " Make sure they appear before any existing WordPress rules. "
530
+ msgstr ""
531
+
532
+ #: wp-cache.php:603
533
+ #, php-format
534
+ msgid "Rules must be added to %s too:"
535
+ msgstr ""
536
+
537
+ #: wp-cache.php:608
538
+ msgid "Update Mod_Rewrite Rules"
539
+ msgstr ""
540
+
541
+ #: wp-cache.php:617
542
+ msgid "Mod Rewrite rules updated!"
543
+ msgstr ""
544
+
545
+ #: wp-cache.php:618
546
+ #, php-format
547
+ msgid ""
548
+ "%s.htaccess has been updated with the necessary mod_rewrite rules. Please "
549
+ "verify they are correct. They should look like this:"
550
+ msgstr ""
551
+
552
+ #: wp-cache.php:620
553
+ msgid "Mod Rewrite rules must be updated!"
554
+ msgstr ""
555
+
556
+ #: wp-cache.php:621
557
+ #, php-format
558
+ msgid ""
559
+ "Your %s.htaccess is not writable by the webserver and must be updated with "
560
+ "the necessary mod_rewrite rules. The new rules go above the regular "
561
+ "WordPress rules as shown in the code below:"
562
+ msgstr ""
563
+
564
+ #: wp-cache.php:626
565
+ #, php-format
566
+ msgid ""
567
+ "WP Super Cache mod rewrite rules were detected in your %s.htaccess file.<br /"
568
+ "> Click the following link to see the lines added to that file. If you have "
569
+ "upgraded the plugin make sure these rules match."
570
+ msgstr ""
571
+
572
+ #: wp-cache.php:627
573
+ msgid "View Mod_Rewrite Rules"
574
+ msgstr ""
575
+
576
+ #: wp-cache.php:638
577
+ #, php-format
578
+ msgid "Gzip encoding rules in %s.htaccess created."
579
+ msgstr ""
580
+
581
+ #: wp-cache.php:645
582
+ msgid "Fix Configuration"
583
+ msgstr ""
584
+
585
+ #: wp-cache.php:648
586
+ msgid "Restore Default Configuration"
587
+ msgstr ""
588
+
589
+ #: wp-cache.php:656
590
+ msgid ""
591
+ "Comment moderation is enabled. Your comment may take some time to appear."
592
+ msgstr ""
593
+
594
+ #: wp-cache.php:680
595
+ msgid "Lock Down:"
596
+ msgstr ""
597
+
598
+ #: wp-cache.php:681
599
+ msgid ""
600
+ "Prepare your server for an expected spike in traffic by enabling the lock "
601
+ "down. When this is enabled, new comments on a post will not refresh the "
602
+ "cached static files."
603
+ msgstr ""
604
+
605
+ #: wp-cache.php:682
606
+ msgid ""
607
+ "Developers: Make your plugin lock down compatible by checking the "
608
+ "\"WPLOCKDOWN\" constant. The following code will make sure your plugin "
609
+ "respects the WPLOCKDOWN setting."
610
+ msgstr ""
611
+
612
+ #: wp-cache.php:684
613
+ msgid "Sorry. My blog is locked down. Updates will appear shortly"
614
+ msgstr ""
615
+
616
+ #: wp-cache.php:688
617
+ msgid ""
618
+ "WordPress is locked down. Super Cache static files will not be deleted when "
619
+ "new comments are made."
620
+ msgstr ""
621
+
622
+ #: wp-cache.php:690
623
+ msgid ""
624
+ "WordPress is not locked down. New comments will refresh Super Cache static "
625
+ "files as normal."
626
+ msgstr ""
627
+
628
+ #: wp-cache.php:693
629
+ msgid "Disable"
630
+ msgstr ""
631
+
632
+ #: wp-cache.php:693
633
+ msgid "Enable"
634
+ msgstr ""
635
+
636
+ #: wp-cache.php:696
637
+ msgid "Lock Down"
638
+ msgstr ""
639
+
640
+ #: wp-cache.php:704
641
+ msgid "Directly Cached Files"
642
+ msgstr ""
643
+
644
+ #: wp-cache.php:762
645
+ #, php-format
646
+ msgid "%s removed!"
647
+ msgstr ""
648
+
649
+ #: wp-cache.php:770 wp-cache.php:772
650
+ msgid "Warning!"
651
+ msgstr ""
652
+
653
+ #: wp-cache.php:770
654
+ #, php-format
655
+ msgid ""
656
+ "You must make %s writable to enable this feature. As this is a security risk "
657
+ "please make it readonly after your page is generated."
658
+ msgstr ""
659
+
660
+ #: wp-cache.php:772
661
+ #, php-format
662
+ msgid ""
663
+ "%s is writable. Please make it readonly after your page is generated as this "
664
+ "is a security risk."
665
+ msgstr ""
666
+
667
+ #: wp-cache.php:786
668
+ msgid "Existing direct page"
669
+ msgstr ""
670
+
671
+ #: wp-cache.php:786
672
+ msgid "Delete cached file"
673
+ msgstr ""
674
+
675
+ #: wp-cache.php:791
676
+ msgid "Add direct page:"
677
+ msgstr ""
678
+
679
+ #: wp-cache.php:793
680
+ #, php-format
681
+ msgid ""
682
+ "Directly cached files are files created directly off %s where your blog "
683
+ "lives. This feature is only useful if you are expecting a major Digg or "
684
+ "Slashdot level of traffic to one post or page."
685
+ msgstr ""
686
+
687
+ #: wp-cache.php:795
688
+ #, php-format
689
+ msgid ""
690
+ "For example: to cache <em>%1$sabout/</em>, you would enter %1$sabout/ or /"
691
+ "about/. The cached file will be generated the next time an anonymous user "
692
+ "visits that page."
693
+ msgstr ""
694
+
695
+ #: wp-cache.php:796
696
+ msgid ""
697
+ "Make the textbox blank to remove it from the list of direct pages and delete "
698
+ "the cached file."
699
+ msgstr ""
700
+
701
+ #: wp-cache.php:801
702
+ msgid "Update Direct Pages"
703
+ msgstr ""
704
+
705
+ #: wp-cache.php:841
706
+ msgid "Expiry Time &amp; Garbage Collection"
707
+ msgstr ""
708
+
709
+ #: wp-cache.php:843
710
+ msgid "Expire time:"
711
+ msgstr ""
712
+
713
+ #: wp-cache.php:844
714
+ msgid "seconds"
715
+ msgstr ""
716
+
717
+ #: wp-cache.php:845
718
+ msgid "Garbage Collection"
719
+ msgstr ""
720
+
721
+ #: wp-cache.php:845
722
+ msgid ""
723
+ "If expiry time is more than 1800 seconds (half an hour), garbage collection "
724
+ "will be done every 10 minutes, otherwise it will happen 10 seconds after the "
725
+ "expiry time above."
726
+ msgstr ""
727
+
728
+ #: wp-cache.php:846
729
+ msgid ""
730
+ "Checking for and deleting expired files is expensive, but it&#8217;s "
731
+ "expensive leaving them there too. On a very busy site you should set the "
732
+ "expiry time to <em>300 seconds</em>. Experiment with different values and "
733
+ "visit this page to see how many expired files remain at different times "
734
+ "during the day. Aim to have less than 500 cached files if possible."
735
+ msgstr ""
736
+
737
+ #: wp-cache.php:847
738
+ msgid "Change Expiration"
739
+ msgstr ""
740
+
741
+ #: wp-cache.php:886
742
+ msgid "Rejected User Agents"
743
+ msgstr ""
744
+
745
+ #: wp-cache.php:887
746
+ msgid ""
747
+ "Strings in the HTTP &#8217;User Agent&#8217; header that prevent WP-Cache "
748
+ "from caching bot, spiders, and crawlers&#8217; requests. Note that super "
749
+ "cached files are still sent to these agents if they already exists."
750
+ msgstr ""
751
+
752
+ #: wp-cache.php:894
753
+ msgid "Save UA Strings"
754
+ msgstr ""
755
+
756
+ #: wp-cache.php:917
757
+ msgid ""
758
+ "Do not cache the following page types. See the <a href=\"http://codex."
759
+ "wordpress.org/Conditional_Tags\">Conditional Tags</a> documentation for a "
760
+ "complete discussion on each type."
761
+ msgstr ""
762
+
763
+ #: wp-cache.php:920
764
+ msgid "Single Posts"
765
+ msgstr ""
766
+
767
+ #: wp-cache.php:921
768
+ msgid "Pages"
769
+ msgstr ""
770
+
771
+ #: wp-cache.php:922
772
+ msgid "Front Page"
773
+ msgstr ""
774
+
775
+ #: wp-cache.php:923
776
+ msgid "Home"
777
+ msgstr ""
778
+
779
+ #: wp-cache.php:924
780
+ msgid "Archives"
781
+ msgstr ""
782
+
783
+ #: wp-cache.php:925
784
+ msgid "Tags"
785
+ msgstr ""
786
+
787
+ #: wp-cache.php:926
788
+ msgid "Category"
789
+ msgstr ""
790
+
791
+ #: wp-cache.php:927
792
+ msgid "Feeds"
793
+ msgstr ""
794
+
795
+ #: wp-cache.php:928
796
+ msgid "Search Pages"
797
+ msgstr ""
798
+
799
+ #: wp-cache.php:930 wp-cache.php:1035
800
+ msgid "Save"
801
+ msgstr ""
802
+
803
+ #: wp-cache.php:947
804
+ msgid ""
805
+ "Add here strings (not a filename) that forces a page not to be cached. For "
806
+ "example, if your URLs include year and you dont want to cache last year "
807
+ "posts, it&#8217;s enough to specify the year, i.e. &#8217;/2004/&#8217;. WP-"
808
+ "Cache will search if that string is part of the URI and if so, it will not "
809
+ "cache that page."
810
+ msgstr ""
811
+
812
+ #: wp-cache.php:953
813
+ msgid "Save Strings"
814
+ msgstr ""
815
+
816
+ #: wp-cache.php:969
817
+ msgid ""
818
+ "Add here those filenames that can be cached, even if they match one of the "
819
+ "rejected substring specified above."
820
+ msgstr ""
821
+
822
+ #: wp-cache.php:975
823
+ msgid "Save Files"
824
+ msgstr ""
825
+
826
+ #: wp-cache.php:1018
827
+ msgid ""
828
+ "Fix problems with the plugin by debugging it here. It can send you debug "
829
+ "emails or log them to a file in your cache directory."
830
+ msgstr ""
831
+
832
+ #: wp-cache.php:1019
833
+ msgid ""
834
+ "Logging to a file is easier but faces the problem that clearing the cache "
835
+ "will clear the log file."
836
+ msgstr ""
837
+
838
+ #: wp-cache.php:1023
839
+ msgid "Debugging"
840
+ msgstr ""
841
+
842
+ #: wp-cache.php:1023
843
+ msgid "enabled"
844
+ msgstr ""
845
+
846
+ #: wp-cache.php:1024
847
+ msgid "Email"
848
+ msgstr ""
849
+
850
+ #: wp-cache.php:1025
851
+ msgid "file"
852
+ msgstr ""
853
+
854
+ #: wp-cache.php:1026
855
+ msgid "IP Address"
856
+ msgstr ""
857
+
858
+ #: wp-cache.php:1026
859
+ #, php-format
860
+ msgid "(only log requests from this IP address. Your IP is %s)"
861
+ msgstr ""
862
+
863
+ #: wp-cache.php:1033
864
+ msgid "(1 = less, 5 = more, may cause severe server load.)"
865
+ msgstr ""
866
+
867
+ #: wp-cache.php:1045
868
+ msgid ""
869
+ "Error: GZIP compression is enabled, disable it if you want to enable wp-"
870
+ "cache."
871
+ msgstr ""
872
+
873
+ #: wp-cache.php:1093 wp-cache.php:1255
874
+ msgid "Warning"
875
+ msgstr ""
876
+
877
+ #: wp-cache.php:1093
878
+ msgid ""
879
+ "GZIP compression is enabled in Wordpress, wp-cache will be bypassed until "
880
+ "you disable gzip compression."
881
+ msgstr ""
882
+
883
+ #: wp-cache.php:1151 wp-cache.php:1156 wp-cache.php:1188 wp-cache.php:1193
884
+ #: wp-cache.php:1199
885
+ msgid "Error"
886
+ msgstr ""
887
+
888
+ #: wp-cache.php:1151
889
+ #, php-format
890
+ msgid ""
891
+ "Your cache directory (<strong>$cache_path</strong>) did not exist and "
892
+ "couldn&#8217;t be created by the web server. Check %s permissions."
893
+ msgstr ""
894
+
895
+ #: wp-cache.php:1156
896
+ #, php-format
897
+ msgid ""
898
+ "Your cache directory (<strong>%1$s</strong>) or <strong>%2$s</strong> need "
899
+ "to be writable for this plugin to work. Double-check it."
900
+ msgstr ""
901
+
902
+ #: wp-cache.php:1188
903
+ #, php-format
904
+ msgid ""
905
+ "Your WP-Cache config file (<strong>%s</strong>) is out of date and not "
906
+ "writable by the Web server.Please delete it and refresh this page."
907
+ msgstr ""
908
+
909
+ #: wp-cache.php:1193
910
+ #, php-format
911
+ msgid ""
912
+ "Configuration file missing and %1$s directory (<strong>%2$s</strong>) is "
913
+ "not writable by the Web server.Check its permissions."
914
+ msgstr ""
915
+
916
+ #: wp-cache.php:1199
917
+ #, php-format
918
+ msgid ""
919
+ "Sample WP-Cache config file (<strong>%s</strong>) does not exist.Verify you "
920
+ "installation."
921
+ msgstr ""
922
+
923
+ #: wp-cache.php:1255
924
+ #, php-format
925
+ msgid "%s/advanced-cache.php</em> does not exist or cannot be updated."
926
+ msgstr ""
927
+
928
+ #: wp-cache.php:1256
929
+ msgid "1. If it already exists please delete the file first."
930
+ msgstr ""
931
+
932
+ #: wp-cache.php:1257
933
+ #, php-format
934
+ msgid ""
935
+ "2. Make %1$s writable using the chmod command through your ftp or server "
936
+ "software. (<em>chmod 777 %1$s</em>) and refresh this page. This is only a "
937
+ "temporary measure and you&#8217;ll have to make it read only afterwards "
938
+ "again. (Change 777 to 755 in the previous command)"
939
+ msgstr ""
940
+
941
+ #: wp-cache.php:1258
942
+ #, php-format
943
+ msgid "3. Refresh this page to update <em>%s/advanced-cache.php</em>"
944
+ msgstr ""
945
+
946
+ #: wp-cache.php:1259
947
+ #, php-format
948
+ msgid ""
949
+ "If that doesn&#8217;t work, make sure the file <em>%s/advanced-cache.php</"
950
+ "em> doesn&#8217;t exist:"
951
+ msgstr ""
952
+
953
+ #: wp-cache.php:1260
954
+ #, php-format
955
+ msgid ""
956
+ "<li>1. Open <em>%1$s$wp_cache_file</em> in a text editor.</li><li>2. Change "
957
+ "the text <em>CACHEHOME</em> to <em>%2$s</em></li><li>3. Save the file and "
958
+ "copy it to <em>%3$s</em> and refresh this page.</li>"
959
+ msgstr ""
960
+
961
+ #: wp-cache.php:1276
962
+ #, php-format
963
+ msgid ""
964
+ "Edit <code>%s</code> and add the following line: <code>define('WP_CACHE', "
965
+ "true);</code>Otherwise, <strong>WP-Cache will not be executed</strong> by "
966
+ "Wordpress core. "
967
+ msgstr ""
968
+
969
+ #: wp-cache.php:1286
970
+ msgid ""
971
+ "<strong>Error: WP_CACHE is not enabled</strong> in your <code>wp-config.php</"
972
+ "code> file and I couldn&#8217;t modify it."
973
+ msgstr ""
974
+
975
+ #: wp-cache.php:1328
976
+ #, php-format
977
+ msgid "Deleting supercache file: <strong>%s</strong><br />"
978
+ msgstr ""
979
+
980
+ #: wp-cache.php:1345
981
+ #, php-format
982
+ msgid "Deleting wp-cache file: <strong>%s</strong><br />"
983
+ msgstr ""
984
+
985
+ #: wp-cache.php:1409
986
+ msgid "WP-Cache"
987
+ msgstr ""
988
+
989
+ #: wp-cache.php:1410 wp-cache.php:1423
990
+ #, php-format
991
+ msgid "%s Cached Pages"
992
+ msgstr ""
993
+
994
+ #: wp-cache.php:1411 wp-cache.php:1425
995
+ #, php-format
996
+ msgid "%s Expired Pages"
997
+ msgstr ""
998
+
999
+ #: wp-cache.php:1422
1000
+ msgid "WP-Super-Cache"
1001
+ msgstr ""
1002
+
1003
+ #: wp-cache.php:1430
1004
+ msgid "Fresh WP-Cached Files"
1005
+ msgstr ""
1006
+
1007
+ #: wp-cache.php:1431 wp-cache.php:1447 wp-cache.php:1463 wp-cache.php:1479
1008
+ msgid "URI"
1009
+ msgstr ""
1010
+
1011
+ #: wp-cache.php:1431 wp-cache.php:1447
1012
+ msgid "Key"
1013
+ msgstr ""
1014
+
1015
+ #: wp-cache.php:1431 wp-cache.php:1447 wp-cache.php:1463 wp-cache.php:1479
1016
+ msgid "Age"
1017
+ msgstr ""
1018
+
1019
+ #: wp-cache.php:1431 wp-cache.php:1447 wp-cache.php:1463 wp-cache.php:1479
1020
+ msgid "Delete"
1021
+ msgstr ""
1022
+
1023
+ #: wp-cache.php:1446
1024
+ msgid "Stale WP-Cached Files"
1025
+ msgstr ""
1026
+
1027
+ #: wp-cache.php:1462
1028
+ msgid "Fresh Super Cached Files"
1029
+ msgstr ""
1030
+
1031
+ #: wp-cache.php:1478
1032
+ msgid "Stale Super Cached Files"
1033
+ msgstr ""
1034
+
1035
+ #: wp-cache.php:1494
1036
+ msgid "Hide file list"
1037
+ msgstr ""
1038
+
1039
+ #: wp-cache.php:1496
1040
+ msgid "List all cached files"
1041
+ msgstr ""
1042
+
1043
+ #: wp-cache.php:1502
1044
+ #, php-format
1045
+ msgid ""
1046
+ "<strong>Garbage Collection</strong><br />Last GC was <strong>%s</strong> "
1047
+ "minutes ago<br />"
1048
+ msgstr ""
1049
+
1050
+ #: wp-cache.php:1503
1051
+ #, php-format
1052
+ msgid "Next GC in <strong>%s</strong> minutes"
1053
+ msgstr ""
1054
+
1055
+ #: wp-cache.php:1506
1056
+ #, php-format
1057
+ msgid ""
1058
+ "Expired files are files older than %s seconds. They are still used by the "
1059
+ "plugin and are deleted periodically."
1060
+ msgstr ""
1061
+
1062
+ #: wp-cache.php:1509
1063
+ msgid "Delete Expired"
1064
+ msgstr ""
1065
+
1066
+ #: wp-cache.php:1515 wp-cache.php:1529 wp-cache.php:1685
1067
+ msgid "Delete Cache"
1068
+ msgstr ""
1069
+
1070
+ #: wp-cache.php:1529
1071
+ msgid "Delete Super Cache cached files (opens in new window)"
1072
+ msgstr ""
1073
+
1074
+ #: wp-cache.php:1661
1075
+ #, php-format
1076
+ msgid "%1$s is Digg proof thanks to caching by %2$s"
1077
+ msgstr ""
1078
+
1079
+ #: wp-cache.php:1694
1080
+ #, php-format
1081
+ msgid ""
1082
+ "WP Super Cache must be configured. Go to <a href=\"%s\">the admin page</a> "
1083
+ "to enable and configure the plugin."
1084
+ msgstr ""
1085
+
1086
+ #: wp-cache.php:1700
1087
+ msgid "Settings"
1088
+ msgstr ""
1089
+
1090
+ #: wp-cache.php:1710
1091
+ #, php-format
1092
+ msgid ""
1093
+ "WP Super Cache is disabled. Please go to the <a href=\"%s\">plugin admin "
1094
+ "page</a> to enable caching."
1095
+ msgstr ""