WP Super Cache - Version 0.9.3.1

Version Description

Download this release

Release Info

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

Code changes from version 0.9.3 to 0.9.3.1

Changelog.txt CHANGED
@@ -1,3 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  2009-04-05 08:25 donncha
2
 
3
  * wp-cache-phase2.php: Hide any potential opendir warnings
1
+ 2009-04-06 14:16 donncha
2
+
3
+ * readme.txt, wp-cache.php: Bump version to 0.9.3.1
4
+
5
+ 2009-04-06 14:16 donncha
6
+
7
+ * readme.txt: Added link to forum thread on posting problems in
8
+ 0.9.3
9
+
10
+ 2009-04-06 14:11 donncha
11
+
12
+ * readme.txt: Added "Recent Changes" section to start of readme.txt
13
+ to make life easier on those upgrading
14
+
15
+ 2009-04-05 22:15 donncha
16
+
17
+ * advanced-cache.php: Don't show broken path message in wp-admin.
18
+ Check if file is missing before showing an error
19
+
20
+ 2009-04-05 21:51 donncha
21
+
22
+ * wp-cache-phase1.php: Return true so the include_once() returns
23
+ true. Fixes problem with saving posts
24
+
25
+ 2009-04-05 18:53 donncha
26
+
27
+ * wp-cache-phase2.php: Clear the supercache when all cache is
28
+ cleared on post edit.
29
+
30
+ 2009-04-05 18:53 donncha
31
+
32
+ * advanced-cache.php: whitespace cleanup
33
+
34
+ 2009-04-05 09:36 donncha
35
+
36
+ * Changelog.txt: Updated changelog
37
+
38
  2009-04-05 08:25 donncha
39
 
40
  * wp-cache-phase2.php: Hide any potential opendir warnings
advanced-cache.php CHANGED
@@ -1,8 +1,12 @@
1
  <?php
2
  # WP SUPER CACHE 0.8.9.1
3
  function wpcache_broken_message() {
4
- echo "<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->";
 
 
 
 
 
 
5
  }
6
- if( !include_once( 'CACHEHOME' . 'wp-cache-phase1.php' ) )
7
- register_shutdown_function( 'wpcache_broken_message' );
8
  ?>
1
  <?php
2
  # WP SUPER CACHE 0.8.9.1
3
  function wpcache_broken_message() {
4
+ if ( false == strpos( $_SERVER[ 'REQUEST_URI' ], 'wp-admin' ) )
5
+ echo "<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->";
6
+ }
7
+
8
+ if ( !include_once( 'CACHEHOME' . 'wp-cache-phase1.php' ) ) {
9
+ if ( !@is_file( 'CACHEHOME' . 'wp-cache-phase1.php' ) )
10
+ register_shutdown_function( 'wpcache_broken_message' );
11
  }
 
 
12
  ?>
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: donncha
3
  Tags: performance,caching,wp-cache,wp-super-cache,cache
4
  Tested up to: 2.7.1
5
- Stable tag: 0.9.3
6
  Requires at least: 2.6
7
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3244504
8
 
@@ -11,15 +11,23 @@ A very fast caching engine for WordPress that produces static html files.
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
- However, because a user's details are displayed in the comment form after they leave a comment, the plugin will only serve static html files to:
 
 
 
 
 
 
 
 
15
 
16
  1. Users who are not logged in.
17
  2. Users who have not left a comment on your blog.
18
- 3. Or users who have not viewed a password protected post.
19
 
20
- The good news is that probably more than 99% of your visitors don't do any of the above! Those users who don't see the static files will still benefit because they will see regular WP-Cache cached files and your server won't be as busy as before. This plugin should help your server cope with a front page appearance on digg.com or other social networking site.
21
 
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.
2
  Contributors: donncha
3
  Tags: performance,caching,wp-cache,wp-super-cache,cache
4
  Tested up to: 2.7.1
5
+ Stable tag: 0.9.3.1
6
  Requires at least: 2.6
