WP Super Cache - Version 1.4.2

Version Description

Fixed "acceptable file list" and no caching for GET queries bugs in last release.

=

Download this release

Release Info

Developer jeherve
Plugin Icon 128x128 WP Super Cache
Version 1.4.2
Comparing to
See all releases

Code changes from version 1.4.1 to 1.4.2

Changelog.txt CHANGED
@@ -1,3 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  2014-08-07 12:45 donncha
2
 
3
  * wp-cache.php: Removed author information
1
+ 2014-08-08 13:07 donncha
2
+
3
+ * wp-cache-phase1.php: Just in case the local modified time of a
4
+ file is 0, disable the "last modified time" check.
5
+
6
+ 2014-08-08 11:32 donncha
7
+
8
+ * plugins/domain-mapping.php: Check if HTTPS exists before checking
9
+ it's value to avoid warnings
10
+
11
+ 2014-08-08 11:24 donncha
12
+
13
+ * wp-cache.php: Replace wpdb->escape with esc_sql() as it's
14
+ deprecated.
15
+
16
+ 2014-08-08 11:21 donncha
17
+
18
+ * wp-cache-phase2.php: Make sure $wp_cache_no_cache_for_get,
19
+ $wp_cache_object_cache, $wp_cache_request_uri are visible to the
20
+ OB callback to avoid warnings and fix functionality
21
+
22
+ 2014-08-07 14:00 donncha
23
+
24
+ * Changelog.txt, readme.txt, wp-cache.php: Updated changelog,
25
+ documentation, bumped version number to 1.4.1 and tested version.
26
+
27
  2014-08-07 12:45 donncha
28
 
29
  * wp-cache.php: Removed author information
plugins/domain-mapping.php CHANGED
@@ -10,7 +10,7 @@ function domain_mapping_gc_cache( $function, $directory ) {
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' )
@@ -39,7 +39,7 @@ function domain_mapping_supercachedir( $dir ) {
39
  if ( !$siteurl )
40
  return $dir;
41
 
42
- $protocol = ( 'on' == strtolower( $_SERVER['HTTPS' ] ) ) ? 'https://' : 'http://';
43
  $siteurl = str_replace( $protocol, '', $siteurl );
44
  return $cache_path . 'supercache/' . $siteurl;
45
  }
10
  if ( !$siteurl )
11
  return false;
12
 
13
+ $protocol = ( isset( $_SERVER['HTTPS' ] ) && 'on' == strtolower( $_SERVER['HTTPS' ] ) ) ? 'https://' : 'http://';
14
  $siteurl = trailingslashit( str_replace( $protocol, '', $siteurl ) );
15
 
16
  if ( $directory == 'homepage' )
39
  if ( !$siteurl )
40
  return $dir;
41
 
42
+ $protocol = ( isset( $_SERVER['HTTPS' ] ) && 'on' == strtolower( $_SERVER['HTTPS' ] ) ) ? 'https://' : 'http://';
43
  $siteurl = str_replace( $protocol, '', $siteurl );
44
  return $cache_path . 'supercache/' . $siteurl;
45
  }
readme.txt CHANGED
@@ -1,8 +1,8 @@
1
  === WP Super Cache ===
2
  Contributors: donncha, automattic
3
  Tags: performance,caching,wp-cache,wp-super-cache,cache
4
- Tested up to: 3.9.2
5
- Stable tag: 1.4.1
6
  Requires at least: 3.0
7
 
8
  A very fast caching engine for WordPress that produces static html files.
@@ -56,10 +56,16 @@ The cache directory, usually wp-content/cache/ is only for temporary files. Do n
56
 
57
  == Upgrade Notice ==
58
 
59
- = 1.4.1 =
60
- Fix for XSS in settings page.
61
 
62
  == Changelog ==
 
 
 
 
 
 
63
  = 1.4.1 =
64
  * Fixed XSS in settings page. Props Simon Waters, Surevine Limited.
65
  * Fix to object cache so entries may now be deleted when posts updated. (object cache still experimental)
1
  === WP Super Cache ===
2
  Contributors: donncha, automattic
3
  Tags: performance,caching,wp-cache,wp-super-cache,cache
4
+ Tested up to: 4.1
5
+ Stable tag: 1.4.2
6
  Requires at least: 3.0
7
 
8
  A very fast caching engine for WordPress that produces static html files.
56
 
57
  == Upgrade Notice ==
58
 
59
+ = 1.4.2 =
60
+ Fixed "acceptable file list" and no caching for GET queries bugs in last release.
61
 
62
  == Changelog ==
63
+ = 1.4.2 =
64
+ * Fixed "acceptable file list".
65
+ * Fixed "Don't cache GET requests" feature.
66
+ * Maybe fixed "304 not modified" problem for some users.
67
+ * Fixed some PHP warnings.
68
+
69
  = 1.4.1 =
70
  * Fixed XSS in settings page. Props Simon Waters, Surevine Limited.
71
  * Fix to object cache so entries may now be deleted when posts updated. (object cache still experimental)
