Version Description
Download this release
Release Info
Developer | donncha |
Plugin | WP Super Cache |
Version | 0.8.1 |
Comparing to | |
See all releases |
Code changes from version 0.8 to 0.8.1
- Changelog.txt +64 -0
- readme.txt +21 -11
- wp-cache-phase2.php +31 -10
- wp-cache.php +16 -3
Changelog.txt
CHANGED
@@ -1,3 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
2008-09-23 13:05 donncha
|
2 |
|
3 |
* readme.txt, wp-cache.php: Bump the version to 0.8
|
1 |
+
2008-09-24 13:03 donncha
|
2 |
+
|
3 |
+
* wp-cache-phase2.php: Added function to clear cache when a post is
|
4 |
+
edited
|
5 |
+
|
6 |
+
2008-09-24 13:02 donncha
|
7 |
+
|
8 |
+
* wp-cache.php: Added "Clear on edit" checkbox to clear all cache
|
9 |
+
files when a post or page is edited
|
10 |
+
|
11 |
+
2008-09-24 13:01 donncha
|
12 |
+
|
13 |
+
* wp-cache.php: Remove meta and supercache directories when
|
14 |
+
deactivating
|
15 |
+
|
16 |
+
2008-09-24 12:47 donncha
|
17 |
+
|
18 |
+
* wp-cache.php: Switch status messages around.
|
19 |
+
|
20 |
+
2008-09-24 12:47 donncha
|
21 |
+
|
22 |
+
* wp-cache.php: Remove cache/.htaccess when uninstalling.
|
23 |
+
|
24 |
+
2008-09-24 12:44 donncha
|
25 |
+
|
26 |
+
* readme.txt: Make mod mime and rewrite line clearer, hopefully
|
27 |
+
|
28 |
+
2008-09-24 12:38 donncha
|
29 |
+
|
30 |
+
* wp-cache-phase2.php: comment_id typo
|
31 |
+
Only clear supercache files if it's enabled
|
32 |
+
|
33 |
+
2008-09-24 12:37 donncha
|
34 |
+
|
35 |
+
* readme.txt: Updated mod_rewrite rules and expiry/mime type rules
|
36 |
+
|
37 |
+
2008-09-24 11:57 donncha
|
38 |
+
|
39 |
+
* Changelog.txt: Updated changelog for 0.8.1
|
40 |
+
|
41 |
+
2008-09-24 11:57 donncha
|
42 |
+
|
43 |
+
* readme.txt, wp-cache.php: Bump the version number
|
44 |
+
|
45 |
+
2008-09-24 10:01 donncha
|
46 |
+
|
47 |
+
* wp-cache-phase2.php: Make the temporary filename world readable
|
48 |
+
to avoid problems where Apache and PHP run as different users.
|
49 |
+
Thanks Tigertech for the code.
|
50 |
+
|
51 |
+
2008-09-24 09:57 donncha
|
52 |
+
|
53 |
+
* wp-cache-phase2.php: Check that rename worked, if not, remove
|
54 |
+
cache file and rename again. Props tigertech
|
55 |
+
|
56 |
+
2008-09-23 19:55 donncha
|
57 |
+
|
58 |
+
* wp-cache-phase2.php: Don't clear the supercache if it's not
|
59 |
+
enabled (In blog context, when a moderated comment is made)
|
60 |
+
|
61 |
+
2008-09-23 13:09 donncha
|
62 |
+
|
63 |
+
* Changelog.txt: Updated changelog
|
64 |
+
|
65 |
2008-09-23 13:05 donncha
|
66 |
|
67 |
* readme.txt, wp-cache.php: Bump the version to 0.8
|
readme.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
Contributors: donncha
|
3 |
Tags: performance,caching,wp-cache
|
4 |
Tested up to: 2.6.2
|
5 |
-
Stable tag: 0.8
|
6 |
Requires at least: 2.2
|
7 |
|
8 |
A very fast caching engine for WordPress that produces static html files.
|
@@ -26,7 +26,7 @@ See the [WP Super Cache homepage](http://ocaoimh.ie/wp-super-cache/) for further
|
|
26 |
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.
|
27 |
|
28 |
== Installation ==
|
29 |
-
1. You should have mod mime
|
30 |
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.
|
31 |
3. Upload this directory to your plugins directory. It will create a 'wp-content/plugins/wp-super-cache/' directory.
|
32 |
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.
|
@@ -39,19 +39,14 @@ The [changelog](http://svn.wp-plugins.org/wp-super-cache/trunk/Changelog.txt) is
|
|
39 |
`RewriteBase /`
|
40 |
|
41 |
`RewriteCond %{REQUEST_METHOD} !=POST`
|
42 |
-
`RewriteCond %{QUERY_STRING}
|
43 |
-
`RewriteCond %{QUERY_STRING} !.*p=.*`
|
44 |
-
`RewriteCond %{QUERY_STRING} !.*attachment_id=.*`
|
45 |
-
`RewriteCond %{QUERY_STRING} !.*wp-subscription-manager=.*`
|
46 |
`RewriteCond %{HTTP_COOKIE} !^.*(comment_author_|wordpress|wp-postpass_).*$`
|
47 |
`RewriteCond %{HTTP:Accept-Encoding} gzip`
|
48 |
`RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f`
|
49 |
`RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz [L]`
|
50 |
|
51 |
`RewriteCond %{REQUEST_METHOD} !=POST`
|
52 |
-
`RewriteCond %{QUERY_STRING}
|
53 |
-
`RewriteCond %{QUERY_STRING} !.*p=.*`
|
54 |
-
`RewriteCond %{QUERY_STRING} !.*wp-subscription-manager=.*`
|
55 |
`RewriteCond %{QUERY_STRING} !.*attachment_id=.*`
|
56 |
`RewriteCond %{HTTP_COOKIE} !^.*(comment_author_|wordpress|wp-postpass_).*$`
|
57 |
`RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f`
|
@@ -63,8 +58,23 @@ The [changelog](http://svn.wp-plugins.org/wp-super-cache/trunk/Changelog.txt) is
|
|
63 |
`-----------------.htaccess-----------------`
|
64 |
8. After you have enabled the plugin, look for the file "wp-content/cache/.htaccess". If it's not there you must create it. It should read:
|
65 |
|
66 |
-
|
67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
== Frequently Asked Questions ==
|
70 |
|
2 |
Contributors: donncha
|
3 |
Tags: performance,caching,wp-cache
|
4 |
Tested up to: 2.6.2
|
5 |
+
Stable tag: 0.8.1
|
6 |
Requires at least: 2.2
|
7 |
|
8 |
A very fast caching engine for WordPress that produces static html files.
|
26 |
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.
|
27 |
|
28 |
== Installation ==
|
29 |
+
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.
|
30 |
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.
|
31 |
3. Upload this directory to your plugins directory. It will create a 'wp-content/plugins/wp-super-cache/' directory.
|
32 |
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.
|
39 |
`RewriteBase /`
|
40 |
|
41 |
`RewriteCond %{REQUEST_METHOD} !=POST`
|
42 |
+
`RewriteCond %{QUERY_STRING} !.*=.*`
|
|
|
|
|
|
|
43 |
`RewriteCond %{HTTP_COOKIE} !^.*(comment_author_|wordpress|wp-postpass_).*$`
|
44 |
`RewriteCond %{HTTP:Accept-Encoding} gzip`
|
45 |
`RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f`
|
46 |
`RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz [L]`
|
47 |
|
48 |
`RewriteCond %{REQUEST_METHOD} !=POST`
|
49 |
+
`RewriteCond %{QUERY_STRING} !.*=.*`
|
|
|
|
|
50 |
`RewriteCond %{QUERY_STRING} !.*attachment_id=.*`
|
51 |
`RewriteCond %{HTTP_COOKIE} !^.*(comment_author_|wordpress|wp-postpass_).*$`
|
52 |
`RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f`
|
58 |
`-----------------.htaccess-----------------`
|
59 |
8. After you have enabled the plugin, look for the file "wp-content/cache/.htaccess". If it's not there you must create it. It should read:
|
60 |
|
61 |
+
`# BEGIN supercache`
|
62 |
+
`<IfModule mod_mime.c>`
|
63 |
+
` AddEncoding x-gzip .gz`
|
64 |
+
` AddType text/html .gz`
|
65 |
+
`</IfModule>`
|
66 |
+
`<IfModule mod_deflate.c>`
|
67 |
+
` SetEnvIfNoCase Request_URI \.gz$ no-gzip`
|
68 |
+
`</IfModule>`
|
69 |
+
`<IfModule mod_headers.c>`
|
70 |
+
` Header set Cache-Control 'max-age=300, must-revalidate'`
|
71 |
+
`</IfModule>`
|
72 |
+
`<IfModule mod_expires.c>`
|
73 |
+
` ExpiresActive On`
|
74 |
+
` ExpiresByType text/html A300`
|
75 |
+
`</IfModule>`
|
76 |
+
``
|
77 |
+
`# END supercache`
|
78 |
|
79 |
== Frequently Asked Questions ==
|
80 |
|
wp-cache-phase2.php
CHANGED
@@ -7,10 +7,10 @@ function wp_cache_phase2() {
|
|
7 |
wp_cache_mutex_init();
|
8 |
if(function_exists('add_action') && ( !defined( 'WPLOCKDOWN' ) || ( defined( 'WPLOCKDOWN' ) && constant( 'WPLOCKDOWN' ) == '0' ) ) ) {
|
9 |
// Post ID is received
|
10 |
-
add_action('publish_post', '
|
11 |
-
add_action('edit_post', '
|
12 |
-
add_action('delete_post', '
|
13 |
-
add_action('publish_phone', '
|
14 |
// Coment ID is received
|
15 |
add_action('trackback_post', 'wp_cache_get_postid_from_comment', 0);
|
16 |
add_action('pingback_post', 'wp_cache_get_postid_from_comment', 0);
|
@@ -236,11 +236,18 @@ function wp_cache_ob_callback($buffer) {
|
|
236 |
fclose($fr);
|
237 |
if( $fr2 ) {
|
238 |
fclose($fr2);
|
239 |
-
|
|
|
|
|
|
|
|
|
240 |
}
|
241 |
if( $gz ) {
|
242 |
fclose($gz);
|
243 |
-
rename( $tmp_cache_filename . '.gz', $cache_fname . '.gz' )
|
|
|
|
|
|
|
244 |
}
|
245 |
}
|
246 |
wp_cache_writers_exit();
|
@@ -264,7 +271,10 @@ function wp_cache_phase2_clean_cache($file_prefix) {
|
|
264 |
}
|
265 |
|
266 |
function prune_super_cache($directory, $force = false) {
|
267 |
-
global $cache_max_time, $cache_path;
|
|
|
|
|
|
|
268 |
|
269 |
if( !isset( $cache_max_time ) )
|
270 |
$cache_max_time = 3600;
|
@@ -417,7 +427,7 @@ function wp_cache_no_postid($id) {
|
|
417 |
|
418 |
function wp_cache_get_postid_from_comment($comment_id) {
|
419 |
global $super_cache_enabled;
|
420 |
-
$comment = get_comment($
|
421 |
$postid = $comment['comment_post_ID'];
|
422 |
// Do nothing if comment is not moderated
|
423 |
// http://ocaoimh.ie/2006/12/05/caching-wordpress-with-wp-cache-in-a-spam-filled-world
|
@@ -436,6 +446,15 @@ function wp_cache_get_postid_from_comment($comment_id) {
|
|
436 |
return wp_cache_post_change(wp_cache_post_id());
|
437 |
}
|
438 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
439 |
function wp_cache_post_change($post_id) {
|
440 |
global $file_prefix, $cache_path, $blog_id, $blogcacheid, $super_cache_enabled;
|
441 |
static $last_processed = -1;
|
@@ -470,8 +489,10 @@ function wp_cache_post_change($post_id) {
|
|
470 |
if ($meta->blog_id == $blog_id && (!$meta->post || $meta->post == $post_id) ) {
|
471 |
@unlink($meta_pathname);
|
472 |
@unlink($content_pathname);
|
473 |
-
|
474 |
-
|
|
|
|
|
475 |
}
|
476 |
} elseif ($meta->blog_id == $blog_id) {
|
477 |
@unlink($meta_pathname);
|
7 |
wp_cache_mutex_init();
|
8 |
if(function_exists('add_action') && ( !defined( 'WPLOCKDOWN' ) || ( defined( 'WPLOCKDOWN' ) && constant( 'WPLOCKDOWN' ) == '0' ) ) ) {
|
9 |
// Post ID is received
|
10 |
+
add_action('publish_post', 'wp_cache_post_edit', 0);
|
11 |
+
add_action('edit_post', 'wp_cache_post_edit', 0);
|
12 |
+
add_action('delete_post', 'wp_cache_post_edit', 0);
|
13 |
+
add_action('publish_phone', 'wp_cache_post_edit', 0);
|
14 |
// Coment ID is received
|
15 |
add_action('trackback_post', 'wp_cache_get_postid_from_comment', 0);
|
16 |
add_action('pingback_post', 'wp_cache_get_postid_from_comment', 0);
|
236 |
fclose($fr);
|
237 |
if( $fr2 ) {
|
238 |
fclose($fr2);
|
239 |
+
chmod( $tmp_cache_filename, 0666 & ~umask());
|
240 |
+
if( !rename( $tmp_cache_filename, $cache_fname ) ) {
|
241 |
+
unlink( $cache_fname );
|
242 |
+
rename( $tmp_cache_filename, $cache_fname );
|
243 |
+
}
|
244 |
}
|
245 |
if( $gz ) {
|
246 |
fclose($gz);
|
247 |
+
if( !rename( $tmp_cache_filename . '.gz', $cache_fname . '.gz' ) ) {
|
248 |
+
unlink( $cache_fname . '.gz' );
|
249 |
+
rename( $tmp_cache_filename . '.gz', $cache_fname . '.gz' );
|
250 |
+
}
|
251 |
}
|
252 |
}
|
253 |
wp_cache_writers_exit();
|
271 |
}
|
272 |
|
273 |
function prune_super_cache($directory, $force = false) {
|
274 |
+
global $cache_max_time, $cache_path, $super_cache_enabled;
|
275 |
+
|
276 |
+
if( !is_admin() && $super_cache_enabled == 0 )
|
277 |
+
return false;
|
278 |
|
279 |
if( !isset( $cache_max_time ) )
|
280 |
$cache_max_time = 3600;
|
427 |
|
428 |
function wp_cache_get_postid_from_comment($comment_id) {
|
429 |
global $super_cache_enabled;
|
430 |
+
$comment = get_comment($comment_id, ARRAY_A);
|
431 |
$postid = $comment['comment_post_ID'];
|
432 |
// Do nothing if comment is not moderated
|
433 |
// http://ocaoimh.ie/2006/12/05/caching-wordpress-with-wp-cache-in-a-spam-filled-world
|
446 |
return wp_cache_post_change(wp_cache_post_id());
|
447 |
}
|
448 |
|
449 |
+
function wp_cache_post_edit($post_id) {
|
450 |
+
global $wp_cache_clear_on_post_edit, $cache_path;
|
451 |
+
if( $wp_cache_clear_on_post_edit ) {
|
452 |
+
prune_super_cache( $cache_path, true );
|
453 |
+
} else {
|
454 |
+
wp_cache_post_change( $post_id );
|
455 |
+
}
|
456 |
+
}
|
457 |
+
|
458 |
function wp_cache_post_change($post_id) {
|
459 |
global $file_prefix, $cache_path, $blog_id, $blogcacheid, $super_cache_enabled;
|
460 |
static $last_processed = -1;
|
489 |
if ($meta->blog_id == $blog_id && (!$meta->post || $meta->post == $post_id) ) {
|
490 |
@unlink($meta_pathname);
|
491 |
@unlink($content_pathname);
|
492 |
+
if( $super_cache_enabled ) {
|
493 |
+
@unlink( $cache_path . 'supercache/' . trailingslashit( $meta->uri ) . 'index.html' );
|
494 |
+
@unlink( $cache_path . 'supercache/' . trailingslashit( $meta->uri ) . 'index.html.gz' );
|
495 |
+
}
|
496 |
}
|
497 |
} elseif ($meta->blog_id == $blog_id) {
|
498 |
@unlink($meta_pathname);
|
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 module for WordPress. Once activated, you must <a href="options-general.php?page=wpsupercache">enable the cache</a>. Based on WP-Cache by <a href="http://mnm.uib.es/gallir/">Ricardo Galli Granada</a>.
|
6 |
-
Version: 0.8
|
7 |
Author: Donncha O Caoimh
|
8 |
Author URI: http://ocaoimh.ie/
|
9 |
*/
|
@@ -90,6 +90,9 @@ function wpsupercache_deactivate() {
|
|
90 |
if( !function_exists( 'prune_super_cache' ) )
|
91 |
include_once( 'wp-cache-phase2.php' );
|
92 |
prune_super_cache ($cache_path, true);
|
|
|
|
|
|
|
93 |
}
|
94 |
register_deactivation_hook( __FILE__, 'wpsupercache_deactivate' );
|
95 |
|
@@ -106,7 +109,7 @@ function wp_cache_add_pages() {
|
|
106 |
add_action('admin_menu', 'wp_cache_add_pages');
|
107 |
|
108 |
function wp_cache_manager() {
|
109 |
-
global $wp_cache_config_file, $valid_nonce, $supercachedir, $cache_path, $cache_enabled, $cache_compression, $super_cache_enabled, $wp_cache_hello_world;
|
110 |
|
111 |
if( function_exists( 'is_site_admin' ) )
|
112 |
if( !is_site_admin() )
|
@@ -228,6 +231,10 @@ function toggleLayer( whichLayer ) {
|
|
228 |
prune_super_cache ($cache_path, true);
|
229 |
delete_option( 'super_cache_meta' );
|
230 |
}
|
|
|
|
|
|
|
|
|
231 |
}
|
232 |
|
233 |
?><fieldset class="options">
|
@@ -235,9 +242,10 @@ function toggleLayer( whichLayer ) {
|
|
235 |
echo '<form name="wp_manager" action="'. $_SERVER["REQUEST_URI"] . '" method="post">';
|
236 |
?>
|
237 |
<label><input type='radio' name='wp_cache_status' value='all' <?php if( $cache_enabled == true && $super_cache_enabled == true ) { echo 'checked=checked'; } ?>> <strong>ON</strong> (WP Cache and Super Cache enabled)</label><br />
|
238 |
-
<label><input type='radio' name='wp_cache_status' value='none' <?php if( $cache_enabled == false ) { echo 'checked=checked'; } ?>> <strong>OFF</strong> (WP Cache and Super Cache disabled)</label><br />
|
239 |
<label><input type='radio' name='wp_cache_status' value='wpcache' <?php if( $cache_enabled == true && $super_cache_enabled == false ) { echo 'checked=checked'; } ?>> <strong>HALF ON</strong> (Super Cache Disabled, only legacy WP-Cache caching.)</label><br />
|
|
|
240 |
<p><label><input type='checkbox' name='wp_cache_hello_world' <?php if( $wp_cache_hello_world ) echo "checked"; ?> value='1'> Proudly tell the world your server is Digg proof! (places a message in your blog's footer)</label></p>
|
|
|
241 |
<p>Note: if uninstalling this plugin, make sure the directory <em><?php echo WP_CONTENT_DIR; ?></em> is writeable by the webserver so the files <em>advanced-cache.php</em> and <em>cache-config.php</em> can be deleted automatically. (Making sure those files are writeable too is probably a good idea!)</p>
|
242 |
<?php
|
243 |
echo "<div><input type='submit' " . SUBMITDISABLED . " value='Update Status »' /></div>";
|
@@ -1065,6 +1073,11 @@ function wp_cache_files() {
|
|
1065 |
echo '</fieldset>';
|
1066 |
}
|
1067 |
|
|
|
|
|
|
|
|
|
|
|
1068 |
function wpsc_dirsize($directory, $sizes) {
|
1069 |
global $cache_max_time;
|
1070 |
$now = time();
|
3 |
Plugin Name: WP Super Cache
|
4 |
Plugin URI: http://ocaoimh.ie/wp-super-cache/
|
5 |
Description: Very fast caching module for WordPress. Once activated, you must <a href="options-general.php?page=wpsupercache">enable the cache</a>. Based on WP-Cache by <a href="http://mnm.uib.es/gallir/">Ricardo Galli Granada</a>.
|
6 |
+
Version: 0.8.1
|
7 |
Author: Donncha O Caoimh
|
8 |
Author URI: http://ocaoimh.ie/
|
9 |
*/
|
90 |
if( !function_exists( 'prune_super_cache' ) )
|
91 |
include_once( 'wp-cache-phase2.php' );
|
92 |
prune_super_cache ($cache_path, true);
|
93 |
+
@unlink( $cache_path . '.htaccess' );
|
94 |
+
@unlink( $cache_path . 'meta' );
|
95 |
+
@unlink( $cache_path . 'supercache' );
|
96 |
}
|
97 |
register_deactivation_hook( __FILE__, 'wpsupercache_deactivate' );
|
98 |
|
109 |
add_action('admin_menu', 'wp_cache_add_pages');
|
110 |
|
111 |
function wp_cache_manager() {
|
112 |
+
global $wp_cache_config_file, $valid_nonce, $supercachedir, $cache_path, $cache_enabled, $cache_compression, $super_cache_enabled, $wp_cache_hello_world, $wp_cache_clear_on_post_edit;
|
113 |
|
114 |
if( function_exists( 'is_site_admin' ) )
|
115 |
if( !is_site_admin() )
|
231 |
prune_super_cache ($cache_path, true);
|
232 |
delete_option( 'super_cache_meta' );
|
233 |
}
|
234 |
+
if( isset( $_POST[ 'wp_cache_clear_on_post_edit' ] ) && $_POST[ 'wp_cache_clear_on_post_edit' ] != $wp_cache_clear_on_post_edit ) {
|
235 |
+
$wp_cache_clear_on_post_edit = intval( $_POST[ 'wp_cache_clear_on_post_edit' ] );
|
236 |
+
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);
|
237 |
+
}
|
238 |
}
|
239 |
|
240 |
?><fieldset class="options">
|
242 |
echo '<form name="wp_manager" action="'. $_SERVER["REQUEST_URI"] . '" method="post">';
|
243 |
?>
|
244 |
<label><input type='radio' name='wp_cache_status' value='all' <?php if( $cache_enabled == true && $super_cache_enabled == true ) { echo 'checked=checked'; } ?>> <strong>ON</strong> (WP Cache and Super Cache enabled)</label><br />
|
|
|
245 |
<label><input type='radio' name='wp_cache_status' value='wpcache' <?php if( $cache_enabled == true && $super_cache_enabled == false ) { echo 'checked=checked'; } ?>> <strong>HALF ON</strong> (Super Cache Disabled, only legacy WP-Cache caching.)</label><br />
|
246 |
+
<label><input type='radio' name='wp_cache_status' value='none' <?php if( $cache_enabled == false ) { echo 'checked=checked'; } ?>> <strong>OFF</strong> (WP Cache and Super Cache disabled)</label><br />
|
247 |
<p><label><input type='checkbox' name='wp_cache_hello_world' <?php if( $wp_cache_hello_world ) echo "checked"; ?> value='1'> Proudly tell the world your server is Digg proof! (places a message in your blog's footer)</label></p>
|
248 |
+
<p><label><input type='checkbox' name='wp_cache_clear_on_post_edit' <?php if( $wp_cache_clear_on_post_edit ) echo "checked"; ?> value='1'> Clear all cache files when a post or page is edited. (This may significantly slow down saving of posts.)</label></p>
|
249 |
<p>Note: if uninstalling this plugin, make sure the directory <em><?php echo WP_CONTENT_DIR; ?></em> is writeable by the webserver so the files <em>advanced-cache.php</em> and <em>cache-config.php</em> can be deleted automatically. (Making sure those files are writeable too is probably a good idea!)</p>
|
250 |
<?php
|
251 |
echo "<div><input type='submit' " . SUBMITDISABLED . " value='Update Status »' /></div>";
|
1073 |
echo '</fieldset>';
|
1074 |
}
|
1075 |
|
1076 |
+
function delete_cache_dashboard() {
|
1077 |
+
echo "<li><a href='" . wp_nonce_url( 'options-general.php?page=wpsupercache&wp_delete_cache=1#list', 'wp-cache' ) . "' target='_blank' title='Delete Super Cache cached files (opens in new window)'>Delete Cache</a></li>";
|
1078 |
+
}
|
1079 |
+
add_action( 'dashmenu', 'delete_cache_dashboard' );
|
1080 |
+
|
1081 |
function wpsc_dirsize($directory, $sizes) {
|
1082 |
global $cache_max_time;
|
1083 |
$now = time();
|