7
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3244504
8
 
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
+ = Recent Changes =
15
+
16
+ 1. Fix problem with saving posts in 0.9.3 [(more)](http://wordpress.org/support/topic/259636?replies=2)
17
+ 2. WordPress MU cache files will go in separate directories to scale better.
18
+ 3. Cache Rebuild on by default on new installs. File locking is off.
19
+ 4. More PHP5 `register_shutdown_function()` object destruction fixes.
20
+ 5. Warn user via html comment if path to wp-cache-phase1.php in advanced-cache.php is broken.
21
+
22
+ 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:
23
 
24
  1. Users who are not logged in.
25
  2. Users who have not left a comment on your blog.
26
+ 3. Or users who have not viewed a password protected post.
27
 
28
+ 99% of your visitors will be served static html files. Those users who don't see the static files will still benefit because they will see regular WP-Cache cached files and your server won't be as busy as before. This plugin will help your server cope with a front page appearance on digg.com or other social networking site.
29
 
30
+ 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.
31
  Super Cached html files will be served more quickly than PHP generated cached files but in every day use, the difference isn't noticeable.
32
 
33
  See the [WP Super Cache homepage](http://ocaoimh.ie/wp-super-cache/) for further information.
wp-cache-phase1.php CHANGED
@@ -4,7 +4,7 @@ if( !defined('WP_CONTENT_DIR') )
4
  define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
5
 
6
  if( !include( WP_CONTENT_DIR . '/wp-cache-config.php' ) )
7
- return;
8
  if( !defined( 'WPCACHEHOME' ) )
9
  define('WPCACHEHOME', dirname(__FILE__).'/');
10
 
@@ -18,7 +18,7 @@ if( $blogcacheid != '' ) {
18
 
19
  if(defined('DOING_CRON')) {
20
  require_once( WPCACHEHOME . 'wp-cache-phase2.php');
21
- return;
22
  }
23
 
24
  $mutex_filename = 'wp_cache_mutex.lock';
@@ -37,7 +37,7 @@ if( is_array( $plugins ) ) {
37
  }
38
 
39
  if (!$cache_enabled || $_SERVER["REQUEST_METHOD"] == 'POST')
40
- return;
41
 
42
  $file_expired = false;
43
  $cache_filename = '';
@@ -82,11 +82,11 @@ if( file_exists( $cache_file ) && ($mtime = @filemtime($meta_pathname)) ) {
82
  if ($mtime + $cache_max_time > time() ) {
83
 
84
  if (! ($meta = unserialize(@file_get_contents($meta_pathname))) )
85
- return;
86
  if( is_array( $meta ) == false ) {
87
  @unlink( $meta_pathname );
88
  @unlink( $cache_file );
89
- return;
90
  }
91
  $cache_file = do_cacheaction( 'wp_cache_served_cache_file', $cache_file );
92
  // Sometimes the gzip headers are lost. If this is a gzip capable client, send those headers.
@@ -102,7 +102,7 @@ if( file_exists( $cache_file ) && ($mtime = @filemtime($meta_pathname)) ) {
102
  }
103
  header( 'WP-Super-Cache: WP-Cache' );
104
  if ( !($content_size = @filesize($cache_file)) > 0 || $mtime < @filemtime($cache_file))
105
- return;
106
  if ( $meta[ 'dynamic' ] ) {
107
  include($cache_file);
108
  } else {
@@ -131,7 +131,7 @@ function wp_cache_postload() {
131
  global $cache_enabled;
132
 
133
  if (!$cache_enabled)
134
- return;
135
  require_once( WPCACHEHOME . 'wp-cache-phase2.php');
136
  wp_cache_phase2();
137
  }
4
  define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
5
 
6
  if( !include( WP_CONTENT_DIR . '/wp-cache-config.php' ) )
7
+ return true;
8
  if( !defined( 'WPCACHEHOME' ) )
9
  define('WPCACHEHOME', dirname(__FILE__).'/');
10
 
18
 
19
  if(defined('DOING_CRON')) {
20
  require_once( WPCACHEHOME . 'wp-cache-phase2.php');
21
+ return true;
22
  }
23
 
24
  $mutex_filename = 'wp_cache_mutex.lock';
37
  }
38
 
39
  if (!$cache_enabled || $_SERVER["REQUEST_METHOD"] == 'POST')
40
+ return true;
41
 
42
  $file_expired = false;
43
  $cache_filename = '';
82
  if ($mtime + $cache_max_time > time() ) {
83
 
84
  if (! ($meta = unserialize(@file_get_contents($meta_pathname))) )
85
+ return true;
86
  if( is_array( $meta ) == false ) {
87
  @unlink( $meta_pathname );
88
  @unlink( $cache_file );
89
+ return true;
90
  }
91
  $cache_file = do_cacheaction( 'wp_cache_served_cache_file', $cache_file );
92
  // Sometimes the gzip headers are lost. If this is a gzip capable client, send those headers.
102
  }
103
  header( 'WP-Super-Cache: WP-Cache' );
104
  if ( !($content_size = @filesize($cache_file)) > 0 || $mtime < @filemtime($cache_file))
105
+ return true;
106
  if ( $meta[ 'dynamic' ] ) {
107
  include($cache_file);
108
  } else {
131
  global $cache_enabled;
132
 
133
  if (!$cache_enabled)
134
+ return true;
135
  require_once( WPCACHEHOME . 'wp-cache-phase2.php');
136
  wp_cache_phase2();
137
  }
wp-cache-phase2.php CHANGED
@@ -587,6 +587,7 @@ function wp_cache_post_edit($post_id) {
587
  global $wp_cache_clear_on_post_edit, $cache_path, $blog_cache_dir;
588
  if( $wp_cache_clear_on_post_edit ) {
589
  prune_super_cache( $blog_cache_dir, true );
 
590
  } else {
591
  wp_cache_post_change( $post_id );
592
  }
587
  global $wp_cache_clear_on_post_edit, $cache_path, $blog_cache_dir;
588
  if( $wp_cache_clear_on_post_edit ) {
589
  prune_super_cache( $blog_cache_dir, true );
590
+ prune_super_cache( $cache_path . 'supercache/', true );
591
  } else {
592
  wp_cache_post_change( $post_id );
593
  }
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.3
7
  Author: Donncha O Caoimh
8
  Author URI: http://ocaoimh.ie/
9
  */
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.3.1
7
  Author: Donncha O Caoimh
8
  Author URI: http://ocaoimh.ie/
9
  */