wp-cache-phase1.php CHANGED
@@ -240,7 +240,7 @@ function wp_cache_serve_cache_file() {
240
  $remote_mod_time = 0;
241
  }
242
  $local_mod_time = gmdate("D, d M Y H:i:s",filemtime( $file )).' GMT';
243
- if ( $remote_mod_time == $local_mod_time ) {
244
  header("HTTP/1.0 304 Not Modified");
245
  exit();
246
  }
240
  $remote_mod_time = 0;
241
  }
242
  $local_mod_time = gmdate("D, d M Y H:i:s",filemtime( $file )).' GMT';
243
+ if ( $remote_mod_time != 0 && $remote_mod_time == $local_mod_time ) {
244
  header("HTTP/1.0 304 Not Modified");
245
  exit();
246
  }
wp-cache-phase2.php CHANGED
@@ -2,7 +2,7 @@
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_last_gc;
5
- global $cache_max_time, $wp_cache_request_uri, $super_cache_enabled, $wp_cache_object_cache, $cache_time_interval, $wp_cache_no_cache_for_get;
6
  global $cache_enabled, $wp_cache_gmt_offset, $wp_cache_blog_charset, $cache_schedule_type, $cache_scheduled_time, $cache_schedule_interval;
7
 
8
  if ( $cache_enabled == false ) {
@@ -239,7 +239,7 @@ function wp_super_cache_query_vars() {
239
  }
240
 
241
  function wp_cache_ob_callback( $buffer ) {
242
- global $wp_cache_pages, $wp_query, $wp_super_cache_query, $cache_acceptable_files;
243
  $buffer = apply_filters( 'wp_cache_ob_callback_filter', $buffer );
244
 
245
  $script = basename($_SERVER['PHP_SELF']);
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_last_gc;
5
+ global $cache_max_time, $wp_cache_request_uri, $super_cache_enabled, $wp_cache_object_cache, $cache_time_interval;
6
  global $cache_enabled, $wp_cache_gmt_offset, $wp_cache_blog_charset, $cache_schedule_type, $cache_scheduled_time, $cache_schedule_interval;
7
 
8
  if ( $cache_enabled == false ) {
239
  }
240
 
241
  function wp_cache_ob_callback( $buffer ) {
242
+ global $wp_cache_pages, $wp_query, $wp_super_cache_query, $cache_acceptable_files, $wp_cache_no_cache_for_get, $wp_cache_object_cache, $wp_cache_request_uri;
243
  $buffer = apply_filters( 'wp_cache_ob_callback_filter', $buffer );
244
 
245
  $script = basename($_SERVER['PHP_SELF']);
wp-cache.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Super Cache
4
  Plugin URI: http://wordpress.org/plugins/wp-super-cache/
5
  Description: Very fast caching plugin for WordPress.
6
- Version: 1.4.1
7
  Author: Automattic
8
  Author URI: http://automattic.com/
9
  License: GPL2+
@@ -1444,7 +1444,7 @@ function wp_lock_down() {
1444
  $expiredfiles = array_diff( $cached_direct_pages, $_POST[ 'direct_pages' ] );
1445
  unset( $cached_direct_pages );
1446
  foreach( $_POST[ 'direct_pages' ] as $page ) {
1447
- $page = $wpdb->escape( $page );
1448
  if( $page != '' ) {
1449
  $cached_direct_pages[] = $page;
1450
  $out .= "'$page', ";
@@ -1458,7 +1458,7 @@ function wp_lock_down() {
1458
  $page = str_replace( get_option( 'siteurl' ), '', $_POST[ 'new_direct_page' ] );
1459
  if( substr( $page, 0, 1 ) != '/' )
1460
  $page = '/' . $page;
1461
- $page = $wpdb->escape( $page );
1462
  if( in_array( $page, $cached_direct_pages ) == false ) {
1463
  $cached_direct_pages[] = $page;
1464
  $out .= "'$page', ";
3
  Plugin Name: WP Super Cache
4
  Plugin URI: http://wordpress.org/plugins/wp-super-cache/
5
  Description: Very fast caching plugin for WordPress.
6
+ Version: 1.4.2
7
  Author: Automattic
8
  Author URI: http://automattic.com/
9
  License: GPL2+
1444
  $expiredfiles = array_diff( $cached_direct_pages, $_POST[ 'direct_pages' ] );
1445
  unset( $cached_direct_pages );
1446
  foreach( $_POST[ 'direct_pages' ] as $page ) {
1447
+ $page = esc_sql( $page );
1448
  if( $page != '' ) {
1449
  $cached_direct_pages[] = $page;
1450
  $out .= "'$page', ";
1458
  $page = str_replace( get_option( 'siteurl' ), '', $_POST[ 'new_direct_page' ] );
1459
  if( substr( $page, 0, 1 ) != '/' )
1460
  $page = '/' . $page;
1461
+ $page = esc_sql( $page );
1462
  if( in_array( $page, $cached_direct_pages ) == false ) {
1463
  $cached_direct_pages[] = $page;
1464
  $out .= "'$page', ";