WP Super Cache - Version 0.9.9.4

Version Description

Cache tester fixes, Easy settings page and tabs to settings page, new PHP caching mode, fixes to mobile support, domain mapping support plugin.

=

Download this release

Release Info

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

Code changes from version 0.9.9.3 to 0.9.9.4

Changelog.txt CHANGED
@@ -1,3 +1,348 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  2010-06-16 10:26 donncha
2
 
3
  * wp-super-cache.pot: Updated translation file for 0.9.9.3
1
+ 2010-09-22 16:02 donncha
2
+
3
+ * readme.txt, wp-cache.php: Bump version to 0.9.9.4 and update some
4
+ docs
5
+
6
+ 2010-09-22 15:20 donncha
7
+
8
+ * wp-cache.php: When supercache is disabled delete the mod_rewrite
9
+ rules
10
+
11
+ 2010-09-22 15:16 donncha
12
+
13
+ * wp-cache.php: Don't check the mod_rewrite rules if caching
14
+ disabled
15
+
16
+ 2010-09-22 14:54 donncha
17
+
18
+ * readme.txt: Updated changelog and added language credits
19
+
20
+ 2010-09-22 14:26 donncha
21
+
22
+ * wp-super-cache.pot: Updated translation file
23
+
24
+ 2010-09-22 14:18 donncha
25
+
26
+ * plugins/domain-mapping.php: Added code to check if domain mapping
27
+ used and print a warning message
28
+
29
+ 2010-09-22 13:23 donncha
30
+
31
+ * wp-cache.php: Set "wp_cache_mod_rewrite" if it's not defined
32
+ already, for those upgrading
33
+
34
+ 2010-09-22 11:50 donncha
35
+
36
+ * wp-cache.php: Fixed typo in rewrite rules notice
37
+
38
+ 2010-09-21 11:54 donncha
39
+
40
+ * wp-cache.php: Don't need this adminpage form any more
41
+
42
+ 2010-09-21 10:00 donncha
43
+
44
+ * wp-cache.php: Update the docs explaining garbage collection
45
+
46
+ 2010-09-21 09:58 donncha
47
+
48
+ * wp-cache.php: Show advanced settings page if legacy caching
49
+ enabled too
50
+
51
+ 2010-09-21 09:44 donncha
52
+
53
+ * wp-cache.php: Show "advanced settings" page when mod_rewrite
54
+ caching enabled.
55
+
56
+ 2010-09-21 09:34 donncha
57
+
58
+ * wp-cache.php: Disable .htaccess checks when not running on "main
59
+ site" instead of disabling settings page completely
60
+
61
+ 2010-09-20 15:43 donncha
62
+
63
+ * plugins/domain-mapping.php, wp-cache-phase2.php: Added "gc_cache"
64
+ action and domain mapping cache plugin to clear the cache of
65
+ domain mapped multisite websites
66
+
67
+ 2010-09-20 12:58 donncha
68
+
69
+ * wp-cache.php: Added another check for the mod_rewrite config
70
+ before displaying a warning about those rules
71
+
72
+ 2010-09-20 12:47 donncha
73
+
74
+ * wp-cache.php: Correctly check for the "main blog"
75
+
76
+ 2010-09-20 12:01 donncha
77
+
78
+ * wp-cache.php: * Tester tab added "& Contents" to make it clearer
79
+ what's in this page.
80
+ * Add back in "List Files" link. Oops.
81
+
82
+ 2010-09-20 11:59 donncha
83
+
84
+ * wp-cache-config-sample.php, wp-cache.php: No need for simple
85
+ setup variable now
86
+
87
+ 2010-09-20 11:37 donncha
88
+
89
+ * plugins/awaitingmoderation.php: Added example plugin to remove
90
+ "Awaiting moderation" message when comments left on posts.
91
+
92
+ 2010-09-20 11:36 donncha
93
+
94
+ * plugins/badbehaviour.php, plugins/searchengine.php: Make plugins
95
+ listed in an ordered list
96
+
97
+ 2010-09-20 11:35 donncha
98
+
99
+ * wp-cache.php: * Added Plugins tab
100
+ * Check if if PHP or Supercache mode before checking .htaccess
101
+ file for rewrite rules.
102
+ * Change "half-on" text to "legacy" to reflect new terminology
103
+ * Split Settings page into Easy and Advanced tabs instead of
104
+ form.
105
+
106
+ 2010-09-13 22:46 donncha
107
+
108
+ * wp-cache.php: Make tabs like those on the themes page
109
+
110
+ 2010-09-13 04:31 donncha
111
+
112
+ * wp-cache.php: Cast as an array to hide a warning about 2nd arg.
113
+
114
+ 2010-09-13 04:28 donncha
115
+
116
+ * wp-cache.php: Hopefully trap wp_errors generating from page
117
+ requests to tester
118
+
119
+ 2010-09-07 16:16 donncha
120
+
121
+ * wp-cache.php: Enable "PHP Caching" from the easy setup page
122
+
123
+ 2010-09-07 16:07 donncha
124
+
125
+ * wp-cache.php: Minor tweaks to layout of admin page
126
+
127
+ 2010-09-07 16:06 donncha
128
+
129
+ * wp-cache-config-sample.php, wp-cache.php: Added "easy setup"
130
+ configuration screen (WIP)
131
+
132
+ 2010-09-07 16:03 donncha
133
+
134
+ * wp-cache.php: Fixed check for "main site" on MU sites
135
+
136
+ 2010-09-07 12:31 donncha
137
+
138
+ * wp-cache.php: * Fixed check for "main site"
139
+ * Updated error messages
140
+
141
+ 2010-09-07 12:09 donncha
142
+
143
+ * wp-cache.php: Added tabs to the Supercache admin page
144
+
145
+ 2010-09-06 07:33 donncha
146
+
147
+ * readme.txt: Added FAQ on writable directories and fixed a few
148
+ typos
149
+
150
+ 2010-09-03 15:15 donncha
151
+
152
+ * readme.txt, wp-cache-phase1.php: Updated headers and docs for PHP
153
+ served cache files
154
+
155
+ 2010-08-31 17:55 donncha
156
+
157
+ * wp-cache.php: Added "$wp_super_cache_lock_down" config variable
158
+ to hide lockdown and directly cached pages admin menus
159
+
160
+ 2010-08-31 17:44 donncha
161
+
162
+ * readme.txt: Major updates to the docs, covering legacy mode.
163
+
164
+ 2010-08-31 15:34 donncha
165
+
166
+ * readme.txt: Updated docs on legacy caching
167
+
168
+ 2010-08-31 13:50 donncha
169
+
170
+ * readme.txt: Minor mod to caching mechanism list
171
+
172
+ 2010-08-31 13:48 donncha
173
+
174
+ * readme.txt: Added docs on legacy caching and the different
175
+ caching mechanisms
176
+
177
+ 2010-08-31 12:45 donncha
178
+
179
+ * wp-cache-phase2.php: Added action on "wp_update_nav_menu" to
180
+ clear cache, props
181
+ http://www.webmasterbulletin.net/2010/07/wp-super-cache-and-wp3-0-menus/1270
182
+
183
+ 2010-08-30 16:50 donncha
184
+
185
+ * wp-cache.php: Admin page upgrades:
186
+ * Separate out PHP and mod_rewrite supercaching.
187
+ * Minor text changes
188
+
189
+ 2010-08-30 16:38 donncha
190
+
191
+ * wp-cache-phase2.php: Hide potential error messages
192
+
193
+ 2010-08-30 16:37 donncha
194
+
195
+ * wp-cache-phase2.php: Revert this settings change for now.
196
+
197
+ 2010-08-30 16:35 donncha
198
+
199
+ * wp-cache-phase2.php: If caching disabled, then don't run the
200
+ second phase function
201
+
202
+ 2010-08-30 11:46 donncha
203
+
204
+ * wp-cache-phase1.php: Minor whitespace mod
205
+
206
+ 2010-08-30 11:46 donncha
207
+
208
+ * wp-cache-phase1.php: Serve a gzipped supercache file if the
209
+ client supports it.
210
+
211
+ 2010-08-30 10:16 donncha
212
+
213
+ * wp-cache-phase2.php: Remove unused global variable
214
+
215
+ 2010-08-30 09:36 donncha
216
+
217
+ * wp-cache-phase2.php: Don't delete supercache files if supercache
218
+ is disabled when posts change. Stops moderated comments deleting
219
+ the front page.
220
+
221
+ 2010-08-29 10:17 donncha
222
+
223
+ * wp-cache-phase2.php: Check for empty tmp cache files and report
224
+ them correctly.
225
+
226
+ 2010-08-27 15:40 donncha
227
+
228
+ * wp-cache.php: Change cache compression on/off into a checkbox and
229
+ move into "Misc" section.
230
+
231
+ 2010-08-27 14:56 donncha
232
+
233
+ * wp-cache.php: Ignore case when checking mobile user agents in
234
+ .htaccess
235
+
236
+ 2010-08-26 16:37 donncha
237
+
238
+ * wp-cache.php: Hide warnings from these unlinks, even though the
239
+ plugin checks if they exist!
240
+
241
+ 2010-08-26 14:43 donncha
242
+
243
+ * wp-cache.php: Add a timestamp to the preload counter to catch
244
+ when it stalls. Reschedule the preload job when that happens.
245
+
246
+ 2010-08-26 12:34 donncha
247
+
248
+ * wp-cache.php: Cache tester should probably send http requests for
249
+ homepage if admin is secure
250
+
251
+ 2010-08-26 11:30 donncha
252
+
253
+ * wp-cache.php: Ony add mobile rules if mobile support is enabled
254
+
255
+ 2010-08-26 11:26 donncha
256
+
257
+ * wp-cache.php: Move code to handle updating the options into it's
258
+ own function and move more error checking into it's own function
259
+
260
+ 2010-08-24 17:07 donncha
261
+
262
+ * wp-cache.php: First go at reorganising the admin page
263
+
264
+ 2010-08-23 17:27 donncha
265
+
266
+ * wp-cache-phase2.php: Starting to use $wpsc_settings
267
+
268
+ 2010-08-23 17:09 donncha
269
+
270
+ * wp-cache-phase1.php, wp-cache-phase2.php: Added
271
+ "wp_cache_load_config()" and $wpsc_settings array
272
+
273
+ 2010-08-23 12:23 donncha
274
+
275
+ * readme.txt: Added new FAQ, "How do I delay serving the cache
276
+ until the "init" action fires?"
277
+
278
+ 2010-08-23 12:07 donncha
279
+
280
+ * readme.txt: Include a simple mfunc example
281
+
282
+ 2010-08-23 12:06 donncha
283
+
284
+ * wp-cache-config-sample.php, wp-cache-phase2.php: Removed
285
+ $wp_cache_gzip_first, if compression is enabled there's no reason
286
+ it won't work for the cache generating visit
287
+
288
+ 2010-08-23 11:40 donncha
289
+
290
+ * wp-cache-phase2.php: Warn if late init not set on dynamic pages
291
+
292
+ 2010-08-23 10:45 donncha
293
+
294
+ * wp-cache-phase2.php: Added "wp_cache_append_tag()" to add the
295
+ Supercache log message after filtering
296
+
297
+ 2010-08-06 17:09 donncha
298
+
299
+ * wp-cache.php: Added the function "wpsupercache_site_admin()" to
300
+ support old versions of MU using is_site_admin()
301
+
302
+ 2010-08-06 16:10 donncha
303
+
304
+ * wp-cache-phase1.php, wp-cache.php: Removed lots of PHP variable
305
+ warnings. Props Joel Hardi
306
+
307
+ 2010-08-06 15:30 donncha
308
+
309
+ * wp-cache.php: Fixed cache tester when WP is installed in a sub
310
+ directory
311
+
312
+ 2010-08-03 12:17 donncha
313
+
314
+ * wp-cache-phase2.php: Check for closing "urlset" tag for xml
315
+ sitemap generators
316
+ (http://wordpress.org/support/topic/plugin-wp-super-cache-xml-sitemap-feed-not-cached?replies=11#post-1627457)
317
+
318
+ 2010-07-30 12:19 donncha
319
+
320
+ * wp-cache.php: Check the status of pages returned by the cache
321
+ tester and report any problems.
322
+
323
+ 2010-07-01 15:30 donncha
324
+
325
+ * wp-cache.php: Removed donation blurb from admin page
326
+
327
+ 2010-07-01 15:27 donncha
328
+
329
+ * readme.txt: Removed donation link, updated min version and added
330
+ automattic as contributor
331
+
332
+ 2010-06-28 10:25 donncha
333
+
334
+ * wp-cache-config-sample.php: Use WP_PLUGIN_DIR instead of
335
+ WP_CONTENT_DIR, props Baris Unver
336
+
337
+ 2010-06-21 15:42 donncha
338
+
339
+ * wp-cache.php: On MU/WP 3.0 network sites only allow admin page on
340
+ main site. http://wordpress.org/support/topic/412472?replies=2
341
+
342
+ 2010-06-16 10:34 donncha
343
+
344
+ * Changelog.txt, readme.txt: Updated changelogs
345
+
346
  2010-06-16 10:26 donncha
347
 
348
  * wp-super-cache.pot: Updated translation file for 0.9.9.3
plugins/awaitingmoderation.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function awaitingmoderation_action( $buffer ) {
4
+ $buffer = str_replace( __( 'Your comment is awaiting moderation.' ), '', $buffer );
5
+ return $buffer;
6
+ }
7
+
8
+ function awaitingmoderation_actions() {
9
+ global $cache_awaitingmoderation;
10
+ if( $cache_awaitingmoderation == '1' ) {
11
+ add_filter( 'wpsupercache_buffer', 'awaitingmoderation_action' );
12
+ }
13
+ }
14
+ add_cacheaction( 'add_cacheaction', 'awaitingmoderation_actions' );
15
+
16
+ //Your comment is awaiting moderation.
17
+ function wp_supercache_awaitingmoderation_admin() {
18
+ global $cache_awaitingmoderation, $wp_cache_config_file, $valid_nonce;
19
+
20
+ $cache_awaitingmoderation = $cache_awaitingmoderation == '' ? '0' : $cache_awaitingmoderation;
21
+
22
+ if(isset($_POST['cache_awaitingmoderation']) && $valid_nonce) {
23
+ $cache_awaitingmoderation = $_POST['cache_awaitingmoderation'] == __( 'Disable', 'wp-super-cache' ) ? '0' : '1';
24
+ wp_cache_replace_line('^ *\$cache_awaitingmoderation', "\$cache_awaitingmoderation = '$cache_awaitingmoderation';", $wp_cache_config_file);
25
+ }
26
+ echo '<li><form name="wp_supercache_searchengine_admin" action="'. $_SERVER["REQUEST_URI"] . '" method="post">';
27
+ wp_nonce_field('wp-cache');
28
+ if( $cache_awaitingmoderation == '0' ) {
29
+ $status = __( 'disabled', 'wp-super-cache' );
30
+ } else {
31
+ $status = __( 'enabled', 'wp-super-cache' );
32
+ }
33
+ echo '<strong>' . sprintf( __( 'Awaiting Moderation plugin is %s', 'wp-super-cache' ), $status );
34
+ echo '.</strong> ' . __( '(Remove the text "Your comment is awaiting moderation." when someone leaves a moderated comment.) ', 'wp-super-cache' );
35
+ if( $cache_awaitingmoderation == '0' ) {
36
+ echo '<input type="submit" name="cache_awaitingmoderation" value="' . __( 'Enable', 'wp-super-cache' ) . '" />';
37
+ } else {
38
+ echo '<input type="submit" name="cache_awaitingmoderation" value="' . __( 'Disable', 'wp-super-cache' ) . '" />';
39
+ }
40
+ echo "</form></li>\n";
41
+
42
+ }
43
+ add_cacheaction( 'cache_admin_page', 'wp_supercache_awaitingmoderation_admin' );
44
+ ?>
plugins/badbehaviour.php CHANGED
@@ -49,7 +49,7 @@ function wp_supercache_badbehaviour_admin() {
49
  wp_cache_replace_line('^ *\$cache_badbehaviour', "\$cache_badbehaviour = $cache_badbehaviour;", $wp_cache_config_file);
50
  wp_cache_replace_line('^ *\$cache_badbehaviour_file', "\$cache_badbehaviour_file = '$bbfile';", $wp_cache_config_file);
51
  }
52
- echo '<form name="wp_supercache_badbehaviour_admin" action="'. $_SERVER["REQUEST_URI"] . '" method="post">';
53
  wp_nonce_field('wp-cache');
54
  if( $cache_badbehaviour == 0 ) {
55
  $bb_status = __( 'disabled', 'wp-super-cache' );
@@ -58,7 +58,7 @@ function wp_supercache_badbehaviour_admin() {
58
  wp_super_cache_disable();
59
  }
60
  echo '<strong>' . sprintf( __( 'Bad Behaviour support is %s.', 'wp-super-cache' ), $bb_status ) . '</strong>';
61
- printf( __( '(Only half-on caching supported, disabled compression and requires <a href="http://www.bad-behavior.ioerror.us/">Bad Behavior</a> in "%s/plugins/bad-behavior/") ', 'wp-super-cache' ), WP_CONTENT_DIR );
62
  if( $cache_badbehaviour == 0 ) {
63
  echo '<input type="submit" name="cache_badbehaviour" value="' . __( 'Enable', 'wp-super-cache' ) . '" />';
64
  } else {
@@ -67,6 +67,7 @@ function wp_supercache_badbehaviour_admin() {
67
  echo "</form>\n";
68
  if( $err )
69
  echo "<p><strong>" . __( 'Warning!', 'wp-super-cache' ) . "</strong> $err</p>";
 
70
 
71
  }
72
  add_cacheaction( 'cache_admin_page', 'wp_supercache_badbehaviour_admin' );
49
  wp_cache_replace_line('^ *\$cache_badbehaviour', "\$cache_badbehaviour = $cache_badbehaviour;", $wp_cache_config_file);
50
  wp_cache_replace_line('^ *\$cache_badbehaviour_file', "\$cache_badbehaviour_file = '$bbfile';", $wp_cache_config_file);
51
  }
52
+ echo '<li><form name="wp_supercache_badbehaviour_admin" action="'. $_SERVER["REQUEST_URI"] . '" method="post">';
53
  wp_nonce_field('wp-cache');
54
  if( $cache_badbehaviour == 0 ) {
55
  $bb_status = __( 'disabled', 'wp-super-cache' );
58
  wp_super_cache_disable();
59
  }
60
  echo '<strong>' . sprintf( __( 'Bad Behaviour support is %s.', 'wp-super-cache' ), $bb_status ) . '</strong>';
61
+ printf( __( '(Only legacy caching supported, disabled compression and requires <a href="http://www.bad-behavior.ioerror.us/">Bad Behavior</a> in "%s/plugins/bad-behavior/") ', 'wp-super-cache' ), WP_CONTENT_DIR );
62
  if( $cache_badbehaviour == 0 ) {
63
  echo '<input type="submit" name="cache_badbehaviour" value="' . __( 'Enable', 'wp-super-cache' ) . '" />';
64
  } else {
67
  echo "</form>\n";
68
  if( $err )
69
  echo "<p><strong>" . __( 'Warning!', 'wp-super-cache' ) . "</strong> $err</p>";
70
+ echo '</li>';
71
 
72
  }
73
  add_cacheaction( 'cache_admin_page', 'wp_supercache_badbehaviour_admin' );
plugins/domain-mapping.php ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function domain_mapping_gc_cache( $function, $directory ) {
4
+ global $cache_path;
5
+
6
+ if ( !function_exists( 'domain_mapping_warning' ) )
7
+ return false;
8
+
9
+ $siteurl = domain_mapping_siteurl( false );
10
+ if ( !$siteurl )
11
+ return false;
12
+
13
+ $protocol = ( 'on' == strtolower( $_SERVER['HTTPS' ] ) ) ? 'https://' : 'http://';
14
+ $siteurl = trailingslashit( str_replace( $protocol, '', $siteurl ) );
15
+
16
+ if ( $directory == 'homepage' )
17
+ $directory = '';
18
+
19
+ switch( $function ) {
20
+ case "rebuild":
21
+ @wp_cache_rebuild_or_delete( $cache_path . 'supercache/' . $siteurl . $directory . 'index.html' );
22
+ @wp_cache_rebuild_or_delete( $cache_path . 'supercache/' . $siteurl . $directory . 'index.html.gz' );
23
+ break;
24
+ case "prune":
25
+ prune_super_cache( $cache_path . 'supercache/' . $siteurl . $directory . 'index.html', true, true );
26
+ prune_super_cache( $cache_path . 'supercache/' . $siteurl . $directory . 'index.html.gz', true, true );
27
+ break;
28
+ }
29
+
30
+ return $directory;
31
+ }
32
+
33
+ function domain_mapping_actions() {
34
+ global $cache_domain_mapping;
35
+ if( $cache_domain_mapping == '1' ) {
36
+ add_action( 'gc_cache', 'domain_mapping_gc_cache', 10, 2 );
37
+ }
38
+ }
39
+ add_cacheaction( 'add_cacheaction', 'domain_mapping_actions' );
40
+
41
+ function wp_supercache_domain_mapping_admin() {
42
+ global $cache_domain_mapping, $wp_cache_config_file, $valid_nonce;
43
+
44
+ $cache_domain_mapping = $cache_domain_mapping == '' ? '0' : $cache_domain_mapping;
45
+
46
+ if(isset($_POST['cache_domain_mapping']) && $valid_nonce) {
47
+ $cache_domain_mapping = $_POST['cache_domain_mapping'] == __( 'Disable', 'wp-super-cache' ) ? '0' : '1';
48
+ wp_cache_replace_line('^ *\$cache_domain_mapping', "\$cache_domain_mapping = '$cache_domain_mapping';", $wp_cache_config_file);
49
+ }
50
+ echo '<li><form name="wp_supercache_searchengine_admin" action="'. $_SERVER["REQUEST_URI"] . '" method="post">';
51
+ wp_nonce_field('wp-cache');
52
+ if( $cache_domain_mapping == '0' ) {
53
+ $status = __( 'disabled', 'wp-super-cache' );
54
+ } else {
55
+ $status = __( 'enabled', 'wp-super-cache' );
56
+ }
57
+ echo '<strong>' . sprintf( __( '<a href="http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/">Domain Mapping</a> support plugin is %s', 'wp-super-cache' ), $status );
58
+ echo '.</strong> ' . __( '(support for multiple domains on multisite websites) ', 'wp-super-cache' );
59
+ if( $cache_domain_mapping == '0' ) {
60
+ echo '<input type="submit" name="cache_domain_mapping" value="' . __( 'Enable', 'wp-super-cache' ) . '" />';
61
+ } else {
62
+ echo '<input type="submit" name="cache_domain_mapping" value="' . __( 'Disable', 'wp-super-cache' ) . '" />';
63
+ }
64
+ echo "</form></li>\n";
65
+
66
+ }
67
+ add_cacheaction( 'cache_admin_page', 'wp_supercache_domain_mapping_admin' );
68
+
69
+ function wp_supercache_domain_mapping_notice() {
70
+ global $cache_enabled, $cache_domain_mapping;
71
+ if( $cache_enabled )
72
+ echo '<div class="error"><p><strong>' . __('Domain Mapping plugin detected! Please go to the Supercache plugins page and enable the domain mapping helper plugin.', 'wp-super-cache' ) . '</strong></p></div>';
73
+ }
74
+ function wp_supercache_domain_mapping_exists() {
75
+ global $cache_domain_mapping;
76
+ if ( $cache_domain_mapping == 1 )
77
+ return false;
78
+
79
+ if ( is_admin() && function_exists( 'domain_mapping_warning' ) )
80
+ add_action( 'admin_notices', 'wp_supercache_domain_mapping_notice' );
81
+ }
82
+
83
+ if ( isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] == 'wpsupercache' ) {
84
+ add_cacheaction( 'add_cacheaction', 'wp_supercache_domain_mapping_exists' );
85
+ }
86
+ ?>
plugins/searchengine.php CHANGED
@@ -61,7 +61,7 @@ function wp_supercache_searchengine_admin() {
61
  $cache_no_adverts_for_friends = $_POST['cache_no_adverts_for_friends'] == __( 'Disable', 'wp-super-cache' ) ? 'no' : 'yes';
62
  wp_cache_replace_line('^ *\$cache_no_adverts_for_friends', "\$cache_no_adverts_for_friends = '$cache_no_adverts_for_friends';", $wp_cache_config_file);
63
  }
64
- echo '<form name="wp_supercache_searchengine_admin" action="'. $_SERVER["REQUEST_URI"] . '" method="post">';
65
  wp_nonce_field('wp-cache');
66
  if( $cache_no_adverts_for_friends == 'no' ) {
67
  $status = __( 'disabled', 'wp-super-cache' );
@@ -75,7 +75,7 @@ function wp_supercache_searchengine_admin() {
75
  } else {
76
  echo '<input type="submit" name="cache_no_adverts_for_friends" value="' . __( 'Disable', 'wp-super-cache' ) . '" />';
77
  }
78
- echo "</form>\n";
79
 
80
  }
81
  add_cacheaction( 'cache_admin_page', 'wp_supercache_searchengine_admin' );
61
  $cache_no_adverts_for_friends = $_POST['cache_no_adverts_for_friends'] == __( 'Disable', 'wp-super-cache' ) ? 'no' : 'yes';
62
  wp_cache_replace_line('^ *\$cache_no_adverts_for_friends', "\$cache_no_adverts_for_friends = '$cache_no_adverts_for_friends';", $wp_cache_config_file);
63
  }
64
+ echo '<li><form name="wp_supercache_searchengine_admin" action="'. $_SERVER["REQUEST_URI"] . '" method="post">';
65
  wp_nonce_field('wp-cache');
66
  if( $cache_no_adverts_for_friends == 'no' ) {
67
  $status = __( 'disabled', 'wp-super-cache' );
75
  } else {
76
  echo '<input type="submit" name="cache_no_adverts_for_friends" value="' . __( 'Disable', 'wp-super-cache' ) . '" />';
77
  }
78
+ echo "</form></li>\n";
79
 
80
  }
81
  add_cacheaction( 'cache_admin_page', 'wp_supercache_searchengine_admin' );
readme.txt CHANGED
@@ -1,17 +1,16 @@
1
  === WP Super Cache ===
2
- Contributors: donncha
3
  Tags: performance,caching,wp-cache,wp-super-cache,cache
4
- Tested up to: 3.0
5
- Stable tag: 0.9.9.3
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
 
11
  == Description ==
12
  This plugin generates static html files from your dynamic WordPress blog. After a html file is generated your webserver will serve that file instead of processing the comparatively heavier and more expensive WordPress PHP scripts.
13
 
14
- The static html files will be served to the vast majority of your users, but because a user's details are displayed in the comment form after they leave a comment those requests are handled by PHP. Static files are served to:
15
 
16
  1. Users who are not logged in.
17
  2. Users who have not left a comment on your blog.
@@ -22,17 +21,55 @@ The static html files will be served to the vast majority of your users, but bec
22
  If for some reason "supercaching" doesn't work on your server then don't worry. Caching will still be performed, but every request will require loading the PHP engine. In normal circumstances this isn't bad at all. Visitors to your site will notice no slowdown or difference. Supercache really comes into it's own if your server is underpowered, or you're experiencing heavy traffic.
23
  Super Cached html files will be served more quickly than PHP generated cached files but in every day use, the difference isn't noticeable.
24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  See the [WP Super Cache homepage](http://ocaoimh.ie/wp-super-cache/) for further information. [Developer documentation](http://ocaoimh.ie/wp-super-cache-developers/) is also available for those who need to interact with the cache or write plugins.
26
 
27
  The [changelog](http://svn.wp-plugins.org/wp-super-cache/trunk/Changelog.txt) is a good place to start if you want to know what has changed since you last downloaded the plugin.
28
 
29
  == Upgrade Notice ==
30
 
31
- = 0.9.9.3 =
32
- Fix division by zero error in half-on mode, always show "delete cache" button, fix "Update mod_rewrite rules" button.
33
 
34
  == Changelog ==
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  = 0.9.9.3 =
37
  * Fixed division by zero error in half on mode.
38
  * Always show "delete cache" button.
@@ -127,13 +164,13 @@ Fix division by zero error in half-on mode, always show "delete cache" button, f
127
  6. Fixed problems with posts and comments not refreshing.
128
 
129
  == Installation ==
130
- 1. You should have the Apache mod mime and mod rewrite modules installed and WordPress fancy permalinks enabled. PHP safe mode should be disabled. If any of those are missing or off you can still use the slower WP-Cache part of the plugin.
131
  2. If you have WP-Cache installed already, please disable it. Edit wp-config.php and make sure the WP_CACHE define is deleted, and remove the files wp-content/wp-cache-config.php and wp-content/advanced-cache.php. These will be recreated when you install this plugin.
132
  3. Upload this directory to your plugins directory. It will create a 'wp-content/plugins/wp-super-cache/' directory.
133
  4. If you are using WordPress MU you will need to install this in 'wp-content/mu-plugins/wp-super-cache/' and the file wp-cache.php must be copied into the mu-plugins directory.
134
  5. WordPress users should go to their Plugins page and activate "WP Super Cache".
135
- 6. Now go to Settings->WP Super Cache and enable caching. If you see an error message or a blank screen you may need to fix it. See the "FAQ" section later in this readme for instructions.
136
- 7. mod_rewrite rules will be inserted into your .htaccess file. Look in your web root directory for this file. It should look similar to this:
137
 
138
  `-----------------.htaccess-----------------`
139
  `RewriteEngine On`
@@ -192,7 +229,7 @@ Fix division by zero error in half-on mode, always show "delete cache" button, f
192
  == How to uninstall WP Super Cache ==
193
 
194
  Edit the file uninstall.php in your plugins/wp-super-cache/ directory and set
195
- UNINSTALL_WPSUPERCACHE to a non blank value.
196
 
197
  `define( 'UNINSTALL_WPSUPERCACHE', '1' );`
198
 
@@ -221,8 +258,8 @@ To manually uninstall:
221
  = How do I know my blog is being cached? =
222
 
223
  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.
224
- 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.
225
- If the plugin rules are missing from your .htaccess file, the plugin will attempt to serve the super cached page if it's found. The header "WP-Cache: Served supercache file from PHP" if this happens.
226
 
227
  = WP-Cache vs Supercache files =
228
 
@@ -239,11 +276,11 @@ Comments will show as soon as they are moderated, depending on the comment polic
239
 
240
  = Will the Super Cache compression slow down my server? =
241
 
242
- 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.
243
 
244
  = How do I make certain parts of the page stay dynamic? =
245
 
246
- WP Super Cache retains the dynamic loading code of WP Cache but only works in "half on" mode.
247
 
248
  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:
249
 
@@ -259,6 +296,15 @@ The HTML comments around the mirrored PHP allow it to be executed in the static
259
 
260
  That will include file.php under the ABSPATH directory, which is the same as where your wp-config.php file is located.
261
 
 
 
 
 
 
 
 
 
 
262
  = Why doesn't WP UserOnline, Popularity Contest, WP Postratings or plugin X not work or update on my blog now? =
263
 
264
  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.
@@ -274,7 +320,7 @@ A tiny proportion of websites will have problems with the following configuratio
274
  1. Uses a static page for the front page.
275
  2. Uses /%category%/%postname%/ permalink structure.
276
 
277
- 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.
278
 
279
  = Why do I get warnings about caching from http://ismyblogworking.com/ =
280
 
@@ -289,6 +335,10 @@ Try the Cacheability Engine at http://www.ircache.net/cgi-bin/cacheability.py or
289
 
290
  That tracking adds a query string to each url linked from various sources like Twitter and feedreaders. Unfortunately it stops pages being supercached. See [Joost's comment here](http://ocaoimh.ie/remove-unused-utmsource-urls/#comment-672813) for how to turn it into an anchor tag which can be supercached.
291
 
 
 
 
 
292
  = Troubleshooting =
293
 
294
  If things don't work when you installed the plugin here are a few things to check:
@@ -308,15 +358,15 @@ If things don't work when you installed the plugin here are a few things to chec
308
  11. If pages are randomly super cached and sometimes not, your blog can probably be viewed with and without the "www" prefix on the URL. You should choose one way and install the [Enforce www preference](http://txfx.net/code/wordpress/enforce-www-preference/) plugin if you are using an old WordPress install. The latest versions redirect themselves (you should always be running the latest version of WordPress anyway!)
309
  12. Private Server users at Dreamhost should edit wp-content/wp-cache-config.php and set the cache dir to "/tmp/" if they are getting errors about increasing CPU usage. See this [discussion](http://wordpress.org/support/topic/145895?replies=42) for more.
310
  13. File locking errors such as "failed to acquire key 0x152b: Permission denied in..." or "Page not cached by WP Super Cache. Could not get mutex lock." are a sign that you may have to use file locking. Edit wp-content/wp-cache-config.php and uncomment "$use_flock = true" or set $sem_id to a different value. You can also disable file locking from the Admin screen as a last resort.
311
- 14. Make sure cache/wp_cache_mutex.lock is writeable by the web server.
312
  15. The cache folder cannot be put on an NFS or Samba or NAS share. It has to be on a local disk. File locking and deleting expired files will not work properly unless the cache folder is on the local machine.
313
  16. Garbage collection of old cache files won't work if WordPress can't find wp-cron.php. If your hostname resolves to 127.0.0.1 it could be preventing the garbage collection from working. Check your access_logs for wp-cron.php entries. Do they return a 404 (file not found) or 200 code? If it's 404 or you don't see wp-cron.php anywhere WordPress may be looking for that script in the wrong place. You should speak to your server administator to correct this or edit /etc/hosts on Unix servers and remove the following line. Your hostname must resolve to the external IP address other servers on the network/Internet use. See http://yoast.com/wp-cron-issues/ for more.
314
 
315
  `127.0.0.1 myhostname.com`
316
  A line like "127.0.0.1 localhost localhost.localdomain" is ok.
317
  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.
318
- 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.
319
- 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.
320
  20. If supercache cache files are generated but not served, check the permissions on all your wp-content/cache/supercache folders (and each of wp-content cache and supercache folders) and wp-content/cache/.htaccess. If your PHP runs as a different user to Apache and permissions are strict Apache may not be able to read the PHP generated cache files. To fix you must add the following line to your wp-config.php (Add it above the WP_CACHE define.) Then clear your cache.
321
 
322
  `umask( 0022 );`
@@ -356,5 +406,10 @@ I would sincerely like to thank [John Pozadzides](http://onemansblog.com/) for g
356
  Thanks to James Farmer and Andrew Billits of [Edu Blogs](http://edublogs.org/) fame who helped me make this more WordPress MU friendly.
357
 
358
  Translators who did a great job converting the text of the plugin to their native language. Thank you!
359
- [Gianni Diurno](http://gidibao.net/) (Italian)
360
- [Omi](http://equipajedemano.info/) (Spanish)
 
 
 
 
 
1
  === WP Super Cache ===
2
+ Contributors: donncha, automattic
3
  Tags: performance,caching,wp-cache,wp-super-cache,cache
4
+ Tested up to: 3.0.1
5
+ Stable tag: 0.9.9.4
6
+ Requires at least: 2.9.2
 
7
 
8
  A very fast caching engine for WordPress that produces static html files.
9
 
10
  == Description ==
11
  This plugin generates static html files from your dynamic WordPress blog. After a html file is generated your webserver will serve that file instead of processing the comparatively heavier and more expensive WordPress PHP scripts.
12
 
13
+ The static html files will be served to the vast majority of your users, but because a user's details are displayed in the comment form after they leave a comment those requests are handled by the legacy caching engine. Static files are served to:
14
 
15
  1. Users who are not logged in.
16
  2. Users who have not left a comment on your blog.
21
  If for some reason "supercaching" doesn't work on your server then don't worry. Caching will still be performed, but every request will require loading the PHP engine. In normal circumstances this isn't bad at all. Visitors to your site will notice no slowdown or difference. Supercache really comes into it's own if your server is underpowered, or you're experiencing heavy traffic.
22
  Super Cached html files will be served more quickly than PHP generated cached files but in every day use, the difference isn't noticeable.
23
 
24
+ The plugin serves cached files in 3 ways (ranked by speed):
25
+
26
+ 1. Mod_Rewrite. The fastest method is by using Apache mod_rewrite (or whatever similar module your web server supports) to serve "supercached" static html files. This completely bypasses PHP and is extremely quick. If your server is hit by a deluge of traffic it is more likely to cope as the requests are "lighter". This does require the Apache mod_rewrite module (which is probably installed if you have custom permalinks) and a modification of your .htaccess file. Visits by anonymous or unknown users will be served this way.
27
+ 2. PHP. Supercached static files can now be served by PHP. The plugin will serve a "supercached" file if it exists and it's almost as fast as the mod_rewrite method. It's easier to configure as the .htaccess file doesn't need to be changed. You still need a custom permalink. Your server may not cope as well with a really large amount of traffic. (You're gaming Digg aren't you? You'll need mod_rewrite, the rest of us are ok with PHP!)
28
+ 3. Legacy caching. This is mainly used to cache pages for known users. These are logged in users, visitors who leave comments or those who should be shown custom per-user data. It's the most flexible caching method but also the slowest. As each page is different it's often better not to cache pages for these users at all and avoid legacy caching. Legacy caching will also cache visits by unknown users if this caching mode is selected. See the FAQ, "How do I make certain parts of the page stay dynamic?" for the main reason to use legacy caching.
29
+
30
+ If you're new to caching use PHP caching. It's easy to set up and very fast. Avoid legacy caching unless you want to have highly customised pages.
31
+
32
+ = Recommended Settings =
33
+ Advanced users will probably want to use mod_rewrite caching, but PHP caching is almost as good and recommended for everyone else. Enable the following:
34
+
35
+ 1. PHP caching.
36
+ 2. Compress pages.
37
+ 3. Don't cache pages for known users.
38
+ 4. Cache rebuild.
39
+
40
+ Garbage collection is the act of cleaning up cache files that are out of date and stale. There's no correct value for the expiry time but a good starting point is 1800 seconds if you're not using legacy mode. If you are using that mode start with an expiry time of 600 seconds.
41
+
42
+ If you are not using legacy mode caching consider deleting the contents of the "Rejected User Agents" text box and allow search engines create supercache static files.
43
+
44
+ Likewise, preload as many posts as you can and enable "Preload Mode". Garbage collection will still occur but it won't affect the preloaded files. If you don't care about sidebar widgets updating often set the preload interval to 2880 minutes (2 days) so all your posts aren't recached very often. When the preload occurs the cache files for the post being refreshed is deleted and then regenerated. Afterwards a garbage collection of all old files is performed to clean out stale cache files.
45
+ With preloading on cached files will still be deleted when posts are made or edited or comments made.
46
+
47
  See the [WP Super Cache homepage](http://ocaoimh.ie/wp-super-cache/) for further information. [Developer documentation](http://ocaoimh.ie/wp-super-cache-developers/) is also available for those who need to interact with the cache or write plugins.
48
 
49
  The [changelog](http://svn.wp-plugins.org/wp-super-cache/trunk/Changelog.txt) is a good place to start if you want to know what has changed since you last downloaded the plugin.
50
 
51
  == Upgrade Notice ==
52
 
53
+ = 0.9.9.4 =
54
+ Cache tester fixes, Easy settings page and tabs to settings page, new PHP caching mode, fixes to mobile support, domain mapping support plugin.
55
 
56
  == Changelog ==
57
 
58
+ = 0.9.9.4 =
59
+ * Settings page split into tabbed pages.
60
+ * Added new "Easy" settings page for new users.
61
+ * New PHP caching mode to serve supercached files.
62
+ * Mobile support fixes.
63
+ * Added Domain mapping support plugin.
64
+ * Added "awaiting moderation" plugin that removes that text from posts.
65
+ * Terminology change. Changed "half on" to "legacy caching".
66
+ * Fixed cache tester on some installs of WordPress.
67
+ * Updated documentation
68
+ * Added $wp_super_cache_lock_down config variable to hide lockdown and directly cached pages admin items.
69
+ * Preloaded checks if it has stalled and reschedules the job to continue.
70
+ * Serve the gzipped page when first cached if the client supports compression.
71
+ * Lots more bug fixes..
72
+
73
  = 0.9.9.3 =
74
  * Fixed division by zero error in half on mode.
75
  * Always show "delete cache" button.
164
  6. Fixed problems with posts and comments not refreshing.
165
 
166
  == Installation ==
167
+ 1. You should have the Apache mod mime and mod rewrite modules installed and WordPress custom permalinks (Settings->Permalinks) enabled. PHP safe mode should be disabled. If any of those are missing or off you can still use PHP or legacy caching.
168
  2. If you have WP-Cache installed already, please disable it. Edit wp-config.php and make sure the WP_CACHE define is deleted, and remove the files wp-content/wp-cache-config.php and wp-content/advanced-cache.php. These will be recreated when you install this plugin.
169
  3. Upload this directory to your plugins directory. It will create a 'wp-content/plugins/wp-super-cache/' directory.
170
  4. If you are using WordPress MU you will need to install this in 'wp-content/mu-plugins/wp-super-cache/' and the file wp-cache.php must be copied into the mu-plugins directory.
171
  5. WordPress users should go to their Plugins page and activate "WP Super Cache".
172
+ 6. Now go to Settings->WP Super Cache and enable caching. If you see an error message or a blank screen see the "FAQ" section later in this readme for instructions.
173
+ 7. If you choose "Mod Rewrite caching", mod_rewrite rules will be inserted into your .htaccess file. Look in your web root directory for this file. It should look similar to this:
174
 
175
  `-----------------.htaccess-----------------`
176
  `RewriteEngine On`
229
  == How to uninstall WP Super Cache ==
230
 
231
  Edit the file uninstall.php in your plugins/wp-super-cache/ directory and set
232
+ UNINSTALL_WPSUPERCACHE to a non blank value like this:
233
 
234
  `define( 'UNINSTALL_WPSUPERCACHE', '1' );`
235
 
258
  = How do I know my blog is being cached? =
259
 
260
  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.
261
+ In legacy caching 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. PHP cached pages will have the header "WP-Super-Cache: Served supercache file from PHP". Legacy cached files will have the header, "WP-Super-Cache: Served legacy cache file". 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.
262
+ If the plugin rules are missing from your .htaccess file, the plugin will attempt to serve the super cached page if it's found. The header "WP-Super-Cache: Served supercache file from PHP" if this happens.
263
 
264
  = WP-Cache vs Supercache files =
265
 
276
 
277
  = Will the Super Cache compression slow down my server? =
278
 
279
+ No, it will do the opposite. 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.
280
 
281
  = How do I make certain parts of the page stay dynamic? =
282
 
283
+ WP Super Cache retains the dynamic loading code of WP Cache but only works in legacy caching mode.
284
 
285
  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:
286
 
296
 
297
  That will include file.php under the ABSPATH directory, which is the same as where your wp-config.php file is located.
298
 
299
+ Example:
300
+ `<!--mfunc date( 'Y-m-d H:i:s' ) -->
301
+ <?php date( 'Y-m-d H:i:s' ) ?>
302
+ <!--/mfunc-->`
303
+
304
+ = How do I delay serving the cache until the "init" action fires? =
305
+
306
+ Cached files are served before almost all of WordPress is loaded. While that's great for performance it's a pain when you want to extend the plugin using a core part of WordPress. Set $wp_super_cache_late_init to "1" in wp-content/wp-cache-config.php and cached files will be served when "init" fires. WordPress and it's plugins will be loaded now. This is very useful when you are using the mfunc tag in your theme.
307
+
308
  = Why doesn't WP UserOnline, Popularity Contest, WP Postratings or plugin X not work or update on my blog now? =
309
 
310
  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.
320
  1. Uses a static page for the front page.
321
  2. Uses /%category%/%postname%/ permalink structure.
322
 
323
+ 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 PHP mode. For normal traffic you will see no difference in the speed of your site.
324
 
325
  = Why do I get warnings about caching from http://ismyblogworking.com/ =
326
 
335
 
336
  That tracking adds a query string to each url linked from various sources like Twitter and feedreaders. Unfortunately it stops pages being supercached. See [Joost's comment here](http://ocaoimh.ie/remove-unused-utmsource-urls/#comment-672813) for how to turn it into an anchor tag which can be supercached.
337
 
338
+ = The plugin complains that wp-content is writable! htdocs is writable! =
339
+
340
+ It's not good when the web server can write to these directories but sometimes shared hosting accounts are set up in this way to make administration easier. Use `chmod 755 directory` to fix the permissions or find the permissions section of your ftp client. This [Google search](http://www.google.ie/search?sourceid=chrome&ie=UTF-8&q=ftp+fix+directory+permissions+755) will lead you to more information on this topic. Unfortunately some hosts require that those directories be writable. If that's the case just ignore this warning.
341
+
342
  = Troubleshooting =
343
 
344
  If things don't work when you installed the plugin here are a few things to check:
358
  11. If pages are randomly super cached and sometimes not, your blog can probably be viewed with and without the "www" prefix on the URL. You should choose one way and install the [Enforce www preference](http://txfx.net/code/wordpress/enforce-www-preference/) plugin if you are using an old WordPress install. The latest versions redirect themselves (you should always be running the latest version of WordPress anyway!)
359
  12. Private Server users at Dreamhost should edit wp-content/wp-cache-config.php and set the cache dir to "/tmp/" if they are getting errors about increasing CPU usage. See this [discussion](http://wordpress.org/support/topic/145895?replies=42) for more.
360
  13. File locking errors such as "failed to acquire key 0x152b: Permission denied in..." or "Page not cached by WP Super Cache. Could not get mutex lock." are a sign that you may have to use file locking. Edit wp-content/wp-cache-config.php and uncomment "$use_flock = true" or set $sem_id to a different value. You can also disable file locking from the Admin screen as a last resort.
361
+ 14. Make sure cache/wp_cache_mutex.lock is writable by the web server if using coarse file locking.
362
  15. The cache folder cannot be put on an NFS or Samba or NAS share. It has to be on a local disk. File locking and deleting expired files will not work properly unless the cache folder is on the local machine.
363
  16. Garbage collection of old cache files won't work if WordPress can't find wp-cron.php. If your hostname resolves to 127.0.0.1 it could be preventing the garbage collection from working. Check your access_logs for wp-cron.php entries. Do they return a 404 (file not found) or 200 code? If it's 404 or you don't see wp-cron.php anywhere WordPress may be looking for that script in the wrong place. You should speak to your server administator to correct this or edit /etc/hosts on Unix servers and remove the following line. Your hostname must resolve to the external IP address other servers on the network/Internet use. See http://yoast.com/wp-cron-issues/ for more.
364
 
365
  `127.0.0.1 myhostname.com`
366
  A line like "127.0.0.1 localhost localhost.localdomain" is ok.
367
  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.
368
+ 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? This file will normally be in wp-content/plugins/wp-super-cache/. If it is not correct the caching engine will not load.
369
+ 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 PHP or legacy caching mode.
370
  20. If supercache cache files are generated but not served, check the permissions on all your wp-content/cache/supercache folders (and each of wp-content cache and supercache folders) and wp-content/cache/.htaccess. If your PHP runs as a different user to Apache and permissions are strict Apache may not be able to read the PHP generated cache files. To fix you must add the following line to your wp-config.php (Add it above the WP_CACHE define.) Then clear your cache.
371
 
372
  `umask( 0022 );`
406
  Thanks to James Farmer and Andrew Billits of [Edu Blogs](http://edublogs.org/) fame who helped me make this more WordPress MU friendly.
407
 
408
  Translators who did a great job converting the text of the plugin to their native language. Thank you!
409
+
410
+ * [Gianni Diurno](http://gidibao.net/) (Italian)
411
+ * [Omi](http://equipajedemano.info/) (Spanish)
412
+ * [tomchen1989](http://emule-fans.com/) (Simplified Chinese)
413
+ * Tai (Japanese)
414
+ * [Vitaly](http://pressword.com.ua/wordpress/) (Ukranian)
415
+ * [Pseric](http://pseric.com/) (Traditional Chinese)
wp-cache-config-sample.php CHANGED
@@ -6,7 +6,7 @@ See wp-cache.php for author details.
6
  */
7
 
8
  if ( ! defined('WPCACHEHOME') )
9
- define( 'WPCACHEHOME', WP_CONTENT_DIR . '/plugins/wp-super-cache/' );
10
 
11
  $cache_compression = 0; // Super cache compression
12
  $cache_enabled = false;
@@ -62,8 +62,6 @@ $wp_cache_mobile = 0;
62
  $wp_cache_mobile_whitelist = 'Stand Alone/QNws';
63
  $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';
64
 
65
- // gzip the first page generated for clients that support it.
66
- $wp_cache_gzip_first = 0;
67
  // change to relocate the supercache plugins directory
68
  $wp_cache_plugins_dir = WPCACHEHOME . 'plugins';
69
  // set to 1 to do garbage collection during normal process shutdown instead of wp-cron
6
  */
7
 
8
  if ( ! defined('WPCACHEHOME') )
9
+ define( 'WPCACHEHOME', WP_PLUGIN_DIR . '/wp-super-cache/' );
10
 
11
  $cache_compression = 0; // Super cache compression
12
  $cache_enabled = false;
62
  $wp_cache_mobile_whitelist = 'Stand Alone/QNws';
63
  $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';
64
 
 
 
65
  // change to relocate the supercache plugins directory
66
  $wp_cache_plugins_dir = WPCACHEHOME . 'plugins';
67
  // set to 1 to do garbage collection during normal process shutdown instead of wp-cron
wp-cache-phase1.php CHANGED
@@ -4,24 +4,36 @@
4
  if( !defined('WP_CONTENT_DIR') )
5
  define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
6
 
7
- if( !include( WP_CONTENT_DIR . '/wp-cache-config.php' ) )
 
 
 
 
 
 
 
 
 
 
 
 
8
  return true;
 
9
  if( !defined( 'WPCACHEHOME' ) )
10
  define('WPCACHEHOME', dirname(__FILE__).'/');
11
 
12
  include( WPCACHEHOME . 'wp-cache-base.php');
13
 
14
- if( $blogcacheid != '' ) {
15
- $blog_cache_dir = str_replace( '//', '/', $cache_path . "blogs/" . $blogcacheid . '/' );
16
  } else {
17
- $blog_cache_dir = $cache_path;
18
  }
 
19
 
20
- $mutex_filename = 'wp_cache_mutex.lock';
21
  $new_cache = false;
22
 
23
- // Don't change variables behind this point
24
-
25
  if( !isset( $wp_cache_plugins_dir ) )
26
  $wp_cache_plugins_dir = WPCACHEHOME . 'plugins';
27
 
@@ -152,8 +164,14 @@ function wp_cache_serve_cache_file() {
152
  header( "Content-type: text/html; charset=UTF-8" ); // UTF-8 hard coded is bad but we don't know what it is this early in the process
153
  header( "Vary: Accept-Encoding, Cookie" );
154
  header( "Cache-Control: max-age=300, must-revalidate" );
155
- header( "WP-Cache: Served supercache file from PHP" );
156
- readfile( $file );
 
 
 
 
 
 
157
  if ( isset( $wp_super_cache_debug ) && $wp_super_cache_debug ) wp_cache_debug( "Served page from supercache file. Mod rewrite rules may be broken or missing.", 5 );
158
  die();
159
  } else {
@@ -174,7 +192,7 @@ function wp_cache_serve_cache_file() {
174
  if( strpos( $header, 'Last-Modified:' ) === false )
175
  header($header);
176
  }
177
- header( 'WP-Super-Cache: WP-Cache' );
178
  if ( $wp_cache_object_cache ) {
179
  if ( $cache ) {
180
  if ( $ungzip ) {
@@ -285,7 +303,7 @@ function add_cacheaction( $action, $func ) {
285
 
286
  function do_cacheaction( $action, $value = '' ) {
287
  global $wp_supercache_actions;
288
- if( is_array( $wp_supercache_actions[ $action ] ) ) {
289
  $actions = $wp_supercache_actions[ $action ];
290
  foreach( $actions as $func ) {
291
  $value = $func( $value );
@@ -311,10 +329,10 @@ function wp_cache_mobile_group( $user_agent ) {
311
  // From http://wordpress.org/extend/plugins/wordpress-mobile-edition/ by Alex King
312
  function wp_cache_check_mobile( $cache_key ) {
313
  global $wp_cache_mobile_enabled, $wp_cache_mobile_browsers, $wp_cache_mobile_prefixes;
314
- if( !isset( $wp_cache_mobile_enabled ) || false == $wp_cache_mobile_enabled )
315
  return $cache_key;
316
 
317
- if (!isset($_SERVER["HTTP_USER_AGENT"])) {
318
  return $cache_key;
319
  }
320
 
4
  if( !defined('WP_CONTENT_DIR') )
5
  define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
6
 
7
+ function wp_cache_load_config() {
8
+ global $wpsc_settings;
9
+ if( !include( WP_CONTENT_DIR . '/wp-cache-config.php' ) )
10
+ return false;
11
+ $fields = array( "cache_compression", "cache_enabled", "super_cache_enabled", "cache_max_time", "cache_path", "file_prefix", "blogcacheid", "cache_acceptable_files", "cache_rejected_uri", "cache_rejected_user_agent", "cache_rebuild_files", "wp_cache_mutex_disabled", "wp_cache_mobile", "wp_cache_mobile_whitelist", "wp_cache_mobile_browsers", "wp_cache_plugins_dir", "wp_cache_shutdown_gc", "wp_super_cache_late_init", "wp_super_cache_advanced_debug", "wp_super_cache_front_page_text", "wp_super_cache_front_page_clear", "wp_super_cache_front_page_check", "wp_super_cache_front_page_notification", "wp_cache_object_cache", "wp_cache_anon_only", "wp_supercache_cache_list", "wp_cache_debug_to_file", "wp_super_cache_debug", "wp_cache_debug_level", "wp_cache_debug_ip", "wp_cache_debug_log", "wp_cache_debug_email", "wp_cache_pages", "wp_cache_hide_donation", "wp_cache_not_logged_in", "wp_cache_clear_on_post_edit", "wp_cache_hello_world", "wp_cache_mobile_enabled", "wp_cache_cron_check", "use_flock", "sem_id" );
12
+ foreach( $fields as $field ) {
13
+ $GLOBALS[ $field ] = $$field;
14
+ $wpsc_settings[ $field ] = $$field;
15
+ }
16
+ return true;
17
+ }
18
+
19
+ if( false == wp_cache_load_config() )
20
  return true;
21
+
22
  if( !defined( 'WPCACHEHOME' ) )
23
  define('WPCACHEHOME', dirname(__FILE__).'/');
24
 
25
  include( WPCACHEHOME . 'wp-cache-base.php');
26
 
27
+ if( $wpsc_settings[ 'blogcacheid' ] != '' ) {
28
+ $wpsc_settings[ 'blog_cache_dir' ] = str_replace( '//', '/', $wpsc_settings[ 'cache_path' ] . "blogs/" . $wpsc_settings[ 'blogcacheid' ] . '/' );
29
  } else {
30
+ $wpsc_settings[ 'blog_cache_dir' ] = $wpsc_settings[ 'cache_path' ];
31
  }
32
+ $blog_cache_dir = $wpsc_settings[ 'blog_cache_dir' ];
33
 
34
+ $wpsc_settings[ 'mutex_filename' ] = 'wp_cache_mutex.lock';
35
  $new_cache = false;
36
 
 
 
37
  if( !isset( $wp_cache_plugins_dir ) )
38
  $wp_cache_plugins_dir = WPCACHEHOME . 'plugins';
39
 
164
  header( "Content-type: text/html; charset=UTF-8" ); // UTF-8 hard coded is bad but we don't know what it is this early in the process
165
  header( "Vary: Accept-Encoding, Cookie" );
166
  header( "Cache-Control: max-age=300, must-revalidate" );
167
+ header( "WP-Super-Cache: Served supercache file from PHP" );
168
+ if ( file_exists( $file . ".gz" ) && $wp_cache_gzip_encoding ) {
169
+ header( 'Content-Encoding: ' . $wp_cache_gzip_encoding );
170
+ header( 'Content-Length: ' . filesize( $file . ".gz" ) );
171
+ readfile( $file . ".gz" );
172
+ } else {
173
+ readfile( $file );
174
+ }
175
  if ( isset( $wp_super_cache_debug ) && $wp_super_cache_debug ) wp_cache_debug( "Served page from supercache file. Mod rewrite rules may be broken or missing.", 5 );
176
  die();
177
  } else {
192
  if( strpos( $header, 'Last-Modified:' ) === false )
193
  header($header);
194
  }
195
+ header( 'WP-Super-Cache: Served legacy cache file' );
196
  if ( $wp_cache_object_cache ) {
197
  if ( $cache ) {
198
  if ( $ungzip ) {
303
 
304
  function do_cacheaction( $action, $value = '' ) {
305
  global $wp_supercache_actions;
306
+ if( array_key_exists($action, $wp_supercache_actions) && is_array( $wp_supercache_actions[ $action ] ) ) {
307
  $actions = $wp_supercache_actions[ $action ];
308
  foreach( $actions as $func ) {
309
  $value = $func( $value );
329
  // From http://wordpress.org/extend/plugins/wordpress-mobile-edition/ by Alex King
330
  function wp_cache_check_mobile( $cache_key ) {
331
  global $wp_cache_mobile_enabled, $wp_cache_mobile_browsers, $wp_cache_mobile_prefixes;
332
+ if ( !isset( $wp_cache_mobile_enabled ) || false == $wp_cache_mobile_enabled )
333
  return $cache_key;
334
 
335
+ if ( !isset( $_SERVER[ "HTTP_USER_AGENT" ] ) ) {
336
  return $cache_key;
337
  }
338
 
wp-cache-phase2.php CHANGED
@@ -1,12 +1,18 @@
1
  <?php
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_request_uri, $super_cache_enabled, $wp_cache_object_cache;
 
 
 
 
 
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' ) ) ) {
@@ -26,6 +32,8 @@ function wp_cache_phase2() {
26
  add_action('switch_theme', 'wp_cache_no_postid', 99);
27
  add_action('edit_user_profile_update', 'wp_cache_no_postid', 99);
28
 
 
 
29
  add_action('wp_cache_gc','wp_cache_gc_cron');
30
 
31
  do_cacheaction( 'add_cacheaction' );
@@ -165,7 +173,7 @@ function wp_cache_is_rejected($uri) {
165
  if( strstr( $uri, $u ) )
166
  return true; // we don't allow caching of wp-admin for security reasons
167
  }
168
- foreach ($cache_rejected_uri as $expr) {
169
  if( $expr != '' && preg_match( "~$expr~", $uri ) )
170
  return true;
171
  }
@@ -173,32 +181,32 @@ function wp_cache_is_rejected($uri) {
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'))
183
- $use_flock = false;
184
  else
185
- $use_flock = true;
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() {
199
- global $use_flock, $mutex, $cache_path, $mutex_filename, $wp_cache_mutex_disabled;
200
 
201
- if( isset( $wp_cache_mutex_disabled ) && $wp_cache_mutex_disabled )
202
  return true;
203
 
204
  if( !$mutex ) {
@@ -206,7 +214,7 @@ function wp_cache_writers_entry() {
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 {
@@ -218,9 +226,9 @@ function wp_cache_writers_entry() {
218
  }
219
 
220
  function wp_cache_writers_exit() {
221
- global $use_flock, $mutex, $cache_path, $mutex_filename, $wp_cache_mutex_disabled;
222
 
223
- if( isset( $wp_cache_mutex_disabled ) && $wp_cache_mutex_disabled )
224
  return true;
225
 
226
  if( !$mutex ) {
@@ -228,7 +236,7 @@ function wp_cache_writers_exit() {
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 {
@@ -280,12 +288,23 @@ function wp_cache_ob_callback( $buffer ) {
280
  return $buffer;
281
  }
282
 
 
 
 
 
 
 
 
 
 
 
283
 
284
  function wp_cache_get_ob(&$buffer) {
 
285
  global $cache_enabled, $cache_path, $cache_filename, $meta_file, $wp_start_time, $supercachedir;
286
  global $new_cache, $wp_cache_meta, $file_expired, $blog_id, $cache_compression;
287
  global $wp_cache_gzip_encoding, $super_cache_enabled, $cached_direct_pages;
288
- global $wp_cache_404, $gzsize, $supercacheonly, $wp_cache_gzip_first, $wp_cache_gmt_offset;
289
  global $blog_cache_dir, $wp_cache_request_uri, $wp_supercache_cache_list;
290
  global $wp_cache_not_logged_in, $wp_cache_object_cache, $cache_max_time;
291
 
@@ -310,7 +329,7 @@ function wp_cache_get_ob(&$buffer) {
310
  }
311
  }
312
 
313
- if (!preg_match('/(<\/html>|<\/rss>|<\/feed>)/i',$buffer) ) {
314
  $new_cache = false;
315
  if( false === strpos( $_SERVER[ 'REQUEST_URI' ], 'robots.txt' ) ) {
316
  if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) {
@@ -415,12 +434,6 @@ function wp_cache_get_ob(&$buffer) {
415
  }
416
  }
417
 
418
- if ( $cache_enabled || $super_cache_enabled ) {
419
- $buffer .= "<!-- Cached page generated by WP-Super-Cache on " . gmdate('Y-m-d H:i:s', (time() + ( $wp_cache_gmt_offset * 3600))) . " -->\n";
420
- } else {
421
- $buffer .= "<!-- Live page served on " . gmdate('Y-m-d H:i:s', (time() + ( $wp_cache_gmt_offset * 3600))) . " -->\n";
422
- }
423
-
424
  $added_cache = 0;
425
  $oc_key = get_oc_key();
426
  if ( preg_match('/<!--mclude|<!--mfunc/', $buffer)) { //Dynamic content
@@ -429,11 +442,17 @@ function wp_cache_get_ob(&$buffer) {
429
  "<!--mclude-->\n<?php include_once('" . ABSPATH . "$1'); ?>\n<!--/mclude-->", $buffer);
430
  $store = preg_replace('|<!--mfunc (.*?)-->(.*?)<!--/mfunc-->|is',
431
  "<!--mfunc-->\n<?php $1 ;?>\n<!--/mfunc-->", $store);
432
- $store = apply_filters( 'wpsupercache_buffer', $store );
433
  $wp_cache_meta[ 'dynamic' ] = true;
434
  /* Clean function calls in tag */
435
  $buffer = preg_replace('|<!--mclude (.*?)-->|is', '<!--mclude-->', $buffer);
436
  $buffer = preg_replace('|<!--mfunc (.*?)-->|is', '<!--mfunc-->', $buffer);
 
 
 
 
 
 
 
437
  if ( false == $wp_cache_object_cache ) {
438
  if( $fr )
439
  fputs($fr, $store);
@@ -442,6 +461,8 @@ function wp_cache_get_ob(&$buffer) {
442
  }
443
  } else {
444
  $buffer = apply_filters( 'wpsupercache_buffer', $buffer );
 
 
445
  if( $gz || $wp_cache_gzip_encoding ) {
446
  if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Gzipping buffer.", 5 );
447
  $gzdata = gzencode( $buffer . "<!-- Compression = gzip -->", 3, FORCE_GZIP );
@@ -489,35 +510,44 @@ function wp_cache_get_ob(&$buffer) {
489
  $supercacheonly = false;
490
  fclose($fr);
491
  if ( filesize( $tmp_wpcache_filename ) == 0 ) {
 
492
  @unlink( $tmp_wpcache_filename );
493
- } elseif ( !rename( $tmp_wpcache_filename, $blog_cache_dir . $cache_filename ) ) {
494
- unlink( $blog_cache_dir . $cache_filename );
495
- rename( $tmp_wpcache_filename, $blog_cache_dir . $cache_filename );
 
 
 
 
496
  }
497
- 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 );
498
- $added_cache = 1;
499
  }
500
  if( $fr2 ) {
501
  fclose($fr2);
502
  if ( filesize( $tmp_cache_filename ) == 0 ) {
 
503
  @unlink( $tmp_cache_filename );
504
- } elseif ( !@rename( $tmp_cache_filename, $cache_fname ) ) {
505
- @unlink( $cache_fname );
506
- @rename( $tmp_cache_filename, $cache_fname );
 
 
 
 
507
  }
508
- if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Renamed temp supercache file to $cache_fname", 5 );
509
- $added_cache = 1;
510
  }
511
  if( $gz ) {
512
  fclose($gz);
513
  if ( filesize( $tmp_cache_filename . '.gz' ) == 0 ) {
 
514
  @unlink( $tmp_cache_filename . '.gz' );
515
- } elseif ( !@rename( $tmp_cache_filename . '.gz', $cache_fname . '.gz' ) ) {
516
- @unlink( $cache_fname . '.gz' );
517
- @rename( $tmp_cache_filename . '.gz', $cache_fname . '.gz' );
 
 
 
 
518
  }
519
- 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 );
520
- $added_cache = 1;
521
  }
522
  }
523
  if ( $added_cache && isset( $wp_supercache_cache_list ) && $wp_supercache_cache_list ) {
@@ -529,7 +559,7 @@ function wp_cache_get_ob(&$buffer) {
529
  update_option( 'supercache_last_cached', $last_urls );
530
  }
531
  wp_cache_writers_exit();
532
- if ( !headers_sent() && isset( $wp_cache_gzip_first ) && 1 == $wp_cache_gzip_first && $wp_cache_gzip_encoding && $gzdata) {
533
  if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Writing gzip content headers. Sending buffer to browser", 5 );
534
  header( 'Content-Encoding: ' . $wp_cache_gzip_encoding );
535
  header( 'Vary: Accept-Encoding, Cookie' );
@@ -669,8 +699,9 @@ function wp_cache_phase2_clean_expired( $file_prefix, $force = false ) {
669
  }
670
 
671
  function wp_cache_shutdown_callback() {
 
672
  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;
673
- global $wp_cache_blog_charset, $wp_cache_request_uri, $wp_cache_key, $wp_cache_object_cache, $cache_enabled;
674
 
675
  $wp_cache_meta[ 'uri' ] = $_SERVER["SERVER_NAME"].preg_replace('/[ <>\'\"\r\n\t\(\)]/', '', $wp_cache_request_uri); // To avoid XSS attacks
676
  $wp_cache_meta[ 'blog_id' ] = $blog_id;
@@ -715,7 +746,7 @@ function wp_cache_shutdown_callback() {
715
  if( $value == '' )
716
  $value = 'text/html';
717
  }
718
- $value .= "; charset=\"" . $wp_cache_blog_charset . "\"";
719
 
720
  if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Sending 'Content-Type: $value' header.", 2 );
721
  @header("Content-Type: $value");
@@ -742,8 +773,8 @@ function wp_cache_shutdown_callback() {
742
  fclose($fr);
743
  @chmod( $tmp_meta_filename, 0666 & ~umask());
744
  if( !@rename( $tmp_meta_filename, $blog_cache_dir . 'meta/' . $meta_file ) ) {
745
- unlink( $blog_cache_dir . 'meta/' . $meta_file );
746
- rename( $tmp_meta_filename, $blog_cache_dir . 'meta/' . $meta_file );
747
  }
748
  } elseif ( $cache_enabled ) {
749
  $oc_key = get_oc_key() . ".meta";
@@ -853,14 +884,17 @@ function wp_cache_post_id_gc( $siteurl, $post_id, $all = 'all' ) {
853
  if ( $all == 'all' ) {
854
  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 );
855
  prune_super_cache( $dir . $permalink, true, true );
 
856
  @rmdir( $dir . $permalink );
857
  } else {
858
  if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "wp_cache_post_id_gc clearing cached index.html(.gz) in $dir{$permalink}.", 4 );
859
  prune_super_cache( $dir . $permalink . 'index.html', true, true );
860
  prune_super_cache( $dir . $permalink . 'index.html.gz', true, true );
 
861
  }
862
  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 );
863
  prune_super_cache( $dir . 'page/', true );
 
864
  }
865
 
866
  function wp_cache_post_change( $post_id ) {
@@ -896,6 +930,7 @@ function wp_cache_post_change( $post_id ) {
896
  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 );
897
  prune_super_cache( $cache_path . 'supercache/' . $siteurl . 'index.html', true, true );
898
  prune_super_cache( $cache_path . 'supercache/' . $siteurl . 'index.html.gz', true, true );
 
899
  }
900
  wp_cache_post_id_gc( $siteurl, $post_id );
901
  if( $all == true && get_option( 'show_on_front' ) == 'page' ) {
@@ -905,6 +940,7 @@ function wp_cache_post_change( $post_id ) {
905
  $permalink = trailingslashit( str_replace( get_option( 'home' ), '', post_permalink( get_option( 'page_for_posts' ) ) ) );
906
  prune_super_cache( $cache_path . 'supercache/' . $siteurl . $permalink . 'index.html', true, true );
907
  prune_super_cache( $cache_path . 'supercache/' . $siteurl . $permalink . 'index.html.gz', true, true );
 
908
  }
909
  }
910
 
@@ -926,15 +962,21 @@ function wp_cache_post_change( $post_id ) {
926
  if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Post change: deleting post cache files for {$meta[ 'uri' ]}: $content_pathname", 4 );
927
  @unlink($meta_pathname);
928
  @unlink($content_pathname);
929
- @wp_cache_rebuild_or_delete($cache_path . 'supercache/' . trailingslashit( $meta[ 'uri' ] ) . 'index.html');
930
- @wp_cache_rebuild_or_delete($cache_path . 'supercache/' . trailingslashit( $meta[ 'uri' ] ) . 'index.html.gz');
 
 
 
931
  }
932
  } elseif ($meta[ 'blog_id' ] == $blog_id) {
933
  if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Post change: deleting cache files for {$meta[ 'uri' ]}: $content_pathname", 4 );
934
  @unlink($meta_pathname);
935
  @unlink($content_pathname);
936
- @wp_cache_rebuild_or_delete($cache_path . 'supercache/' . trailingslashit( $meta[ 'uri' ] ) . 'index.html');
937
- @wp_cache_rebuild_or_delete($cache_path . 'supercache/' . trailingslashit( $meta[ 'uri' ] ) . 'index.html.gz');
 
 
 
938
  }
939
 
940
  }
1
  <?php
2
 
3
  function wp_cache_phase2() {
4
+ global $wpsc_settings;
5
+ global $cache_filename, $cache_acceptable_files, $wp_cache_gzip_encoding, $super_cache_enabled, $cache_rebuild_files, $wp_cache_last_gc;
6
  global $cache_max_time, $wp_cache_request_uri, $super_cache_enabled, $wp_cache_object_cache;
7
+ global $cache_enabled;
8
+
9
+ if ( $cache_enabled == false )
10
+ return false;
11
+
12
  if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( 'In WP Cache Phase 2', 5 );
13
 
14
+ $wpsc_settings[ 'wp_cache_gmt_offset' ] = get_option( 'gmt_offset' ); // caching for later use when wpdb is gone. http://wordpress.org/support/topic/224349
15
+ $wpsc_settings[ 'wp_cache_blog_charset' ] = get_option( 'blog_charset' );
16
 
17
  wp_cache_mutex_init();
18
  if(function_exists('add_action') && ( !defined( 'WPLOCKDOWN' ) || ( defined( 'WPLOCKDOWN' ) && constant( 'WPLOCKDOWN' ) == '0' ) ) ) {
32
  add_action('switch_theme', 'wp_cache_no_postid', 99);
33
  add_action('edit_user_profile_update', 'wp_cache_no_postid', 99);
34
 
35
+ add_action( 'wp_update_nav_menu', 'wp_cache_clear_cache' );
36
+
37
  add_action('wp_cache_gc','wp_cache_gc_cron');
38
 
39
  do_cacheaction( 'add_cacheaction' );
173
  if( strstr( $uri, $u ) )
174
  return true; // we don't allow caching of wp-admin for security reasons
175
  }
176
+ foreach ( $cache_rejected_uri as $expr ) {
177
  if( $expr != '' && preg_match( "~$expr~", $uri ) )
178
  return true;
179
  }
181
  }
182
 
183
  function wp_cache_mutex_init() {
184
+ global $wpsc_settings, $mutex;
185
 
186
+ if( isset( $wpsc_settings[ 'wp_cache_mutex_disabled' ] ) && $wpsc_settings[ 'wp_cache_mutex_disabled' ] )
187
  return true;
188
 
189
+ if( !is_bool( $wpsc_settings[ 'use_flock' ] ) ) {
190
  if(function_exists('sem_get'))
191
+ $wpsc_settings[ 'use_flock' ] = false;
192
  else
193
+ $wpsc_settings[ 'use_flock' ] = true;
194
  }
195
 
196
  $mutex = false;
197
+ if ($wpsc_settings[ 'use_flock' ] ) {
198
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Created mutex lock on filename: {$wpsc_settings[ 'blog_cache_dir' ]}{$wpsc_settings[ 'mutex_filename' ]}", 5 );
199
+ $mutex = @fopen( $wpsc_settings[ 'blog_cache_dir' ] . $wpsc_settings[ 'mutex_filename' ], 'w' );
200
  } else {
201
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Created mutex lock on semaphore: {$wpsc_settings[ 'sem_id' ]}", 5 );
202
+ $mutex = @sem_get( $wpsc_settings[ 'sem_id' ], 1, 0644 | IPC_CREAT, 1 );
203
  }
204
  }
205
 
206
  function wp_cache_writers_entry() {
207
+ global $wpsc_settings, $mutex;
208
 
209
+ if( isset( $wpsc_settings[ 'wp_cache_mutex_disabled' ] ) && $wpsc_settings[ 'wp_cache_mutex_disabled' ] )
210
  return true;
211
 
212
  if( !$mutex ) {
214
  return false;
215
  }
216
 
217
+ if ( $wpsc_settings[ 'use_flock' ] ) {
218
  if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "grabbing lock using flock()", 5 );
219
  flock($mutex, LOCK_EX);
220
  } else {
226
  }
227
 
228
  function wp_cache_writers_exit() {
229
+ global $wpsc_settings, $mutex;
230
 
231
+ if( isset( $wpsc_settings[ 'wp_cache_mutex_disabled' ] ) && $wpsc_settings[ 'wp_cache_mutex_disabled' ] )
232
  return true;
233
 
234
  if( !$mutex ) {
236
  return false;
237
  }
238
 
239
+ if ( $wpsc_settings[ 'use_flock' ] ) {
240
  if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "releasing lock using flock()", 5 );
241
  flock($mutex, LOCK_UN);
242
  } else {
288
  return $buffer;
289
  }
290
 
291
+ function wp_cache_append_tag( &$buffer ) {
292
+ global $wpsc_settings;
293
+ global $cache_enabled, $super_cache_enabled;
294
+ $timestamp = gmdate('Y-m-d H:i:s', (time() + ( $wpsc_settings[ 'wp_cache_gmt_offset' ] * 3600)));
295
+ if ( $cache_enabled || $super_cache_enabled ) {
296
+ $buffer .= "<!-- Cached page generated by WP-Super-Cache on $timestamp -->\n";
297
+ } else {
298
+ $buffer .= "<!-- Live page served on $timestamp -->\n";
299
+ }
300
+ }
301
 
302
  function wp_cache_get_ob(&$buffer) {
303
+ global $wpsc_settings;
304
  global $cache_enabled, $cache_path, $cache_filename, $meta_file, $wp_start_time, $supercachedir;
305
  global $new_cache, $wp_cache_meta, $file_expired, $blog_id, $cache_compression;
306
  global $wp_cache_gzip_encoding, $super_cache_enabled, $cached_direct_pages;
307
+ global $wp_cache_404, $gzsize, $supercacheonly;
308
  global $blog_cache_dir, $wp_cache_request_uri, $wp_supercache_cache_list;
309
  global $wp_cache_not_logged_in, $wp_cache_object_cache, $cache_max_time;
310
 
329
  }
330
  }
331
 
332
+ if (!preg_match('/(<\/html>|<\/rss>|<\/feed>|<\/urlset)/i',$buffer) ) {
333
  $new_cache = false;
334
  if( false === strpos( $_SERVER[ 'REQUEST_URI' ], 'robots.txt' ) ) {
335
  if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) {
434
  }
435
  }
436
 
 
 
 
 
 
 
437
  $added_cache = 0;
438
  $oc_key = get_oc_key();
439
  if ( preg_match('/<!--mclude|<!--mfunc/', $buffer)) { //Dynamic content
442
  "<!--mclude-->\n<?php include_once('" . ABSPATH . "$1'); ?>\n<!--/mclude-->", $buffer);
443
  $store = preg_replace('|<!--mfunc (.*?)-->(.*?)<!--/mfunc-->|is',
444
  "<!--mfunc-->\n<?php $1 ;?>\n<!--/mfunc-->", $store);
 
445
  $wp_cache_meta[ 'dynamic' ] = true;
446
  /* Clean function calls in tag */
447
  $buffer = preg_replace('|<!--mclude (.*?)-->|is', '<!--mclude-->', $buffer);
448
  $buffer = preg_replace('|<!--mfunc (.*?)-->|is', '<!--mfunc-->', $buffer);
449
+ $store = apply_filters( 'wpsupercache_buffer', $store );
450
+ // Append WP Super Cache or Live page comment tag
451
+ wp_cache_append_tag($buffer);
452
+ global $wp_super_cache_late_init;
453
+ if ( false == isset( $wp_super_cache_late_init ) || ( isset( $wp_super_cache_late_init ) && $wp_super_cache_late_init == 0 ) )
454
+ $buffer .= '<!-- Super Cache dynamic page detected but $wp_super_cache_late_init not set. See the readme.txt for further details. -->';
455
+
456
  if ( false == $wp_cache_object_cache ) {
457
  if( $fr )
458
  fputs($fr, $store);
461
  }
462
  } else {
463
  $buffer = apply_filters( 'wpsupercache_buffer', $buffer );
464
+ // Append WP Super Cache or Live page comment tag
465
+ wp_cache_append_tag($buffer);
466
  if( $gz || $wp_cache_gzip_encoding ) {
467
  if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Gzipping buffer.", 5 );
468
  $gzdata = gzencode( $buffer . "<!-- Compression = gzip -->", 3, FORCE_GZIP );
510
  $supercacheonly = false;
511
  fclose($fr);
512
  if ( filesize( $tmp_wpcache_filename ) == 0 ) {
513
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Warning! The file $tmp_wpcache_filename was empty. Did not rename to {$blog_cache_dir}{$cache_filename}", 5 );
514
  @unlink( $tmp_wpcache_filename );
515
+ } else {
516
+ if ( !rename( $tmp_wpcache_filename, $blog_cache_dir . $cache_filename ) ) {
517
+ unlink( $blog_cache_dir . $cache_filename );
518
+ rename( $tmp_wpcache_filename, $blog_cache_dir . $cache_filename );
519
+ }
520
+ 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 );
521
+ $added_cache = 1;
522
  }
 
 
523
  }
524
  if( $fr2 ) {
525
  fclose($fr2);
526
  if ( filesize( $tmp_cache_filename ) == 0 ) {
527
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Warning! The file $tmp_cache_filename was empty. Did not rename to {$cache_fname}", 5 );
528
  @unlink( $tmp_cache_filename );
529
+ } else {
530
+ if ( !@rename( $tmp_cache_filename, $cache_fname ) ) {
531
+ @unlink( $cache_fname );
532
+ @rename( $tmp_cache_filename, $cache_fname );
533
+ }
534
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Renamed temp supercache file to $cache_fname", 5 );
535
+ $added_cache = 1;
536
  }
 
 
537
  }
538
  if( $gz ) {
539
  fclose($gz);
540
  if ( filesize( $tmp_cache_filename . '.gz' ) == 0 ) {
541
+ if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Warning! The file {$tmp_cache_filename}.gz was empty. Did not rename to {$cache_fname}.gz", 5 );
542
  @unlink( $tmp_cache_filename . '.gz' );
543
+ } else {
544
+ if ( !@rename( $tmp_cache_filename . '.gz', $cache_fname . '.gz' ) ) {
545
+ @unlink( $cache_fname . '.gz' );
546
+ @rename( $tmp_cache_filename . '.gz', $cache_fname . '.gz' );
547
+ }
548
+ 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 );
549
+ $added_cache = 1;
550
  }
 
 
551
  }
552
  }
553
  if ( $added_cache && isset( $wp_supercache_cache_list ) && $wp_supercache_cache_list ) {
559
  update_option( 'supercache_last_cached', $last_urls );
560
  }
561
  wp_cache_writers_exit();
562
+ if ( !headers_sent() && $wp_cache_gzip_encoding && $gzdata) {
563
  if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Writing gzip content headers. Sending buffer to browser", 5 );
564
  header( 'Content-Encoding: ' . $wp_cache_gzip_encoding );
565
  header( 'Vary: Accept-Encoding, Cookie' );
699
  }
700
 
701
  function wp_cache_shutdown_callback() {
702
+ global $wpsc_settings;
703
  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;
704
+ global $wp_cache_request_uri, $wp_cache_key, $wp_cache_object_cache, $cache_enabled;
705
 
706
  $wp_cache_meta[ 'uri' ] = $_SERVER["SERVER_NAME"].preg_replace('/[ <>\'\"\r\n\t\(\)]/', '', $wp_cache_request_uri); // To avoid XSS attacks
707
  $wp_cache_meta[ 'blog_id' ] = $blog_id;
746
  if( $value == '' )
747
  $value = 'text/html';
748
  }
749
+ $value .= "; charset=\"" . $wpsc_settings[ 'wp_cache_blog_charset' ] . "\"";
750
 
751
  if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Sending 'Content-Type: $value' header.", 2 );
752
  @header("Content-Type: $value");
773
  fclose($fr);
774
  @chmod( $tmp_meta_filename, 0666 & ~umask());
775
  if( !@rename( $tmp_meta_filename, $blog_cache_dir . 'meta/' . $meta_file ) ) {
776
+ @unlink( $blog_cache_dir . 'meta/' . $meta_file );
777
+ @rename( $tmp_meta_filename, $blog_cache_dir . 'meta/' . $meta_file );
778
  }
779
  } elseif ( $cache_enabled ) {
780
  $oc_key = get_oc_key() . ".meta";
884
  if ( $all == 'all' ) {
885
  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 );
886
  prune_super_cache( $dir . $permalink, true, true );
887
+ do_action( 'gc_cache', 'prune', $permalink );
888
  @rmdir( $dir . $permalink );
889
  } else {
890
  if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "wp_cache_post_id_gc clearing cached index.html(.gz) in $dir{$permalink}.", 4 );
891
  prune_super_cache( $dir . $permalink . 'index.html', true, true );
892
  prune_super_cache( $dir . $permalink . 'index.html.gz', true, true );
893
+ do_action( 'gc_cache', 'prune', $permalink );
894
  }
895
  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 );
896
  prune_super_cache( $dir . 'page/', true );
897
+ do_action( 'gc_cache', 'prune', '/page/' );
898
  }
899
 
900
  function wp_cache_post_change( $post_id ) {
930
  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 );
931
  prune_super_cache( $cache_path . 'supercache/' . $siteurl . 'index.html', true, true );
932
  prune_super_cache( $cache_path . 'supercache/' . $siteurl . 'index.html.gz', true, true );
933
+ do_action( 'gc_cache', 'prune', 'homepage' );
934
  }
935
  wp_cache_post_id_gc( $siteurl, $post_id );
936
  if( $all == true && get_option( 'show_on_front' ) == 'page' ) {
940
  $permalink = trailingslashit( str_replace( get_option( 'home' ), '', post_permalink( get_option( 'page_for_posts' ) ) ) );
941
  prune_super_cache( $cache_path . 'supercache/' . $siteurl . $permalink . 'index.html', true, true );
942
  prune_super_cache( $cache_path . 'supercache/' . $siteurl . $permalink . 'index.html.gz', true, true );
943
+ do_action( 'gc_cache', 'prune', $permalink );
944
  }
945
  }
946
 
962
  if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Post change: deleting post cache files for {$meta[ 'uri' ]}: $content_pathname", 4 );
963
  @unlink($meta_pathname);
964
  @unlink($content_pathname);
965
+ if ( $super_cache_enabled == true ) {
966
+ @wp_cache_rebuild_or_delete($cache_path . 'supercache/' . trailingslashit( $meta[ 'uri' ] ) . 'index.html');
967
+ @wp_cache_rebuild_or_delete($cache_path . 'supercache/' . trailingslashit( $meta[ 'uri' ] ) . 'index.html.gz');
968
+ do_action( 'gc_cache', 'rebuild', trailingslashit( $meta[ 'uri' ] ) );
969
+ }
970
  }
971
  } elseif ($meta[ 'blog_id' ] == $blog_id) {
972
  if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Post change: deleting cache files for {$meta[ 'uri' ]}: $content_pathname", 4 );
973
  @unlink($meta_pathname);
974
  @unlink($content_pathname);
975
+ if ( $super_cache_enabled == true ) {
976
+ @wp_cache_rebuild_or_delete($cache_path . 'supercache/' . trailingslashit( $meta[ 'uri' ] ) . 'index.html');
977
+ @wp_cache_rebuild_or_delete($cache_path . 'supercache/' . trailingslashit( $meta[ 'uri' ] ) . 'index.html.gz');
978
+ do_action( 'gc_cache', 'rebuild', trailingslashit( $meta[ 'uri' ] ) );
979
+ }
980
  }
981
 
982
  }
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.9.3
7
  Author: Donncha O Caoimh
8
  Author URI: http://ocaoimh.ie/
9
  */
@@ -110,27 +110,347 @@ function wpsupercache_activate() {
110
  }
111
  register_activation_hook( __FILE__, 'wpsupercache_activate' );
112
 
 
 
 
 
 
 
 
 
 
 
113
  function wp_cache_add_pages() {
114
- if( function_exists( 'is_site_admin' ) ) {
115
- if( is_site_admin() ) {
116
- add_submenu_page( 'ms-admin.php', 'WP Super Cache', 'WP Super Cache', 'manage_options', 'wpsupercache', 'wp_cache_manager' );
117
- add_options_page('WP Super Cache', 'WP Super Cache', 'manage_options', 'wpsupercache', 'wp_cache_manager');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  } else {
120
- add_options_page('WP Super Cache', 'WP Super Cache', 'manage_options', 'wpsupercache', 'wp_cache_manager');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  }
122
  }
123
- add_action('admin_menu', 'wp_cache_add_pages');
 
124
 
125
  function wp_cache_manager() {
126
  global $wp_cache_config_file, $valid_nonce, $supercachedir, $cache_path, $cache_enabled, $cache_compression, $super_cache_enabled, $wp_cache_hello_world;
127
  global $wp_cache_clear_on_post_edit, $cache_rebuild_files, $wp_cache_mutex_disabled, $wp_cache_mobile_enabled, $wp_cache_mobile_browsers;
128
- global $wp_cache_cron_check, $wp_cache_debug, $wp_cache_hide_donation, $wp_cache_not_logged_in, $wp_supercache_cache_list;
129
  global $wp_super_cache_front_page_check, $wp_cache_object_cache, $_wp_using_ext_object_cache, $wp_cache_refresh_single_only, $wp_cache_mobile_prefixes;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
 
131
- if( function_exists( 'is_site_admin' ) )
132
- if( !is_site_admin() )
133
- return;
134
 
135
  $supercachedir = $cache_path . 'supercache/' . preg_replace('/:.*$/', '', $_SERVER["HTTP_HOST"]);
136
  if( get_option( 'gzipcompression' ) == 1 )
@@ -165,24 +485,30 @@ jQuery(document).ready(function(){
165
  });
166
  });
167
  </script>
 
 
 
 
 
 
 
168
  <?php
 
169
  echo '<div class="wrap">';
170
- echo "<h2><a href='?page=wpsupercache'>" . __( 'WP Super Cache Manager', 'wp-super-cache' ) . "</a></h2>\n";
171
- if ( 1 == ini_get( 'safe_mode' ) || "on" == strtolower( ini_get( 'safe_mode' ) ) ) {
172
- ?><h3><?php _e( 'Warning! PHP Safe Mode Enabled!', 'wp-super-cache' ); ?></h3>
173
- <p><?php _e( 'You may experience problems running this plugin because SAFE MODE is enabled.', 'wp-super-cache' );
174
- if( !ini_get( 'safe_mode_gid' ) ) {
175
- 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>";
176
- 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>";
177
- } else {
178
- 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>";
179
- }
180
  }
181
 
182
- if ( '' == get_option( 'permalink_structure' ) ) {
183
- echo "<h3>" . __( 'Permlink Structure Error', 'wp-super-cache' ) . "</h3>";
184
- echo "<p>" . __( 'A custom url or permalink structure is required for this plugin to work correctly. Please go to the <a href="options-permalink.php">Permalinks Options Page</a> to configure your permalinks.' ) . "</p>";
185
  }
 
186
 
187
  if ( isset( $wp_super_cache_front_page_check ) && $wp_super_cache_front_page_check == 1 && !wp_next_scheduled( 'wp_cache_check_site_hook' ) ) {
188
  wp_schedule_single_event( time() + 360 , 'wp_cache_check_site_hook' );
@@ -194,282 +520,74 @@ jQuery(document).ready(function(){
194
  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>';
195
  }
196
 
197
- if ( !wp_cache_check_link() ||
198
- !wp_cache_verify_config_file() ||
199
- !wp_cache_verify_cache_dir() ) {
200
- echo '<p>' . __( "Cannot continue... fix previous problems and retry.", 'wp-super-cache' ) . '</p>';
201
- echo "</div>\n";
202
- return;
203
- }
204
-
205
- if (!wp_cache_check_global_config()) {
206
- echo "</div>\n";
207
- return;
208
- }
209
- if( $wp_cache_debug || !$wp_cache_cron_check ) {
210
- if( function_exists( "wp_remote_get" ) == false ) {
211
- $hostname = str_replace( 'http://', '', str_replace( 'https://', '', get_option( 'siteurl' ) ) );
212
- if( strpos( $hostname, '/' ) )
213
- $hostname = substr( $hostname, 0, strpos( $hostname, '/' ) );
214
- $ip = gethostbyname( $hostname );
215
- if( substr( $ip, 0, 3 ) == '127' || substr( $ip, 0, 7 ) == '192.168' ) {
216
- ?><h3><?php printf( __( 'Warning! Your hostname "%s" resolves to %s', 'wp-super-cache' ), $hostname, $ip ); ?></h3>
217
- <div style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'>
218
- <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>
219
- <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>
220
- </div>
221
- <?php
222
- } else {
223
- wp_cache_replace_line('^ *\$wp_cache_cron_check', "\$wp_cache_cron_check = 1;", $wp_cache_config_file);
224
- }
225
- } else {
226
- $cron_url = get_option( 'siteurl' ) . '/wp-cron.php?check=' . wp_hash('187425');
227
- $cron = wp_remote_get($cron_url, array('timeout' => 0.01, 'blocking' => true));
228
- if( is_array( $cron ) ) {
229
- if( $cron[ 'response' ][ 'code' ] == '404' ) {
230
- ?><h3>Warning! wp-cron.php not found!</h3>
231
- <div style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'>
232
- <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>
233
- <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>
234
- </div>
235
- <?php
236
- } else {
237
- wp_cache_replace_line('^ *\$wp_cache_cron_check', "\$wp_cache_cron_check = 1;", $wp_cache_config_file);
238
- }
239
- }
240
- }
241
- }
242
-
243
  if ( substr( get_option( 'permalink_structure' ), -1 ) == '/' ) {
244
  wp_cache_replace_line('^ *\$wp_cache_slash_check', "\$wp_cache_slash_check = 1;", $wp_cache_config_file);
245
  } else {
246
  wp_cache_replace_line('^ *\$wp_cache_slash_check', "\$wp_cache_slash_check = 0;", $wp_cache_config_file);
247
  }
248
 
249
- if ( 1 == ini_get( 'zlib.output_compression' ) || "on" == strtolower( ini_get( 'zlib.output_compression' ) ) ) {
250
- ?><h4 style='color: #a00'><?php _e( 'Zlib Output Compression Enabled!', 'wp-super-cache' ); ?></h4>
251
- <p><?php _e( 'PHP is compressing the data sent to the visitors of your site. Disabling this is recommended as the plugin caches the compressed output once instead of compressing the same page over and over again. Also see #21 in the Troubleshooting section. See <a href="http://php.net/manual/en/zlib.configuration.php">this page</a> for instructions on modifying your php.ini.', 'wp-super-cache' ); ?></p><?php
252
- }
253
-
254
- if( $cache_enabled == true && $super_cache_enabled == true && !got_mod_rewrite() ) {
255
- ?><h4 style='color: #a00'><?php _e( 'Mod rewrite may not be installed!', 'wp-super-cache' ); ?></h4>
256
- <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
257
  }
258
 
259
- if( !is_writeable_ACLSafe($wp_cache_config_file) ) {
260
- define( "SUBMITDISABLED", 'disabled style="color: #aaa" ' );
261
- ?><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>
262
- <div id='readonlywarning' style='border: 1px solid #aaa; margin: 2px; padding: 2px; display: none;'>
263
- <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 ); ?>
264
- <?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>
265
- <?php _e( 'Writeable:', 'wp-super-cache' ); ?> <code>chmod 666 <?php echo WP_CONTENT_DIR; ?>/wp-cache-config.php</code>
266
- <?php _e( 'Readonly:', 'wp-super-cache' ); ?> <code>chmod 644 <?php echo WP_CONTENT_DIR; ?>/wp-cache-config.php</code></p>
267
- </div><?php
268
- } else {
269
- define( "SUBMITDISABLED", ' ' );
270
- }
271
-
272
- // Server could be running as the owner of the wp-content directory. Therefore, if it's
273
- // writable, issue a warning only if the permissions aren't 755.
274
- if( is_writeable_ACLSafe( WP_CONTENT_DIR . '/' ) ) {
275
- $wp_content_stat = stat(WP_CONTENT_DIR . '/');
276
- $wp_content_mode = ($wp_content_stat['mode'] & 0777);
277
- if( $wp_content_mode != 0755 ) {
278
- ?><h4 style='text-align:center; color: #a00'><?php printf( __( 'Warning! %s is writeable!', 'wp-super-cache' ), WP_CONTENT_DIR ); ?></h4>
279
- <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
280
- }
281
- }
282
-
283
- // used by mod_rewrite rules and config file
284
- if ( function_exists( "cfmobi_default_browsers" ) ) {
285
- $wp_cache_mobile_browsers = cfmobi_default_browsers( "mobile" );
286
- $wp_cache_mobile_browsers = array_merge( $wp_cache_mobile_browsers, cfmobi_default_browsers( "touch" ) );
287
- } else {
288
- $wp_cache_mobile_browsers = array( '2.0 MMP', '240x320', '400X240', 'AvantGo', 'BlackBerry', 'Blazer', 'Cellphone', 'Danger', 'DoCoMo', 'Elaine/3.0', 'EudoraWeb', 'Googlebot-Mobile', 'hiptop', 'IEMobile', 'KYOCERA/WX310K', 'LG/U990', 'MIDP-2.', 'MMEF20', 'MOT-V', 'NetFront', 'Newt', 'Nintendo Wii', 'Nitro', 'Nokia', 'Opera Mini', 'Palm', 'PlayStation Portable', 'portalmmm', 'Proxinet', 'ProxiNet', 'SHARP-TQ-GX10', 'SHG-i900', 'Small', 'SonyEricsson', 'Symbian OS', 'SymbianOS', 'TS21i-10', 'UP.Browser', 'UP.Link', 'webOS', 'Windows CE', 'WinWAP', 'YahooSeeker/M1A1-R2D2', 'iPhone', 'iPod', 'Android', 'BlackBerry9530', 'LG-TU915 Obigo', 'LGE VX', 'webOS', 'Nokia5800' );
289
- }
290
- $wp_cache_mobile_prefixes = array( 'w3c ', 'w3c-', 'acs-', 'alav', 'alca', 'amoi', 'audi', 'avan', 'benq', 'bird', 'blac', 'blaz', 'brew', 'cell', 'cldc', 'cmd-', 'dang', 'doco', 'eric', 'hipt', 'htc_', 'inno', 'ipaq', 'ipod', 'jigs', 'kddi', 'keji', 'leno', 'lg-c', 'lg-d', 'lg-g', 'lge-', 'lg/u', 'maui', 'maxo', 'midp', 'mits', 'mmef', 'mobi', 'mot-', 'moto', 'mwbp', 'nec-', 'newt', 'noki', 'palm', 'pana', 'pant', 'phil', 'play', 'port', 'prox', 'qwap', 'sage', 'sams', 'sany', 'sch-', 'sec-', 'send', 'seri', 'sgh-', 'shar', 'sie-', 'siem', 'smal', 'smar', 'sony', 'sph-', 'symb', 't-mo', 'teli', 'tim-', 'tosh', 'tsm-', 'upg1', 'upsi', 'vk-v', 'voda', 'wap-', 'wapa', 'wapi', 'wapp', 'wapr', 'webc', 'winw', 'winw', 'xda ', 'xda-' ); // from http://svn.wp-plugins.org/wordpress-mobile-pack/trunk/plugins/wpmp_switcher/lite_detection.php
291
- $wp_cache_mobile_browsers = apply_filters( 'cached_mobile_browsers', $wp_cache_mobile_browsers ); // Allow mobile plugins access to modify the mobile UA list
292
- $wp_cache_mobile_prefixes = apply_filters( 'cached_mobile_prefixes', $wp_cache_mobile_prefixes ); // Allow mobile plugins access to modify the mobile UA prefix list
293
- $mobile_groups = apply_filters( 'cached_mobile_groups', array() ); // Group mobile user agents by capabilities. Lump them all together by default
294
- // mobile_groups = array( 'apple' => array( 'ipod', 'iphone' ), 'nokia' => array( 'nokia5800', 'symbianos' ) );
295
-
296
- if ( $valid_nonce ) {
297
- if( isset( $_POST[ 'wp_cache_status' ] ) ) {
298
- if( isset( $_POST[ 'wp_cache_mobile_enabled' ] ) ) {
299
- $wp_cache_mobile_enabled = 1;
300
- } else {
301
- $wp_cache_mobile_enabled = 0;
302
- }
303
- if( $wp_cache_mobile_enabled == 1 ) {
304
- update_cached_mobile_ua_list( $wp_cache_mobile_browsers, $wp_cache_mobile_prefixes, $mobile_groups );
305
- }
306
- wp_cache_replace_line('^ *\$wp_cache_mobile_enabled', "\$wp_cache_mobile_enabled = " . $wp_cache_mobile_enabled . ";", $wp_cache_config_file);
307
-
308
- $wp_supercache_cache_list = $_POST[ 'wp_supercache_cache_list' ] == 1 ? 1 : 0;
309
- wp_cache_replace_line('^ *\$wp_supercache_cache_list', "\$wp_supercache_cache_list = " . $wp_supercache_cache_list . ";", $wp_cache_config_file);
310
-
311
- switch( $_POST[ 'wp_cache_status' ] ) {
312
- case 'all':
313
- wp_cache_enable();
314
- break;
315
- case 'none':
316
- wp_cache_disable();
317
- break;
318
- case 'wpcache':
319
- wp_cache_enable();
320
- wp_super_cache_disable();
321
- break;
322
- }
323
- if( isset( $_POST[ 'wp_cache_hello_world' ] ) ) {
324
- $wp_cache_hello_world = 1;
325
- } else {
326
- $wp_cache_hello_world = 0;
327
- }
328
- wp_cache_replace_line('^ *\$wp_cache_hello_world', '$wp_cache_hello_world = ' . (int)$wp_cache_hello_world . ";", $wp_cache_config_file);
329
- if( isset( $_POST[ 'wp_cache_clear_on_post_edit' ] ) ) {
330
- $wp_cache_clear_on_post_edit = 1;
331
- } else {
332
- $wp_cache_clear_on_post_edit = 0;
333
- }
334
- wp_cache_replace_line('^ *\$wp_cache_clear_on_post_edit', "\$wp_cache_clear_on_post_edit = " . $wp_cache_clear_on_post_edit . ";", $wp_cache_config_file);
335
- if( isset( $_POST[ 'cache_rebuild_files' ] ) ) {
336
- $cache_rebuild_files = 1;
337
- } else {
338
- $cache_rebuild_files = 0;
339
- }
340
- wp_cache_replace_line('^ *\$cache_rebuild_files', "\$cache_rebuild_files = " . $cache_rebuild_files . ";", $wp_cache_config_file);
341
- if( isset( $_POST[ 'wp_cache_mutex_disabled' ] ) ) {
342
- $wp_cache_mutex_disabled = 0;
343
- } else {
344
- $wp_cache_mutex_disabled = 1;
345
- }
346
- if( defined( 'WPSC_DISABLE_LOCKING' ) ) {
347
- $wp_cache_mutex_disabled = 1;
348
- }
349
- wp_cache_replace_line('^ *\$wp_cache_mutex_disabled', "\$wp_cache_mutex_disabled = " . $wp_cache_mutex_disabled . ";", $wp_cache_config_file);
350
- if( isset( $_POST[ 'wp_cache_not_logged_in' ] ) ) {
351
- if( $wp_cache_not_logged_in == 0 && function_exists( 'prune_super_cache' ) )
352
- prune_super_cache ($cache_path, true);
353
- $wp_cache_not_logged_in = 1;
354
- } else {
355
- $wp_cache_not_logged_in = 0;
356
- }
357
- wp_cache_replace_line('^ *\$wp_cache_not_logged_in', "\$wp_cache_not_logged_in = " . $wp_cache_not_logged_in . ";", $wp_cache_config_file);
358
- if( $_wp_using_ext_object_cache && isset( $_POST[ 'wp_cache_object_cache' ] ) ) {
359
- if( $wp_cache_object_cache == 0 && function_exists( 'prune_super_cache' ) )
360
- prune_super_cache ($cache_path, true);
361
- $wp_cache_object_cache = 1;
362
- } else {
363
- $wp_cache_object_cache = 0;
364
- }
365
- wp_cache_replace_line('^ *\$wp_cache_object_cache', "\$wp_cache_object_cache = " . $wp_cache_object_cache . ";", $wp_cache_config_file);
366
- if( isset( $_POST[ 'wp_cache_refresh_single_only' ] ) ) {
367
- $wp_cache_refresh_single_only = 1;
368
- } else {
369
- $wp_cache_refresh_single_only = 0;
370
- }
371
- wp_cache_replace_line('^ *\$wp_cache_refresh_single_only', "\$wp_cache_refresh_single_only = '" . $wp_cache_refresh_single_only . "';", $wp_cache_config_file);
372
- }
373
- if( defined( 'WPSC_DISABLE_COMPRESSION' ) ) {
374
- $cache_compression_changed = false;
375
- $cache_compression = 0;
376
- wp_cache_replace_line('^ *\$cache_compression', "\$cache_compression = " . $cache_compression . ";", $wp_cache_config_file);
377
- } elseif( isset( $_POST[ 'cache_compression' ] ) && $_POST[ 'cache_compression' ] != $cache_compression ) {
378
- if ( $_POST[ 'cache_compression' ] && 1 == ini_get( 'zlib.output_compression' ) || "on" == strtolower( ini_get( 'zlib.output_compression' ) ) ) {
379
- _e( "<strong>Warning!</strong> You attempted to enable compression but <code>zlib.output_compression</code> is enabled. See #21 in the Troubleshooting section of the readme file.", 'wp-super-cache' );
380
- } else {
381
- $cache_compression = intval( $_POST[ 'cache_compression' ] );
382
- $cache_compression_changed = true;
383
- wp_cache_replace_line('^ *\$cache_compression', "\$cache_compression = " . $cache_compression . ";", $wp_cache_config_file);
384
- if( function_exists( 'prune_super_cache' ) )
385
- prune_super_cache ($cache_path, true);
386
- delete_option( 'super_cache_meta' );
387
- }
388
- }
389
- if( isset( $_POST[ 'wp_cache_hide_donation' ] ) && $_POST[ 'wp_cache_hide_donation' ] != $wp_cache_hide_donation ) {
390
- $wp_cache_hide_donation = intval( $_POST[ 'wp_cache_hide_donation' ] );
391
- wp_cache_replace_line('^ *\$wp_cache_hide_donation', "\$wp_cache_hide_donation = " . $wp_cache_hide_donation . ";", $wp_cache_config_file);
392
- }
393
- }
394
-
395
- echo '<a name="top"></a>';
396
- ?>
397
- <table><td><fieldset class="options" id="show-this-fieldset">
398
- <h3><?php _e( 'WP Super Cache Status', 'wp-super-cache' ); ?></h3><?php
399
- echo '<form name="wp_manager" action="#top" method="post">';
400
- ?>
401
- <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 />
402
- <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 />
403
- <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 />
404
- <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 known users. (Logged in users and those that comment)', 'wp-super-cache' ); ?></label></p>
405
- <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>
406
- <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.)', 'wp-super-cache' ); ?></label></p>
407
- <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.', 'wp-super-cache' ); ?></label></p>
408
- <?php if( false == defined( 'WPSC_DISABLE_LOCKING' ) ) { ?>
409
- <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>
410
- <?php } ?>
411
- <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>
412
- <p><label><input type='checkbox' name='wp_cache_mobile_enabled' <?php if( $wp_cache_mobile_enabled ) echo "checked"; ?> value='1'> <?php printf( __( 'Mobile device support.', 'wp-super-cache' ), 'http://wordpress.org/extend/plugins/wordpress-mobile-edition/' ); ?></label>
413
- <?php
414
- $home_path = trailingslashit( get_home_path() );
415
- $scrules = implode( "\n", extract_from_markers( $home_path.'.htaccess', 'WPSuperCache' ) );
416
- if ( !$wp_cache_mobile_enabled && strpos( $scrules, addcslashes( implode( '|', $wp_cache_mobile_browsers ), ' ' ) ) ) {
417
- echo "<blockquote style='background-color:#feefb3; padding: 5px; margin: 5px;'><h4>" . __( 'Mobile rewrite rules detected', 'wp-super-cache' ) . "</h4>";
418
- 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 "2.0\ MMP|240x320" 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>";
419
- } elseif ( $wp_cache_mobile_enabled && $scrules != '' && (
420
- false === strpos( $scrules, addcslashes( implode( '|', $wp_cache_mobile_prefixes ), ' ' ) ) ||
421
- false === strpos( $scrules, addcslashes( implode( '|', $wp_cache_mobile_browsers ), ' ' ) ) )
422
- ) {
423
- ?>
424
- <blockquote style='background-color:#fefeb3; padding: 5px; margin: 5px;'><h4><?php _e( 'Rewrite rules must be updated', 'wp-super-cache' ); ?></h4>
425
- <p><?php _e( 'The rewrite rules required by this plugin have changed or are missing. ', 'wp-super-cache' ); ?>
426
- <?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' ); ?>
427
- <ol><li> <?php _e( 'Set the plugin to half on mode and enable mobile support.', 'wp-super-cache' ); ?></li>
428
- <li> <?php _e( 'Scroll down this page and click the <strong>Update Mod_Rewrite Rules</strong> button.', 'wp-super-cache' ); ?></li>
429
- <li> <?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>
430
- <li> <?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_logged_in|wp-postpass_).*$</code> add these lines: (do it twice, once for each section)', 'wp-super-cache' ), $home_path ); ?></p>
431
- <div style='padding: 2px; margin: 2px; border: 1px solid #333; width:400px; overflow: scroll'><pre>RewriteCond %{HTTP_user_agent} !^.*(<?php echo addcslashes( implode( '|', $wp_cache_mobile_browsers ), ' ' ); ?>).*
432
- RewriteCond %{HTTP_user_agent} !^(<?php echo addcslashes( implode( '|', $wp_cache_mobile_prefixes ), ' ' ); ?>).*</pre></div></li></ol></blockquote>
433
- <?php } ?>
434
- <?php if ( $_wp_using_ext_object_cache ) {
435
- ?><p><label><input type='checkbox' name='wp_cache_object_cache' <?php if( $wp_cache_object_cache ) echo "checked"; ?> value='1'> <?php echo __( 'Use object cache to store cached files.', 'wp-super-cache' ) . ' ' . __( '(Experimental)', 'wp-super-cache' ); ?></label></p><?php
436
- }
437
- ?><p><label><input type='checkbox' name='wp_cache_refresh_single_only' <?php if( $wp_cache_refresh_single_only ) echo "checked"; ?> value='1'> <?php echo __( 'Only refresh current page when comments made.', 'wp-super-cache' ); ?></label></p>
438
- <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>
439
- <p><?php printf( __( 'Please see the <a href="%1$s/wp-super-cache/readme.txt">readme.txt</a> for instructions on uninstalling this script. Look for the heading, "How to uninstall WP Super Cache".', 'wp-super-cache' ), WP_PLUGIN_URL ); ?></p><?php
440
- echo "<p><em>" . sprintf( __( 'Need help? Check the <a href="%1$s">Super Cache readme file</a>. It includes installation documentation, a FAQ and Troubleshooting tips. The <a href="%2$s">support forum</a> is also available. Your question may already have been answered.', 'wp-super-cache' ), 'http://wordpress.org/extend/plugins/wp-super-cache/', 'http://wordpress.org/tags/wp-super-cache?forum_id=10' ) . "</em></p>";
441
-
442
- echo "<div class='submit'><input type='submit' " . SUBMITDISABLED . " value='" . __( 'Update Status', 'wp-super-cache' ) . " &raquo;' /></div>";
443
- wp_nonce_field('wp-cache');
444
- ?>
445
- </form>
446
- <?php
447
- if ( $cache_enabled ) {
448
  echo '<a name="test"></a>';
449
  echo "<h3>" . __( 'Cache Tester', 'wp-super-cache' ) . "</h3>";
450
  echo '<p>' . __( 'Test your cached website by clicking the test button below.', 'wp-super-cache' ) . '</p>';
451
- if ( $_POST[ 'action' ] == 'test' && $valid_nonce ) {
 
 
 
452
  // Prime the cache
453
  echo "<p>";
454
- printf( __( 'Fetching %s to prime cache: ', 'wp-super-cache' ), site_url() );
455
- $page = wp_remote_get( site_url(), array('timeout' => 60, 'blocking' => true ) );
456
  echo '<strong>' . __( 'OK', 'wp-super-cache' ) . '</strong>';
457
  echo "</p>";
458
  sleep( 1 );
459
  // Get the first copy
460
  echo "<p>";
461
- printf( __( 'Fetching first copy of %s: ', 'wp-super-cache' ), site_url() );
462
- $page = wp_remote_get( site_url(), array('timeout' => 60, 'blocking' => true ) );
463
  echo '<strong>' . __( 'OK', 'wp-super-cache' ) . '</strong>';
464
  echo "</p>";
465
  sleep( 1 );
466
  // Get the second copy
467
  echo "<p>";
468
- printf( __( 'Fetching second copy of %s: ', 'wp-super-cache' ), site_url() );
469
- $page2 = wp_remote_get( site_url(), array('timeout' => 60, 'blocking' => true ) );
470
  echo '<strong>' . __( 'OK', 'wp-super-cache' ) . '</strong>';
471
  echo "</p>";
472
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
473
  if ( preg_match( '/(Cached page generated by WP-Super-Cache on) ([0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]*)/', $page[ 'body' ], $matches1 ) &&
474
  preg_match( '/(Cached page generated by WP-Super-Cache on) ([0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]*)/', $page2[ 'body' ], $matches2 ) && $matches1[2] == $matches2[2] ) {
475
  echo '<p>' . sprintf( __( 'Page 1: %s', 'wp-super-cache' ), $matches1[ 2 ] ) . '</p>';
@@ -479,14 +597,19 @@ RewriteCond %{HTTP_user_agent} !^(<?php echo addcslashes( implode( '|', $wp_cach
479
  echo '<p><strong>' . __( 'The pages do not match! Timestamps differ or were not found!', 'wp-super-cache' ) . '</strong></p>';
480
  }
481
  }
482
- echo '<form name="cache_tester" action="#test" method="post">';
483
  echo '<input type="hidden" name="action" value="test" />';
 
 
484
  echo '<div class="submit"><input type="submit" name="test" value="' . __( 'Test Cache', 'wp-super-cache' ) . '" /></div>';
485
  wp_nonce_field('wp-cache');
486
  echo '</form>';
487
-
 
 
 
 
488
  echo '<a name="preload"></a>';
489
- echo "<h3>" . __( 'Preload Cache', 'wp-super-cache' ) . "</h3>";
490
  if ( $super_cache_enabled == true && false == defined( 'DISABLESUPERCACHEPRELOADING' ) ) {
491
  global $wp_cache_preload_interval, $wp_cache_preload_on, $wp_cache_preload_email_me, $wp_cache_preload_email_volume, $wp_cache_preload_posts, $wpdb;
492
  $count = $wpdb->get_var( "SELECT count(*) FROM {$wpdb->posts} WHERE post_status = 'publish'" );
@@ -495,7 +618,7 @@ RewriteCond %{HTTP_user_agent} !^(<?php echo addcslashes( implode( '|', $wp_cach
495
  } else {
496
  $min_refresh_interval = 30;
497
  }
498
- if ( $_POST[ 'action' ] == 'preload' && $valid_nonce ) {
499
  if ( $_POST[ 'posts_to_cache' ] == 'all' ) {
500
  $wp_cache_preload_posts = 'all';
501
  } else {
@@ -506,7 +629,7 @@ RewriteCond %{HTTP_user_agent} !^(<?php echo addcslashes( implode( '|', $wp_cach
506
  if ( isset( $_POST[ 'preload' ] ) && $_POST[ 'preload' ] == __( 'Cancel Cache Preload', 'wp-super-cache' ) ) {
507
  $next_preload = wp_next_scheduled( 'wp_cache_preload_hook' );
508
  if ( $next_preload ) {
509
- update_option( 'preload_cache_counter', 0 );
510
  wp_unschedule_event( $next_preload, 'wp_cache_preload_hook' );
511
  }
512
  echo "<p><strong>" . __( 'Scheduled preloading of cache cancelled. If a job is currently running it will not shutdown until the current 100 pages are complete.', 'wp-super-cache' ) . "</strong></p>";
@@ -516,7 +639,7 @@ RewriteCond %{HTTP_user_agent} !^(<?php echo addcslashes( implode( '|', $wp_cach
516
  if ( $wp_cache_preload_interval != $_POST[ 'custom_preload_interval' ] ) {
517
  $next_preload = wp_next_scheduled( 'wp_cache_full_preload_hook' );
518
  if ( $next_preload ) {
519
- update_option( 'preload_cache_counter', 0 );
520
  add_option( 'preload_cache_stop', 1 );
521
  wp_unschedule_event( $next_preload, 'wp_cache_full_preload_hook' );
522
  if ( $wp_cache_preload_interval == 0 ) {
@@ -547,11 +670,11 @@ RewriteCond %{HTTP_user_agent} !^(<?php echo addcslashes( implode( '|', $wp_cach
547
  }
548
  wp_cache_replace_line('^ *\$wp_cache_preload_on', "\$wp_cache_preload_on = $wp_cache_preload_on;", $wp_cache_config_file);
549
  if ( isset( $_POST[ 'preload' ] ) && $_POST[ 'preload' ] == __( 'Preload Cache Now', 'wp-super-cache' ) ) {
550
- update_option( 'preload_cache_counter', 0 );
551
  wp_schedule_single_event( time() + 10, 'wp_cache_preload_hook' );
552
  echo "<p><strong>" . __( 'Scheduled preloading of cache in 10 seconds.' ) . "</strong></p>";
553
  } elseif ( (int)$_POST[ 'custom_preload_interval' ] ) {
554
- update_option( 'preload_cache_counter', 0 );
555
  wp_schedule_single_event( time() + ( (int)$_POST[ 'custom_preload_interval' ] * 60 ), 'wp_cache_full_preload_hook' );
556
  echo "<p><strong>" . sprintf( __( 'Scheduled preloading of cache in %d minutes', 'wp-super-cache' ), (int)$_POST[ 'custom_preload_interval' ] ) . "</strong></p>";
557
  }
@@ -559,8 +682,8 @@ RewriteCond %{HTTP_user_agent} !^(<?php echo addcslashes( implode( '|', $wp_cach
559
  }
560
  echo '<p>' . __( 'This will cache every published post and page on your site. It will create supercache static files so unknown visitors (including bots) will hit a cached page. This will probably help your Google ranking as they are using speed as a metric when judging websites now.', 'wp-super-cache' ) . '</p>';
561
  echo '<p>' . __( 'Preloading creates lots of files however. Caching is done from the newest post to the oldest so please consider only caching the newest if you have lots (10,000+) of posts. This is especially important on shared hosting.', 'wp-super-cache' ) . '</p>';
562
- echo '<p>' . __( 'In &#8217;Preload Mode&#8217; regular garbage collection will only clean out old half-on files for known users, not the preloaded supercache files. This is a recommended setting when the cache is preloaded.', 'wp-super-cache' ) . '</p>';
563
- echo '<form name="cache_filler" action="#preload" method="POST">';
564
  echo '<input type="hidden" name="action" value="preload" />';
565
  echo '<input type="hidden" name="page" value="wpsupercache" />';
566
  echo '<p>' . sprintf( __( 'Refresh preloaded cache files every %s minutes. (0 to disable, minimum %d minutes.)', 'wp-super-cache' ), "<input type='text' size=4 name='custom_preload_interval' value='" . (int)$wp_cache_preload_interval . "' />", $min_refresh_interval ) . '</p>';
@@ -596,7 +719,7 @@ RewriteCond %{HTTP_user_agent} !^(<?php echo addcslashes( implode( '|', $wp_cach
596
 
597
  echo '<input type="checkbox" name="preload_on" value="1" ';
598
  echo $wp_cache_preload_on == 1 ? 'checked=1' : '';
599
- echo ' /> ' . __( 'Preload mode (garbage collection only on half-on cache files. Recommended.)', 'wp-super-cache' ) . '<br />';
600
  echo '<input type="checkbox" name="preload_email_me" value="1" ';
601
  echo $wp_cache_preload_email_me == 1 ? 'checked=1' : '';
602
  echo ' /> ' . __( 'Send me status emails when files are refreshed.', 'wp-super-cache' ) . '<br />';
@@ -617,8 +740,11 @@ RewriteCond %{HTTP_user_agent} !^(<?php echo addcslashes( implode( '|', $wp_cach
617
  next_preload_message( 'wp_cache_preload_hook', 'Refresh of cache in %d hours %d minutes and %d seconds.', 60 );
618
  next_preload_message( 'wp_cache_full_preload_hook', 'Full refresh of cache in %d hours %d minutes and %d seconds.' );
619
 
620
- if ( $preload_counter = get_option( 'preload_cache_counter' ) ) {
621
- echo '<p><strong>' . sprintf( __( 'Currently caching from post %d to %d.', 'wp-super-cache' ), $preload_counter, ( $preload_counter + 100 ) ) . '</strong></p>';
 
 
 
622
  $currently_preloading = true;
623
  }
624
  echo '<div class="submit"><input type="submit" name="preload" value="' . __( 'Update Settings', 'wp-super-cache' ) . '" />&nbsp;<input type="submit" name="preload" value="' . __( 'Preload Cache Now', 'wp-super-cache' ) . '" />';
@@ -629,53 +755,138 @@ RewriteCond %{HTTP_user_agent} !^(<?php echo addcslashes( implode( '|', $wp_cach
629
  wp_nonce_field('wp-cache');
630
  echo '</form>';
631
  } else {
632
- echo '<p>' . __( 'Preloading of cache disabled. Please enable supercaching or talk to your host administrator.', 'wp-super-cache' ) . '</p>';
633
- }
634
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
635
 
636
- if( $super_cache_enabled && function_exists( 'apache_get_modules' ) ) {
637
- $mods = apache_get_modules();
638
- $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' ) );
639
- foreach( $required_modules as $req => $desc ) {
640
- if( !in_array( $req, $mods ) ) {
641
- $missing_mods[ $req ] = $desc;
642
- }
643
- }
644
- if( isset( $missing_mods) && is_array( $missing_mods ) ) {
645
- echo "<h3>" . __( 'Missing Apache Modules', 'wp-super-cache' ) . "</h3>";
646
- 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>";
647
- echo "<ul>";
648
- foreach( $missing_mods as $req => $desc ) {
649
- echo "<li> $req - $desc</li>";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
650
  }
651
- echo "</ul>";
652
- }
 
653
  }
 
654
  ?>
655
  </fieldset>
656
- </td><td valign='top'>
657
  <div style='background: #ffc; border: 1px solid #333; margin: 2px; padding: 5px'>
658
  <h3 align='center'><?php _e( 'Make WordPress Faster', 'wp-super-cache' ); ?></h3>
659
- <?php if( $wp_cache_hide_donation != 1 ) { ?>
660
- <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>
661
- <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>
662
- <p><?php _e( 'Thanks in advance!', 'wp-super-cache' ); ?><br />Donncha<br />
663
- <small>* <?php _e( 'Ok, it won&#8217;t go any faster but you&#8217;ll make this plugin author very happy!', 'wp-super-cache' ); ?></small></p>
664
- <div align='center'>
665
- <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
666
- <input type="hidden" name="cmd" value="_s-xclick"/>
667
- <input type="hidden" name="hosted_button_id" value="3244504"/>
668
- <input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_donate_SM.gif" border="0" name="submit" alt=""/>
669
- <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"/><br />
670
- </form>
671
- <p><?php _e( 'Don&#8217;t show me this again.', 'wp-super-cache' ); ?> <form action="#top" method="post"><input type='hidden' name='wp_cache_hide_donation' value='1' /><input type='submit' value='<?php _e( 'Hide', 'wp-super-cache' ); ?>' /><?php wp_nonce_field('wp-cache'); ?></form></p>
672
- </div>
673
- <?php } else { ?>
674
  <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>
675
- <p><?php printf( __( 'He blogs at %1$s and posts photos at %2$s. He would really appreciate a <a href="%3$s">donation</a> to encourage development of this plugin.<br />Even a penny will help.', 'wp-super-cache' ), '<a href="http://ocaoimh.ie/?r=supercache">Holy Shmoly</a>', '<a href="http://inphotos.org/?r=supercache">In Photos.org</a>', 'http://ocaoimh.ie/gad' ); ?></p>
676
  <p><?php printf( __( 'Please say hi to him on %s too!', 'wp-super-cache' ), '<a href="http://twitter.com/donncha/">Twitter</a>' ); ?></p>
677
  <?php
678
- }
679
  if ( isset( $wp_supercache_cache_list ) && $wp_supercache_cache_list ) {
680
  $start_date = get_option( 'wpsupercache_start' );
681
  if ( !$start_date ) {
@@ -687,7 +898,7 @@ RewriteCond %{HTTP_user_agent} !^(<?php echo addcslashes( implode( '|', $wp_cach
687
  <?php
688
  foreach( array_reverse( (array)get_option( 'supercache_last_cached' ) ) as $url ) {
689
  $since = time() - strtotime( $url[ 'date' ] );
690
- echo "<li><a title='" . sprintf( __( 'Cached %s seconds ago', 'wp-super-cache' ), $since ) . "' href='" . site_url( $url[ 'url' ] ) . "'>{$url[ 'url' ]}</a></li>\n";
691
  }
692
  ?></ol>
693
  <small><?php _e( '(may not always be accurate on busy sites)', 'wp-super-cache' ); ?></small>
@@ -701,32 +912,16 @@ RewriteCond %{HTTP_user_agent} !^(<?php echo addcslashes( implode( '|', $wp_cach
701
  }
702
  ?>
703
  </div>
704
-
705
  </td></table>
706
- <?php
707
-
708
- wp_cache_files();
709
-
710
- wsc_mod_rewrite();
711
-
712
- wp_cache_edit_max_time();
713
 
714
- echo '<a name="files"></a><fieldset class="options"><h3>' . __( 'Accepted Filenames &amp; Rejected URIs', 'wp-super-cache' ) . '</h3>';
715
- wp_cache_edit_rejected_pages();
716
- echo "\n";
717
- wp_cache_edit_rejected();
718
- echo "\n";
719
- wp_cache_edit_accepted();
720
- echo '</fieldset>';
721
-
722
- wp_cache_edit_rejected_ua();
723
-
724
- wp_cache_debug_settings();
725
-
726
- wp_lock_down();
727
 
728
- wp_cache_restore();
 
729
 
 
 
 
730
  ob_start();
731
  if( defined( 'WP_CACHE' ) ) {
732
  if( function_exists( 'do_cacheaction' ) ) {
@@ -736,45 +931,60 @@ RewriteCond %{HTTP_user_agent} !^(<?php echo addcslashes( implode( '|', $wp_cach
736
  $out = ob_get_contents();
737
  ob_end_clean();
738
  if( SUBMITDISABLED == ' ' && $out != '' ) {
739
- echo '<fieldset class="options"><h3>' . __( 'Cache Plugins', 'wp-super-cache' ) . '</h3>';
 
740
  echo $out;
741
- echo '</fieldset>';
742
  }
743
 
744
- echo "</div>\n";
745
  }
746
 
747
- function wsc_mod_rewrite() {
748
- global $cache_enabled, $super_cache_enabled, $cache_compression, $cache_compression_changed, $valid_nonce, $cache_path;
749
- if( $super_cache_enabled == false && $cache_enabled == true ) {
750
- ?><h3><?php _e( 'Super Cache Compression', 'wp-super-cache' ); ?></h3>
751
- <p><?php _e( 'Compression is enabled by default when in <em>HALF ON</em> mode.', 'wp-super-cache' ); ?></p>
752
- <?php
753
- return;
754
- } elseif ( $super_cache_enabled == false ) {
755
- return;
756
  }
757
- if( false == defined( 'WPSC_DISABLE_COMPRESSION' ) ) {
758
- ?>
759
- <a name='rewrite'></a>
760
- <fieldset class="options">
761
- <h3><?php _e( 'Super Cache Compression', 'wp-super-cache' ); ?></h3>
762
- <form name="wp_manager" action="#rewrite" method="post">
763
- <label><input type="radio" name="cache_compression" value="1" <?php if( $cache_compression ) { echo "checked=checked"; } ?>> <?php _e( 'Enabled', 'wp-super-cache' ); ?></label>
764
- <label><input type="radio" name="cache_compression" value="0" <?php if( !$cache_compression ) { echo "checked=checked"; } ?>> <?php _e( 'Disabled', 'wp-super-cache' ); ?></label>
765
- <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>
766
- <?php
767
- if( isset( $cache_compression_changed ) && isset( $_POST[ 'cache_compression' ] ) && !$cache_compression ) {
768
- ?><p><strong><?php _e( 'Super Cache compression is now disabled.', 'wp-super-cache' ); ?></strong></p> <?php
769
- } elseif( isset( $cache_compression_changed ) && isset( $_POST[ 'cache_compression' ] ) && $cache_compression ) {
770
- ?><p><strong><?php _e( 'Super Cache compression is now enabled.', 'wps-uper-cache' ); ?></strong></p><?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
771
  }
772
- echo '<div class="submit"><input ' . SUBMITDISABLED . 'type="submit" value="' . __( 'Update Compression', 'wp-super-cache' ) . ' &raquo;" /></div>';
773
- wp_nonce_field('wp-cache');
774
- echo "</form>\n";
775
- ?></fieldset>
776
- <?php } ?>
777
 
 
 
 
778
  <a name="modrewrite"></a><fieldset class="options">
779
  <h3><?php _e( 'Mod Rewrite Rules', 'wp-super-cache' ); ?></h3><?php
780
 
@@ -817,7 +1027,7 @@ function wsc_mod_rewrite() {
817
  echo "<h4>" . __( 'Mod Rewrite rules must be updated!', 'wp-super-cache' ) . "</h4>";
818
  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";
819
  }
820
- echo "<p><pre>" . wp_specialchars( $rules ) . "</pre></p>\n</div>";
821
  } else {
822
  ?>
823
  <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 ); ?></p>
@@ -829,9 +1039,9 @@ function wsc_mod_rewrite() {
829
  <a href="javascript:toggleLayer('rewriterules');" class="button"><?php _e( 'View Mod_Rewrite Rules', 'wp-super-cache' ); ?></a>
830
  <?php wpsc_update_htaccess_form(); ?>
831
  <div id='rewriterules' style='display: none;'>
832
- <?php echo "<p><pre># BEGIN WPSuperCache\n" . wp_specialchars( $rules ) . "# END WPSuperCache</pre></p>\n";
833
  echo "<p>" . sprintf( __( 'Rules must be added to %s too:', 'wp-super-cache' ), WP_CONTENT_DIR . "/cache/.htaccess" ) . "</p>";
834
- echo "<pre># BEGIN supercache\n" . wp_specialchars( $gziprules ) . "# END supercache</pre></p>"; ?>
835
  </div>
836
  <?php
837
  }
@@ -863,6 +1073,10 @@ if( defined( 'WPLOCKDOWN' ) && constant( 'WPLOCKDOWN' ) )
863
 
864
  function wp_lock_down() {
865
  global $wpdb, $cache_path, $wp_cache_config_file, $valid_nonce, $cached_direct_pages, $cache_enabled, $super_cache_enabled;
 
 
 
 
866
 
867
  if(isset($_POST['wp_lock_down']) && $valid_nonce) {
868
  $wp_lock_down = $_POST['wp_lock_down'] == '1' ? '1' : '0';
@@ -907,7 +1121,7 @@ function wp_lock_down() {
907
  <h3><?php _e( 'Directly Cached Files', 'wp-super-cache' ); ?></h3><?php
908
 
909
  $out = '';
910
- if( $valid_nonce && is_array( $_POST[ 'direct_pages' ] ) && !empty( $_POST[ 'direct_pages' ] ) ) {
911
  $expiredfiles = array_diff( $cached_direct_pages, $_POST[ 'direct_pages' ] );
912
  unset( $cached_direct_pages );
913
  foreach( $_POST[ 'direct_pages' ] as $page ) {
@@ -921,7 +1135,7 @@ function wp_lock_down() {
921
  $out = "'', ";
922
  }
923
  }
924
- if( $valid_nonce && $_POST[ 'new_direct_page' ] && '' != $_POST[ 'new_direct_page' ] ) {
925
  $page = str_replace( get_option( 'siteurl' ), '', $_POST[ 'new_direct_page' ] );
926
  if( substr( $page, 0, 1 ) != '/' )
927
  $page = '/' . $page;
@@ -952,7 +1166,7 @@ function wp_lock_down() {
952
  }
953
  }
954
 
955
- if( $valid_nonce && $_POST[ 'deletepage' ] ) {
956
  $page = preg_replace('/[ <>\'\"\r\n\t\(\)]/', '', str_replace( '..', '', $_POST['deletepage']) );
957
  $pagefile = ABSPATH . $page . 'index.html';
958
  $firstfolder = explode( '/', $page );
@@ -1043,8 +1257,8 @@ function wp_cache_edit_max_time () {
1043
  echo '<form name="wp_edit_max_time" action="#expirytime" method="post">';
1044
  echo '<label for="wp_max_time">' . __( 'Expire time:', 'wp-super-cache' ) . '</label> ';
1045
  echo "<input type=\"text\" size=6 name=\"wp_max_time\" value=\"$cache_max_time\" /> " . __( "seconds", 'wp-super-cache' );
1046
- 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.', 'wp-super-cache' ) . "</p>";
1047
- 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>";
1048
  echo "<p>" . __( 'Set the expiry time to 0 seconds to disable garbage collection.', 'wp-super-cache' ) . "</p>";
1049
  echo '<div class="submit"><input type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Change Expiration', 'wp-super-cache' ) . ' &raquo;" /></div>';
1050
  wp_nonce_field('wp-cache');
@@ -1053,7 +1267,7 @@ function wp_cache_edit_max_time () {
1053
  }
1054
 
1055
  function wp_cache_sanitize_value($text, & $array) {
1056
- $text = wp_specialchars(strip_tags($text));
1057
  $array = preg_split("/[\s,]+/", chop($text));
1058
  $text = var_export($array, true);
1059
  $text = preg_replace('/[\s]+/', ' ', $text);
@@ -1154,7 +1368,7 @@ function wp_cache_edit_rejected() {
1154
  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";
1155
  echo '<textarea name="wp_rejected_uri" cols="40" rows="4" style="width: 50%; font-size: 12px;" class="code">';
1156
  foreach ($cache_rejected_uri as $file) {
1157
- echo wp_specialchars( $file ) . "\n";
1158
  }
1159
  echo '</textarea> ';
1160
  echo '<div class="submit"><input type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Save Strings', 'wp-super-cache' ) . ' &raquo;" /></div>';
@@ -1176,7 +1390,7 @@ function wp_cache_edit_accepted() {
1176
  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";
1177
  echo '<textarea name="wp_accepted_files" cols="40" rows="8" style="width: 50%; font-size: 12px;" class="code">';
1178
  foreach ($cache_acceptable_files as $file) {
1179
- echo wp_specialchars($file) . "\n";
1180
  }
1181
  echo '</textarea> ';
1182
  echo '<div class="submit"><input type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Save Files', 'wp-super-cache' ) . ' &raquo;" /></div>';
@@ -1193,7 +1407,7 @@ function wp_cache_debug_settings() {
1193
  if ( isset( $_POST[ 'wp_cache_debug' ] ) && $valid_nonce ) {
1194
  $wp_super_cache_debug = intval( $_POST[ 'wp_super_cache_debug' ] );
1195
  wp_cache_replace_line('^ *\$wp_super_cache_debug', "\$wp_super_cache_debug = '$wp_super_cache_debug';", $wp_cache_config_file);
1196
- $wp_cache_debug_email = wp_specialchars( $_POST[ 'wp_cache_debug_email' ] );
1197
  wp_cache_replace_line('^ *\$wp_cache_debug_email', "\$wp_cache_debug_email = '$wp_cache_debug_email';", $wp_cache_config_file);
1198
  $wp_cache_debug_to_file = intval( $_POST[ 'wp_cache_debug_to_file' ] );
1199
  if ( $wp_cache_debug_to_file && ( ( isset( $wp_cache_debug_log ) && $wp_cache_debug_log == '' ) || !isset( $wp_cache_debug_log ) ) ) {
@@ -1203,7 +1417,7 @@ function wp_cache_debug_settings() {
1203
  }
1204
  wp_cache_replace_line('^ *\$wp_cache_debug_to_file', "\$wp_cache_debug_to_file = '$wp_cache_debug_to_file';", $wp_cache_config_file);
1205
  wp_cache_replace_line('^ *\$wp_cache_debug_log', "\$wp_cache_debug_log = '$wp_cache_debug_log';", $wp_cache_config_file);
1206
- $wp_cache_debug_ip = wp_specialchars( $_POST[ 'wp_cache_debug_ip' ] );
1207
  wp_cache_replace_line('^ *\$wp_cache_debug_ip', "\$wp_cache_debug_ip = '$wp_cache_debug_ip';", $wp_cache_config_file);
1208
  $wp_cache_debug_level = (int)$_POST[ 'wp_cache_debug_level' ];
1209
  wp_cache_replace_line('^ *\$wp_cache_debug_level', "\$wp_cache_debug_level = '$wp_cache_debug_level';", $wp_cache_config_file);
@@ -1211,7 +1425,7 @@ function wp_cache_debug_settings() {
1211
  wp_cache_replace_line('^ *\$wp_super_cache_front_page_check', "\$wp_super_cache_front_page_check = '$wp_super_cache_front_page_check';", $wp_cache_config_file);
1212
  $wp_super_cache_front_page_clear = (int)$_POST[ 'wp_super_cache_front_page_clear' ];
1213
  wp_cache_replace_line('^ *\$wp_super_cache_front_page_clear', "\$wp_super_cache_front_page_clear = '$wp_super_cache_front_page_clear';", $wp_cache_config_file);
1214
- $wp_super_cache_front_page_text = wp_specialchars( $_POST[ 'wp_super_cache_front_page_text' ] );
1215
  wp_cache_replace_line('^ *\$wp_super_cache_front_page_text', "\$wp_super_cache_front_page_text = '$wp_super_cache_front_page_text';", $wp_cache_config_file);
1216
  $wp_super_cache_front_page_notification = (int)$_POST[ 'wp_super_cache_front_page_notification' ];
1217
  wp_cache_replace_line('^ *\$wp_super_cache_front_page_notification', "\$wp_super_cache_front_page_notification = '$wp_super_cache_front_page_notification';", $wp_cache_config_file);
@@ -1223,7 +1437,6 @@ function wp_cache_debug_settings() {
1223
 
1224
  echo '<a name="debug"></a>';
1225
  echo '<fieldset class="options">';
1226
- echo "<h3>" . __( 'Debug Settings', 'wp-super-cache' ) . "</h3>";
1227
  if ( ( isset( $wp_cache_debug_log ) && $wp_cache_debug_log != '' ) || ( isset( $wp_cache_debug_email ) && $wp_cache_debug_email != '' ) ) {
1228
  echo "<p>" . __( 'Currently logging to: ', 'wp-super-cache' );
1229
  if ( isset( $wp_cache_debug_log ) && $wp_cache_debug_log != '' ) {
@@ -1237,7 +1450,7 @@ function wp_cache_debug_settings() {
1237
  }
1238
  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>';
1239
  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>';
1240
- echo '<div style="clear:both"></div><form name="wp_cache_debug" action="#debug" method="post">';
1241
  echo "<input type='hidden' name='wp_cache_debug' value='1' /><br />";
1242
  echo "<table class='form-table'>";
1243
  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>";
@@ -1288,7 +1501,6 @@ function wp_cache_disable() {
1288
  if (wp_cache_replace_line('^ *\$cache_enabled', '$cache_enabled = false;', $wp_cache_config_file)) {
1289
  $cache_enabled = false;
1290
  }
1291
- wp_super_cache_disable();
1292
  }
1293
  function wp_super_cache_enable() {
1294
  global $supercachedir, $wp_cache_config_file, $super_cache_enabled;
@@ -1483,12 +1695,13 @@ function wp_cache_check_link() {
1483
  }
1484
 
1485
  if( false == $ret ) {
1486
- 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>";
1487
  echo "<p><ul><li>" . __( '1. If it already exists please delete the file first.', 'wp-super-cache' ) . "</li>";
1488
  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>";
1489
  echo "<li>" . sprintf( __( '3. Refresh this page to update <em>%s/advanced-cache.php</em>', 'wp-super-cache' ), WP_CONTENT_DIR ) . "</li></ul>";
1490
  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>";
1491
  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 );
 
1492
  return false;
1493
  }
1494
  return true;
@@ -1510,7 +1723,7 @@ function wp_cache_check_global_config() {
1510
  $line = 'define(\'WP_CACHE\', true);';
1511
  if (!is_writeable_ACLSafe($global) || !wp_cache_replace_line('define *\( *\'WP_CACHE\'', $line, $global) ) {
1512
  if ( defined( 'WP_CACHE' ) && constant( 'WP_CACHE' ) == false ) {
1513
- echo "<div style='border: 1px solid #333; background: #ffffaa; padding: 2px;'>" . __( '<h3>WP_CACHE constant in wp-config.php set to false</h3><p>The WP_CACHE constant is defined in your wp-config.php but must be set to true, not false for this plugin to work correctly.</p>', 'wp-super-cache' ) . "</div>";
1514
  } else {
1515
  echo "<p>" . __( "<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' ) . "</p>";;
1516
  echo "<p>" . sprintf( __( "Edit <code>%s</code> and add the following line:<br /> <code>define('WP_CACHE', true);</code><br />Otherwise, <strong>WP-Cache will not be executed</strong> by WordPress core. ", 'wp-super-cache' ), $global ) . "</p>";
@@ -1549,7 +1762,7 @@ function wp_cache_files() {
1549
  }
1550
 
1551
  $cache_stats = get_option( 'supercache_stats' );
1552
- if ( !is_array( $cache_stats ) || ( $valid_nonce && $_GET[ 'action' ] == 'regenerate_cache_stats' ) ) {
1553
  $list_files = false; // it doesn't list supercached files, and removing single pages is buggy
1554
  $count = 0;
1555
  $expired = 0;
@@ -1649,7 +1862,7 @@ function wp_cache_files() {
1649
  update_option( 'supercache_stats', $cache_stats );
1650
  } else {
1651
  echo "<p>" . __( 'Cache stats are not automatically generated. You must click the link below to regenerate the stats on this page.', 'wp-super-cache' ) . "</p>";
1652
- echo "<a href='" . wp_nonce_url( add_query_arg( array( 'page' => 'wpsupercache', 'action' => 'regenerate_cache_stats' ) ), 'wp-cache' ) . "'>" . __( 'Regenerate cache stats' ) . "</a>";
1653
  if ( is_array( $cache_stats ) ) {
1654
  echo "<p>" . sprintf( __( 'Cache stats last generated: %s minutes ago.', 'wp-super-cache' ), number_format( ( time() - $cache_stats[ 'generated' ] ) / 60 ) ) . "</p>";
1655
  }
@@ -1662,7 +1875,10 @@ function wp_cache_files() {
1662
  echo "<li>" . sprintf( __( '%s Expired Pages', 'wp-super-cache' ), $cache_stats[ 'wpcache' ][ 'expired' ] ) . "</li></ul>";
1663
  $divisor = $cache_compression == 1 ? 2 : 1;
1664
  if( $cache_enabled == true && $super_cache_enabled == true ) {
1665
- $fsize = $cache_stats[ 'supercache' ][ 'fsize' ] / 1024;
 
 
 
1666
  if( $fsize > 1024 ) {
1667
  $fsize = number_format( $fsize / 1024, 2 ) . "MB";
1668
  } elseif( $fsize != 0 ) {
@@ -1672,10 +1888,13 @@ function wp_cache_files() {
1672
  }
1673
  echo "<p><strong>" . __( 'WP-Super-Cache', 'wp-super-cache' ) . " ({$fsize})</strong></p>";
1674
  echo "<ul><li>" . sprintf( __( '%s Cached Pages', 'wp-super-cache' ), intval( $cache_stats[ 'supercache' ][ 'cached' ] / $divisor ) ) . "</li>";
1675
- $age = intval(($now - $sizes['ts'])/60);
 
 
 
1676
  echo "<li>" . sprintf( __( '%s Expired Pages', 'wp-super-cache' ), intval( $cache_stats[ 'supercache' ][ 'expired' ] / $divisor ) ) . "</li></ul>";
1677
  }
1678
- if ( $valid_nonce && $_GET[ 'listfiles' ] ) {
1679
  echo "<div style='padding: 10px; border: 1px solid #333; height: 400px; width: 70%; overflow: auto'>";
1680
  if ( is_array( $cached_list ) && !empty( $cached_list ) ) {
1681
  echo "<h4>" . __( 'Fresh WP-Cached Files', 'wp-super-cache' ) . "</h4>";
@@ -1745,6 +1964,8 @@ function wp_cache_files() {
1745
  echo "<p><a href='?page=wpsupercache#top'>" . __( 'Hide file list', 'wp-super-cache' ) . "</a></p>";
1746
  } elseif ( $cache_stats[ 'supercache' ][ 'cached' ] > 300 || $cache_stats[ 'supercache' ][ 'expired' ] > 300 || ( $cache_stats[ 'wpcache' ][ 'cached' ] / $divisor ) > 300 || ( $cache_stats[ 'wpcache' ][ 'expired' ] / $divisor) > 300 ) {
1747
  echo "<p><em>" . __( 'Too many cached files, no listing possible.', 'wp-super-cache' ) . "</em></p>";
 
 
1748
  }
1749
  $last_gc = get_option( "wpsupercache_gc_time" );
1750
  if ( $cache_max_time > 0 && $last_gc ) {
@@ -1777,10 +1998,10 @@ function wp_cache_delete_buttons() {
1777
  }
1778
 
1779
  function delete_cache_dashboard() {
1780
- if( function_exists( 'is_site_admin' ) && !is_site_admin() )
1781
  return false;
1782
 
1783
- if( function_exists('current_user_can') && !current_user_can('manage_options') )
1784
  return false;
1785
 
1786
  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>";
@@ -1809,7 +2030,7 @@ function wpsc_dirsize($directory, $sizes) {
1809
  $sizes[ 'expired_list' ][ $now - $filem ][ str_replace( $cache_path . 'supercache/' , '', str_replace( 'index.html', '', str_replace( 'index.html.gz', '', $directory ) ) ) ] = 1;
1810
  } else {
1811
  $sizes[ 'cached' ]+=1;
1812
- if ( $valid_nonce && $_GET[ 'listfiles' ] )
1813
  $sizes[ 'cached_list' ][ $now - $filem ][ str_replace( $cache_path . 'supercache/' , '', str_replace( 'index.html', '', str_replace( 'index.html.gz', '', $directory ) ) ) ] = 1;
1814
  }
1815
  if ( ! isset( $sizes[ 'fsize' ] ) )
@@ -1940,10 +2161,10 @@ function wp_cache_catch_404() {
1940
  add_action( 'template_redirect', 'wp_cache_catch_404' );
1941
 
1942
  function wp_cache_favorite_action( $actions ) {
1943
- if( function_exists( 'is_site_admin' ) && !is_site_admin() )
1944
  return $actions;
1945
 
1946
- if( function_exists('current_user_can') && !current_user_can('manage_options') )
1947
  return $actions;
1948
 
1949
  $actions[ wp_nonce_url( 'options-general.php?page=wpsupercache&wp_delete_cache=1', 'wp-cache' ) ] = array( __( 'Delete Cache', 'wp-super-cache' ), 'manage_options' );
@@ -2052,19 +2273,15 @@ function wpsc_update_htaccess_form( $short_form = true ) {
2052
  extract( wpsc_get_htaccess_info() );
2053
  if( !is_writeable_ACLSafe( $home_path . ".htaccess" ) ) {
2054
  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>";
2055
- echo "<p><pre># BEGIN WPSuperCache\n" . wp_specialchars( $rules ) . "# END WPSuperCache</pre></p></div>";
2056
  } else {
2057
  if ( $short_form == false ) {
2058
  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 ) . " ";
2059
- if( !function_exists( 'is_site_admin' ) ) {
2060
- _e( "You must edit the file yourself add the following rules.", 'wp-super-cache' );
2061
- } else {
2062
- _e( "You can edit the file yourself add the following rules.", 'wp-super-cache' );
2063
- }
2064
  echo __( " Make sure they appear before any existing WordPress rules. ", 'wp-super-cache' ) . "</p>";
2065
- echo "<pre># BEGIN WPSuperCache\n" . wp_specialchars( $rules ) . "# END WPSuperCache</pre></p>";
2066
  echo "<p>" . sprintf( __( 'Rules must be added to %s too:', 'wp-super-cache' ), WP_CONTENT_DIR . "/cache/.htaccess" ) . "</p>";
2067
- echo "<pre># BEGIN supercache\n" . wp_specialchars( $gziprules ) . "# END supercache</pre></p>";
2068
  }
2069
  if ( !isset( $wpmu_version ) || $wpmu_version == '' ) {
2070
  echo '<form name="updatehtaccess" action="#modrewrite" method="post">';
@@ -2077,7 +2294,7 @@ function wpsc_update_htaccess_form( $short_form = true ) {
2077
  }
2078
 
2079
  function wpsc_get_htaccess_info() {
2080
- global $wp_cache_mobile_prefixes, $wp_cache_mobile_browsers;
2081
  if ( isset( $_SERVER[ "PHP_DOCUMENT_ROOT" ] ) ) {
2082
  $document_root = $_SERVER[ "PHP_DOCUMENT_ROOT" ];
2083
  $apache_root = $_SERVER[ "PHP_DOCUMENT_ROOT" ];
@@ -2103,8 +2320,10 @@ function wpsc_get_htaccess_info() {
2103
  $condition_rules[] = "RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$";
2104
  $condition_rules[] = "RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\\\"]+ [NC]";
2105
  $condition_rules[] = "RewriteCond %{HTTP:Profile} !^[a-z0-9\\\"]+ [NC]";
2106
- $condition_rules[] = "RewriteCond %{HTTP_USER_AGENT} !^.*(" . addcslashes( implode( '|', $wp_cache_mobile_browsers ), ' ' ) . ").*";
2107
- $condition_rules[] = "RewriteCond %{HTTP_user_agent} !^(" . addcslashes( implode( '|', $wp_cache_mobile_prefixes ), ' ' ) . ").*";
 
 
2108
  $condition_rules = apply_filters( 'supercacherewriteconditions', $condition_rules );
2109
 
2110
  $rules = "<IfModule mod_rewrite.c>\n";
@@ -2135,10 +2354,10 @@ function wpsc_get_htaccess_info() {
2135
  function clear_post_supercache( $post_id ) {
2136
  $dir = get_current_url_supercache_dir( $post_id );
2137
  if ( file_exists( $dir . 'index.html' ) ) {
2138
- unlink( $dir . 'index.html' );
2139
  }
2140
  if ( file_exists( $dir . 'index.html.gz' ) ) {
2141
- unlink( $dir . 'index.html.gz' );
2142
  }
2143
  }
2144
 
@@ -2150,7 +2369,8 @@ function wp_cron_preload_cache() {
2150
  return true;
2151
  }
2152
 
2153
- $c = (int)get_option( 'preload_cache_counter' );
 
2154
  if ( $wp_cache_preload_posts == 'all' || $c <= $wp_cache_preload_posts ) {
2155
  $posts = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} WHERE post_status = 'publish' ORDER BY post_date DESC LIMIT $c, 100" );
2156
  } else {
@@ -2159,7 +2379,7 @@ function wp_cron_preload_cache() {
2159
  if ( !isset( $wp_cache_preload_email_volume ) )
2160
  $wp_cache_preload_email_volume = 'medium';
2161
 
2162
- update_option( 'preload_cache_counter', ($c + 100) );
2163
  if ( $posts ) {
2164
  if ( $wp_cache_preload_email_me && $c == 0 )
2165
  wp_mail( get_option( 'admin_email' ), sprintf( __( '[%1$s] Cache Preload Started', 'wp-super-cache' ), site_url(), '' ), '' );
@@ -2181,7 +2401,7 @@ function wp_cron_preload_cache() {
2181
  }
2182
  } else {
2183
  $msg = '';
2184
- update_option( 'preload_cache_counter', 0 );
2185
  if ( (int)$wp_cache_preload_interval && defined( 'DOING_CRON' ) ) {
2186
  if ( $wp_cache_preload_email_me )
2187
  $msg = sprintf( __( 'Scheduling next preload refresh in %d minutes.', 'wp-super-cache' ), (int)$wp_cache_preload_interval );
@@ -2220,4 +2440,24 @@ function next_preload_message( $hook, $text, $limit = 0 ) {
2220
  $currently_preloading = true;
2221
  }
2222
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2223
  ?>
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.9.4
7
  Author: Donncha O Caoimh
8
  Author URI: http://ocaoimh.ie/
9
  */
110
  }
111
  register_activation_hook( __FILE__, 'wpsupercache_activate' );
112
 
113
+ function wpsupercache_site_admin() {
114
+ if ( function_exists( 'is_super_admin' ) ) {
115
+ return is_super_admin();
116
+ } elseif ( function_exists( 'is_site_admin' ) ) {
117
+ return is_site_admin();
118
+ } else {
119
+ return true;
120
+ }
121
+ }
122
+
123
  function wp_cache_add_pages() {
124
+ global $wpmu_version;
125
+ if ( function_exists( 'is_multisite' ) && is_multisite() && wpsupercache_site_admin() ) {
126
+ add_submenu_page( 'ms-admin.php', 'WP Super Cache', 'WP Super Cache', 'manage_options', 'wpsupercache', 'wp_cache_manager' );
127
+ } elseif ( isset( $wpmu_version ) && wpsupercache_site_admin() ) {
128
+ add_submenu_page( 'wpmu-admin.php', 'WP Super Cache', 'WP Super Cache', 'manage_options', 'wpsupercache', 'wp_cache_manager' );
129
+ }
130
+ add_options_page('WP Super Cache', 'WP Super Cache', 'manage_options', 'wpsupercache', 'wp_cache_manager');
131
+ }
132
+ add_action('admin_menu', 'wp_cache_add_pages');
133
+
134
+ function wp_cache_manager_error_checks() {
135
+ global $wpmu_version, $wp_cache_debug, $wp_cache_cron_check, $cache_enabled, $super_cache_enabled, $wp_cache_config_file, $wp_cache_mobile_browsers, $wp_cache_mobile_prefixes, $wp_cache_mobile_browsers, $wp_cache_mobile_enabled, $wp_cache_mod_rewrite;
136
+
137
+ if ( 1 == ini_get( 'safe_mode' ) || "on" == strtolower( ini_get( 'safe_mode' ) ) ) {
138
+ echo '<div id="message" class="updated fade"><h3>' . __( 'Warning! PHP Safe Mode Enabled!', 'wp-super-cache' ) . '</h3><p>' .
139
+ __( 'You may experience problems running this plugin because SAFE MODE is enabled.', 'wp-super-cache' ) . ' ';
140
+
141
+
142
+ if( !ini_get( 'safe_mode_gid' ) ) {
143
+ _e( 'Your server is set up to check the owner of PHP scripts before allowing them to read and write files.', 'wp-super-cache' ) . " ";
144
+ printf( __( '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 );
145
+ } else {
146
+ _e( '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' );
147
  }
148
+ echo '</p></div>';
149
+ return false;
150
+ }
151
+
152
+ if ( '' == get_option( 'permalink_structure' ) ) {
153
+ echo '<div id="message" class="updated fade"><h3>' . __( 'Permlink Structure Error', 'wp-super-cache' ) . '</h3>';
154
+ echo "<p>" . __( 'A custom url or permalink structure is required for this plugin to work correctly. Please go to the <a href="options-permalink.php">Permalinks Options Page</a> to configure your permalinks.' ) . "</p>";
155
+ echo '</div>';
156
+ return false;
157
+ }
158
+
159
+ if( $wp_cache_debug || !$wp_cache_cron_check ) {
160
+ if( function_exists( "wp_remote_get" ) == false ) {
161
+ $hostname = str_replace( 'http://', '', str_replace( 'https://', '', get_option( 'siteurl' ) ) );
162
+ if( strpos( $hostname, '/' ) )
163
+ $hostname = substr( $hostname, 0, strpos( $hostname, '/' ) );
164
+ $ip = gethostbyname( $hostname );
165
+ if( substr( $ip, 0, 3 ) == '127' || substr( $ip, 0, 7 ) == '192.168' ) {
166
+ ?><div id="message" class="updated fade"><h3><?php printf( __( 'Warning! Your hostname "%s" resolves to %s', 'wp-super-cache' ), $hostname, $ip ); ?></h3>
167
+ <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>
168
+ <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>
169
+ </div>
170
+ <?php
171
+ return false;
172
+ } else {
173
+ wp_cache_replace_line('^ *\$wp_cache_cron_check', "\$wp_cache_cron_check = 1;", $wp_cache_config_file);
174
+ }
175
+ } else {
176
+ $cron_url = get_option( 'siteurl' ) . '/wp-cron.php?check=' . wp_hash('187425');
177
+ $cron = wp_remote_get($cron_url, array('timeout' => 0.01, 'blocking' => true));
178
+ if( is_array( $cron ) ) {
179
+ if( $cron[ 'response' ][ 'code' ] == '404' ) {
180
+ ?><div id="message" class="updated fade"><h3>Warning! wp-cron.php not found!</h3>
181
+ <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>
182
+ <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>
183
+ </div>
184
+ <?php
185
+ return false;
186
+ } else {
187
+ wp_cache_replace_line('^ *\$wp_cache_cron_check', "\$wp_cache_cron_check = 1;", $wp_cache_config_file);
188
+ }
189
+ }
190
+ }
191
+ }
192
+
193
+ if ( !wp_cache_check_link() ||
194
+ !wp_cache_verify_config_file() ||
195
+ !wp_cache_verify_cache_dir() ) {
196
+ echo '<p>' . __( "Cannot continue... fix previous problems and retry.", 'wp-super-cache' ) . '</p>';
197
+ return false;
198
+ }
199
+
200
+ if (!wp_cache_check_global_config()) {
201
+ return false;
202
+ }
203
+
204
+ if ( 1 == ini_get( 'zlib.output_compression' ) || "on" == strtolower( ini_get( 'zlib.output_compression' ) ) ) {
205
+ ?><div id="message" class="updated fade"><h3><?php _e( 'Zlib Output Compression Enabled!', 'wp-super-cache' ); ?></h3>
206
+ <p><?php _e( 'PHP is compressing the data sent to the visitors of your site. Disabling this is recommended as the plugin caches the compressed output once instead of compressing the same page over and over again. Also see #21 in the Troubleshooting section. See <a href="http://php.net/manual/en/zlib.configuration.php">this page</a> for instructions on modifying your php.ini.', 'wp-super-cache' ); ?></p></div><?php
207
+ }
208
+
209
+ if( $cache_enabled == true && $super_cache_enabled == true && $wp_cache_mod_rewrite && !got_mod_rewrite() ) {
210
+ ?><div id="message" class="updated fade"><h3><?php _e( 'Mod rewrite may not be installed!', 'wp-super-cache' ); ?></h3>
211
+ <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 legacy or PHP modes.', 'wp-super-cache' ); ?></p></div><?php
212
+ }
213
+
214
+ if( !is_writeable_ACLSafe( $wp_cache_config_file ) ) {
215
+ define( "SUBMITDISABLED", 'disabled style="color: #aaa" ' );
216
+ ?><div id="message" class="updated fade"><h3><?php _e( 'Read Only Mode. Configuration cannot be changed.', 'wp-super-cache' ); ?></h3>
217
+ <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 ); ?>
218
+ <?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>
219
+ <?php _e( 'Writeable:', 'wp-super-cache' ); ?> <code>chmod 666 <?php echo WP_CONTENT_DIR; ?>/wp-cache-config.php</code>
220
+ <?php _e( 'Readonly:', 'wp-super-cache' ); ?> <code>chmod 644 <?php echo WP_CONTENT_DIR; ?>/wp-cache-config.php</code></p>
221
+ </div><?php
222
  } else {
223
+ define( "SUBMITDISABLED", ' ' );
224
+ }
225
+
226
+ // Server could be running as the owner of the wp-content directory. Therefore, if it's
227
+ // writable, issue a warning only if the permissions aren't 755.
228
+ if( is_writeable_ACLSafe( WP_CONTENT_DIR . '/' ) ) {
229
+ $wp_content_stat = stat(WP_CONTENT_DIR . '/');
230
+ $wp_content_mode = ( $wp_content_stat[ 'mode' ] & 0777 );
231
+ if( $wp_content_mode != 0755 ) {
232
+ ?><div id="message" class="updated fade"><h3><?php printf( __( 'Warning! %s is writeable!', 'wp-super-cache' ), WP_CONTENT_DIR ); ?></h3>
233
+ <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></div><?php
234
+ }
235
+ }
236
+
237
+ if ( function_exists( "is_main_site" ) && true == is_main_site() || function_exists( 'is_main_blog' ) && true == is_main_blog() ) {
238
+ $home_path = trailingslashit( get_home_path() );
239
+ $scrules = implode( "\n", extract_from_markers( $home_path.'.htaccess', 'WPSuperCache' ) );
240
+ if ( $cache_enabled && $wp_cache_mod_rewrite && !$wp_cache_mobile_enabled && strpos( $scrules, addcslashes( implode( '|', $wp_cache_mobile_browsers ), ' ' ) ) ) {
241
+ echo '<div id="message" class="updated fade"><h3>' . __( 'Mobile rewrite rules detected', 'wp-super-cache' ) . "</h3>";
242
+ 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 "2.0\ MMP|240x320" 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></div>";
243
+ } elseif ( $wp_cache_mod_rewrite && $cache_enabled && $wp_cache_mobile_enabled && $scrules != '' && (
244
+ false === strpos( $scrules, addcslashes( implode( '|', $wp_cache_mobile_prefixes ), ' ' ) ) ||
245
+ false === strpos( $scrules, addcslashes( implode( '|', $wp_cache_mobile_browsers ), ' ' ) ) )
246
+ ) {
247
+ ?>
248
+ <div id="message" class="updated fade"><h3><?php _e( 'Rewrite rules must be updated', 'wp-super-cache' ); ?></h3>
249
+ <p><?php _e( 'The rewrite rules required by this plugin have changed or are missing. ', 'wp-super-cache' ); ?>
250
+ <?php _e( 'Mobile support requires extra rules in your .htaccess file, or you can set the plugin to legacy mode. Here are your options (in order of difficulty):', 'wp-super-cache' ); ?>
251
+ <ol><li> <?php _e( 'Set the plugin to legacy mode and enable mobile support.', 'wp-super-cache' ); ?></li>
252
+ <li> <?php _e( 'Scroll down the Advanced Settings page and click the <strong>Update Mod_Rewrite Rules</strong> button.', 'wp-super-cache' ); ?></li>
253
+ <li> <?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>
254
+ <li> <?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_logged_in|wp-postpass_).*$</code> add these lines: (do it twice, once for each section)', 'wp-super-cache' ), $home_path ); ?></p>
255
+ <div style='padding: 2px; margin: 2px; border: 1px solid #333; width:400px; overflow: scroll'><pre><?php echo "RewriteCond %{HTTP_user_agent} !^.*(" . addcslashes( implode( '|', $wp_cache_mobile_browsers ), ' ' ) . ").*\nRewriteCond %{HTTP_user_agent} !^(" . addcslashes( implode( '|', $wp_cache_mobile_prefixes ), ' ' ) . ").*"; ?></pre></div></li></ol></div><?php
256
+ }
257
+
258
+ if ( $cache_enabled && $super_cache_enabled && $wp_cache_mod_rewrite && $scrules == '' ) {
259
+ ?><div id="message" class="updated fade"><h3><?php _e( 'Rewrite rules must be updated', 'wp-super-cache' ); ?></h3>
260
+ <p><?php _e( 'The rewrite rules required by this plugin have changed or are missing. ', 'wp-super-cache' ); ?>
261
+ <?php _e( 'Scroll down the Advanced Settings page and click the <strong>Update Mod_Rewrite Rules</strong> button.', 'wp-super-cache' ); ?></p></div><?php
262
+ }
263
+ }
264
+
265
+ if ( $wp_cache_mod_rewrite && $super_cache_enabled && function_exists( 'apache_get_modules' ) ) {
266
+ $mods = apache_get_modules();
267
+ $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' ) );
268
+ foreach( $required_modules as $req => $desc ) {
269
+ if( !in_array( $req, $mods ) ) {
270
+ $missing_mods[ $req ] = $desc;
271
+ }
272
+ }
273
+ if( isset( $missing_mods) && is_array( $missing_mods ) ) {
274
+ ?><div id="message" class="updated fade"><h3><?php _e( 'Missing Apache Modules', 'wp-super-cache' ); ?></h3>
275
+ <p><?php __( 'The following Apache modules are missing. The plugin will work in legacy mode without them. In full Supercache mode, your visitors may see corrupted pages or out of date content however.', 'wp-super-cache' ); ?></p><?php
276
+ echo "<ul>";
277
+ foreach( $missing_mods as $req => $desc ) {
278
+ echo "<li> $req - $desc</li>";
279
+ }
280
+ echo "</ul>";
281
+ echo "</div>";
282
+ }
283
+ }
284
+
285
+ return true;
286
+
287
+ }
288
+ add_filter( 'wp_super_cache_error_checking', 'wp_cache_manager_error_checks' );
289
+
290
+ function wp_cache_manager_updates() {
291
+ global $wp_cache_mobile_enabled, $wp_supercache_cache_list, $wp_cache_config_file, $wp_cache_hello_world, $wp_cache_clear_on_post_edit, $cache_rebuild_files, $wp_cache_mutex_disabled, $wp_cache_not_logged_in, $cache_path, $wp_cache_object_cache, $_wp_using_ext_object_cache, $wp_cache_refresh_single_only, $cache_compression, $wp_cache_mod_rewrite;
292
+ $valid_nonce = isset($_REQUEST['_wpnonce']) ? wp_verify_nonce($_REQUEST['_wpnonce'], 'wp-cache') : false;
293
+ if ( $valid_nonce == false )
294
+ return false;
295
+
296
+ if( isset( $_POST[ 'action' ] ) && $_POST[ 'action' ] == 'easysetup' ) {
297
+ $_POST[ 'action' ] = 'scupdates';
298
+ if( isset( $_POST[ 'wp_cache_easy_on' ] ) && $_POST[ 'wp_cache_easy_on' ] == 1 ) {
299
+ $_POST[ 'wp_cache_mobile_enabled' ] = 1;
300
+ $_POST[ 'wp_cache_status' ] = 'all';
301
+ $_POST[ 'super_cache_enabled' ] = 2; // PHP
302
+ $_POST[ 'wp_cache_hello_world' ] = 1;
303
+ $_POST[ 'cache_rebuild_files' ] = 1;
304
+ $_POST[ 'cache_compression' ] = 1;
305
+ insert_with_markers( trailingslashit( get_home_path() ) . '.htaccess', 'WPSuperCache', array() );
306
+ } else {
307
+ unset( $_POST[ 'wp_cache_status' ] );
308
+ $_POST[ 'super_cache_enabled' ] = 0;
309
+ }
310
+ }
311
+
312
+ if( isset( $_POST[ 'action' ] ) && $_POST[ 'action' ] == 'scupdates' ) {
313
+ if( isset( $_POST[ 'wp_cache_mobile_enabled' ] ) ) {
314
+ $wp_cache_mobile_enabled = 1;
315
+ } else {
316
+ $wp_cache_mobile_enabled = 0;
317
+ }
318
+ wp_cache_replace_line('^ *\$wp_cache_mobile_enabled', "\$wp_cache_mobile_enabled = " . $wp_cache_mobile_enabled . ";", $wp_cache_config_file);
319
+
320
+ $wp_supercache_cache_list = $_POST[ 'wp_supercache_cache_list' ] == 1 ? 1 : 0;
321
+ wp_cache_replace_line('^ *\$wp_supercache_cache_list', "\$wp_supercache_cache_list = " . $wp_supercache_cache_list . ";", $wp_cache_config_file);
322
+
323
+ if ( isset( $_POST[ 'wp_cache_status' ] ) ) {
324
+ if ( $_POST[ 'wp_cache_status' ] == 'all' )
325
+ wp_cache_enable();
326
+
327
+ if ( isset( $_POST[ 'super_cache_enabled' ] ) ) {
328
+ if ( $_POST[ 'super_cache_enabled' ] == 0 ) {
329
+ wp_cache_enable();
330
+ wp_super_cache_disable();
331
+ }
332
+ if( $_POST[ 'super_cache_enabled' ] == 1 ) {
333
+ $wp_cache_mod_rewrite = 1; // we need this because supercached files can be served by PHP too.
334
+ } else {
335
+ $wp_cache_mod_rewrite = 0;
336
+ insert_with_markers( trailingslashit( get_home_path() ) . '.htaccess', 'WPSuperCache', array() );
337
+ }
338
+ wp_cache_replace_line('^ *\$wp_cache_mod_rewrite', '$wp_cache_mod_rewrite = ' . $wp_cache_mod_rewrite . ";", $wp_cache_config_file);
339
+ }
340
+ } else {
341
+ wp_cache_disable();
342
+ }
343
+
344
+ if( isset( $_POST[ 'wp_cache_hello_world' ] ) ) {
345
+ $wp_cache_hello_world = 1;
346
+ } else {
347
+ $wp_cache_hello_world = 0;
348
+ }
349
+ wp_cache_replace_line('^ *\$wp_cache_hello_world', '$wp_cache_hello_world = ' . $wp_cache_hello_world . ";", $wp_cache_config_file);
350
+
351
+ if( isset( $_POST[ 'wp_cache_clear_on_post_edit' ] ) ) {
352
+ $wp_cache_clear_on_post_edit = 1;
353
+ } else {
354
+ $wp_cache_clear_on_post_edit = 0;
355
+ }
356
+ wp_cache_replace_line('^ *\$wp_cache_clear_on_post_edit', "\$wp_cache_clear_on_post_edit = " . $wp_cache_clear_on_post_edit . ";", $wp_cache_config_file);
357
+
358
+ if( isset( $_POST[ 'cache_rebuild_files' ] ) ) {
359
+ $cache_rebuild_files = 1;
360
+ } else {
361
+ $cache_rebuild_files = 0;
362
+ }
363
+ wp_cache_replace_line('^ *\$cache_rebuild_files', "\$cache_rebuild_files = " . $cache_rebuild_files . ";", $wp_cache_config_file);
364
+
365
+ if( isset( $_POST[ 'wp_cache_mutex_disabled' ] ) ) {
366
+ $wp_cache_mutex_disabled = 0;
367
+ } else {
368
+ $wp_cache_mutex_disabled = 1;
369
+ }
370
+ if( defined( 'WPSC_DISABLE_LOCKING' ) ) {
371
+ $wp_cache_mutex_disabled = 1;
372
+ }
373
+ wp_cache_replace_line('^ *\$wp_cache_mutex_disabled', "\$wp_cache_mutex_disabled = " . $wp_cache_mutex_disabled . ";", $wp_cache_config_file);
374
+
375
+ if( isset( $_POST[ 'wp_cache_not_logged_in' ] ) ) {
376
+ if( $wp_cache_not_logged_in == 0 && function_exists( 'prune_super_cache' ) )
377
+ prune_super_cache ($cache_path, true);
378
+ $wp_cache_not_logged_in = 1;
379
+ } else {
380
+ $wp_cache_not_logged_in = 0;
381
+ }
382
+ wp_cache_replace_line('^ *\$wp_cache_not_logged_in', "\$wp_cache_not_logged_in = " . $wp_cache_not_logged_in . ";", $wp_cache_config_file);
383
+
384
+ if( $_wp_using_ext_object_cache && isset( $_POST[ 'wp_cache_object_cache' ] ) ) {
385
+ if( $wp_cache_object_cache == 0 && function_exists( 'prune_super_cache' ) )
386
+ prune_super_cache( $cache_path, true );
387
+ $wp_cache_object_cache = 1;
388
+ } else {
389
+ $wp_cache_object_cache = 0;
390
+ }
391
+ wp_cache_replace_line('^ *\$wp_cache_object_cache', "\$wp_cache_object_cache = " . $wp_cache_object_cache . ";", $wp_cache_config_file);
392
+
393
+ if( isset( $_POST[ 'wp_cache_refresh_single_only' ] ) ) {
394
+ $wp_cache_refresh_single_only = 1;
395
+ } else {
396
+ $wp_cache_refresh_single_only = 0;
397
+ }
398
+ wp_cache_replace_line('^ *\$wp_cache_refresh_single_only', "\$wp_cache_refresh_single_only = '" . $wp_cache_refresh_single_only . "';", $wp_cache_config_file);
399
+
400
+ if ( defined( 'WPSC_DISABLE_COMPRESSION' ) ) {
401
+ $cache_compression = 0;
402
+ wp_cache_replace_line('^ *\$cache_compression', "\$cache_compression = " . $cache_compression . ";", $wp_cache_config_file);
403
+ } else {
404
+ if ( isset( $_POST[ 'cache_compression' ] ) ) {
405
+ $new_cache_compression = 1;
406
+ } else {
407
+ $new_cache_compression = 0;
408
+ }
409
+ if ( 1 == ini_get( 'zlib.output_compression' ) || "on" == strtolower( ini_get( 'zlib.output_compression' ) ) ) {
410
+ echo '<div id="message" class="updated fade">' . __( "<strong>Warning!</strong> You attempted to enable compression but <code>zlib.output_compression</code> is enabled. See #21 in the Troubleshooting section of the readme file.", 'wp-super-cache' ) . '</div>';
411
+ } else {
412
+ if ( $new_cache_compression != $cache_compression ) {
413
+ $cache_compression = $new_cache_compression;
414
+ wp_cache_replace_line('^ *\$cache_compression', "\$cache_compression = " . $cache_compression . ";", $wp_cache_config_file);
415
+ if ( function_exists( 'prune_super_cache' ) )
416
+ prune_super_cache( $cache_path, true );
417
+ delete_option( 'super_cache_meta' );
418
+ }
419
+ }
420
+ }
421
  }
422
  }
423
+ if ( $_GET[ 'page' ] == 'wpsupercache' )
424
+ add_action( 'admin_init', 'wp_cache_manager_updates' );
425
 
426
  function wp_cache_manager() {
427
  global $wp_cache_config_file, $valid_nonce, $supercachedir, $cache_path, $cache_enabled, $cache_compression, $super_cache_enabled, $wp_cache_hello_world;
428
  global $wp_cache_clear_on_post_edit, $cache_rebuild_files, $wp_cache_mutex_disabled, $wp_cache_mobile_enabled, $wp_cache_mobile_browsers;
429
+ global $wp_cache_cron_check, $wp_cache_debug, $wp_cache_not_logged_in, $wp_supercache_cache_list;
430
  global $wp_super_cache_front_page_check, $wp_cache_object_cache, $_wp_using_ext_object_cache, $wp_cache_refresh_single_only, $wp_cache_mobile_prefixes;
431
+ global $wpmu_version, $cache_max_time, $wp_cache_mod_rewrite, $supercache_simple_setup;
432
+
433
+ // used by mod_rewrite rules and config file
434
+ if ( function_exists( "cfmobi_default_browsers" ) ) {
435
+ $wp_cache_mobile_browsers = cfmobi_default_browsers( "mobile" );
436
+ $wp_cache_mobile_browsers = array_merge( $wp_cache_mobile_browsers, cfmobi_default_browsers( "touch" ) );
437
+ } elseif ( function_exists( 'lite_detection_ua_contains' ) ) {
438
+ $wp_cache_mobile_browsers = explode( '|', lite_detection_ua_contains() );
439
+ } else {
440
+ $wp_cache_mobile_browsers = array( '2.0 MMP', '240x320', '400X240', 'AvantGo', 'BlackBerry', 'Blazer', 'Cellphone', 'Danger', 'DoCoMo', 'Elaine/3.0', 'EudoraWeb', 'Googlebot-Mobile', 'hiptop', 'IEMobile', 'KYOCERA/WX310K', 'LG/U990', 'MIDP-2.', 'MMEF20', 'MOT-V', 'NetFront', 'Newt', 'Nintendo Wii', 'Nitro', 'Nokia', 'Opera Mini', 'Palm', 'PlayStation Portable', 'portalmmm', 'Proxinet', 'ProxiNet', 'SHARP-TQ-GX10', 'SHG-i900', 'Small', 'SonyEricsson', 'Symbian OS', 'SymbianOS', 'TS21i-10', 'UP.Browser', 'UP.Link', 'webOS', 'Windows CE', 'WinWAP', 'YahooSeeker/M1A1-R2D2', 'iPhone', 'iPod', 'Android', 'BlackBerry9530', 'LG-TU915 Obigo', 'LGE VX', 'webOS', 'Nokia5800' );
441
+ }
442
+ if ( function_exists( "lite_detection_ua_prefixes" ) ) {
443
+ $wp_cache_mobile_prefixes = lite_detection_ua_prefixes();
444
+ } else {
445
+ $wp_cache_mobile_prefixes = array( 'w3c ', 'w3c-', 'acs-', 'alav', 'alca', 'amoi', 'audi', 'avan', 'benq', 'bird', 'blac', 'blaz', 'brew', 'cell', 'cldc', 'cmd-', 'dang', 'doco', 'eric', 'hipt', 'htc_', 'inno', 'ipaq', 'ipod', 'jigs', 'kddi', 'keji', 'leno', 'lg-c', 'lg-d', 'lg-g', 'lge-', 'lg/u', 'maui', 'maxo', 'midp', 'mits', 'mmef', 'mobi', 'mot-', 'moto', 'mwbp', 'nec-', 'newt', 'noki', 'palm', 'pana', 'pant', 'phil', 'play', 'port', 'prox', 'qwap', 'sage', 'sams', 'sany', 'sch-', 'sec-', 'send', 'seri', 'sgh-', 'shar', 'sie-', 'siem', 'smal', 'smar', 'sony', 'sph-', 'symb', 't-mo', 'teli', 'tim-', 'tosh', 'tsm-', 'upg1', 'upsi', 'vk-v', 'voda', 'wap-', 'wapa', 'wapi', 'wapp', 'wapr', 'webc', 'winw', 'winw', 'xda ', 'xda-' ); // from http://svn.wp-plugins.org/wordpress-mobile-pack/trunk/plugins/wpmp_switcher/lite_detection.php
446
+ }
447
+ $wp_cache_mobile_browsers = apply_filters( 'cached_mobile_browsers', $wp_cache_mobile_browsers ); // Allow mobile plugins access to modify the mobile UA list
448
+ $wp_cache_mobile_prefixes = apply_filters( 'cached_mobile_prefixes', $wp_cache_mobile_prefixes ); // Allow mobile plugins access to modify the mobile UA prefix list
449
+ $mobile_groups = apply_filters( 'cached_mobile_groups', array() ); // Group mobile user agents by capabilities. Lump them all together by default
450
+ // mobile_groups = array( 'apple' => array( 'ipod', 'iphone' ), 'nokia' => array( 'nokia5800', 'symbianos' ) );
451
 
452
+ if ( false == apply_filters( 'wp_super_cache_error_checking', true ) )
453
+ return false;
 
454
 
455
  $supercachedir = $cache_path . 'supercache/' . preg_replace('/:.*$/', '', $_SERVER["HTTP_HOST"]);
456
  if( get_option( 'gzipcompression' ) == 1 )
485
  });
486
  });
487
  </script>
488
+
489
+ <style type='text/css'>
490
+ #nav h2 {
491
+ border-bottom: 1px solid #ccc;
492
+ padding-bottom: 0;
493
+ }
494
+ </style>
495
  <?php
496
+ echo '<a name="top"></a>';
497
  echo '<div class="wrap">';
498
+ echo '<h2>' . __( 'WP Super Cache Settings', 'wp-super-cache' ) . '</h2>';
499
+
500
+ // set a default
501
+ if ( $cache_enabled == false && isset( $wp_cache_mod_rewrite ) == false ) {
502
+ $wp_cache_mod_rewrite = 0;
503
+ } elseif ( !isset( $wp_cache_mod_rewrite ) && $cache_enabled && $super_cache_enabled ) {
504
+ $wp_cache_mod_rewrite = 1;
 
 
 
505
  }
506
 
507
+ if ( !isset( $_GET[ 'tab' ] ) && ( $wp_cache_mod_rewrite || $super_cache_enabled == false ) ) {
508
+ $_GET[ 'tab' ] = 'settings';
509
+ echo '<div id="message" class="updated fade"><p>' . __( 'Notice: <em>Mod_rewrite or Legacy caching enabled</em>. Showing Advanced Settings Page by default.', 'wp-super-cache' ) . '</p></div>';
510
  }
511
+ wpsc_admin_tabs();
512
 
513
  if ( isset( $wp_super_cache_front_page_check ) && $wp_super_cache_front_page_check == 1 && !wp_next_scheduled( 'wp_cache_check_site_hook' ) ) {
514
  wp_schedule_single_event( time() + 360 , 'wp_cache_check_site_hook' );
520
  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>';
521
  }
522
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
523
  if ( substr( get_option( 'permalink_structure' ), -1 ) == '/' ) {
524
  wp_cache_replace_line('^ *\$wp_cache_slash_check', "\$wp_cache_slash_check = 1;", $wp_cache_config_file);
525
  } else {
526
  wp_cache_replace_line('^ *\$wp_cache_slash_check', "\$wp_cache_slash_check = 0;", $wp_cache_config_file);
527
  }
528
 
529
+ if( $wp_cache_mobile_enabled == 1 ) {
530
+ update_cached_mobile_ua_list( $wp_cache_mobile_browsers, $wp_cache_mobile_prefixes, $mobile_groups );
 
 
 
 
 
 
531
  }
532
 
533
+ ?> <table><td valign='top'><?php
534
+ switch( $_GET[ 'tab' ] ) {
535
+ case "tester":
536
+ if ( !$cache_enabled )
537
+ wp_die( __( 'Caching must be enabled to use this feature', 'wp-super-cache' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
538
  echo '<a name="test"></a>';
539
  echo "<h3>" . __( 'Cache Tester', 'wp-super-cache' ) . "</h3>";
540
  echo '<p>' . __( 'Test your cached website by clicking the test button below.', 'wp-super-cache' ) . '</p>';
541
+ if ( array_key_exists('action', $_POST) && $_POST[ 'action' ] == 'test' && $valid_nonce ) {
542
+ $url = trailingslashit( get_bloginfo( 'url' ) );
543
+ if ( isset( $_POST[ 'httponly' ] ) )
544
+ $url = str_replace( 'https://', 'http://', $url );
545
  // Prime the cache
546
  echo "<p>";
547
+ printf( __( 'Fetching %s to prime cache: ', 'wp-super-cache' ), $url );
548
+ $page = wp_remote_get( $url, array('timeout' => 60, 'blocking' => true ) );
549
  echo '<strong>' . __( 'OK', 'wp-super-cache' ) . '</strong>';
550
  echo "</p>";
551
  sleep( 1 );
552
  // Get the first copy
553
  echo "<p>";
554
+ printf( __( 'Fetching first copy of %s: ', 'wp-super-cache' ), $url );
555
+ $page = wp_remote_get( $url, array('timeout' => 60, 'blocking' => true ) );
556
  echo '<strong>' . __( 'OK', 'wp-super-cache' ) . '</strong>';
557
  echo "</p>";
558
  sleep( 1 );
559
  // Get the second copy
560
  echo "<p>";
561
+ printf( __( 'Fetching second copy of %s: ', 'wp-super-cache' ), $url );
562
+ $page2 = wp_remote_get( $url, array('timeout' => 60, 'blocking' => true ) );
563
  echo '<strong>' . __( 'OK', 'wp-super-cache' ) . '</strong>';
564
  echo "</p>";
565
 
566
+ if ( is_wp_error( $page ) || is_wp_error( $page2 ) || $page[ 'response' ][ 'code' ] != 200 || $page2[ 'response' ][ 'code' ] != 200 ) {
567
+ echo '<p><strong>' . __( 'One or more page requests failed:', 'wp-super-cache' ) . '</strong></p>';
568
+ $error = false;
569
+ if ( is_wp_error( $page ) ) {
570
+ $error = $page;
571
+ } elseif ( is_wp_error( $page2 ) ) {
572
+ $error = $page2;
573
+ }
574
+ if ( $error ) {
575
+ $errors = '';
576
+ $messages = '';
577
+ foreach ( $error->get_error_codes() as $code ) {
578
+ $severity = $error->get_error_data($code);
579
+ foreach ( $error->get_error_messages( $code ) as $err ) {
580
+ $errors .= ' ' . $err . "<br />\n";
581
+ }
582
+ }
583
+ if ( !empty($err) )
584
+ echo '<div class="updated fade">' . $errors . "</div>\n";
585
+ } else {
586
+ echo '<ul><li>' . sprintf( __( 'Page %d: %d (%s)', 'wp-super-cache' ), 1, $page[ 'response' ][ 'code' ], $page[ 'response' ][ 'message' ] ) . '</li>';
587
+ echo '<li>' . sprintf( __( 'Page %d: %d (%s)', 'wp-super-cache' ), 2, $page2[ 'response' ][ 'code' ], $page2[ 'response' ][ 'message' ] ) . '</li></ul>';
588
+ }
589
+ }
590
+
591
  if ( preg_match( '/(Cached page generated by WP-Super-Cache on) ([0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]*)/', $page[ 'body' ], $matches1 ) &&
592
  preg_match( '/(Cached page generated by WP-Super-Cache on) ([0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]*)/', $page2[ 'body' ], $matches2 ) && $matches1[2] == $matches2[2] ) {
593
  echo '<p>' . sprintf( __( 'Page 1: %s', 'wp-super-cache' ), $matches1[ 2 ] ) . '</p>';
597
  echo '<p><strong>' . __( 'The pages do not match! Timestamps differ or were not found!', 'wp-super-cache' ) . '</strong></p>';
598
  }
599
  }
600
+ echo '<form name="cache_tester" action="" method="post">';
601
  echo '<input type="hidden" name="action" value="test" />';
602
+ if ( 'on' == strtolower( $_SERVER['HTTPS' ] ) )
603
+ echo "<input type='checkbox' name='httponly' checked='checked' value='1' /> " . __( 'Send non-secure (non https) request for homepage', 'wp-super-cache' );
604
  echo '<div class="submit"><input type="submit" name="test" value="' . __( 'Test Cache', 'wp-super-cache' ) . '" /></div>';
605
  wp_nonce_field('wp-cache');
606
  echo '</form>';
607
+ wp_cache_files();
608
+ break;
609
+ case "preload":
610
+ if ( !$cache_enabled )
611
+ wp_die( __( 'Caching must be enabled to use this feature', 'wp-super-cache' ) );
612
  echo '<a name="preload"></a>';
 
613
  if ( $super_cache_enabled == true && false == defined( 'DISABLESUPERCACHEPRELOADING' ) ) {
614
  global $wp_cache_preload_interval, $wp_cache_preload_on, $wp_cache_preload_email_me, $wp_cache_preload_email_volume, $wp_cache_preload_posts, $wpdb;
615
  $count = $wpdb->get_var( "SELECT count(*) FROM {$wpdb->posts} WHERE post_status = 'publish'" );
618
  } else {
619
  $min_refresh_interval = 30;
620
  }
621
+ if ( array_key_exists('action', $_POST) && $_POST[ 'action' ] == 'preload' && $valid_nonce ) {
622
  if ( $_POST[ 'posts_to_cache' ] == 'all' ) {
623
  $wp_cache_preload_posts = 'all';
624
  } else {
629
  if ( isset( $_POST[ 'preload' ] ) && $_POST[ 'preload' ] == __( 'Cancel Cache Preload', 'wp-super-cache' ) ) {
630
  $next_preload = wp_next_scheduled( 'wp_cache_preload_hook' );
631
  if ( $next_preload ) {
632
+ update_option( 'preload_cache_counter', array( 'c' => 0, 't' => time() ) );
633
  wp_unschedule_event( $next_preload, 'wp_cache_preload_hook' );
634
  }
635
  echo "<p><strong>" . __( 'Scheduled preloading of cache cancelled. If a job is currently running it will not shutdown until the current 100 pages are complete.', 'wp-super-cache' ) . "</strong></p>";
639
  if ( $wp_cache_preload_interval != $_POST[ 'custom_preload_interval' ] ) {
640
  $next_preload = wp_next_scheduled( 'wp_cache_full_preload_hook' );
641
  if ( $next_preload ) {
642
+ update_option( 'preload_cache_counter', array( 'c' => 0, 't' => time() ) );
643
  add_option( 'preload_cache_stop', 1 );
644
  wp_unschedule_event( $next_preload, 'wp_cache_full_preload_hook' );
645
  if ( $wp_cache_preload_interval == 0 ) {
670
  }
671
  wp_cache_replace_line('^ *\$wp_cache_preload_on', "\$wp_cache_preload_on = $wp_cache_preload_on;", $wp_cache_config_file);
672
  if ( isset( $_POST[ 'preload' ] ) && $_POST[ 'preload' ] == __( 'Preload Cache Now', 'wp-super-cache' ) ) {
673
+ update_option( 'preload_cache_counter', array( 'c' => 0, 't' => time() ) );
674
  wp_schedule_single_event( time() + 10, 'wp_cache_preload_hook' );
675
  echo "<p><strong>" . __( 'Scheduled preloading of cache in 10 seconds.' ) . "</strong></p>";
676
  } elseif ( (int)$_POST[ 'custom_preload_interval' ] ) {
677
+ update_option( 'preload_cache_counter', array( 'c' => 0, 't' => time() ) );
678
  wp_schedule_single_event( time() + ( (int)$_POST[ 'custom_preload_interval' ] * 60 ), 'wp_cache_full_preload_hook' );
679
  echo "<p><strong>" . sprintf( __( 'Scheduled preloading of cache in %d minutes', 'wp-super-cache' ), (int)$_POST[ 'custom_preload_interval' ] ) . "</strong></p>";
680
  }
682
  }
683
  echo '<p>' . __( 'This will cache every published post and page on your site. It will create supercache static files so unknown visitors (including bots) will hit a cached page. This will probably help your Google ranking as they are using speed as a metric when judging websites now.', 'wp-super-cache' ) . '</p>';
684
  echo '<p>' . __( 'Preloading creates lots of files however. Caching is done from the newest post to the oldest so please consider only caching the newest if you have lots (10,000+) of posts. This is especially important on shared hosting.', 'wp-super-cache' ) . '</p>';
685
+ echo '<p>' . __( 'In &#8217;Preload Mode&#8217; regular garbage collection will only clean out old legacy files for known users, not the preloaded supercache files. This is a recommended setting when the cache is preloaded.', 'wp-super-cache' ) . '</p>';
686
+ echo '<form name="cache_filler" action="" method="POST">';
687
  echo '<input type="hidden" name="action" value="preload" />';
688
  echo '<input type="hidden" name="page" value="wpsupercache" />';
689
  echo '<p>' . sprintf( __( 'Refresh preloaded cache files every %s minutes. (0 to disable, minimum %d minutes.)', 'wp-super-cache' ), "<input type='text' size=4 name='custom_preload_interval' value='" . (int)$wp_cache_preload_interval . "' />", $min_refresh_interval ) . '</p>';
719
 
720
  echo '<input type="checkbox" name="preload_on" value="1" ';
721
  echo $wp_cache_preload_on == 1 ? 'checked=1' : '';
722
+ echo ' /> ' . __( 'Preload mode (garbage collection only on legacy cache files. Recommended.)', 'wp-super-cache' ) . '<br />';
723
  echo '<input type="checkbox" name="preload_email_me" value="1" ';
724
  echo $wp_cache_preload_email_me == 1 ? 'checked=1' : '';
725
  echo ' /> ' . __( 'Send me status emails when files are refreshed.', 'wp-super-cache' ) . '<br />';
740
  next_preload_message( 'wp_cache_preload_hook', 'Refresh of cache in %d hours %d minutes and %d seconds.', 60 );
741
  next_preload_message( 'wp_cache_full_preload_hook', 'Full refresh of cache in %d hours %d minutes and %d seconds.' );
742
 
743
+ $preload_counter = get_option( 'preload_cache_counter' );
744
+ if ( isset( $preload_counter[ 'first' ] ) ) // converted from int to array
745
+ update_option( 'preload_cache_counter', array( 'c' => $preload_counter[ 'c' ], 't' => time() ) );
746
+ if ( is_array( $preload_counter ) && $preload_counter[ 'c' ] > 0 ) {
747
+ echo '<p><strong>' . sprintf( __( 'Currently caching from post %d to %d.', 'wp-super-cache' ), $preload_counter[ 'c' ], ( $preload_counter[ 'c' ] + 100 ) ) . '</strong></p>';
748
  $currently_preloading = true;
749
  }
750
  echo '<div class="submit"><input type="submit" name="preload" value="' . __( 'Update Settings', 'wp-super-cache' ) . '" />&nbsp;<input type="submit" name="preload" value="' . __( 'Preload Cache Now', 'wp-super-cache' ) . '" />';
755
  wp_nonce_field('wp-cache');
756
  echo '</form>';
757
  } else {
758
+ echo '<p>' . __( 'Preloading of cache disabled. Please disable legacy page caching or talk to your host administrator.', 'wp-super-cache' ) . '</p>';
759
+ }
760
+ break;
761
+ case 'plugins':
762
+ wpsc_plugins_tab();
763
+ break;
764
+ case 'debug':
765
+ wp_cache_debug_settings();
766
+ break;
767
+ case 'settings':
768
+ echo '<form name="wp_manager" action="' . add_query_arg( array( 'page' => 'wpsupercache', 'tab' => 'settings' ) ) . '" method="post">';
769
+ wp_nonce_field('wp-cache');
770
+ echo '<input type="hidden" name="action" value="scupdates" />';
771
+ ?><table class="form-table">
772
+ <tr valign="top">
773
+ <th scope="row"><label for="wp_cache_status"><?php _e( 'Caching', 'wp-super-cache' ); ?></label></th>
774
+ <td>
775
+ <fieldset>
776
+ <legend class="hidden">Caching</legend>
777
+ <label><input type='checkbox' name='wp_cache_status' value='all' <?php if ( $cache_enabled == true ) { echo 'checked=checked'; } ?>> <?php _e( 'Cache hits to this website for quick access.', 'wp-super-cache' ); echo " <em>(" . __( "Recommended", "wp-super-cache" ) . ")</em>"; ?></label><br /><br />
778
+ <label><input type='radio' name='super_cache_enabled' <?php if( $super_cache_enabled ) echo "checked"; ?> value='1'> <?php printf( __( 'Use mod_rewrite to serve cache files.', 'wp-super-cache' ), 'http://wordpress.org/extend/plugins/wordpress-mobile-edition/' ); echo " <em>(" . __( "Recommended", "wp-super-cache" ) . ")</em>"; ?></label><br />
779
+ <label><input type='radio' name='super_cache_enabled' <?php if( $wp_cache_mod_rewrite == 0 ) echo "checked"; ?> value='2'> <?php printf( __( 'Use PHP to serve cache files.', 'wp-super-cache' ), 'http://wordpress.org/extend/plugins/wordpress-mobile-edition/' ); ?></label><br />
780
+ <label><input type='radio' name='super_cache_enabled' <?php if( $super_cache_enabled == false ) echo "checked"; ?> value='0'> <?php _e( 'Legacy page caching.', 'wp-super-cache' ); ?></label><br />
781
+ <em><?php _e( 'Mod_rewrite is fastest, PHP is almost as fast and easier to get working, while legacy caching is slower again, but more flexible and also easy to get working. New users should go with PHP caching.', 'wp-super-cache' ); ?></em><br />
782
+ </legend>
783
+ </fieldset>
784
+ </td>
785
+ </tr>
786
+ <tr valign="top">
787
+ <th scope="row"><label for="wp_cache_status"><?php _e( 'Miscellaneous', 'wp-super-cache' ); ?></label></th>
788
+ <td>
789
+ <fieldset>
790
+ <legend class="hidden">Miscellaneous</legend>
791
+ <?php if( false == defined( 'WPSC_DISABLE_COMPRESSION' ) ) { ?>
792
+ <label><input type='checkbox' name='cache_compression' <?php if( $cache_compression ) echo "checked"; ?> value='1'> <?php _e( 'Compress pages so they&#8217;re served more quickly to visitors.', 'wp-super-cache' ); echo " <em>(" . __( "Recommended", "wp-super-cache" ) . ")</em>"; ?></label><br />
793
+ <em><?php _e( 'Compression is disabled by default because some hosts have problems with compressed files. Switching it on and off clears the cache.', 'wp-super-cache' ); ?></em><br />
794
+ <?php } ?>
795
+ <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 <acronym title="Logged in users and those that comment">known users</acronym>.', 'wp-super-cache' ); echo " <em>(" . __( "Recommended", "wp-super-cache" ) . ")</em>"; ?></label><br />
796
+ <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.', 'wp-super-cache' ); echo " <em>(" . __( "Recommended", "wp-super-cache" ) . ")</em>"; ?></label><br />
797
+ <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><br />
798
+ </legend>
799
+ </fieldset>
800
+ </td>
801
+ </tr>
802
+ <tr valign="top">
803
+ <th scope="row"><label for="wp_cache_status"><?php _e( 'Advanced', 'wp-super-cache' ); ?></label></th>
804
+ <td>
805
+ <fieldset>
806
+ <legend class="hidden">Advanced</legend>
807
+ <label><input type='checkbox' name='wp_cache_mobile_enabled' <?php if( $wp_cache_mobile_enabled ) echo "checked"; ?> value='1'> <?php printf( __( 'Mobile device support.', 'wp-super-cache' ), 'http://wordpress.org/extend/plugins/wordpress-mobile-edition/' ); ?></label><br />
808
+ <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.', 'wp-super-cache' ); ?></label><br />
809
+ <label><input type='checkbox' name='wp_cache_refresh_single_only' <?php if( $wp_cache_refresh_single_only ) echo "checked"; ?> value='1'> <?php _e( 'Only refresh current page when comments made.', 'wp-super-cache' ); ?></label><br />
810
+ <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 on this page.', 'wp-super-cache' ); ?></label><br />
811
+ <?php if( false == defined( 'WPSC_DISABLE_LOCKING' ) ) { ?>
812
+ <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><br />
813
+ <?php } ?>
814
+ <?php if ( $_wp_using_ext_object_cache ) {
815
+ ?><label><input type='checkbox' name='wp_cache_object_cache' <?php if( $wp_cache_object_cache ) echo "checked"; ?> value='1'> <?php echo __( 'Use object cache to store cached files.', 'wp-super-cache' ) . ' ' . __( '(Experimental)', 'wp-super-cache' ); ?></label><?php
816
+ }?>
817
+ </legend>
818
+ </fieldset>
819
+ </td>
820
+ </tr>
821
+ </table>
822
+ <h3><?php _e( 'Note:', 'wp-super-cache' ); ?></h3>
823
+ <ol>
824
+ <li><?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 ); ?></li>
825
+ <li><?php printf( __( 'Please see the <a href="%1$s/wp-super-cache/readme.txt">readme.txt</a> for instructions on uninstalling this script. Look for the heading, "How to uninstall WP Super Cache".', 'wp-super-cache' ), WP_PLUGIN_URL ); ?></li><?php
826
+ echo "<li><em>" . sprintf( __( 'Need help? Check the <a href="%1$s">Super Cache readme file</a>. It includes installation documentation, a FAQ and Troubleshooting tips. The <a href="%2$s">support forum</a> is also available. Your question may already have been answered.', 'wp-super-cache' ), 'http://wordpress.org/extend/plugins/wp-super-cache/', 'http://wordpress.org/tags/wp-super-cache?forum_id=10' ) . "</em></li>";
827
+ echo "</ol>";
828
+
829
+ echo "<div class='submit'><input class='button-primary' type='submit' " . SUBMITDISABLED . " value='" . __( 'Update Status', 'wp-super-cache' ) . " &raquo;' /></div>";
830
+ wp_nonce_field('wp-cache');
831
+ ?> </form> <?php
832
+ wsc_mod_rewrite();
833
 
834
+ wp_cache_edit_max_time();
835
+
836
+ echo '<a name="files"></a><fieldset class="options"><h3>' . __( 'Accepted Filenames &amp; Rejected URIs', 'wp-super-cache' ) . '</h3>';
837
+ wp_cache_edit_rejected_pages();
838
+ echo "\n";
839
+ wp_cache_edit_rejected();
840
+ echo "\n";
841
+ wp_cache_edit_accepted();
842
+ echo '</fieldset>';
843
+
844
+ wp_cache_edit_rejected_ua();
845
+
846
+ wp_lock_down();
847
+
848
+ wp_cache_restore();
849
+
850
+ break;
851
+ case "easy":
852
+ default:
853
+ echo '<form name="wp_manager" action="" method="post">';
854
+ echo '<input type="hidden" name="action" value="easysetup" />';
855
+ wp_nonce_field('wp-cache');
856
+ ?><table class="form-table">
857
+ <tr valign="top">
858
+ <th scope="row"><label for="wp_cache_status"><?php _e( 'Caching', 'wp-super-cache' ); ?></label></th>
859
+ <td>
860
+ <fieldset>
861
+ <label><input type='radio' name='wp_cache_easy_on' value='1' <?php if ( $cache_enabled == true ) { echo 'checked=checked'; } ?>> <?php _e( 'Caching On', 'wp-super-cache' ); echo " <em>(" . __( "Recommended", "wp-super-cache" ) . ")</em>"; ?></label><br />
862
+ <label><input type='radio' name='wp_cache_easy_on' value='0' <?php if ( $cache_enabled == false ) { echo 'checked=checked'; } ?>> <?php _e( 'Caching Off', 'wp-super-cache' ); ?></label><br />
863
+ <em><?php _e( 'Note: enables PHP caching, compression, cache rebuild, Supercache footer message and mobile support', 'wp-super-cache' ); ?></em><br />
864
+ </legend>
865
+ </fieldset>
866
+ </td>
867
+ </tr>
868
+ </table>
869
+ <?php
870
+ if( $cache_enabled ) {
871
+ $scrules = trim( implode( "\n", extract_from_markers( trailingslashit( get_home_path() ) . '.htaccess', 'WPSuperCache' ) ) );
872
+ if ( $scrules != '' ) {
873
+ echo "<p><strong>" . __( 'Notice: Supercache mod_rewrite rules detected. Cached files will be served using those rules. Please see the Advanced settings page for more info.', 'wp-super-cache' ) . '</strong></p>';
874
+ }
875
  }
876
+ echo "<div class='submit'><input class='button-primary' type='submit' " . SUBMITDISABLED . " value='" . __( 'Update Status', 'wp-super-cache' ) . " &raquo;' /></div>";?>
877
+ </form><?php
878
+ break;
879
  }
880
+
881
  ?>
882
  </fieldset>
883
+ </td><td valign='top' style='width: 300px'>
884
  <div style='background: #ffc; border: 1px solid #333; margin: 2px; padding: 5px'>
885
  <h3 align='center'><?php _e( 'Make WordPress Faster', 'wp-super-cache' ); ?></h3>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
886
  <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>
887
+ <p><?php printf( __( 'He blogs at %1$s and posts photos at %2$s.', 'wp-super-cache' ), '<a href="http://ocaoimh.ie/?r=supercache">Holy Shmoly</a>', '<a href="http://inphotos.org/?r=supercache">In Photos.org</a>' ); ?></p>
888
  <p><?php printf( __( 'Please say hi to him on %s too!', 'wp-super-cache' ), '<a href="http://twitter.com/donncha/">Twitter</a>' ); ?></p>
889
  <?php
 
890
  if ( isset( $wp_supercache_cache_list ) && $wp_supercache_cache_list ) {
891
  $start_date = get_option( 'wpsupercache_start' );
892
  if ( !$start_date ) {
898
  <?php
899
  foreach( array_reverse( (array)get_option( 'supercache_last_cached' ) ) as $url ) {
900
  $since = time() - strtotime( $url[ 'date' ] );
901
+ echo "<li><a title='" . sprintf( __( 'Cached %s seconds ago', 'wp-super-cache' ), $since ) . "' href='" . site_url( $url[ 'url' ] ) . "'>" . substr( $url[ 'url' ], 0, 20 ) . "</a></li>\n";
902
  }
903
  ?></ol>
904
  <small><?php _e( '(may not always be accurate on busy sites)', 'wp-super-cache' ); ?></small>
912
  }
913
  ?>
914
  </div>
 
915
  </td></table>
 
 
 
 
 
 
 
916
 
917
+ <?php
 
 
 
 
 
 
 
 
 
 
 
 
918
 
919
+ echo "</div>\n";
920
+ }
921
 
922
+ function wpsc_plugins_tab() {
923
+ echo '<p>' . __( 'Cache plugins are PHP scripts that live in a plugins folder inside the wp-super-cache folder. They are loaded when Supercache loads, much sooner than regular WordPress plugins.', 'wp-super-cache' ) . '</p>';
924
+ echo '<p>' . __( 'This is strictly an advanced feature only and knowledge of both PHP and WordPress actions is required to create them.', 'wp-super-cache' ) . '</p>';
925
  ob_start();
926
  if( defined( 'WP_CACHE' ) ) {
927
  if( function_exists( 'do_cacheaction' ) ) {
931
  $out = ob_get_contents();
932
  ob_end_clean();
933
  if( SUBMITDISABLED == ' ' && $out != '' ) {
934
+ echo '<h3>' . __( 'Available Plugins', 'wp-super-cache' ) . '</h3>';
935
+ echo "<ol>";
936
  echo $out;
937
+ echo "</ol>";
938
  }
939
 
 
940
  }
941
 
942
+ function wpsc_admin_tabs( $current = 0 ) {
943
+ if ( $current == 0 ) {
944
+ if ( isset( $_GET[ 'tab' ] ) ) {
945
+ $current = $_GET[ 'tab' ];
946
+ } else {
947
+ $current = 'easy';
948
+ }
 
 
949
  }
950
+ $tabs = array( 'easy' => 'Easy', 'settings' => __( 'Advanced', 'wp-super-cache' ), 'tester' => __( 'Tester & Contents', 'wp-super-cache' ), 'preload' => __( 'Preload', 'wp-super-cache' ), 'plugins' => __( 'Plugins', 'wp-super-cache' ), 'debug' => __( 'Debug', 'wp-super-cache' ) );
951
+ $links = array();
952
+ foreach( $tabs as $tab => $name ) {
953
+ if ( $current == $tab ) {
954
+ $links[] = "<a class='nav-tab nav-tab-active' href='?page=wpsupercache&tab=$tab'>$name</a>";
955
+ } else {
956
+ $links[] = "<a class='nav-tab' href='?page=wpsupercache&tab=$tab'>$name</a>";
957
+ }
958
+ }
959
+ echo '<div id="nav"><h2 class="themes-php">';
960
+ echo implode( "", $links );
961
+ echo '</h2></div>';
962
+ }
963
+
964
+ function wsc_mod_rewrite() {
965
+ global $cache_enabled, $super_cache_enabled, $valid_nonce, $cache_path, $wp_cache_mod_rewrite, $wpmu_version;
966
+
967
+ if ( !$wp_cache_mod_rewrite )
968
+ return false;
969
+
970
+ if ( isset( $wpmu_version ) || function_exists( 'is_multisite' ) && is_multisite() ) {
971
+ if ( false == wpsupercache_site_admin() )
972
+ return false;
973
+ if ( function_exists( "is_main_site" ) && false == is_main_site() || function_exists( 'is_main_blog' ) && false == is_main_blog() ) {
974
+ global $current_site;
975
+ $protocol = ( 'on' == strtolower( $_SERVER['HTTPS' ] ) ) ? 'https://' : 'http://';
976
+ if ( isset( $wpmu_version ) ) {
977
+ echo '<div id="message" class="updated fade"><p>' . sprintf( __( 'Notice: WP Super Cache mod_rewrite rule checks disabled unless running on <a href="%s">the main site</a> of this network.', 'wp-super-cache' ), admin_url( "ms-admin.php?page=wpsupercache" ) ) . '</p></div>';
978
+ } else {
979
+ echo '<div id="message" class="updated fade"><p>' . sprintf( __( 'Notice: WP Super Cache mod_rewrite rule checks disabled unless running on <a href="%s">on the main site</a> of this network.', 'wp-super-cache' ), admin_url( "wpmu-admin.php?page=wpsupercache" ) ) . '</p></div>';
980
+ }
981
+ return false;
982
+ }
983
  }
 
 
 
 
 
984
 
985
+ if ( function_exists( "is_main_site" ) && false == is_main_site() || function_exists( 'is_main_blog' ) && false == is_main_blog() )
986
+ return true;
987
+ ?>
988
  <a name="modrewrite"></a><fieldset class="options">
989
  <h3><?php _e( 'Mod Rewrite Rules', 'wp-super-cache' ); ?></h3><?php
990
 
1027
  echo "<h4>" . __( 'Mod Rewrite rules must be updated!', 'wp-super-cache' ) . "</h4>";
1028
  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";
1029
  }
1030
+ echo "<p><pre>" . esc_html( $rules ) . "</pre></p>\n</div>";
1031
  } else {
1032
  ?>
1033
  <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 ); ?></p>
1039
  <a href="javascript:toggleLayer('rewriterules');" class="button"><?php _e( 'View Mod_Rewrite Rules', 'wp-super-cache' ); ?></a>
1040
  <?php wpsc_update_htaccess_form(); ?>
1041
  <div id='rewriterules' style='display: none;'>
1042
+ <?php echo "<p><pre># BEGIN WPSuperCache\n" . esc_html( $rules ) . "# END WPSuperCache</pre></p>\n";
1043
  echo "<p>" . sprintf( __( 'Rules must be added to %s too:', 'wp-super-cache' ), WP_CONTENT_DIR . "/cache/.htaccess" ) . "</p>";
1044
+ echo "<pre># BEGIN supercache\n" . esc_html( $gziprules ) . "# END supercache</pre></p>"; ?>
1045
  </div>
1046
  <?php
1047
  }
1073
 
1074
  function wp_lock_down() {
1075
  global $wpdb, $cache_path, $wp_cache_config_file, $valid_nonce, $cached_direct_pages, $cache_enabled, $super_cache_enabled;
1076
+ global $wp_super_cache_lock_down;
1077
+
1078
+ if ( !isset( $wp_super_cache_lock_down ) || ( isset( $wp_super_cache_lock_down ) && $wp_super_cache_lock_down != 1 ) )
1079
+ return false;
1080
 
1081
  if(isset($_POST['wp_lock_down']) && $valid_nonce) {
1082
  $wp_lock_down = $_POST['wp_lock_down'] == '1' ? '1' : '0';
1121
  <h3><?php _e( 'Directly Cached Files', 'wp-super-cache' ); ?></h3><?php
1122
 
1123
  $out = '';
1124
+ if( $valid_nonce && array_key_exists('direct_pages', $_POST) && is_array( $_POST[ 'direct_pages' ] ) && !empty( $_POST[ 'direct_pages' ] ) ) {
1125
  $expiredfiles = array_diff( $cached_direct_pages, $_POST[ 'direct_pages' ] );
1126
  unset( $cached_direct_pages );
1127
  foreach( $_POST[ 'direct_pages' ] as $page ) {
1135
  $out = "'', ";
1136
  }
1137
  }
1138
+ if( $valid_nonce && array_key_exists('new_direct_page', $_POST) && $_POST[ 'new_direct_page' ] && '' != $_POST[ 'new_direct_page' ] ) {
1139
  $page = str_replace( get_option( 'siteurl' ), '', $_POST[ 'new_direct_page' ] );
1140
  if( substr( $page, 0, 1 ) != '/' )
1141
  $page = '/' . $page;
1166
  }
1167
  }
1168
 
1169
+ if( $valid_nonce && array_key_exists('deletepage', $_POST) && $_POST[ 'deletepage' ] ) {
1170
  $page = preg_replace('/[ <>\'\"\r\n\t\(\)]/', '', str_replace( '..', '', $_POST['deletepage']) );
1171
  $pagefile = ABSPATH . $page . 'index.html';
1172
  $firstfolder = explode( '/', $page );
1257
  echo '<form name="wp_edit_max_time" action="#expirytime" method="post">';
1258
  echo '<label for="wp_max_time">' . __( 'Expire time:', 'wp-super-cache' ) . '</label> ';
1259
  echo "<input type=\"text\" size=6 name=\"wp_max_time\" value=\"$cache_max_time\" /> " . __( "seconds", 'wp-super-cache' );
1260
+ echo "<h4>" . __( 'Garbage Collection', 'wp-super-cache' ) . "</h4><p>" . __( 'If the 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.', 'wp-super-cache' ) . "</p>";
1261
+ 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. If you are using legacy caching aim to have less than 500 cached files if possible. You can have many times more cached files when using mod_rewrite or PHP caching.', 'wp-super-cache' ) . "</p>";
1262
  echo "<p>" . __( 'Set the expiry time to 0 seconds to disable garbage collection.', 'wp-super-cache' ) . "</p>";
1263
  echo '<div class="submit"><input type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Change Expiration', 'wp-super-cache' ) . ' &raquo;" /></div>';
1264
  wp_nonce_field('wp-cache');
1267
  }
1268
 
1269
  function wp_cache_sanitize_value($text, & $array) {
1270
+ $text = esc_html(strip_tags($text));
1271
  $array = preg_split("/[\s,]+/", chop($text));
1272
  $text = var_export($array, true);
1273
  $text = preg_replace('/[\s]+/', ' ', $text);
1368
  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";
1369
  echo '<textarea name="wp_rejected_uri" cols="40" rows="4" style="width: 50%; font-size: 12px;" class="code">';
1370
  foreach ($cache_rejected_uri as $file) {
1371
+ echo esc_html( $file ) . "\n";
1372
  }
1373
  echo '</textarea> ';
1374
  echo '<div class="submit"><input type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Save Strings', 'wp-super-cache' ) . ' &raquo;" /></div>';
1390
  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";
1391
  echo '<textarea name="wp_accepted_files" cols="40" rows="8" style="width: 50%; font-size: 12px;" class="code">';
1392
  foreach ($cache_acceptable_files as $file) {
1393
+ echo esc_html($file) . "\n";
1394
  }
1395
  echo '</textarea> ';
1396
  echo '<div class="submit"><input type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Save Files', 'wp-super-cache' ) . ' &raquo;" /></div>';
1407
  if ( isset( $_POST[ 'wp_cache_debug' ] ) && $valid_nonce ) {
1408
  $wp_super_cache_debug = intval( $_POST[ 'wp_super_cache_debug' ] );
1409
  wp_cache_replace_line('^ *\$wp_super_cache_debug', "\$wp_super_cache_debug = '$wp_super_cache_debug';", $wp_cache_config_file);
1410
+ $wp_cache_debug_email = esc_html( $_POST[ 'wp_cache_debug_email' ] );
1411
  wp_cache_replace_line('^ *\$wp_cache_debug_email', "\$wp_cache_debug_email = '$wp_cache_debug_email';", $wp_cache_config_file);
1412
  $wp_cache_debug_to_file = intval( $_POST[ 'wp_cache_debug_to_file' ] );
1413
  if ( $wp_cache_debug_to_file && ( ( isset( $wp_cache_debug_log ) && $wp_cache_debug_log == '' ) || !isset( $wp_cache_debug_log ) ) ) {
1417
  }
1418
  wp_cache_replace_line('^ *\$wp_cache_debug_to_file', "\$wp_cache_debug_to_file = '$wp_cache_debug_to_file';", $wp_cache_config_file);
1419
  wp_cache_replace_line('^ *\$wp_cache_debug_log', "\$wp_cache_debug_log = '$wp_cache_debug_log';", $wp_cache_config_file);
1420
+ $wp_cache_debug_ip = esc_html( $_POST[ 'wp_cache_debug_ip' ] );
1421
  wp_cache_replace_line('^ *\$wp_cache_debug_ip', "\$wp_cache_debug_ip = '$wp_cache_debug_ip';", $wp_cache_config_file);
1422
  $wp_cache_debug_level = (int)$_POST[ 'wp_cache_debug_level' ];
1423
  wp_cache_replace_line('^ *\$wp_cache_debug_level', "\$wp_cache_debug_level = '$wp_cache_debug_level';", $wp_cache_config_file);
1425
  wp_cache_replace_line('^ *\$wp_super_cache_front_page_check', "\$wp_super_cache_front_page_check = '$wp_super_cache_front_page_check';", $wp_cache_config_file);
1426
  $wp_super_cache_front_page_clear = (int)$_POST[ 'wp_super_cache_front_page_clear' ];
1427
  wp_cache_replace_line('^ *\$wp_super_cache_front_page_clear', "\$wp_super_cache_front_page_clear = '$wp_super_cache_front_page_clear';", $wp_cache_config_file);
1428
+ $wp_super_cache_front_page_text = esc_html( $_POST[ 'wp_super_cache_front_page_text' ] );
1429
  wp_cache_replace_line('^ *\$wp_super_cache_front_page_text', "\$wp_super_cache_front_page_text = '$wp_super_cache_front_page_text';", $wp_cache_config_file);
1430
  $wp_super_cache_front_page_notification = (int)$_POST[ 'wp_super_cache_front_page_notification' ];
1431
  wp_cache_replace_line('^ *\$wp_super_cache_front_page_notification', "\$wp_super_cache_front_page_notification = '$wp_super_cache_front_page_notification';", $wp_cache_config_file);
1437
 
1438
  echo '<a name="debug"></a>';
1439
  echo '<fieldset class="options">';
 
1440
  if ( ( isset( $wp_cache_debug_log ) && $wp_cache_debug_log != '' ) || ( isset( $wp_cache_debug_email ) && $wp_cache_debug_email != '' ) ) {
1441
  echo "<p>" . __( 'Currently logging to: ', 'wp-super-cache' );
1442
  if ( isset( $wp_cache_debug_log ) && $wp_cache_debug_log != '' ) {
1450
  }
1451
  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>';
1452
  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>';
1453
+ echo '<div style="clear:both"></div><form name="wp_cache_debug" action="" method="post">';
1454
  echo "<input type='hidden' name='wp_cache_debug' value='1' /><br />";
1455
  echo "<table class='form-table'>";
1456
  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>";
1501
  if (wp_cache_replace_line('^ *\$cache_enabled', '$cache_enabled = false;', $wp_cache_config_file)) {
1502
  $cache_enabled = false;
1503
  }
 
1504
  }
1505
  function wp_super_cache_enable() {
1506
  global $supercachedir, $wp_cache_config_file, $super_cache_enabled;
1695
  }
1696
 
1697
  if( false == $ret ) {
1698
+ echo '<div id="message" class="updated fade"><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>";
1699
  echo "<p><ul><li>" . __( '1. If it already exists please delete the file first.', 'wp-super-cache' ) . "</li>";
1700
  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>";
1701
  echo "<li>" . sprintf( __( '3. Refresh this page to update <em>%s/advanced-cache.php</em>', 'wp-super-cache' ), WP_CONTENT_DIR ) . "</li></ul>";
1702
  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>";
1703
  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 );
1704
+ echo "</div>";
1705
  return false;
1706
  }
1707
  return true;
1723
  $line = 'define(\'WP_CACHE\', true);';
1724
  if (!is_writeable_ACLSafe($global) || !wp_cache_replace_line('define *\( *\'WP_CACHE\'', $line, $global) ) {
1725
  if ( defined( 'WP_CACHE' ) && constant( 'WP_CACHE' ) == false ) {
1726
+ echo '<div id="message" class="updated fade">' . __( "<h3>WP_CACHE constant set to false</h3><p>The WP_CACHE constant is used by WordPress to load the code that serves cached pages. Unfortunately it is set to false. Please edit your wp-config.php and add or edit the following line above the final require_once command:<br /><br /><code>define('WP_CACHE', true);</code></p>", 'wp-super-cache' ) . "</div>";
1727
  } else {
1728
  echo "<p>" . __( "<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' ) . "</p>";;
1729
  echo "<p>" . sprintf( __( "Edit <code>%s</code> and add the following line:<br /> <code>define('WP_CACHE', true);</code><br />Otherwise, <strong>WP-Cache will not be executed</strong> by WordPress core. ", 'wp-super-cache' ), $global ) . "</p>";
1762
  }
1763
 
1764
  $cache_stats = get_option( 'supercache_stats' );
1765
+ if ( !is_array( $cache_stats ) || ( $valid_nonce && array_key_exists('action', $_GET) && $_GET[ 'action' ] == 'regenerate_cache_stats' ) ) {
1766
  $list_files = false; // it doesn't list supercached files, and removing single pages is buggy
1767
  $count = 0;
1768
  $expired = 0;
1862
  update_option( 'supercache_stats', $cache_stats );
1863
  } else {
1864
  echo "<p>" . __( 'Cache stats are not automatically generated. You must click the link below to regenerate the stats on this page.', 'wp-super-cache' ) . "</p>";
1865
+ echo "<a href='" . wp_nonce_url( add_query_arg( array( 'page' => 'wpsupercache', 'tab' => 'tester', 'action' => 'regenerate_cache_stats' ) ), 'wp-cache' ) . "'>" . __( 'Regenerate cache stats' ) . "</a>";
1866
  if ( is_array( $cache_stats ) ) {
1867
  echo "<p>" . sprintf( __( 'Cache stats last generated: %s minutes ago.', 'wp-super-cache' ), number_format( ( time() - $cache_stats[ 'generated' ] ) / 60 ) ) . "</p>";
1868
  }
1875
  echo "<li>" . sprintf( __( '%s Expired Pages', 'wp-super-cache' ), $cache_stats[ 'wpcache' ][ 'expired' ] ) . "</li></ul>";
1876
  $divisor = $cache_compression == 1 ? 2 : 1;
1877
  if( $cache_enabled == true && $super_cache_enabled == true ) {
1878
+ if ( array_key_exists('fsize', (array)$cache_stats[ 'supercache' ]) )
1879
+ $fsize = $cache_stats[ 'supercache' ][ 'fsize' ] / 1024;
1880
+ else
1881
+ $fsize = 0;
1882
  if( $fsize > 1024 ) {
1883
  $fsize = number_format( $fsize / 1024, 2 ) . "MB";
1884
  } elseif( $fsize != 0 ) {
1888
  }
1889
  echo "<p><strong>" . __( 'WP-Super-Cache', 'wp-super-cache' ) . " ({$fsize})</strong></p>";
1890
  echo "<ul><li>" . sprintf( __( '%s Cached Pages', 'wp-super-cache' ), intval( $cache_stats[ 'supercache' ][ 'cached' ] / $divisor ) ) . "</li>";
1891
+ if (isset($now) && isset($sizes))
1892
+ $age = intval(($now - $sizes['ts'])/60);
1893
+ else
1894
+ $age = 0;
1895
  echo "<li>" . sprintf( __( '%s Expired Pages', 'wp-super-cache' ), intval( $cache_stats[ 'supercache' ][ 'expired' ] / $divisor ) ) . "</li></ul>";
1896
  }
1897
+ if ( $valid_nonce && array_key_exists('listfiles', $_GET) && $_GET[ 'listfiles' ] ) {
1898
  echo "<div style='padding: 10px; border: 1px solid #333; height: 400px; width: 70%; overflow: auto'>";
1899
  if ( is_array( $cached_list ) && !empty( $cached_list ) ) {
1900
  echo "<h4>" . __( 'Fresh WP-Cached Files', 'wp-super-cache' ) . "</h4>";
1964
  echo "<p><a href='?page=wpsupercache#top'>" . __( 'Hide file list', 'wp-super-cache' ) . "</a></p>";
1965
  } elseif ( $cache_stats[ 'supercache' ][ 'cached' ] > 300 || $cache_stats[ 'supercache' ][ 'expired' ] > 300 || ( $cache_stats[ 'wpcache' ][ 'cached' ] / $divisor ) > 300 || ( $cache_stats[ 'wpcache' ][ 'expired' ] / $divisor) > 300 ) {
1966
  echo "<p><em>" . __( 'Too many cached files, no listing possible.', 'wp-super-cache' ) . "</em></p>";
1967
+ } else {
1968
+ 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>";
1969
  }
1970
  $last_gc = get_option( "wpsupercache_gc_time" );
1971
  if ( $cache_max_time > 0 && $last_gc ) {
1998
  }
1999
 
2000
  function delete_cache_dashboard() {
2001
+ if ( false == wpsupercache_site_admin() )
2002
  return false;
2003
 
2004
+ if ( function_exists('current_user_can') && !current_user_can('manage_options') )
2005
  return false;
2006
 
2007
  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>";
2030
  $sizes[ 'expired_list' ][ $now - $filem ][ str_replace( $cache_path . 'supercache/' , '', str_replace( 'index.html', '', str_replace( 'index.html.gz', '', $directory ) ) ) ] = 1;
2031
  } else {
2032
  $sizes[ 'cached' ]+=1;
2033
+ if ( $valid_nonce && array_key_exists('listfiles', $_GET) && $_GET[ 'listfiles' ] )
2034
  $sizes[ 'cached_list' ][ $now - $filem ][ str_replace( $cache_path . 'supercache/' , '', str_replace( 'index.html', '', str_replace( 'index.html.gz', '', $directory ) ) ) ] = 1;
2035
  }
2036
  if ( ! isset( $sizes[ 'fsize' ] ) )
2161
  add_action( 'template_redirect', 'wp_cache_catch_404' );
2162
 
2163
  function wp_cache_favorite_action( $actions ) {
2164
+ if ( false == wpsupercache_site_admin() )
2165
  return $actions;
2166
 
2167
+ if ( function_exists('current_user_can') && !current_user_can('manage_options') )
2168
  return $actions;
2169
 
2170
  $actions[ wp_nonce_url( 'options-general.php?page=wpsupercache&wp_delete_cache=1', 'wp-cache' ) ] = array( __( 'Delete Cache', 'wp-super-cache' ), 'manage_options' );
2273
  extract( wpsc_get_htaccess_info() );
2274
  if( !is_writeable_ACLSafe( $home_path . ".htaccess" ) ) {
2275
  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>";
2276
+ echo "<p><pre># BEGIN WPSuperCache\n" . esc_html( $rules ) . "# END WPSuperCache</pre></p></div>";
2277
  } else {
2278
  if ( $short_form == false ) {
2279
  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 ) . " ";
2280
+ _e( "You can edit the file yourself add the following rules.", 'wp-super-cache' );
 
 
 
 
2281
  echo __( " Make sure they appear before any existing WordPress rules. ", 'wp-super-cache' ) . "</p>";
2282
+ echo "<pre># BEGIN WPSuperCache\n" . esc_html( $rules ) . "# END WPSuperCache</pre></p>";
2283
  echo "<p>" . sprintf( __( 'Rules must be added to %s too:', 'wp-super-cache' ), WP_CONTENT_DIR . "/cache/.htaccess" ) . "</p>";
2284
+ echo "<pre># BEGIN supercache\n" . esc_html( $gziprules ) . "# END supercache</pre></p>";
2285
  }
2286
  if ( !isset( $wpmu_version ) || $wpmu_version == '' ) {
2287
  echo '<form name="updatehtaccess" action="#modrewrite" method="post">';
2294
  }
2295
 
2296
  function wpsc_get_htaccess_info() {
2297
+ global $wp_cache_mobile_enabled, $wp_cache_mobile_prefixes, $wp_cache_mobile_browsers;
2298
  if ( isset( $_SERVER[ "PHP_DOCUMENT_ROOT" ] ) ) {
2299
  $document_root = $_SERVER[ "PHP_DOCUMENT_ROOT" ];
2300
  $apache_root = $_SERVER[ "PHP_DOCUMENT_ROOT" ];
2320
  $condition_rules[] = "RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$";
2321
  $condition_rules[] = "RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\\\"]+ [NC]";
2322
  $condition_rules[] = "RewriteCond %{HTTP:Profile} !^[a-z0-9\\\"]+ [NC]";
2323
+ if ( $wp_cache_mobile_enabled ) {
2324
+ $condition_rules[] = "RewriteCond %{HTTP_USER_AGENT} !^.*(" . addcslashes( implode( '|', $wp_cache_mobile_browsers ), ' ' ) . ").* [NC]";
2325
+ $condition_rules[] = "RewriteCond %{HTTP_user_agent} !^(" . addcslashes( implode( '|', $wp_cache_mobile_prefixes ), ' ' ) . ").* [NC]";
2326
+ }
2327
  $condition_rules = apply_filters( 'supercacherewriteconditions', $condition_rules );
2328
 
2329
  $rules = "<IfModule mod_rewrite.c>\n";
2354
  function clear_post_supercache( $post_id ) {
2355
  $dir = get_current_url_supercache_dir( $post_id );
2356
  if ( file_exists( $dir . 'index.html' ) ) {
2357
+ @unlink( $dir . 'index.html' );
2358
  }
2359
  if ( file_exists( $dir . 'index.html.gz' ) ) {
2360
+ @unlink( $dir . 'index.html.gz' );
2361
  }
2362
  }
2363
 
2369
  return true;
2370
  }
2371
 
2372
+ $counter = get_option( 'preload_cache_counter' );
2373
+ $c = $counter[ 'c' ];
2374
  if ( $wp_cache_preload_posts == 'all' || $c <= $wp_cache_preload_posts ) {
2375
  $posts = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} WHERE post_status = 'publish' ORDER BY post_date DESC LIMIT $c, 100" );
2376
  } else {
2379
  if ( !isset( $wp_cache_preload_email_volume ) )
2380
  $wp_cache_preload_email_volume = 'medium';
2381
 
2382
+ update_option( 'preload_cache_counter', array( 'c' => ( $c + 100 ), 't' => time() ) );
2383
  if ( $posts ) {
2384
  if ( $wp_cache_preload_email_me && $c == 0 )
2385
  wp_mail( get_option( 'admin_email' ), sprintf( __( '[%1$s] Cache Preload Started', 'wp-super-cache' ), site_url(), '' ), '' );
2401
  }
2402
  } else {
2403
  $msg = '';
2404
+ update_option( 'preload_cache_counter', array( 'c' => 0, 't' => time() ) );
2405
  if ( (int)$wp_cache_preload_interval && defined( 'DOING_CRON' ) ) {
2406
  if ( $wp_cache_preload_email_me )
2407
  $msg = sprintf( __( 'Scheduling next preload refresh in %d minutes.', 'wp-super-cache' ), (int)$wp_cache_preload_interval );
2440
  $currently_preloading = true;
2441
  }
2442
  }
2443
+
2444
+ function option_preload_cache_counter( $value ) {
2445
+ if ( false == is_array( $value ) ) {
2446
+ $ret = array( 'c' => $value, 't' => time(), 'first' => 1 );
2447
+ return $ret;
2448
+ }
2449
+
2450
+ return $value;
2451
+ }
2452
+ add_filter( 'option_preload_cache_counter', 'option_preload_cache_counter' );
2453
+
2454
+ function check_up_on_preloading() {
2455
+ $value = get_option( 'preload_cache_counter' );
2456
+ if ( $value[ 'c' ] > 0 && ( time() - $value[ 't' ] ) > 3600 && false == wp_next_scheduled( 'wp_cache_preload_hook' ) ) {
2457
+ if ( is_admin() )
2458
+ wp_mail( get_option( 'admin_email' ), sprintf( __( '[%s] Preload may have stalled.', 'wp-super-cache' ), get_bloginfo( 'url' ) ), sprintf( __( "Preload has been restarted.\n%s", 'wp-super-cache' ), admin_url( "options-general.php?page=wpsupercache" ) ) );
2459
+ wp_schedule_single_event( time() + 30, 'wp_cache_preload_hook' );
2460
+ }
2461
+ }
2462
+ add_action( 'init', 'check_up_on_preloading' ); // sometimes preloading stops working. Kickstart it.
2463
  ?>
wp-super-cache.pot CHANGED
@@ -8,7 +8,7 @@ msgid ""
8
  msgstr ""
9
  "Project-Id-Version: \n"
10
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-super-cache\n"
11
- "POT-Creation-Date: 2010-06-16 10:25+0000\n"
12
  "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -16,23 +16,47 @@ msgstr ""
16
  "Content-Type: text/plain; charset=utf-8\n"
17
  "Content-Transfer-Encoding: 8bit\n"
18
 
19
- #: plugins/badbehaviour.php:45
20
- msgid "Bad Behaviour not found. Please check your install."
21
  msgstr ""
22
 
 
23
  #: plugins/badbehaviour.php:47 plugins/badbehaviour.php:65
24
- #: plugins/searchengine.php:61 plugins/searchengine.php:76 wp-cache.php:896
 
25
  msgid "Disable"
26
  msgstr ""
27
 
28
- #: plugins/badbehaviour.php:55 plugins/searchengine.php:67
 
29
  msgid "disabled"
30
  msgstr ""
31
 
32
- #: plugins/badbehaviour.php:57 plugins/searchengine.php:69 wp-cache.php:1243
 
33
  msgid "enabled"
34
  msgstr ""
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  #: plugins/badbehaviour.php:60
37
  #, php-format
38
  msgid "Bad Behaviour support is %s."
@@ -41,17 +65,30 @@ msgstr ""
41
  #: plugins/badbehaviour.php:61
42
  #, php-format
43
  msgid ""
44
- "(Only half-on caching supported, disabled compression and requires <a href="
45
  "\"http://www.bad-behavior.ioerror.us/\">Bad Behavior</a> in \"%s/plugins/bad-"
46
  "behavior/\") "
47
  msgstr ""
48
 
49
- #: plugins/badbehaviour.php:63 plugins/searchengine.php:74 wp-cache.php:896
50
- msgid "Enable"
51
  msgstr ""
52
 
53
- #: plugins/badbehaviour.php:69 wp-cache.php:973 wp-cache.php:975
54
- msgid "Warning!"
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  msgstr ""
56
 
57
  #: plugins/searchengine.php:71
@@ -74,26 +111,22 @@ msgid ""
74
  "sample.php"
75
  msgstr ""
76
 
77
- #: wp-cache.php:170
78
- msgid "WP Super Cache Manager"
79
- msgstr ""
80
-
81
- #: wp-cache.php:172
82
  msgid "Warning! PHP Safe Mode Enabled!"
83
  msgstr ""
84
 
85
- #: wp-cache.php:173
86
  msgid ""
87
  "You may experience problems running this plugin because SAFE MODE is enabled."
88
  msgstr ""
89
 
90
- #: wp-cache.php:175
91
  msgid ""
92
  "Your server is set up to check the owner of PHP scripts before allowing them "
93
  "to read and write files."
94
  msgstr ""
95
 
96
- #: wp-cache.php:176
97
  #, php-format
98
  msgid ""
99
  "You or an administrator may be able to make it work by changing the group "
@@ -103,7 +136,7 @@ msgid ""
103
  "details."
104
  msgstr ""
105
 
106
- #: wp-cache.php:178
107
  msgid ""
108
  "You or an administrator must disable this. See the <a href=\"http://php.net/"
109
  "features.safe-mode\">safe mode manual page</a> for further details. This "
@@ -111,33 +144,23 @@ msgid ""
111
  "php.ini config file."
112
  msgstr ""
113
 
114
- #: wp-cache.php:183
115
  msgid "Permlink Structure Error"
116
  msgstr ""
117
 
118
- #: wp-cache.php:184
119
  msgid ""
120
  "A custom url or permalink structure is required for this plugin to work "
121
  "correctly. Please go to the <a href=\"options-permalink.php\">Permalinks "
122
  "Options Page</a> to configure your permalinks."
123
  msgstr ""
124
 
125
- #: wp-cache.php:194
126
- msgid ""
127
- "Configuration file changed, some values might be wrong. Load the page again "
128
- "from the \"Settings\" menu to reset them."
129
- msgstr ""
130
-
131
- #: wp-cache.php:200
132
- msgid "Cannot continue... fix previous problems and retry."
133
- msgstr ""
134
-
135
- #: wp-cache.php:216
136
  #, php-format
137
  msgid "Warning! Your hostname \"%s\" resolves to %s"
138
  msgstr ""
139
 
140
- #: wp-cache.php:218
141
  #, php-format
142
  msgid ""
143
  "Your server thinks your hostname resolves to %s. Some services such as "
@@ -145,25 +168,29 @@ msgid ""
145
  "operate correctly."
146
  msgstr ""
147
 
148
- #: wp-cache.php:219 wp-cache.php:233
149
  #, php-format
150
  msgid ""
151
  "Please see entry 16 in the <a href=\"%s\">Troubleshooting section</a> of the "
152
  "readme.txt"
153
  msgstr ""
154
 
155
- #: wp-cache.php:232
156
  msgid ""
157
  "Unfortunately WordPress cannot find the file wp-cron.php. This script is "
158
  "required for the the correct operation of garbage collection by this plugin, "
159
  "WordPress scheduled posts as well as other critical activities."
160
  msgstr ""
161
 
162
- #: wp-cache.php:250
 
 
 
 
163
  msgid "Zlib Output Compression Enabled!"
164
  msgstr ""
165
 
166
- #: wp-cache.php:251
167
  msgid ""
168
  "PHP is compressing the data sent to the visitors of your site. Disabling "
169
  "this is recommended as the plugin caches the compressed output once instead "
@@ -172,31 +199,23 @@ msgid ""
172
  "configuration.php\">this page</a> for instructions on modifying your php.ini."
173
  msgstr ""
174
 
175
- #: wp-cache.php:255
176
  msgid "Mod rewrite may not be installed!"
177
  msgstr ""
178
 
179
- #: wp-cache.php:256
180
  msgid ""
181
  "It appears that mod_rewrite is not installed. Sometimes this check isn&#8217;"
182
  "t 100% reliable, especially if you are not using Apache. Please verify that "
183
  "the mod_rewrite module is loaded. It is required for serving Super Cache "
184
- "static files. You will still be able to use half-on mode."
185
  msgstr ""
186
 
187
- #: wp-cache.php:261
188
  msgid "Read Only Mode. Configuration cannot be changed."
189
  msgstr ""
190
 
191
- #: wp-cache.php:261
192
- msgid "Why your configuration may not be changed"
193
- msgstr ""
194
-
195
- #: wp-cache.php:261
196
- msgid "Why"
197
- msgstr ""
198
-
199
- #: wp-cache.php:263
200
  #, php-format
201
  msgid ""
202
  "The WP Super Cache configuration file is <code>%s/wp-cache-config.php</code> "
@@ -204,152 +223,75 @@ msgid ""
204
  "any changes."
205
  msgstr ""
206
 
207
- #: wp-cache.php:264
208
  msgid ""
209
  "A simple way of doing that is by changing the permissions temporarily using "
210
  "the CHMOD command or through your ftp client. Make sure it&#8217;s globally "
211
  "writeable and it should be fine."
212
  msgstr ""
213
 
214
- #: wp-cache.php:265
215
  msgid "Writeable:"
216
  msgstr ""
217
 
218
- #: wp-cache.php:266
219
  msgid "Readonly:"
220
  msgstr ""
221
 
222
- #: wp-cache.php:278
223
  #, php-format
224
  msgid "Warning! %s is writeable!"
225
  msgstr ""
226
 
227
- #: wp-cache.php:279
228
  #, php-format
229
  msgid ""
230
  "You should change the permissions on %s and make it more restrictive. Use "
231
  "your ftp client, or the following command to fix things:"
232
  msgstr ""
233
 
234
- #: wp-cache.php:379
235
- msgid ""
236
- "<strong>Warning!</strong> You attempted to enable compression but <code>zlib."
237
- "output_compression</code> is enabled. See #21 in the Troubleshooting section "
238
- "of the readme file."
239
- msgstr ""
240
-
241
- #: wp-cache.php:398
242
- msgid "WP Super Cache Status"
243
- msgstr ""
244
-
245
- #: wp-cache.php:401
246
- msgid "ON"
247
- msgstr ""
248
-
249
- #: wp-cache.php:401
250
- msgid "WP Cache and Super Cache enabled"
251
- msgstr ""
252
-
253
- #: wp-cache.php:402
254
- msgid "HALF ON"
255
- msgstr ""
256
-
257
- #: wp-cache.php:402
258
- msgid "Super Cache Disabled, only legacy WP-Cache caching."
259
- msgstr ""
260
-
261
- #: wp-cache.php:403
262
- msgid "OFF"
263
- msgstr ""
264
-
265
- #: wp-cache.php:403
266
- msgid "WP Cache and Super Cache disabled"
267
- msgstr ""
268
-
269
- #: wp-cache.php:404
270
- msgid ""
271
- "Don&#8217;t cache pages for known users. (Logged in users and those that "
272
- "comment)"
273
- msgstr ""
274
-
275
- #: wp-cache.php:405
276
- msgid ""
277
- "Proudly tell the world your server is Digg proof! (places a message in your "
278
- "blog&#8217;s footer)"
279
- msgstr ""
280
-
281
- #: wp-cache.php:406
282
- msgid ""
283
- "Clear all cache files when a post or page is published. (This may "
284
- "significantly slow down saving of posts.)"
285
- msgstr ""
286
-
287
- #: wp-cache.php:407
288
- msgid ""
289
- "Cache rebuild. Serve a supercache file to anonymous users while a new file "
290
- "is being generated. Recommended for <em>very</em> busy websites with lots of "
291
- "comments. Makes \"directly cached pages\" and \"Lockdown mode\" obsolete."
292
- msgstr ""
293
-
294
- #: wp-cache.php:409
295
- msgid ""
296
- "Coarse file locking. You probably don&#8217;t need this but it may help if "
297
- "your server is underpowered. Warning! <em>May cause your server to lock up "
298
- "in very rare cases!</em>"
299
- msgstr ""
300
-
301
- #: wp-cache.php:411
302
- msgid ""
303
- "List the newest cached pages (may be expensive to run on busy sites, use "
304
- "with caution.)"
305
- msgstr ""
306
-
307
- #: wp-cache.php:412
308
- msgid "Mobile device support."
309
- msgstr ""
310
-
311
- #: wp-cache.php:417
312
  msgid "Mobile rewrite rules detected"
313
  msgstr ""
314
 
315
- #: wp-cache.php:418
316
  msgid ""
317
  "For best performance you should enable \"Mobile device support\" or delete "
318
  "the mobile rewrite rules in your .htaccess. Look for the 2 lines with the "
319
  "text \"2.0\\ MMP|240x320\" and delete those."
320
  msgstr ""
321
 
322
- #: wp-cache.php:418
323
  msgid ""
324
  "This will have no affect on ordinary users but mobile users will see "
325
  "uncached pages."
326
  msgstr ""
327
 
328
- #: wp-cache.php:424
329
  msgid "Rewrite rules must be updated"
330
  msgstr ""
331
 
332
- #: wp-cache.php:425
333
  msgid "The rewrite rules required by this plugin have changed or are missing. "
334
  msgstr ""
335
 
336
- #: wp-cache.php:426
337
  msgid ""
338
  "Mobile support requires extra rules in your .htaccess file, or you can set "
339
- "the plugin to half-on mode. Here are your options (in order of difficulty):"
340
  msgstr ""
341
 
342
- #: wp-cache.php:427
343
- msgid "Set the plugin to half on mode and enable mobile support."
344
  msgstr ""
345
 
346
- #: wp-cache.php:428
347
  msgid ""
348
- "Scroll down this page and click the <strong>Update Mod_Rewrite Rules</"
349
- "strong> button."
350
  msgstr ""
351
 
352
- #: wp-cache.php:429
353
  #, php-format
354
  msgid ""
355
  "Delete the plugin mod_rewrite rules in %s.htaccess enclosed by <code># BEGIN "
@@ -357,7 +299,7 @@ msgid ""
357
  "regenerate them by reloading this page."
358
  msgstr ""
359
 
360
- #: wp-cache.php:430
361
  #, php-format
362
  msgid ""
363
  "Add the rules yourself. Edit %s.htaccess and find the block of code enclosed "
@@ -367,133 +309,156 @@ msgid ""
367
  "*$</code> add these lines: (do it twice, once for each section)"
368
  msgstr ""
369
 
370
- #: wp-cache.php:435
371
- msgid "Use object cache to store cached files."
 
 
372
  msgstr ""
373
 
374
- #: wp-cache.php:435
375
- msgid "(Experimental)"
376
  msgstr ""
377
 
378
- #: wp-cache.php:437
379
- msgid "Only refresh current page when comments made."
 
 
380
  msgstr ""
381
 
382
- #: wp-cache.php:438
383
- msgid "Note:"
 
 
384
  msgstr ""
385
 
386
- #: wp-cache.php:438
387
- #, php-format
 
 
 
388
  msgid ""
389
- "If uninstalling this plugin, make sure the directory <em>%s</em> is "
390
- "writeable by the webserver so the files <em>advanced-cache.php</em> and "
391
- "<em>cache-config.php</em> can be deleted automatically. (Making sure those "
392
- "files are writeable too is probably a good idea!)"
393
  msgstr ""
394
 
395
- #: wp-cache.php:439
396
- #, php-format
397
  msgid ""
398
- "Please see the <a href=\"%1$s/wp-super-cache/readme.txt\">readme.txt</a> for "
399
- "instructions on uninstalling this script. Look for the heading, \"How to "
400
- "uninstall WP Super Cache\"."
401
  msgstr ""
402
 
403
- #: wp-cache.php:440
404
- #, php-format
 
 
 
405
  msgid ""
406
- "Need help? Check the <a href=\"%1$s\">Super Cache readme file</a>. It "
407
- "includes installation documentation, a FAQ and Troubleshooting tips. The <a "
408
- "href=\"%2$s\">support forum</a> is also available. Your question may already "
409
- "have been answered."
410
  msgstr ""
411
 
412
- #: wp-cache.php:442
413
- msgid "Update Status"
 
 
414
  msgstr ""
415
 
416
- #: wp-cache.php:449
 
 
 
 
417
  msgid "Cache Tester"
418
  msgstr ""
419
 
420
- #: wp-cache.php:450
421
  msgid "Test your cached website by clicking the test button below."
422
  msgstr ""
423
 
424
- #: wp-cache.php:454
425
  #, php-format
426
  msgid "Fetching %s to prime cache: "
427
  msgstr ""
428
 
429
- #: wp-cache.php:456 wp-cache.php:463 wp-cache.php:470
430
  msgid "OK"
431
  msgstr ""
432
 
433
- #: wp-cache.php:461
434
  #, php-format
435
  msgid "Fetching first copy of %s: "
436
  msgstr ""
437
 
438
- #: wp-cache.php:468
439
  #, php-format
440
  msgid "Fetching second copy of %s: "
441
  msgstr ""
442
 
443
- #: wp-cache.php:475
 
 
 
 
 
 
 
 
 
444
  #, php-format
445
  msgid "Page 1: %s"
446
  msgstr ""
447
 
448
- #: wp-cache.php:476
449
  #, php-format
450
  msgid "Page 2: %s"
451
  msgstr ""
452
 
453
- #: wp-cache.php:477
454
  msgid "The timestamps on both pages match!"
455
  msgstr ""
456
 
457
- #: wp-cache.php:479
458
  msgid "The pages do not match! Timestamps differ or were not found!"
459
  msgstr ""
460
 
461
- #: wp-cache.php:484
462
- msgid "Test Cache"
463
  msgstr ""
464
 
465
- #: wp-cache.php:489
466
- msgid "Preload Cache"
467
  msgstr ""
468
 
469
- #: wp-cache.php:506 wp-cache.php:626
470
  msgid "Cancel Cache Preload"
471
  msgstr ""
472
 
473
- #: wp-cache.php:512
474
  msgid ""
475
  "Scheduled preloading of cache cancelled. If a job is currently running it "
476
  "will not shutdown until the current 100 pages are complete."
477
  msgstr ""
478
 
479
- #: wp-cache.php:523
480
  msgid "Scheduled preloading of cache cancelled."
481
  msgstr ""
482
 
483
- #: wp-cache.php:549 wp-cache.php:624
484
  msgid "Preload Cache Now"
485
  msgstr ""
486
 
487
- #: wp-cache.php:552
488
  msgid "Scheduled preloading of cache in 10 seconds."
489
  msgstr ""
490
 
491
- #: wp-cache.php:556
492
  #, php-format
493
  msgid "Scheduled preloading of cache in %d minutes"
494
  msgstr ""
495
 
496
- #: wp-cache.php:560
497
  msgid ""
498
  "This will cache every published post and page on your site. It will create "
499
  "supercache static files so unknown visitors (including bots) will hit a "
@@ -501,236 +466,334 @@ msgid ""
501
  "speed as a metric when judging websites now."
502
  msgstr ""
503
 
504
- #: wp-cache.php:561
505
  msgid ""
506
  "Preloading creates lots of files however. Caching is done from the newest "
507
  "post to the oldest so please consider only caching the newest if you have "
508
  "lots (10,000+) of posts. This is especially important on shared hosting."
509
  msgstr ""
510
 
511
- #: wp-cache.php:562
512
  msgid ""
513
  "In &#8217;Preload Mode&#8217; regular garbage collection will only clean out "
514
- "old half-on files for known users, not the preloaded supercache files. This "
515
  "is a recommended setting when the cache is preloaded."
516
  msgstr ""
517
 
518
- #: wp-cache.php:566
519
  #, php-format
520
  msgid ""
521
  "Refresh preloaded cache files every %s minutes. (0 to disable, minimum %d "
522
  "minutes.)"
523
  msgstr ""
524
 
525
- #: wp-cache.php:579
526
  msgid "all"
527
  msgstr ""
528
 
529
- #: wp-cache.php:592
530
  #, php-format
531
  msgid "Preload %s posts."
532
  msgstr ""
533
 
534
- #: wp-cache.php:599
535
  msgid ""
536
- "Preload mode (garbage collection only on half-on cache files. Recommended.)"
537
  msgstr ""
538
 
539
- #: wp-cache.php:602
540
  msgid "Send me status emails when files are refreshed."
541
  msgstr ""
542
 
543
- #: wp-cache.php:607
544
  msgid "Many emails, 2 emails per 100 posts."
545
  msgstr ""
546
 
547
- #: wp-cache.php:610
548
  msgid "Medium, 1 email per 100 posts."
549
  msgstr ""
550
 
551
- #: wp-cache.php:613
552
  msgid "Less emails, 1 at the start and 1 at the end of preloading all posts."
553
  msgstr ""
554
 
555
- #: wp-cache.php:621
556
  #, php-format
557
  msgid "Currently caching from post %d to %d."
558
  msgstr ""
559
 
560
- #: wp-cache.php:624
561
  msgid "Update Settings"
562
  msgstr ""
563
 
564
- #: wp-cache.php:632
565
  msgid ""
566
- "Preloading of cache disabled. Please enable supercaching or talk to your "
567
- "host administrator."
568
  msgstr ""
569
 
570
- #: wp-cache.php:638
571
- msgid "Required to serve compressed supercache files properly."
 
 
 
 
572
  msgstr ""
573
 
574
- #: wp-cache.php:638
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
575
  msgid ""
576
- "Required to set caching information on supercache pages. IE7 users will see "
577
- "old pages without this module."
 
578
  msgstr ""
579
 
580
- #: wp-cache.php:638
 
 
 
 
 
 
 
 
581
  msgid ""
582
- "Set the expiry date on supercached pages. Visitors may not see new pages "
583
- "when they refresh or leave comments without this module."
584
  msgstr ""
585
 
586
- #: wp-cache.php:645
587
- msgid "Missing Apache Modules"
 
 
588
  msgstr ""
589
 
590
- #: wp-cache.php:646
591
  msgid ""
592
- "The following Apache modules are missing. The plugin will work in half-on "
593
- "mode without them. In full Supercache mode, your visitors may see corrupted "
594
- "pages or out of date content however."
595
  msgstr ""
596
 
597
- #: wp-cache.php:658
598
- msgid "Make WordPress Faster"
 
 
599
  msgstr ""
600
 
601
- #: wp-cache.php:660
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
602
  #, php-format
603
  msgid ""
604
- "%1$s really makes your blog go faster. Make it go faster<sup>*</sup> by "
605
- "buying me an <a href=\"%2$s\">Amazon gift card</a>! Make it out to \"%3$s\" "
606
- "for whatever amount you want. Every penny helps!"
 
607
  msgstr ""
608
 
609
- #: wp-cache.php:661
610
  #, php-format
611
  msgid ""
612
- "If Amazon isn&#8217;t your thing, there&#8217;s also PayPal. Click the "
613
- "\"Donate\" button below or take a quick peek at my <a href=\"%s\">wishlist</"
614
- "a>."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
615
  msgstr ""
616
 
617
- #: wp-cache.php:662
618
- msgid "Thanks in advance!"
619
  msgstr ""
620
 
621
- #: wp-cache.php:663
622
  msgid ""
623
- "Ok, it won&#8217;t go any faster but you&#8217;ll make this plugin author "
624
- "very happy!"
625
  msgstr ""
626
 
627
- #: wp-cache.php:671
628
- msgid "Don&#8217;t show me this again."
 
 
629
  msgstr ""
630
 
631
- #: wp-cache.php:671
632
- msgid "Hide"
633
  msgstr ""
634
 
635
- #: wp-cache.php:674
636
  #, php-format
637
  msgid ""
638
  "%1$s is maintained and developed by %2$s with contributions from many others."
639
  msgstr ""
640
 
641
- #: wp-cache.php:675
642
  #, php-format
643
- msgid ""
644
- "He blogs at %1$s and posts photos at %2$s. He would really appreciate a <a "
645
- "href=\"%3$s\">donation</a> to encourage development of this plugin.<br /"
646
- ">Even a penny will help."
647
  msgstr ""
648
 
649
- #: wp-cache.php:676
650
  #, php-format
651
  msgid "Please say hi to him on %s too!"
652
  msgstr ""
653
 
654
- #: wp-cache.php:685
655
  #, php-format
656
  msgid "Cached pages since %1$s : <strong>%2$s</strong>"
657
  msgstr ""
658
 
659
- #: wp-cache.php:686
660
  msgid "Newest Cached Pages:"
661
  msgstr ""
662
 
663
- #: wp-cache.php:690
664
  #, php-format
665
  msgid "Cached %s seconds ago"
666
  msgstr ""
667
 
668
- #: wp-cache.php:693
669
  msgid "(may not always be accurate on busy sites)"
670
  msgstr ""
671
 
672
- #: wp-cache.php:714
673
- msgid "Accepted Filenames &amp; Rejected URIs"
674
- msgstr ""
675
-
676
- #: wp-cache.php:739
677
- msgid "Cache Plugins"
678
  msgstr ""
679
 
680
- #: wp-cache.php:750 wp-cache.php:761
681
- msgid "Super Cache Compression"
 
 
682
  msgstr ""
683
 
684
- #: wp-cache.php:751
685
- msgid "Compression is enabled by default when in <em>HALF ON</em> mode."
686
  msgstr ""
687
 
688
- #: wp-cache.php:763 wp-cache.php:883
689
- msgid "Enabled"
690
  msgstr ""
691
 
692
- #: wp-cache.php:764 wp-cache.php:883
693
- msgid "Disabled"
694
  msgstr ""
695
 
696
- #: wp-cache.php:765
697
- msgid ""
698
- "Compression is disabled by default because some hosts have problems with "
699
- "compressed files. Switching this on and off clears the cache."
700
  msgstr ""
701
 
702
- #: wp-cache.php:768
703
- msgid "Super Cache compression is now disabled."
704
  msgstr ""
705
 
706
- #: wp-cache.php:770
707
- msgid "Super Cache compression is now enabled."
 
 
 
708
  msgstr ""
709
 
710
- #: wp-cache.php:772
711
- msgid "Update Compression"
 
 
 
712
  msgstr ""
713
 
714
- #: wp-cache.php:779
715
  msgid "Mod Rewrite Rules"
716
  msgstr ""
717
 
718
- #: wp-cache.php:785
719
  msgid "WordPress MU Detected"
720
  msgstr ""
721
 
722
- #: wp-cache.php:785
723
  msgid ""
724
  "Unfortunately the rewrite rules cannot be updated automatically when running "
725
  "WordPress MU. Please open your .htaccess and add the following mod_rewrite "
726
  "rules above any other rules in that file."
727
  msgstr ""
728
 
729
- #: wp-cache.php:787
730
  msgid "Mod Rewrite rules cannot be updated!"
731
  msgstr ""
732
 
733
- #: wp-cache.php:788
734
  #, php-format
735
  msgid ""
736
  "You must have <strong>BEGIN</strong> and <strong>END</strong> markers in %s."
@@ -738,15 +801,15 @@ msgid ""
738
  "main WordPress mod_rewrite rules:"
739
  msgstr ""
740
 
741
- #: wp-cache.php:790
742
  msgid "Refresh this page when you have updated your .htaccess file."
743
  msgstr ""
744
 
745
- #: wp-cache.php:794
746
  msgid "Thank you for upgrading."
747
  msgstr ""
748
 
749
- #: wp-cache.php:794
750
  #, php-format
751
  msgid ""
752
  "The mod_rewrite rules changed since you last installed this plugin. "
@@ -759,11 +822,11 @@ msgid ""
759
  "brave enough to use them."
760
  msgstr ""
761
 
762
- #: wp-cache.php:798
763
  msgid "Trailing slash check required."
764
  msgstr ""
765
 
766
- #: wp-cache.php:798
767
  msgid ""
768
  "It looks like your blog has URLs that end with a \"/\". Unfortunately since "
769
  "you installed this plugin a duplicate content bug has been found where URLs "
@@ -772,28 +835,28 @@ msgid ""
772
  "and add these two rules to the two groups of Super Cache rules:"
773
  msgstr ""
774
 
775
- #: wp-cache.php:800
776
  msgid ""
777
  "You can see where the rules go and examine the complete rules by clicking "
778
  "the \"View mod_rewrite rules\" link below."
779
  msgstr ""
780
 
781
- #: wp-cache.php:814
782
  msgid "Mod Rewrite rules updated!"
783
  msgstr ""
784
 
785
- #: wp-cache.php:815
786
  #, php-format
787
  msgid ""
788
  "%s.htaccess has been updated with the necessary mod_rewrite rules. Please "
789
  "verify they are correct. They should look like this:"
790
  msgstr ""
791
 
792
- #: wp-cache.php:817
793
  msgid "Mod Rewrite rules must be updated!"
794
  msgstr ""
795
 
796
- #: wp-cache.php:818
797
  #, php-format
798
  msgid ""
799
  "Your %s.htaccess is not writable by the webserver and must be updated with "
@@ -801,7 +864,7 @@ msgid ""
801
  "WordPress rules as shown in the code below:"
802
  msgstr ""
803
 
804
- #: wp-cache.php:823
805
  #, php-format
806
  msgid ""
807
  "WP Super Cache mod rewrite rules were detected in your %s.htaccess file.<br /"
@@ -809,7 +872,7 @@ msgid ""
809
  "upgraded the plugin make sure these rules match."
810
  msgstr ""
811
 
812
- #: wp-cache.php:826
813
  msgid ""
814
  "A difference between the rules in your .htaccess file and the plugin rewrite "
815
  "rules has been found. This could be simple whitespace differences but you "
@@ -817,107 +880,115 @@ msgid ""
817
  "Click the &#8217;Update Mod_Rewrite Rules&#8217; button to update the rules."
818
  msgstr ""
819
 
820
- #: wp-cache.php:829
821
  msgid "View Mod_Rewrite Rules"
822
  msgstr ""
823
 
824
- #: wp-cache.php:833 wp-cache.php:2066
825
  #, php-format
826
  msgid "Rules must be added to %s too:"
827
  msgstr ""
828
 
829
- #: wp-cache.php:841
830
  #, php-format
831
  msgid "Gzip encoding rules in %s.htaccess created."
832
  msgstr ""
833
 
834
- #: wp-cache.php:848
835
  msgid "Fix Configuration"
836
  msgstr ""
837
 
838
- #: wp-cache.php:851
839
  msgid "Restore Default Configuration"
840
  msgstr ""
841
 
842
- #: wp-cache.php:859
843
  msgid ""
844
  "Comment moderation is enabled. Your comment may take some time to appear."
845
  msgstr ""
846
 
847
- #: wp-cache.php:883
848
  msgid "Lock Down:"
849
  msgstr ""
850
 
851
- #: wp-cache.php:884
 
 
 
 
 
 
 
 
852
  msgid ""
853
  "Prepare your server for an expected spike in traffic by enabling the lock "
854
  "down. When this is enabled, new comments on a post will not refresh the "
855
  "cached static files."
856
  msgstr ""
857
 
858
- #: wp-cache.php:885
859
  msgid ""
860
  "Developers: Make your plugin lock down compatible by checking the "
861
  "\"WPLOCKDOWN\" constant. The following code will make sure your plugin "
862
  "respects the WPLOCKDOWN setting."
863
  msgstr ""
864
 
865
- #: wp-cache.php:887
866
  msgid "Sorry. My blog is locked down. Updates will appear shortly"
867
  msgstr ""
868
 
869
- #: wp-cache.php:891
870
  msgid ""
871
  "WordPress is locked down. Super Cache static files will not be deleted when "
872
  "new comments are made."
873
  msgstr ""
874
 
875
- #: wp-cache.php:893
876
  msgid ""
877
  "WordPress is not locked down. New comments will refresh Super Cache static "
878
  "files as normal."
879
  msgstr ""
880
 
881
- #: wp-cache.php:899
882
  msgid "Lock Down"
883
  msgstr ""
884
 
885
- #: wp-cache.php:907
886
  msgid "Directly Cached Files"
887
  msgstr ""
888
 
889
- #: wp-cache.php:965
890
  #, php-format
891
  msgid "%s removed!"
892
  msgstr ""
893
 
894
- #: wp-cache.php:973
895
  #, php-format
896
  msgid ""
897
  "You must make %s writable to enable this feature. As this is a security risk "
898
  "please make it readonly after your page is generated."
899
  msgstr ""
900
 
901
- #: wp-cache.php:975
902
  #, php-format
903
  msgid ""
904
  "%s is writable. Please make it readonly after your page is generated as this "
905
  "is a security risk."
906
  msgstr ""
907
 
908
- #: wp-cache.php:989
909
  msgid "Existing direct page"
910
  msgstr ""
911
 
912
- #: wp-cache.php:989
913
  msgid "Delete cached file"
914
  msgstr ""
915
 
916
- #: wp-cache.php:994
917
  msgid "Add direct page:"
918
  msgstr ""
919
 
920
- #: wp-cache.php:996
921
  #, php-format
922
  msgid ""
923
  "Directly cached files are files created directly off %s where your blog "
@@ -925,7 +996,7 @@ msgid ""
925
  "Slashdot level of traffic to one post or page."
926
  msgstr ""
927
 
928
- #: wp-cache.php:998
929
  #, php-format
930
  msgid ""
931
  "For example: to cache <em>%1$sabout/</em>, you would enter %1$sabout/ or /"
@@ -933,119 +1004,121 @@ msgid ""
933
  "visits that page."
934
  msgstr ""
935
 
936
- #: wp-cache.php:999
937
  msgid ""
938
  "Make the textbox blank to remove it from the list of direct pages and delete "
939
  "the cached file."
940
  msgstr ""
941
 
942
- #: wp-cache.php:1004
943
  msgid "Update Direct Pages"
944
  msgstr ""
945
 
946
- #: wp-cache.php:1042
947
  msgid "Expiry Time &amp; Garbage Collection"
948
  msgstr ""
949
 
950
- #: wp-cache.php:1044
951
  msgid "Expire time:"
952
  msgstr ""
953
 
954
- #: wp-cache.php:1045
955
  msgid "seconds"
956
  msgstr ""
957
 
958
- #: wp-cache.php:1046
959
  msgid "Garbage Collection"
960
  msgstr ""
961
 
962
- #: wp-cache.php:1046
963
  msgid ""
964
- "If expiry time is more than 1800 seconds (half an hour), garbage collection "
965
- "will be done every 10 minutes, otherwise it will happen 10 seconds after the "
966
- "expiry time above."
967
  msgstr ""
968
 
969
- #: wp-cache.php:1047
970
  msgid ""
971
  "Checking for and deleting expired files is expensive, but it&#8217;s "
972
  "expensive leaving them there too. On a very busy site you should set the "
973
  "expiry time to <em>300 seconds</em>. Experiment with different values and "
974
  "visit this page to see how many expired files remain at different times "
975
- "during the day. Aim to have less than 500 cached files if possible."
 
 
976
  msgstr ""
977
 
978
- #: wp-cache.php:1048
979
  msgid "Set the expiry time to 0 seconds to disable garbage collection."
980
  msgstr ""
981
 
982
- #: wp-cache.php:1049
983
  msgid "Change Expiration"
984
  msgstr ""
985
 
986
- #: wp-cache.php:1093
987
  msgid "Rejected User Agents"
988
  msgstr ""
989
 
990
- #: wp-cache.php:1094
991
  msgid ""
992
  "Strings in the HTTP &#8217;User Agent&#8217; header that prevent WP-Cache "
993
  "from caching bot, spiders, and crawlers&#8217; requests. Note that super "
994
  "cached files are still sent to these agents if they already exists."
995
  msgstr ""
996
 
997
- #: wp-cache.php:1101
998
  msgid "Save UA Strings"
999
  msgstr ""
1000
 
1001
- #: wp-cache.php:1124
1002
  msgid ""
1003
  "Do not cache the following page types. See the <a href=\"http://codex."
1004
  "wordpress.org/Conditional_Tags\">Conditional Tags</a> documentation for a "
1005
  "complete discussion on each type."
1006
  msgstr ""
1007
 
1008
- #: wp-cache.php:1127
1009
  msgid "Single Posts"
1010
  msgstr ""
1011
 
1012
- #: wp-cache.php:1128
1013
  msgid "Pages"
1014
  msgstr ""
1015
 
1016
- #: wp-cache.php:1129
1017
  msgid "Front Page"
1018
  msgstr ""
1019
 
1020
- #: wp-cache.php:1130
1021
  msgid "Home"
1022
  msgstr ""
1023
 
1024
- #: wp-cache.php:1131
1025
  msgid "Archives"
1026
  msgstr ""
1027
 
1028
- #: wp-cache.php:1132
1029
  msgid "Tags"
1030
  msgstr ""
1031
 
1032
- #: wp-cache.php:1133
1033
  msgid "Category"
1034
  msgstr ""
1035
 
1036
- #: wp-cache.php:1134
1037
  msgid "Feeds"
1038
  msgstr ""
1039
 
1040
- #: wp-cache.php:1135
1041
  msgid "Search Pages"
1042
  msgstr ""
1043
 
1044
- #: wp-cache.php:1137 wp-cache.php:1266
1045
  msgid "Save"
1046
  msgstr ""
1047
 
1048
- #: wp-cache.php:1154
1049
  msgid ""
1050
  "Add here strings (not a filename) that forces a page not to be cached. For "
1051
  "example, if your URLs include year and you dont want to cache last year "
@@ -1054,78 +1127,70 @@ msgid ""
1054
  "cache that page."
1055
  msgstr ""
1056
 
1057
- #: wp-cache.php:1160
1058
  msgid "Save Strings"
1059
  msgstr ""
1060
 
1061
- #: wp-cache.php:1176
1062
  msgid ""
1063
  "Add here those filenames that can be cached, even if they match one of the "
1064
  "rejected substring specified above."
1065
  msgstr ""
1066
 
1067
- #: wp-cache.php:1182
1068
  msgid "Save Files"
1069
  msgstr ""
1070
 
1071
- #: wp-cache.php:1226
1072
- msgid "Debug Settings"
1073
- msgstr ""
1074
-
1075
- #: wp-cache.php:1228
1076
  msgid "Currently logging to: "
1077
  msgstr ""
1078
 
1079
- #: wp-cache.php:1238
1080
  msgid ""
1081
  "Fix problems with the plugin by debugging it here. It can send you debug "
1082
  "emails or log them to a file in your cache directory."
1083
  msgstr ""
1084
 
1085
- #: wp-cache.php:1239
1086
  msgid ""
1087
  "Logging to a file is easier but faces the problem that clearing the cache "
1088
  "will clear the log file."
1089
  msgstr ""
1090
 
1091
- #: wp-cache.php:1243
1092
  msgid "Debugging"
1093
  msgstr ""
1094
 
1095
- #: wp-cache.php:1244
1096
  msgid "Logging Type"
1097
  msgstr ""
1098
 
1099
- #: wp-cache.php:1244
1100
  msgid "Email"
1101
  msgstr ""
1102
 
1103
- #: wp-cache.php:1245
1104
  msgid "file"
1105
  msgstr ""
1106
 
1107
- #: wp-cache.php:1246
1108
  msgid "IP Address"
1109
  msgstr ""
1110
 
1111
- #: wp-cache.php:1246
1112
  #, php-format
1113
  msgid "(only log requests from this IP address. Your IP is %s)"
1114
  msgstr ""
1115
 
1116
- #: wp-cache.php:1247
1117
  msgid "Log level"
1118
  msgstr ""
1119
 
1120
- #: wp-cache.php:1253
1121
  msgid "(1 = less, 5 = more, may cause severe server load.)"
1122
  msgstr ""
1123
 
1124
- #: wp-cache.php:1256
1125
- msgid "Advanced"
1126
- msgstr ""
1127
-
1128
- #: wp-cache.php:1256
1129
  msgid ""
1130
  "In very rare cases two problems may arise on some blogs:<ol><li> The front "
1131
  "page may start downloading as a zip file.</li><li> The wrong page is "
@@ -1133,7 +1198,7 @@ msgid ""
1133
  "and the permalink structure is <em>/%category%/%postname%/</em>.</li></ol>"
1134
  msgstr ""
1135
 
1136
- #: wp-cache.php:1257
1137
  #, php-format
1138
  msgid ""
1139
  "I&#8217;m 99% certain that they aren&#8217;t bugs in WP Super Cache and they "
@@ -1142,94 +1207,94 @@ msgid ""
1142
  "emailed if there is a problem."
1143
  msgstr ""
1144
 
1145
- #: wp-cache.php:1259
1146
  msgid "Check front page every 5 minutes."
1147
  msgstr ""
1148
 
1149
- #: wp-cache.php:1260
1150
  msgid "Front page text"
1151
  msgstr ""
1152
 
1153
- #: wp-cache.php:1260
1154
  msgid ""
1155
  "Text to search for on your front page. If this text is missing the cache "
1156
  "will be cleared. Leave blank to disable."
1157
  msgstr ""
1158
 
1159
- #: wp-cache.php:1261
1160
  msgid "Clear cache on error."
1161
  msgstr ""
1162
 
1163
- #: wp-cache.php:1262
1164
  msgid "Email the blog admin when checks are made. (useful for testing)"
1165
  msgstr ""
1166
 
1167
- #: wp-cache.php:1276
1168
  msgid ""
1169
  "Error: GZIP compression is enabled, disable it if you want to enable wp-"
1170
  "cache."
1171
  msgstr ""
1172
 
1173
- #: wp-cache.php:1324 wp-cache.php:1486
1174
  msgid "Warning"
1175
  msgstr ""
1176
 
1177
- #: wp-cache.php:1324
1178
  msgid ""
1179
  "GZIP compression is enabled in WordPress, wp-cache will be bypassed until "
1180
  "you disable gzip compression."
1181
  msgstr ""
1182
 
1183
- #: wp-cache.php:1382 wp-cache.php:1387 wp-cache.php:1419 wp-cache.php:1424
1184
- #: wp-cache.php:1430
1185
  msgid "Error"
1186
  msgstr ""
1187
 
1188
- #: wp-cache.php:1382
1189
  #, php-format
1190
  msgid ""
1191
  "Your cache directory (<strong>$cache_path</strong>) did not exist and "
1192
  "couldn&#8217;t be created by the web server. Check %s permissions."
1193
  msgstr ""
1194
 
1195
- #: wp-cache.php:1387
1196
  #, php-format
1197
  msgid ""
1198
  "Your cache directory (<strong>%1$s</strong>) or <strong>%2$s</strong> need "
1199
  "to be writable for this plugin to work. Double-check it."
1200
  msgstr ""
1201
 
1202
- #: wp-cache.php:1419
1203
  #, php-format
1204
  msgid ""
1205
  "Your WP-Cache config file (<strong>%s</strong>) is out of date and not "
1206
  "writable by the Web server.Please delete it and refresh this page."
1207
  msgstr ""
1208
 
1209
- #: wp-cache.php:1424
1210
  #, php-format
1211
  msgid ""
1212
  "Configuration file missing and %1$s directory (<strong>%2$s</strong>) is "
1213
  "not writable by the Web server.Check its permissions."
1214
  msgstr ""
1215
 
1216
- #: wp-cache.php:1430
1217
  #, php-format
1218
  msgid ""
1219
  "Sample WP-Cache config file (<strong>%s</strong>) does not exist.Verify you "
1220
  "installation."
1221
  msgstr ""
1222
 
1223
- #: wp-cache.php:1486
1224
  #, php-format
1225
  msgid "%s/advanced-cache.php</em> does not exist or cannot be updated."
1226
  msgstr ""
1227
 
1228
- #: wp-cache.php:1487
1229
  msgid "1. If it already exists please delete the file first."
1230
  msgstr ""
1231
 
1232
- #: wp-cache.php:1488
1233
  #, php-format
1234
  msgid ""
1235
  "2. Make %1$s writable using the chmod command through your ftp or server "
@@ -1238,19 +1303,19 @@ msgid ""
1238
  "again. (Change 777 to 755 in the previous command)"
1239
  msgstr ""
1240
 
1241
- #: wp-cache.php:1489
1242
  #, php-format
1243
  msgid "3. Refresh this page to update <em>%s/advanced-cache.php</em>"
1244
  msgstr ""
1245
 
1246
- #: wp-cache.php:1490
1247
  #, php-format
1248
  msgid ""
1249
  "If that doesn&#8217;t work, make sure the file <em>%s/advanced-cache.php</"
1250
  "em> doesn&#8217;t exist:"
1251
  msgstr ""
1252
 
1253
- #: wp-cache.php:1491
1254
  #, php-format
1255
  msgid ""
1256
  "<li>1. Open <em>%1$s$wp_cache_file</em> in a text editor.</li><li>2. Change "
@@ -1258,20 +1323,22 @@ msgid ""
1258
  "copy it to <em>%3$s</em> and refresh this page.</li>"
1259
  msgstr ""
1260
 
1261
- #: wp-cache.php:1513
1262
  msgid ""
1263
- "<h3>WP_CACHE constant in wp-config.php set to false</h3><p>The WP_CACHE "
1264
- "constant is defined in your wp-config.php but must be set to true, not false "
1265
- "for this plugin to work correctly.</p>"
 
 
1266
  msgstr ""
1267
 
1268
- #: wp-cache.php:1515
1269
  msgid ""
1270
  "<strong>Error: WP_CACHE is not enabled</strong> in your <code>wp-config.php</"
1271
  "code> file and I couldn&#8217;t modify it."
1272
  msgstr ""
1273
 
1274
- #: wp-cache.php:1516
1275
  #, php-format
1276
  msgid ""
1277
  "Edit <code>%s</code> and add the following line:<br /> <code>define"
@@ -1279,7 +1346,7 @@ msgid ""
1279
  "executed</strong> by WordPress core. "
1280
  msgstr ""
1281
 
1282
- #: wp-cache.php:1520
1283
  msgid ""
1284
  "<h3>WP_CACHE constant added to wp-config.php</h3><p>If you continue to see "
1285
  "this warning message please see point 5 of the <a href=\"http://wordpress."
@@ -1287,193 +1354,197 @@ msgid ""
1287
  "moved up."
1288
  msgstr ""
1289
 
1290
- #: wp-cache.php:1542
1291
  msgid "Cache Contents"
1292
  msgstr ""
1293
 
1294
- #: wp-cache.php:1545
1295
  msgid "Object cache in use. No cache listing available."
1296
  msgstr ""
1297
 
1298
- #: wp-cache.php:1569
1299
  #, php-format
1300
  msgid "Deleting supercache file: <strong>%s</strong><br />"
1301
  msgstr ""
1302
 
1303
- #: wp-cache.php:1586
1304
  #, php-format
1305
  msgid "Deleting wp-cache file: <strong>%s</strong><br />"
1306
  msgstr ""
1307
 
1308
- #: wp-cache.php:1651
1309
  msgid ""
1310
  "Cache stats are not automatically generated. You must click the link below "
1311
  "to regenerate the stats on this page."
1312
  msgstr ""
1313
 
1314
- #: wp-cache.php:1652
1315
  msgid "Regenerate cache stats"
1316
  msgstr ""
1317
 
1318
- #: wp-cache.php:1654
1319
  #, php-format
1320
  msgid "Cache stats last generated: %s minutes ago."
1321
  msgstr ""
1322
 
1323
- #: wp-cache.php:1660
1324
  msgid "WP-Cache"
1325
  msgstr ""
1326
 
1327
- #: wp-cache.php:1661 wp-cache.php:1674
1328
  #, php-format
1329
  msgid "%s Cached Pages"
1330
  msgstr ""
1331
 
1332
- #: wp-cache.php:1662 wp-cache.php:1676
1333
  #, php-format
1334
  msgid "%s Expired Pages"
1335
  msgstr ""
1336
 
1337
- #: wp-cache.php:1673
1338
  msgid "WP-Super-Cache"
1339
  msgstr ""
1340
 
1341
- #: wp-cache.php:1681
1342
  msgid "Fresh WP-Cached Files"
1343
  msgstr ""
1344
 
1345
- #: wp-cache.php:1682 wp-cache.php:1698 wp-cache.php:1714 wp-cache.php:1730
1346
  msgid "URI"
1347
  msgstr ""
1348
 
1349
- #: wp-cache.php:1682 wp-cache.php:1698
1350
  msgid "Key"
1351
  msgstr ""
1352
 
1353
- #: wp-cache.php:1682 wp-cache.php:1698 wp-cache.php:1714 wp-cache.php:1730
1354
  msgid "Age"
1355
  msgstr ""
1356
 
1357
- #: wp-cache.php:1682 wp-cache.php:1698 wp-cache.php:1714 wp-cache.php:1730
1358
  msgid "Delete"
1359
  msgstr ""
1360
 
1361
- #: wp-cache.php:1697
1362
  msgid "Stale WP-Cached Files"
1363
  msgstr ""
1364
 
1365
- #: wp-cache.php:1713
1366
  msgid "Fresh Super Cached Files"
1367
  msgstr ""
1368
 
1369
- #: wp-cache.php:1729
1370
  msgid "Stale Super Cached Files"
1371
  msgstr ""
1372
 
1373
- #: wp-cache.php:1745
1374
  msgid "Hide file list"
1375
  msgstr ""
1376
 
1377
- #: wp-cache.php:1747
1378
  msgid "Too many cached files, no listing possible."
1379
  msgstr ""
1380
 
1381
- #: wp-cache.php:1753
 
 
 
 
1382
  #, php-format
1383
  msgid ""
1384
  "<strong>Garbage Collection</strong><br />Last GC was <strong>%s</strong> "
1385
  "minutes ago<br />"
1386
  msgstr ""
1387
 
1388
- #: wp-cache.php:1754
1389
  #, php-format
1390
  msgid "Next GC in <strong>%s</strong> minutes"
1391
  msgstr ""
1392
 
1393
- #: wp-cache.php:1757
1394
  #, php-format
1395
  msgid ""
1396
  "Expired files are files older than %s seconds. They are still used by the "
1397
  "plugin and are deleted periodically."
1398
  msgstr ""
1399
 
1400
- #: wp-cache.php:1768
1401
  msgid "Delete Expired"
1402
  msgstr ""
1403
 
1404
- #: wp-cache.php:1774 wp-cache.php:1786 wp-cache.php:1949
1405
  msgid "Delete Cache"
1406
  msgstr ""
1407
 
1408
- #: wp-cache.php:1786
1409
  msgid "Delete Super Cache cached files (opens in new window)"
1410
  msgstr ""
1411
 
1412
- #: wp-cache.php:1925
1413
  #, php-format
1414
  msgid "%1$s is Digg proof thanks to caching by %2$s"
1415
  msgstr ""
1416
 
1417
- #: wp-cache.php:1958
1418
  #, php-format
1419
  msgid ""
1420
  "WP Super Cache must be configured. Go to <a href=\"%s\">the admin page</a> "
1421
  "to enable and configure the plugin."
1422
  msgstr ""
1423
 
1424
- #: wp-cache.php:1964
1425
  msgid "Settings"
1426
  msgstr ""
1427
 
1428
- #: wp-cache.php:1974
1429
  #, php-format
1430
  msgid ""
1431
  "WP Super Cache is disabled. Please go to the <a href=\"%s\">plugin admin "
1432
  "page</a> to enable caching."
1433
  msgstr ""
1434
 
1435
- #: wp-cache.php:1993
1436
  #, php-format
1437
  msgid "[%s] Front page is gzipped! Please clear cache!"
1438
  msgstr ""
1439
 
1440
- #: wp-cache.php:1993
1441
  #, php-format
1442
  msgid ""
1443
  "Please visit %s to clear the cache as the front page of your site is now "
1444
  "downloading!"
1445
  msgstr ""
1446
 
1447
- #: wp-cache.php:1996
1448
  #, php-format
1449
  msgid "[%s] Front page is gzipped! Cache Cleared!"
1450
  msgstr ""
1451
 
1452
- #: wp-cache.php:1996
1453
  #, php-format
1454
  msgid ""
1455
  "The cache on your blog has been cleared because the front page of your site "
1456
  "is now downloading. Please visit %s to verify the cache has been cleared."
1457
  msgstr ""
1458
 
1459
- #: wp-cache.php:2003
1460
  #, php-format
1461
  msgid "[%s] Front page is not correct! Please clear cache!"
1462
  msgstr ""
1463
 
1464
- #: wp-cache.php:2003
1465
  #, php-format
1466
  msgid ""
1467
  "Please visit %1$s to clear the cache as the front page of your site is not "
1468
  "correct and missing the text, \"%2$s\"!"
1469
  msgstr ""
1470
 
1471
- #: wp-cache.php:2006
1472
  #, php-format
1473
  msgid "[%s] Front page is not correct! Cache Cleared!"
1474
  msgstr ""
1475
 
1476
- #: wp-cache.php:2006
1477
  #, php-format
1478
  msgid ""
1479
  "The cache on your blog has been cleared because the front page of your site "
@@ -1481,92 +1552,100 @@ msgid ""
1481
  "cleared."
1482
  msgstr ""
1483
 
1484
- #: wp-cache.php:2011
1485
  #, php-format
1486
  msgid "[%s] Front page check!"
1487
  msgstr ""
1488
 
1489
- #: wp-cache.php:2011
1490
  #, php-format
1491
  msgid ""
1492
  "WP Super Cache has checked the front page of your blog. Please visit %s if "
1493
  "you would like to disable this."
1494
  msgstr ""
1495
 
1496
- #: wp-cache.php:2054
1497
  msgid "Cannot update .htaccess"
1498
  msgstr ""
1499
 
1500
- #: wp-cache.php:2054
1501
  #, php-format
1502
  msgid ""
1503
  "The file <code>%s.htaccess</code> cannot be modified by the web server. "
1504
  "Please correct this using the chmod command or your ftp client."
1505
  msgstr ""
1506
 
1507
- #: wp-cache.php:2054
1508
  msgid "Refresh this page when the file permissions have been modified."
1509
  msgstr ""
1510
 
1511
- #: wp-cache.php:2054
1512
  #, php-format
1513
  msgid ""
1514
  "Alternatively, you can edit your <code>%s.htaccess</code> file manually and "
1515
  "add the following code (before any WordPress rules):"
1516
  msgstr ""
1517
 
1518
- #: wp-cache.php:2058
1519
  #, php-format
1520
  msgid ""
1521
  "To serve static html files your server must have the correct mod_rewrite "
1522
  "rules added to a file called <code>%s.htaccess</code>"
1523
  msgstr ""
1524
 
1525
- #: wp-cache.php:2060
1526
- msgid "You must edit the file yourself add the following rules."
1527
- msgstr ""
1528
-
1529
- #: wp-cache.php:2062
1530
  msgid "You can edit the file yourself add the following rules."
1531
  msgstr ""
1532
 
1533
- #: wp-cache.php:2064
1534
  msgid " Make sure they appear before any existing WordPress rules. "
1535
  msgstr ""
1536
 
1537
- #: wp-cache.php:2072
1538
  msgid "Update Mod_Rewrite Rules"
1539
  msgstr ""
1540
 
1541
- #: wp-cache.php:2165
1542
  #, php-format
1543
  msgid "[%1$s] Cache Preload Started"
1544
  msgstr ""
1545
 
1546
- #: wp-cache.php:2167
1547
  #, php-format
1548
  msgid "[%1$s] Refreshing posts from %2$d to %3$d"
1549
  msgstr ""
1550
 
1551
- #: wp-cache.php:2178
1552
  #, php-format
1553
  msgid "[%1$s] %2$d posts refreshed"
1554
  msgstr ""
1555
 
1556
- #: wp-cache.php:2178
1557
  msgid "Refreshed the following posts:"
1558
  msgstr ""
1559
 
1560
- #: wp-cache.php:2187
1561
  #, php-format
1562
  msgid "Scheduling next preload refresh in %d minutes."
1563
  msgstr ""
1564
 
1565
- #: wp-cache.php:2197
1566
  #, php-format
1567
  msgid "[%s] Cache Preload Completed"
1568
  msgstr ""
1569
 
1570
- #: wp-cache.php:2197
1571
  msgid "Cleaning up old supercache files."
1572
  msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
8
  msgstr ""
9
  "Project-Id-Version: \n"
10
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-super-cache\n"
11
+ "POT-Creation-Date: 2010-09-22 14:24+0000\n"
12
  "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
16
  "Content-Type: text/plain; charset=utf-8\n"
17
  "Content-Transfer-Encoding: 8bit\n"
18
 
19
+ #: plugins/awaitingmoderation.php:4
20
+ msgid "Your comment is awaiting moderation."
21
  msgstr ""
22
 
23
+ #: plugins/awaitingmoderation.php:23 plugins/awaitingmoderation.php:38
24
  #: plugins/badbehaviour.php:47 plugins/badbehaviour.php:65
25
+ #: plugins/domain-mapping.php:47 plugins/domain-mapping.php:62
26
+ #: plugins/searchengine.php:61 plugins/searchengine.php:76 wp-cache.php:1108
27
  msgid "Disable"
28
  msgstr ""
29
 
30
+ #: plugins/awaitingmoderation.php:29 plugins/badbehaviour.php:55
31
+ #: plugins/domain-mapping.php:53 plugins/searchengine.php:67
32
  msgid "disabled"
33
  msgstr ""
34
 
35
+ #: plugins/awaitingmoderation.php:31 plugins/badbehaviour.php:57
36
+ #: plugins/domain-mapping.php:55 plugins/searchengine.php:69 wp-cache.php:1454
37
  msgid "enabled"
38
  msgstr ""
39
 
40
+ #: plugins/awaitingmoderation.php:33
41
+ #, php-format
42
+ msgid "Awaiting Moderation plugin is %s"
43
+ msgstr ""
44
+
45
+ #: plugins/awaitingmoderation.php:34
46
+ msgid ""
47
+ "(Remove the text \"Your comment is awaiting moderation.\" when someone "
48
+ "leaves a moderated comment.) "
49
+ msgstr ""
50
+
51
+ #: plugins/awaitingmoderation.php:36 plugins/badbehaviour.php:63
52
+ #: plugins/domain-mapping.php:60 plugins/searchengine.php:74 wp-cache.php:1108
53
+ msgid "Enable"
54
+ msgstr ""
55
+
56
+ #: plugins/badbehaviour.php:45
57
+ msgid "Bad Behaviour not found. Please check your install."
58
+ msgstr ""
59
+
60
  #: plugins/badbehaviour.php:60
61
  #, php-format
62
  msgid "Bad Behaviour support is %s."
65
  #: plugins/badbehaviour.php:61
66
  #, php-format
67
  msgid ""
68
+ "(Only legacy caching supported, disabled compression and requires <a href="
69
  "\"http://www.bad-behavior.ioerror.us/\">Bad Behavior</a> in \"%s/plugins/bad-"
70
  "behavior/\") "
71
  msgstr ""
72
 
73
+ #: plugins/badbehaviour.php:69 wp-cache.php:1185 wp-cache.php:1187
74
+ msgid "Warning!"
75
  msgstr ""
76
 
77
+ #: plugins/domain-mapping.php:57
78
+ #, php-format
79
+ msgid ""
80
+ "<a href=\"http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/"
81
+ "\">Domain Mapping</a> support plugin is %s"
82
+ msgstr ""
83
+
84
+ #: plugins/domain-mapping.php:58
85
+ msgid "(support for multiple domains on multisite websites) "
86
+ msgstr ""
87
+
88
+ #: plugins/domain-mapping.php:72
89
+ msgid ""
90
+ "Domain Mapping plugin detected! Please go to the Supercache plugins page and "
91
+ "enable the domain mapping helper plugin."
92
  msgstr ""
93
 
94
  #: plugins/searchengine.php:71
111
  "sample.php"
112
  msgstr ""
113
 
114
+ #: wp-cache.php:138
 
 
 
 
115
  msgid "Warning! PHP Safe Mode Enabled!"
116
  msgstr ""
117
 
118
+ #: wp-cache.php:139
119
  msgid ""
120
  "You may experience problems running this plugin because SAFE MODE is enabled."
121
  msgstr ""
122
 
123
+ #: wp-cache.php:143
124
  msgid ""
125
  "Your server is set up to check the owner of PHP scripts before allowing them "
126
  "to read and write files."
127
  msgstr ""
128
 
129
+ #: wp-cache.php:144
130
  #, php-format
131
  msgid ""
132
  "You or an administrator may be able to make it work by changing the group "
136
  "details."
137
  msgstr ""
138
 
139
+ #: wp-cache.php:146
140
  msgid ""
141
  "You or an administrator must disable this. See the <a href=\"http://php.net/"
142
  "features.safe-mode\">safe mode manual page</a> for further details. This "
144
  "php.ini config file."
145
  msgstr ""
146
 
147
+ #: wp-cache.php:153
148
  msgid "Permlink Structure Error"
149
  msgstr ""
150
 
151
+ #: wp-cache.php:154
152
  msgid ""
153
  "A custom url or permalink structure is required for this plugin to work "
154
  "correctly. Please go to the <a href=\"options-permalink.php\">Permalinks "
155
  "Options Page</a> to configure your permalinks."
156
  msgstr ""
157
 
158
+ #: wp-cache.php:166
 
 
 
 
 
 
 
 
 
 
159
  #, php-format
160
  msgid "Warning! Your hostname \"%s\" resolves to %s"
161
  msgstr ""
162
 
163
+ #: wp-cache.php:167
164
  #, php-format
165
  msgid ""
166
  "Your server thinks your hostname resolves to %s. Some services such as "
168
  "operate correctly."
169
  msgstr ""
170
 
171
+ #: wp-cache.php:168 wp-cache.php:182
172
  #, php-format
173
  msgid ""
174
  "Please see entry 16 in the <a href=\"%s\">Troubleshooting section</a> of the "
175
  "readme.txt"
176
  msgstr ""
177
 
178
+ #: wp-cache.php:181
179
  msgid ""
180
  "Unfortunately WordPress cannot find the file wp-cron.php. This script is "
181
  "required for the the correct operation of garbage collection by this plugin, "
182
  "WordPress scheduled posts as well as other critical activities."
183
  msgstr ""
184
 
185
+ #: wp-cache.php:196
186
+ msgid "Cannot continue... fix previous problems and retry."
187
+ msgstr ""
188
+
189
+ #: wp-cache.php:205
190
  msgid "Zlib Output Compression Enabled!"
191
  msgstr ""
192
 
193
+ #: wp-cache.php:206
194
  msgid ""
195
  "PHP is compressing the data sent to the visitors of your site. Disabling "
196
  "this is recommended as the plugin caches the compressed output once instead "
199
  "configuration.php\">this page</a> for instructions on modifying your php.ini."
200
  msgstr ""
201
 
202
+ #: wp-cache.php:210
203
  msgid "Mod rewrite may not be installed!"
204
  msgstr ""
205
 
206
+ #: wp-cache.php:211
207
  msgid ""
208
  "It appears that mod_rewrite is not installed. Sometimes this check isn&#8217;"
209
  "t 100% reliable, especially if you are not using Apache. Please verify that "
210
  "the mod_rewrite module is loaded. It is required for serving Super Cache "
211
+ "static files. You will still be able to use legacy or PHP modes."
212
  msgstr ""
213
 
214
+ #: wp-cache.php:216
215
  msgid "Read Only Mode. Configuration cannot be changed."
216
  msgstr ""
217
 
218
+ #: wp-cache.php:217
 
 
 
 
 
 
 
 
219
  #, php-format
220
  msgid ""
221
  "The WP Super Cache configuration file is <code>%s/wp-cache-config.php</code> "
223
  "any changes."
224
  msgstr ""
225
 
226
+ #: wp-cache.php:218
227
  msgid ""
228
  "A simple way of doing that is by changing the permissions temporarily using "
229
  "the CHMOD command or through your ftp client. Make sure it&#8217;s globally "
230
  "writeable and it should be fine."
231
  msgstr ""
232
 
233
+ #: wp-cache.php:219
234
  msgid "Writeable:"
235
  msgstr ""
236
 
237
+ #: wp-cache.php:220
238
  msgid "Readonly:"
239
  msgstr ""
240
 
241
+ #: wp-cache.php:232
242
  #, php-format
243
  msgid "Warning! %s is writeable!"
244
  msgstr ""
245
 
246
+ #: wp-cache.php:233
247
  #, php-format
248
  msgid ""
249
  "You should change the permissions on %s and make it more restrictive. Use "
250
  "your ftp client, or the following command to fix things:"
251
  msgstr ""
252
 
253
+ #: wp-cache.php:241
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
254
  msgid "Mobile rewrite rules detected"
255
  msgstr ""
256
 
257
+ #: wp-cache.php:242
258
  msgid ""
259
  "For best performance you should enable \"Mobile device support\" or delete "
260
  "the mobile rewrite rules in your .htaccess. Look for the 2 lines with the "
261
  "text \"2.0\\ MMP|240x320\" and delete those."
262
  msgstr ""
263
 
264
+ #: wp-cache.php:242
265
  msgid ""
266
  "This will have no affect on ordinary users but mobile users will see "
267
  "uncached pages."
268
  msgstr ""
269
 
270
+ #: wp-cache.php:248 wp-cache.php:259
271
  msgid "Rewrite rules must be updated"
272
  msgstr ""
273
 
274
+ #: wp-cache.php:249 wp-cache.php:260
275
  msgid "The rewrite rules required by this plugin have changed or are missing. "
276
  msgstr ""
277
 
278
+ #: wp-cache.php:250
279
  msgid ""
280
  "Mobile support requires extra rules in your .htaccess file, or you can set "
281
+ "the plugin to legacy mode. Here are your options (in order of difficulty):"
282
  msgstr ""
283
 
284
+ #: wp-cache.php:251
285
+ msgid "Set the plugin to legacy mode and enable mobile support."
286
  msgstr ""
287
 
288
+ #: wp-cache.php:252
289
  msgid ""
290
+ "Scroll down the Advanced Settings page and click the <strong>Update "
291
+ "Mod_Rewrite Rules</strong> button."
292
  msgstr ""
293
 
294
+ #: wp-cache.php:253
295
  #, php-format
296
  msgid ""
297
  "Delete the plugin mod_rewrite rules in %s.htaccess enclosed by <code># BEGIN "
299
  "regenerate them by reloading this page."
300
  msgstr ""
301
 
302
+ #: wp-cache.php:254
303
  #, php-format
304
  msgid ""
305
  "Add the rules yourself. Edit %s.htaccess and find the block of code enclosed "
309
  "*$</code> add these lines: (do it twice, once for each section)"
310
  msgstr ""
311
 
312
+ #: wp-cache.php:261
313
+ msgid ""
314
+ "Scroll down this page and click the <strong>Update Mod_Rewrite Rules</"
315
+ "strong> button."
316
  msgstr ""
317
 
318
+ #: wp-cache.php:267
319
+ msgid "Required to serve compressed supercache files properly."
320
  msgstr ""
321
 
322
+ #: wp-cache.php:267
323
+ msgid ""
324
+ "Required to set caching information on supercache pages. IE7 users will see "
325
+ "old pages without this module."
326
  msgstr ""
327
 
328
+ #: wp-cache.php:267
329
+ msgid ""
330
+ "Set the expiry date on supercached pages. Visitors may not see new pages "
331
+ "when they refresh or leave comments without this module."
332
  msgstr ""
333
 
334
+ #: wp-cache.php:274
335
+ msgid "Missing Apache Modules"
336
+ msgstr ""
337
+
338
+ #: wp-cache.php:275
339
  msgid ""
340
+ "The following Apache modules are missing. The plugin will work in legacy "
341
+ "mode without them. In full Supercache mode, your visitors may see corrupted "
342
+ "pages or out of date content however."
 
343
  msgstr ""
344
 
345
+ #: wp-cache.php:408
 
346
  msgid ""
347
+ "<strong>Warning!</strong> You attempted to enable compression but <code>zlib."
348
+ "output_compression</code> is enabled. See #21 in the Troubleshooting section "
349
+ "of the readme file."
350
  msgstr ""
351
 
352
+ #: wp-cache.php:496
353
+ msgid "WP Super Cache Settings"
354
+ msgstr ""
355
+
356
+ #: wp-cache.php:507
357
  msgid ""
358
+ "Notice: <em>Mod_rewrite or Legacy caching enabled</em>. Showing Advanced "
359
+ "Settings Page by default."
 
 
360
  msgstr ""
361
 
362
+ #: wp-cache.php:518
363
+ msgid ""
364
+ "Configuration file changed, some values might be wrong. Load the page again "
365
+ "from the \"Settings\" menu to reset them."
366
  msgstr ""
367
 
368
+ #: wp-cache.php:535 wp-cache.php:609
369
+ msgid "Caching must be enabled to use this feature"
370
+ msgstr ""
371
+
372
+ #: wp-cache.php:537
373
  msgid "Cache Tester"
374
  msgstr ""
375
 
376
+ #: wp-cache.php:538
377
  msgid "Test your cached website by clicking the test button below."
378
  msgstr ""
379
 
380
+ #: wp-cache.php:545
381
  #, php-format
382
  msgid "Fetching %s to prime cache: "
383
  msgstr ""
384
 
385
+ #: wp-cache.php:547 wp-cache.php:554 wp-cache.php:561
386
  msgid "OK"
387
  msgstr ""
388
 
389
+ #: wp-cache.php:552
390
  #, php-format
391
  msgid "Fetching first copy of %s: "
392
  msgstr ""
393
 
394
+ #: wp-cache.php:559
395
  #, php-format
396
  msgid "Fetching second copy of %s: "
397
  msgstr ""
398
 
399
+ #: wp-cache.php:565
400
+ msgid "One or more page requests failed:"
401
+ msgstr ""
402
+
403
+ #: wp-cache.php:584 wp-cache.php:585
404
+ #, php-format
405
+ msgid "Page %d: %d (%s)"
406
+ msgstr ""
407
+
408
+ #: wp-cache.php:591
409
  #, php-format
410
  msgid "Page 1: %s"
411
  msgstr ""
412
 
413
+ #: wp-cache.php:592
414
  #, php-format
415
  msgid "Page 2: %s"
416
  msgstr ""
417
 
418
+ #: wp-cache.php:593
419
  msgid "The timestamps on both pages match!"
420
  msgstr ""
421
 
422
+ #: wp-cache.php:595
423
  msgid "The pages do not match! Timestamps differ or were not found!"
424
  msgstr ""
425
 
426
+ #: wp-cache.php:601
427
+ msgid "Send non-secure (non https) request for homepage"
428
  msgstr ""
429
 
430
+ #: wp-cache.php:602
431
+ msgid "Test Cache"
432
  msgstr ""
433
 
434
+ #: wp-cache.php:627 wp-cache.php:750
435
  msgid "Cancel Cache Preload"
436
  msgstr ""
437
 
438
+ #: wp-cache.php:633
439
  msgid ""
440
  "Scheduled preloading of cache cancelled. If a job is currently running it "
441
  "will not shutdown until the current 100 pages are complete."
442
  msgstr ""
443
 
444
+ #: wp-cache.php:644
445
  msgid "Scheduled preloading of cache cancelled."
446
  msgstr ""
447
 
448
+ #: wp-cache.php:670 wp-cache.php:748
449
  msgid "Preload Cache Now"
450
  msgstr ""
451
 
452
+ #: wp-cache.php:673
453
  msgid "Scheduled preloading of cache in 10 seconds."
454
  msgstr ""
455
 
456
+ #: wp-cache.php:677
457
  #, php-format
458
  msgid "Scheduled preloading of cache in %d minutes"
459
  msgstr ""
460
 
461
+ #: wp-cache.php:681
462
  msgid ""
463
  "This will cache every published post and page on your site. It will create "
464
  "supercache static files so unknown visitors (including bots) will hit a "
466
  "speed as a metric when judging websites now."
467
  msgstr ""
468
 
469
+ #: wp-cache.php:682
470
  msgid ""
471
  "Preloading creates lots of files however. Caching is done from the newest "
472
  "post to the oldest so please consider only caching the newest if you have "
473
  "lots (10,000+) of posts. This is especially important on shared hosting."
474
  msgstr ""
475
 
476
+ #: wp-cache.php:683
477
  msgid ""
478
  "In &#8217;Preload Mode&#8217; regular garbage collection will only clean out "
479
+ "old legacy files for known users, not the preloaded supercache files. This "
480
  "is a recommended setting when the cache is preloaded."
481
  msgstr ""
482
 
483
+ #: wp-cache.php:687
484
  #, php-format
485
  msgid ""
486
  "Refresh preloaded cache files every %s minutes. (0 to disable, minimum %d "
487
  "minutes.)"
488
  msgstr ""
489
 
490
+ #: wp-cache.php:700
491
  msgid "all"
492
  msgstr ""
493
 
494
+ #: wp-cache.php:713
495
  #, php-format
496
  msgid "Preload %s posts."
497
  msgstr ""
498
 
499
+ #: wp-cache.php:720
500
  msgid ""
501
+ "Preload mode (garbage collection only on legacy cache files. Recommended.)"
502
  msgstr ""
503
 
504
+ #: wp-cache.php:723
505
  msgid "Send me status emails when files are refreshed."
506
  msgstr ""
507
 
508
+ #: wp-cache.php:728
509
  msgid "Many emails, 2 emails per 100 posts."
510
  msgstr ""
511
 
512
+ #: wp-cache.php:731
513
  msgid "Medium, 1 email per 100 posts."
514
  msgstr ""
515
 
516
+ #: wp-cache.php:734
517
  msgid "Less emails, 1 at the start and 1 at the end of preloading all posts."
518
  msgstr ""
519
 
520
+ #: wp-cache.php:745
521
  #, php-format
522
  msgid "Currently caching from post %d to %d."
523
  msgstr ""
524
 
525
+ #: wp-cache.php:748
526
  msgid "Update Settings"
527
  msgstr ""
528
 
529
+ #: wp-cache.php:756
530
  msgid ""
531
+ "Preloading of cache disabled. Please disable legacy page caching or talk to "
532
+ "your host administrator."
533
  msgstr ""
534
 
535
+ #: wp-cache.php:771 wp-cache.php:856
536
+ msgid "Caching"
537
+ msgstr ""
538
+
539
+ #: wp-cache.php:775
540
+ msgid "Cache hits to this website for quick access."
541
  msgstr ""
542
 
543
+ #: wp-cache.php:775 wp-cache.php:776 wp-cache.php:790 wp-cache.php:793
544
+ #: wp-cache.php:794 wp-cache.php:859
545
+ msgid "Recommended"
546
+ msgstr ""
547
+
548
+ #: wp-cache.php:776
549
+ msgid "Use mod_rewrite to serve cache files."
550
+ msgstr ""
551
+
552
+ #: wp-cache.php:777
553
+ msgid "Use PHP to serve cache files."
554
+ msgstr ""
555
+
556
+ #: wp-cache.php:778
557
+ msgid "Legacy page caching."
558
+ msgstr ""
559
+
560
+ #: wp-cache.php:779
561
  msgid ""
562
+ "Mod_rewrite is fastest, PHP is almost as fast and easier to get working, "
563
+ "while legacy caching is slower again, but more flexible and also easy to get "
564
+ "working. New users should go with PHP caching."
565
  msgstr ""
566
 
567
+ #: wp-cache.php:785
568
+ msgid "Miscellaneous"
569
+ msgstr ""
570
+
571
+ #: wp-cache.php:790
572
+ msgid "Compress pages so they&#8217;re served more quickly to visitors."
573
+ msgstr ""
574
+
575
+ #: wp-cache.php:791
576
  msgid ""
577
+ "Compression is disabled by default because some hosts have problems with "
578
+ "compressed files. Switching it on and off clears the cache."
579
  msgstr ""
580
 
581
+ #: wp-cache.php:793
582
+ msgid ""
583
+ "Don&#8217;t cache pages for <acronym title=\"Logged in users and those that "
584
+ "comment\">known users</acronym>."
585
  msgstr ""
586
 
587
+ #: wp-cache.php:794
588
  msgid ""
589
+ "Cache rebuild. Serve a supercache file to anonymous users while a new file "
590
+ "is being generated."
 
591
  msgstr ""
592
 
593
+ #: wp-cache.php:795
594
+ msgid ""
595
+ "Proudly tell the world your server is Digg proof! (places a message in your "
596
+ "blog&#8217;s footer)"
597
  msgstr ""
598
 
599
+ #: wp-cache.php:801 wp-cache.php:948 wp-cache.php:1467
600
+ msgid "Advanced"
601
+ msgstr ""
602
+
603
+ #: wp-cache.php:805
604
+ msgid "Mobile device support."
605
+ msgstr ""
606
+
607
+ #: wp-cache.php:806
608
+ msgid "Clear all cache files when a post or page is published."
609
+ msgstr ""
610
+
611
+ #: wp-cache.php:807
612
+ msgid "Only refresh current page when comments made."
613
+ msgstr ""
614
+
615
+ #: wp-cache.php:808
616
+ msgid "List the newest cached pages on this page."
617
+ msgstr ""
618
+
619
+ #: wp-cache.php:810
620
+ msgid ""
621
+ "Coarse file locking. You probably don&#8217;t need this but it may help if "
622
+ "your server is underpowered. Warning! <em>May cause your server to lock up "
623
+ "in very rare cases!</em>"
624
+ msgstr ""
625
+
626
+ #: wp-cache.php:813
627
+ msgid "Use object cache to store cached files."
628
+ msgstr ""
629
+
630
+ #: wp-cache.php:813
631
+ msgid "(Experimental)"
632
+ msgstr ""
633
+
634
+ #: wp-cache.php:820
635
+ msgid "Note:"
636
+ msgstr ""
637
+
638
+ #: wp-cache.php:822
639
  #, php-format
640
  msgid ""
641
+ "If uninstalling this plugin, make sure the directory <em>%s</em> is "
642
+ "writeable by the webserver so the files <em>advanced-cache.php</em> and "
643
+ "<em>cache-config.php</em> can be deleted automatically. (Making sure those "
644
+ "files are writeable too is probably a good idea!)"
645
  msgstr ""
646
 
647
+ #: wp-cache.php:823
648
  #, php-format
649
  msgid ""
650
+ "Please see the <a href=\"%1$s/wp-super-cache/readme.txt\">readme.txt</a> for "
651
+ "instructions on uninstalling this script. Look for the heading, \"How to "
652
+ "uninstall WP Super Cache\"."
653
+ msgstr ""
654
+
655
+ #: wp-cache.php:824
656
+ #, php-format
657
+ msgid ""
658
+ "Need help? Check the <a href=\"%1$s\">Super Cache readme file</a>. It "
659
+ "includes installation documentation, a FAQ and Troubleshooting tips. The <a "
660
+ "href=\"%2$s\">support forum</a> is also available. Your question may already "
661
+ "have been answered."
662
+ msgstr ""
663
+
664
+ #: wp-cache.php:827 wp-cache.php:874
665
+ msgid "Update Status"
666
+ msgstr ""
667
+
668
+ #: wp-cache.php:834
669
+ msgid "Accepted Filenames &amp; Rejected URIs"
670
+ msgstr ""
671
+
672
+ #: wp-cache.php:859
673
+ msgid "Caching On"
674
  msgstr ""
675
 
676
+ #: wp-cache.php:860
677
+ msgid "Caching Off"
678
  msgstr ""
679
 
680
+ #: wp-cache.php:861
681
  msgid ""
682
+ "Note: enables PHP caching, compression, cache rebuild, Supercache footer "
683
+ "message and mobile support"
684
  msgstr ""
685
 
686
+ #: wp-cache.php:871
687
+ msgid ""
688
+ "Notice: Supercache mod_rewrite rules detected. Cached files will be served "
689
+ "using those rules. Please see the Advanced settings page for more info."
690
  msgstr ""
691
 
692
+ #: wp-cache.php:883
693
+ msgid "Make WordPress Faster"
694
  msgstr ""
695
 
696
+ #: wp-cache.php:884
697
  #, php-format
698
  msgid ""
699
  "%1$s is maintained and developed by %2$s with contributions from many others."
700
  msgstr ""
701
 
702
+ #: wp-cache.php:885
703
  #, php-format
704
+ msgid "He blogs at %1$s and posts photos at %2$s."
 
 
 
705
  msgstr ""
706
 
707
+ #: wp-cache.php:886
708
  #, php-format
709
  msgid "Please say hi to him on %s too!"
710
  msgstr ""
711
 
712
+ #: wp-cache.php:894
713
  #, php-format
714
  msgid "Cached pages since %1$s : <strong>%2$s</strong>"
715
  msgstr ""
716
 
717
+ #: wp-cache.php:895
718
  msgid "Newest Cached Pages:"
719
  msgstr ""
720
 
721
+ #: wp-cache.php:899
722
  #, php-format
723
  msgid "Cached %s seconds ago"
724
  msgstr ""
725
 
726
+ #: wp-cache.php:902
727
  msgid "(may not always be accurate on busy sites)"
728
  msgstr ""
729
 
730
+ #: wp-cache.php:921
731
+ msgid ""
732
+ "Cache plugins are PHP scripts that live in a plugins folder inside the wp-"
733
+ "super-cache folder. They are loaded when Supercache loads, much sooner than "
734
+ "regular WordPress plugins."
 
735
  msgstr ""
736
 
737
+ #: wp-cache.php:922
738
+ msgid ""
739
+ "This is strictly an advanced feature only and knowledge of both PHP and "
740
+ "WordPress actions is required to create them."
741
  msgstr ""
742
 
743
+ #: wp-cache.php:932
744
+ msgid "Available Plugins"
745
  msgstr ""
746
 
747
+ #: wp-cache.php:948
748
+ msgid "Tester & Contents"
749
  msgstr ""
750
 
751
+ #: wp-cache.php:948
752
+ msgid "Preload"
753
  msgstr ""
754
 
755
+ #: wp-cache.php:948
756
+ msgid "Plugins"
 
 
757
  msgstr ""
758
 
759
+ #: wp-cache.php:948
760
+ msgid "Debug"
761
  msgstr ""
762
 
763
+ #: wp-cache.php:975
764
+ #, php-format
765
+ msgid ""
766
+ "Notice: WP Super Cache mod_rewrite rule checks disabled unless running on <a "
767
+ "href=\"%s\">the main site</a> of this network."
768
  msgstr ""
769
 
770
+ #: wp-cache.php:977
771
+ #, php-format
772
+ msgid ""
773
+ "Notice: WP Super Cache mod_rewrite rule checks disabled unless running on <a "
774
+ "href=\"%s\">on the main site</a> of this network."
775
  msgstr ""
776
 
777
+ #: wp-cache.php:987
778
  msgid "Mod Rewrite Rules"
779
  msgstr ""
780
 
781
+ #: wp-cache.php:993
782
  msgid "WordPress MU Detected"
783
  msgstr ""
784
 
785
+ #: wp-cache.php:993
786
  msgid ""
787
  "Unfortunately the rewrite rules cannot be updated automatically when running "
788
  "WordPress MU. Please open your .htaccess and add the following mod_rewrite "
789
  "rules above any other rules in that file."
790
  msgstr ""
791
 
792
+ #: wp-cache.php:995
793
  msgid "Mod Rewrite rules cannot be updated!"
794
  msgstr ""
795
 
796
+ #: wp-cache.php:996
797
  #, php-format
798
  msgid ""
799
  "You must have <strong>BEGIN</strong> and <strong>END</strong> markers in %s."
801
  "main WordPress mod_rewrite rules:"
802
  msgstr ""
803
 
804
+ #: wp-cache.php:998
805
  msgid "Refresh this page when you have updated your .htaccess file."
806
  msgstr ""
807
 
808
+ #: wp-cache.php:1002
809
  msgid "Thank you for upgrading."
810
  msgstr ""
811
 
812
+ #: wp-cache.php:1002
813
  #, php-format
814
  msgid ""
815
  "The mod_rewrite rules changed since you last installed this plugin. "
822
  "brave enough to use them."
823
  msgstr ""
824
 
825
+ #: wp-cache.php:1006
826
  msgid "Trailing slash check required."
827
  msgstr ""
828
 
829
+ #: wp-cache.php:1006
830
  msgid ""
831
  "It looks like your blog has URLs that end with a \"/\". Unfortunately since "
832
  "you installed this plugin a duplicate content bug has been found where URLs "
835
  "and add these two rules to the two groups of Super Cache rules:"
836
  msgstr ""
837
 
838
+ #: wp-cache.php:1008
839
  msgid ""
840
  "You can see where the rules go and examine the complete rules by clicking "
841
  "the \"View mod_rewrite rules\" link below."
842
  msgstr ""
843
 
844
+ #: wp-cache.php:1022
845
  msgid "Mod Rewrite rules updated!"
846
  msgstr ""
847
 
848
+ #: wp-cache.php:1023
849
  #, php-format
850
  msgid ""
851
  "%s.htaccess has been updated with the necessary mod_rewrite rules. Please "
852
  "verify they are correct. They should look like this:"
853
  msgstr ""
854
 
855
+ #: wp-cache.php:1025
856
  msgid "Mod Rewrite rules must be updated!"
857
  msgstr ""
858
 
859
+ #: wp-cache.php:1026
860
  #, php-format
861
  msgid ""
862
  "Your %s.htaccess is not writable by the webserver and must be updated with "
864
  "WordPress rules as shown in the code below:"
865
  msgstr ""
866
 
867
+ #: wp-cache.php:1031
868
  #, php-format
869
  msgid ""
870
  "WP Super Cache mod rewrite rules were detected in your %s.htaccess file.<br /"
872
  "upgraded the plugin make sure these rules match."
873
  msgstr ""
874
 
875
+ #: wp-cache.php:1034
876
  msgid ""
877
  "A difference between the rules in your .htaccess file and the plugin rewrite "
878
  "rules has been found. This could be simple whitespace differences but you "
880
  "Click the &#8217;Update Mod_Rewrite Rules&#8217; button to update the rules."
881
  msgstr ""
882
 
883
+ #: wp-cache.php:1037
884
  msgid "View Mod_Rewrite Rules"
885
  msgstr ""
886
 
887
+ #: wp-cache.php:1041 wp-cache.php:2281
888
  #, php-format
889
  msgid "Rules must be added to %s too:"
890
  msgstr ""
891
 
892
+ #: wp-cache.php:1049
893
  #, php-format
894
  msgid "Gzip encoding rules in %s.htaccess created."
895
  msgstr ""
896
 
897
+ #: wp-cache.php:1056
898
  msgid "Fix Configuration"
899
  msgstr ""
900
 
901
+ #: wp-cache.php:1059
902
  msgid "Restore Default Configuration"
903
  msgstr ""
904
 
905
+ #: wp-cache.php:1067
906
  msgid ""
907
  "Comment moderation is enabled. Your comment may take some time to appear."
908
  msgstr ""
909
 
910
+ #: wp-cache.php:1095
911
  msgid "Lock Down:"
912
  msgstr ""
913
 
914
+ #: wp-cache.php:1095
915
+ msgid "Disabled"
916
+ msgstr ""
917
+
918
+ #: wp-cache.php:1095
919
+ msgid "Enabled"
920
+ msgstr ""
921
+
922
+ #: wp-cache.php:1096
923
  msgid ""
924
  "Prepare your server for an expected spike in traffic by enabling the lock "
925
  "down. When this is enabled, new comments on a post will not refresh the "
926
  "cached static files."
927
  msgstr ""
928
 
929
+ #: wp-cache.php:1097
930
  msgid ""
931
  "Developers: Make your plugin lock down compatible by checking the "
932
  "\"WPLOCKDOWN\" constant. The following code will make sure your plugin "
933
  "respects the WPLOCKDOWN setting."
934
  msgstr ""
935
 
936
+ #: wp-cache.php:1099
937
  msgid "Sorry. My blog is locked down. Updates will appear shortly"
938
  msgstr ""
939
 
940
+ #: wp-cache.php:1103
941
  msgid ""
942
  "WordPress is locked down. Super Cache static files will not be deleted when "
943
  "new comments are made."
944
  msgstr ""
945
 
946
+ #: wp-cache.php:1105
947
  msgid ""
948
  "WordPress is not locked down. New comments will refresh Super Cache static "
949
  "files as normal."
950
  msgstr ""
951
 
952
+ #: wp-cache.php:1111
953
  msgid "Lock Down"
954
  msgstr ""
955
 
956
+ #: wp-cache.php:1119
957
  msgid "Directly Cached Files"
958
  msgstr ""
959
 
960
+ #: wp-cache.php:1177
961
  #, php-format
962
  msgid "%s removed!"
963
  msgstr ""
964
 
965
+ #: wp-cache.php:1185
966
  #, php-format
967
  msgid ""
968
  "You must make %s writable to enable this feature. As this is a security risk "
969
  "please make it readonly after your page is generated."
970
  msgstr ""
971
 
972
+ #: wp-cache.php:1187
973
  #, php-format
974
  msgid ""
975
  "%s is writable. Please make it readonly after your page is generated as this "
976
  "is a security risk."
977
  msgstr ""
978
 
979
+ #: wp-cache.php:1201
980
  msgid "Existing direct page"
981
  msgstr ""
982
 
983
+ #: wp-cache.php:1201
984
  msgid "Delete cached file"
985
  msgstr ""
986
 
987
+ #: wp-cache.php:1206
988
  msgid "Add direct page:"
989
  msgstr ""
990
 
991
+ #: wp-cache.php:1208
992
  #, php-format
993
  msgid ""
994
  "Directly cached files are files created directly off %s where your blog "
996
  "Slashdot level of traffic to one post or page."
997
  msgstr ""
998
 
999
+ #: wp-cache.php:1210
1000
  #, php-format
1001
  msgid ""
1002
  "For example: to cache <em>%1$sabout/</em>, you would enter %1$sabout/ or /"
1004
  "visits that page."
1005
  msgstr ""
1006
 
1007
+ #: wp-cache.php:1211
1008
  msgid ""
1009
  "Make the textbox blank to remove it from the list of direct pages and delete "
1010
  "the cached file."
1011
  msgstr ""
1012
 
1013
+ #: wp-cache.php:1216
1014
  msgid "Update Direct Pages"
1015
  msgstr ""
1016
 
1017
+ #: wp-cache.php:1254
1018
  msgid "Expiry Time &amp; Garbage Collection"
1019
  msgstr ""
1020
 
1021
+ #: wp-cache.php:1256
1022
  msgid "Expire time:"
1023
  msgstr ""
1024
 
1025
+ #: wp-cache.php:1257
1026
  msgid "seconds"
1027
  msgstr ""
1028
 
1029
+ #: wp-cache.php:1258
1030
  msgid "Garbage Collection"
1031
  msgstr ""
1032
 
1033
+ #: wp-cache.php:1258
1034
  msgid ""
1035
+ "If the expiry time is more than 1800 seconds (half an hour), garbage "
1036
+ "collection will be done every 10 minutes, otherwise it will happen 10 "
1037
+ "seconds after the expiry time above."
1038
  msgstr ""
1039
 
1040
+ #: wp-cache.php:1259
1041
  msgid ""
1042
  "Checking for and deleting expired files is expensive, but it&#8217;s "
1043
  "expensive leaving them there too. On a very busy site you should set the "
1044
  "expiry time to <em>300 seconds</em>. Experiment with different values and "
1045
  "visit this page to see how many expired files remain at different times "
1046
+ "during the day. If you are using legacy caching aim to have less than 500 "
1047
+ "cached files if possible. You can have many times more cached files when "
1048
+ "using mod_rewrite or PHP caching."
1049
  msgstr ""
1050
 
1051
+ #: wp-cache.php:1260
1052
  msgid "Set the expiry time to 0 seconds to disable garbage collection."
1053
  msgstr ""
1054
 
1055
+ #: wp-cache.php:1261
1056
  msgid "Change Expiration"
1057
  msgstr ""
1058
 
1059
+ #: wp-cache.php:1305
1060
  msgid "Rejected User Agents"
1061
  msgstr ""
1062
 
1063
+ #: wp-cache.php:1306
1064
  msgid ""
1065
  "Strings in the HTTP &#8217;User Agent&#8217; header that prevent WP-Cache "
1066
  "from caching bot, spiders, and crawlers&#8217; requests. Note that super "
1067
  "cached files are still sent to these agents if they already exists."
1068
  msgstr ""
1069
 
1070
+ #: wp-cache.php:1313
1071
  msgid "Save UA Strings"
1072
  msgstr ""
1073
 
1074
+ #: wp-cache.php:1336
1075
  msgid ""
1076
  "Do not cache the following page types. See the <a href=\"http://codex."
1077
  "wordpress.org/Conditional_Tags\">Conditional Tags</a> documentation for a "
1078
  "complete discussion on each type."
1079
  msgstr ""
1080
 
1081
+ #: wp-cache.php:1339
1082
  msgid "Single Posts"
1083
  msgstr ""
1084
 
1085
+ #: wp-cache.php:1340
1086
  msgid "Pages"
1087
  msgstr ""
1088
 
1089
+ #: wp-cache.php:1341
1090
  msgid "Front Page"
1091
  msgstr ""
1092
 
1093
+ #: wp-cache.php:1342
1094
  msgid "Home"
1095
  msgstr ""
1096
 
1097
+ #: wp-cache.php:1343
1098
  msgid "Archives"
1099
  msgstr ""
1100
 
1101
+ #: wp-cache.php:1344
1102
  msgid "Tags"
1103
  msgstr ""
1104
 
1105
+ #: wp-cache.php:1345
1106
  msgid "Category"
1107
  msgstr ""
1108
 
1109
+ #: wp-cache.php:1346
1110
  msgid "Feeds"
1111
  msgstr ""
1112
 
1113
+ #: wp-cache.php:1347
1114
  msgid "Search Pages"
1115
  msgstr ""
1116
 
1117
+ #: wp-cache.php:1349 wp-cache.php:1477
1118
  msgid "Save"
1119
  msgstr ""
1120
 
1121
+ #: wp-cache.php:1366
1122
  msgid ""
1123
  "Add here strings (not a filename) that forces a page not to be cached. For "
1124
  "example, if your URLs include year and you dont want to cache last year "
1127
  "cache that page."
1128
  msgstr ""
1129
 
1130
+ #: wp-cache.php:1372
1131
  msgid "Save Strings"
1132
  msgstr ""
1133
 
1134
+ #: wp-cache.php:1388
1135
  msgid ""
1136
  "Add here those filenames that can be cached, even if they match one of the "
1137
  "rejected substring specified above."
1138
  msgstr ""
1139
 
1140
+ #: wp-cache.php:1394
1141
  msgid "Save Files"
1142
  msgstr ""
1143
 
1144
+ #: wp-cache.php:1439
 
 
 
 
1145
  msgid "Currently logging to: "
1146
  msgstr ""
1147
 
1148
+ #: wp-cache.php:1449
1149
  msgid ""
1150
  "Fix problems with the plugin by debugging it here. It can send you debug "
1151
  "emails or log them to a file in your cache directory."
1152
  msgstr ""
1153
 
1154
+ #: wp-cache.php:1450
1155
  msgid ""
1156
  "Logging to a file is easier but faces the problem that clearing the cache "
1157
  "will clear the log file."
1158
  msgstr ""
1159
 
1160
+ #: wp-cache.php:1454
1161
  msgid "Debugging"
1162
  msgstr ""
1163
 
1164
+ #: wp-cache.php:1455
1165
  msgid "Logging Type"
1166
  msgstr ""
1167
 
1168
+ #: wp-cache.php:1455
1169
  msgid "Email"
1170
  msgstr ""
1171
 
1172
+ #: wp-cache.php:1456
1173
  msgid "file"
1174
  msgstr ""
1175
 
1176
+ #: wp-cache.php:1457
1177
  msgid "IP Address"
1178
  msgstr ""
1179
 
1180
+ #: wp-cache.php:1457
1181
  #, php-format
1182
  msgid "(only log requests from this IP address. Your IP is %s)"
1183
  msgstr ""
1184
 
1185
+ #: wp-cache.php:1458
1186
  msgid "Log level"
1187
  msgstr ""
1188
 
1189
+ #: wp-cache.php:1464
1190
  msgid "(1 = less, 5 = more, may cause severe server load.)"
1191
  msgstr ""
1192
 
1193
+ #: wp-cache.php:1467
 
 
 
 
1194
  msgid ""
1195
  "In very rare cases two problems may arise on some blogs:<ol><li> The front "
1196
  "page may start downloading as a zip file.</li><li> The wrong page is "
1198
  "and the permalink structure is <em>/%category%/%postname%/</em>.</li></ol>"
1199
  msgstr ""
1200
 
1201
+ #: wp-cache.php:1468
1202
  #, php-format
1203
  msgid ""
1204
  "I&#8217;m 99% certain that they aren&#8217;t bugs in WP Super Cache and they "
1207
  "emailed if there is a problem."
1208
  msgstr ""
1209
 
1210
+ #: wp-cache.php:1470
1211
  msgid "Check front page every 5 minutes."
1212
  msgstr ""
1213
 
1214
+ #: wp-cache.php:1471
1215
  msgid "Front page text"
1216
  msgstr ""
1217
 
1218
+ #: wp-cache.php:1471
1219
  msgid ""
1220
  "Text to search for on your front page. If this text is missing the cache "
1221
  "will be cleared. Leave blank to disable."
1222
  msgstr ""
1223
 
1224
+ #: wp-cache.php:1472
1225
  msgid "Clear cache on error."
1226
  msgstr ""
1227
 
1228
+ #: wp-cache.php:1473
1229
  msgid "Email the blog admin when checks are made. (useful for testing)"
1230
  msgstr ""
1231
 
1232
+ #: wp-cache.php:1487
1233
  msgid ""
1234
  "Error: GZIP compression is enabled, disable it if you want to enable wp-"
1235
  "cache."
1236
  msgstr ""
1237
 
1238
+ #: wp-cache.php:1534 wp-cache.php:1696
1239
  msgid "Warning"
1240
  msgstr ""
1241
 
1242
+ #: wp-cache.php:1534
1243
  msgid ""
1244
  "GZIP compression is enabled in WordPress, wp-cache will be bypassed until "
1245
  "you disable gzip compression."
1246
  msgstr ""
1247
 
1248
+ #: wp-cache.php:1592 wp-cache.php:1597 wp-cache.php:1629 wp-cache.php:1634
1249
+ #: wp-cache.php:1640
1250
  msgid "Error"
1251
  msgstr ""
1252
 
1253
+ #: wp-cache.php:1592
1254
  #, php-format
1255
  msgid ""
1256
  "Your cache directory (<strong>$cache_path</strong>) did not exist and "
1257
  "couldn&#8217;t be created by the web server. Check %s permissions."
1258
  msgstr ""
1259
 
1260
+ #: wp-cache.php:1597
1261
  #, php-format
1262
  msgid ""
1263
  "Your cache directory (<strong>%1$s</strong>) or <strong>%2$s</strong> need "
1264
  "to be writable for this plugin to work. Double-check it."
1265
  msgstr ""
1266
 
1267
+ #: wp-cache.php:1629
1268
  #, php-format
1269
  msgid ""
1270
  "Your WP-Cache config file (<strong>%s</strong>) is out of date and not "
1271
  "writable by the Web server.Please delete it and refresh this page."
1272
  msgstr ""
1273
 
1274
+ #: wp-cache.php:1634
1275
  #, php-format
1276
  msgid ""
1277
  "Configuration file missing and %1$s directory (<strong>%2$s</strong>) is "
1278
  "not writable by the Web server.Check its permissions."
1279
  msgstr ""
1280
 
1281
+ #: wp-cache.php:1640
1282
  #, php-format
1283
  msgid ""
1284
  "Sample WP-Cache config file (<strong>%s</strong>) does not exist.Verify you "
1285
  "installation."
1286
  msgstr ""
1287
 
1288
+ #: wp-cache.php:1696
1289
  #, php-format
1290
  msgid "%s/advanced-cache.php</em> does not exist or cannot be updated."
1291
  msgstr ""
1292
 
1293
+ #: wp-cache.php:1697
1294
  msgid "1. If it already exists please delete the file first."
1295
  msgstr ""
1296
 
1297
+ #: wp-cache.php:1698
1298
  #, php-format
1299
  msgid ""
1300
  "2. Make %1$s writable using the chmod command through your ftp or server "
1303
  "again. (Change 777 to 755 in the previous command)"
1304
  msgstr ""
1305
 
1306
+ #: wp-cache.php:1699
1307
  #, php-format
1308
  msgid "3. Refresh this page to update <em>%s/advanced-cache.php</em>"
1309
  msgstr ""
1310
 
1311
+ #: wp-cache.php:1700
1312
  #, php-format
1313
  msgid ""
1314
  "If that doesn&#8217;t work, make sure the file <em>%s/advanced-cache.php</"
1315
  "em> doesn&#8217;t exist:"
1316
  msgstr ""
1317
 
1318
+ #: wp-cache.php:1701
1319
  #, php-format
1320
  msgid ""
1321
  "<li>1. Open <em>%1$s$wp_cache_file</em> in a text editor.</li><li>2. Change "
1323
  "copy it to <em>%3$s</em> and refresh this page.</li>"
1324
  msgstr ""
1325
 
1326
+ #: wp-cache.php:1724
1327
  msgid ""
1328
+ "<h3>WP_CACHE constant set to false</h3><p>The WP_CACHE constant is used by "
1329
+ "WordPress to load the code that serves cached pages. Unfortunately it is set "
1330
+ "to false. Please edit your wp-config.php and add or edit the following line "
1331
+ "above the final require_once command:<br /><br /><code>define('WP_CACHE', "
1332
+ "true);</code></p>"
1333
  msgstr ""
1334
 
1335
+ #: wp-cache.php:1726
1336
  msgid ""
1337
  "<strong>Error: WP_CACHE is not enabled</strong> in your <code>wp-config.php</"
1338
  "code> file and I couldn&#8217;t modify it."
1339
  msgstr ""
1340
 
1341
+ #: wp-cache.php:1727
1342
  #, php-format
1343
  msgid ""
1344
  "Edit <code>%s</code> and add the following line:<br /> <code>define"
1346
  "executed</strong> by WordPress core. "
1347
  msgstr ""
1348
 
1349
+ #: wp-cache.php:1731
1350
  msgid ""
1351
  "<h3>WP_CACHE constant added to wp-config.php</h3><p>If you continue to see "
1352
  "this warning message please see point 5 of the <a href=\"http://wordpress."
1354
  "moved up."
1355
  msgstr ""
1356
 
1357
+ #: wp-cache.php:1753
1358
  msgid "Cache Contents"
1359
  msgstr ""
1360
 
1361
+ #: wp-cache.php:1756
1362
  msgid "Object cache in use. No cache listing available."
1363
  msgstr ""
1364
 
1365
+ #: wp-cache.php:1780
1366
  #, php-format
1367
  msgid "Deleting supercache file: <strong>%s</strong><br />"
1368
  msgstr ""
1369
 
1370
+ #: wp-cache.php:1797
1371
  #, php-format
1372
  msgid "Deleting wp-cache file: <strong>%s</strong><br />"
1373
  msgstr ""
1374
 
1375
+ #: wp-cache.php:1862
1376
  msgid ""
1377
  "Cache stats are not automatically generated. You must click the link below "
1378
  "to regenerate the stats on this page."
1379
  msgstr ""
1380
 
1381
+ #: wp-cache.php:1863
1382
  msgid "Regenerate cache stats"
1383
  msgstr ""
1384
 
1385
+ #: wp-cache.php:1865
1386
  #, php-format
1387
  msgid "Cache stats last generated: %s minutes ago."
1388
  msgstr ""
1389
 
1390
+ #: wp-cache.php:1871
1391
  msgid "WP-Cache"
1392
  msgstr ""
1393
 
1394
+ #: wp-cache.php:1872 wp-cache.php:1888
1395
  #, php-format
1396
  msgid "%s Cached Pages"
1397
  msgstr ""
1398
 
1399
+ #: wp-cache.php:1873 wp-cache.php:1893
1400
  #, php-format
1401
  msgid "%s Expired Pages"
1402
  msgstr ""
1403
 
1404
+ #: wp-cache.php:1887
1405
  msgid "WP-Super-Cache"
1406
  msgstr ""
1407
 
1408
+ #: wp-cache.php:1898
1409
  msgid "Fresh WP-Cached Files"
1410
  msgstr ""
1411
 
1412
+ #: wp-cache.php:1899 wp-cache.php:1915 wp-cache.php:1931 wp-cache.php:1947
1413
  msgid "URI"
1414
  msgstr ""
1415
 
1416
+ #: wp-cache.php:1899 wp-cache.php:1915
1417
  msgid "Key"
1418
  msgstr ""
1419
 
1420
+ #: wp-cache.php:1899 wp-cache.php:1915 wp-cache.php:1931 wp-cache.php:1947
1421
  msgid "Age"
1422
  msgstr ""
1423
 
1424
+ #: wp-cache.php:1899 wp-cache.php:1915 wp-cache.php:1931 wp-cache.php:1947
1425
  msgid "Delete"
1426
  msgstr ""
1427
 
1428
+ #: wp-cache.php:1914
1429
  msgid "Stale WP-Cached Files"
1430
  msgstr ""
1431
 
1432
+ #: wp-cache.php:1930
1433
  msgid "Fresh Super Cached Files"
1434
  msgstr ""
1435
 
1436
+ #: wp-cache.php:1946
1437
  msgid "Stale Super Cached Files"
1438
  msgstr ""
1439
 
1440
+ #: wp-cache.php:1962
1441
  msgid "Hide file list"
1442
  msgstr ""
1443
 
1444
+ #: wp-cache.php:1964
1445
  msgid "Too many cached files, no listing possible."
1446
  msgstr ""
1447
 
1448
+ #: wp-cache.php:1966
1449
+ msgid "List all cached files"
1450
+ msgstr ""
1451
+
1452
+ #: wp-cache.php:1972
1453
  #, php-format
1454
  msgid ""
1455
  "<strong>Garbage Collection</strong><br />Last GC was <strong>%s</strong> "
1456
  "minutes ago<br />"
1457
  msgstr ""
1458
 
1459
+ #: wp-cache.php:1973
1460
  #, php-format
1461
  msgid "Next GC in <strong>%s</strong> minutes"
1462
  msgstr ""
1463
 
1464
+ #: wp-cache.php:1976
1465
  #, php-format
1466
  msgid ""
1467
  "Expired files are files older than %s seconds. They are still used by the "
1468
  "plugin and are deleted periodically."
1469
  msgstr ""
1470
 
1471
+ #: wp-cache.php:1987
1472
  msgid "Delete Expired"
1473
  msgstr ""
1474
 
1475
+ #: wp-cache.php:1993 wp-cache.php:2005 wp-cache.php:2168
1476
  msgid "Delete Cache"
1477
  msgstr ""
1478
 
1479
+ #: wp-cache.php:2005
1480
  msgid "Delete Super Cache cached files (opens in new window)"
1481
  msgstr ""
1482
 
1483
+ #: wp-cache.php:2144
1484
  #, php-format
1485
  msgid "%1$s is Digg proof thanks to caching by %2$s"
1486
  msgstr ""
1487
 
1488
+ #: wp-cache.php:2177
1489
  #, php-format
1490
  msgid ""
1491
  "WP Super Cache must be configured. Go to <a href=\"%s\">the admin page</a> "
1492
  "to enable and configure the plugin."
1493
  msgstr ""
1494
 
1495
+ #: wp-cache.php:2183
1496
  msgid "Settings"
1497
  msgstr ""
1498
 
1499
+ #: wp-cache.php:2193
1500
  #, php-format
1501
  msgid ""
1502
  "WP Super Cache is disabled. Please go to the <a href=\"%s\">plugin admin "
1503
  "page</a> to enable caching."
1504
  msgstr ""
1505
 
1506
+ #: wp-cache.php:2212
1507
  #, php-format
1508
  msgid "[%s] Front page is gzipped! Please clear cache!"
1509
  msgstr ""
1510
 
1511
+ #: wp-cache.php:2212
1512
  #, php-format
1513
  msgid ""
1514
  "Please visit %s to clear the cache as the front page of your site is now "
1515
  "downloading!"
1516
  msgstr ""
1517
 
1518
+ #: wp-cache.php:2215
1519
  #, php-format
1520
  msgid "[%s] Front page is gzipped! Cache Cleared!"
1521
  msgstr ""
1522
 
1523
+ #: wp-cache.php:2215
1524
  #, php-format
1525
  msgid ""
1526
  "The cache on your blog has been cleared because the front page of your site "
1527
  "is now downloading. Please visit %s to verify the cache has been cleared."
1528
  msgstr ""
1529
 
1530
+ #: wp-cache.php:2222
1531
  #, php-format
1532
  msgid "[%s] Front page is not correct! Please clear cache!"
1533
  msgstr ""
1534
 
1535
+ #: wp-cache.php:2222
1536
  #, php-format
1537
  msgid ""
1538
  "Please visit %1$s to clear the cache as the front page of your site is not "
1539
  "correct and missing the text, \"%2$s\"!"
1540
  msgstr ""
1541
 
1542
+ #: wp-cache.php:2225
1543
  #, php-format
1544
  msgid "[%s] Front page is not correct! Cache Cleared!"
1545
  msgstr ""
1546
 
1547
+ #: wp-cache.php:2225
1548
  #, php-format
1549
  msgid ""
1550
  "The cache on your blog has been cleared because the front page of your site "
1552
  "cleared."
1553
  msgstr ""
1554
 
1555
+ #: wp-cache.php:2230
1556
  #, php-format
1557
  msgid "[%s] Front page check!"
1558
  msgstr ""
1559
 
1560
+ #: wp-cache.php:2230
1561
  #, php-format
1562
  msgid ""
1563
  "WP Super Cache has checked the front page of your blog. Please visit %s if "
1564
  "you would like to disable this."
1565
  msgstr ""
1566
 
1567
+ #: wp-cache.php:2273
1568
  msgid "Cannot update .htaccess"
1569
  msgstr ""
1570
 
1571
+ #: wp-cache.php:2273
1572
  #, php-format
1573
  msgid ""
1574
  "The file <code>%s.htaccess</code> cannot be modified by the web server. "
1575
  "Please correct this using the chmod command or your ftp client."
1576
  msgstr ""
1577
 
1578
+ #: wp-cache.php:2273
1579
  msgid "Refresh this page when the file permissions have been modified."
1580
  msgstr ""
1581
 
1582
+ #: wp-cache.php:2273
1583
  #, php-format
1584
  msgid ""
1585
  "Alternatively, you can edit your <code>%s.htaccess</code> file manually and "
1586
  "add the following code (before any WordPress rules):"
1587
  msgstr ""
1588
 
1589
+ #: wp-cache.php:2277
1590
  #, php-format
1591
  msgid ""
1592
  "To serve static html files your server must have the correct mod_rewrite "
1593
  "rules added to a file called <code>%s.htaccess</code>"
1594
  msgstr ""
1595
 
1596
+ #: wp-cache.php:2278
 
 
 
 
1597
  msgid "You can edit the file yourself add the following rules."
1598
  msgstr ""
1599
 
1600
+ #: wp-cache.php:2279
1601
  msgid " Make sure they appear before any existing WordPress rules. "
1602
  msgstr ""
1603
 
1604
+ #: wp-cache.php:2287
1605
  msgid "Update Mod_Rewrite Rules"
1606
  msgstr ""
1607
 
1608
+ #: wp-cache.php:2383
1609
  #, php-format
1610
  msgid "[%1$s] Cache Preload Started"
1611
  msgstr ""
1612
 
1613
+ #: wp-cache.php:2385
1614
  #, php-format
1615
  msgid "[%1$s] Refreshing posts from %2$d to %3$d"
1616
  msgstr ""
1617
 
1618
+ #: wp-cache.php:2396
1619
  #, php-format
1620
  msgid "[%1$s] %2$d posts refreshed"
1621
  msgstr ""
1622
 
1623
+ #: wp-cache.php:2396
1624
  msgid "Refreshed the following posts:"
1625
  msgstr ""
1626
 
1627
+ #: wp-cache.php:2405
1628
  #, php-format
1629
  msgid "Scheduling next preload refresh in %d minutes."
1630
  msgstr ""
1631
 
1632
+ #: wp-cache.php:2415
1633
  #, php-format
1634
  msgid "[%s] Cache Preload Completed"
1635
  msgstr ""
1636
 
1637
+ #: wp-cache.php:2415
1638
  msgid "Cleaning up old supercache files."
1639
  msgstr ""
1640
+
1641
+ #: wp-cache.php:2456
1642
+ #, php-format
1643
+ msgid "[%s] Preload may have stalled."
1644
+ msgstr ""
1645
+
1646
+ #: wp-cache.php:2456
1647
+ #, php-format
1648
+ msgid ""
1649
+ "Preload has been restarted.\n"
1650
+ "%s"
1651
+ msgstr ""