Version Description
- Move "not logged in" message init below check for POST.
- Add is_admin() check so plugin definitely can't cache the backend.
- Add "do not cache" page type to admin page.
Download this release
Release Info
Developer | donncha |
Plugin | WP Super Cache |
Version | 0.9.6.1 |
Comparing to | |
See all releases |
Code changes from version 0.9.6 to 0.9.6.1
- Changelog.txt +27 -0
- readme.txt +6 -1
- wp-cache-phase2.php +21 -3
- wp-cache.php +37 -3
Changelog.txt
CHANGED
@@ -1,3 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
2009-07-27 11:50 donncha
|
2 |
|
3 |
* readme.txt, wp-cache.php: Bumped version to 0.9.6
|
1 |
+
2009-07-29 17:26 donncha
|
2 |
+
|
3 |
+
* readme.txt, wp-cache.php: Bump version to 0.9.6.1
|
4 |
+
|
5 |
+
2009-07-29 17:13 donncha
|
6 |
+
|
7 |
+
* readme.txt: Added changelog details for 0.9.6.1
|
8 |
+
|
9 |
+
2009-07-29 11:43 donncha
|
10 |
+
|
11 |
+
* wp-cache-phase2.php, wp-cache.php: Apply "no caching" rules
|
12 |
+
Record options properly
|
13 |
+
|
14 |
+
2009-07-29 11:29 donncha
|
15 |
+
|
16 |
+
* wp-cache.php: Add page types to not cache to admin page
|
17 |
+
|
18 |
+
2009-07-29 09:36 donncha
|
19 |
+
|
20 |
+
* wp-cache-phase2.php: Move logged in message below check for POST
|
21 |
+
Add check for is_admin() too
|
22 |
+
(http://wordpress.org/support/topic/294687)
|
23 |
+
|
24 |
+
2009-07-27 11:51 donncha
|
25 |
+
|
26 |
+
* Changelog.txt: Updated changelog
|
27 |
+
|
28 |
2009-07-27 11:50 donncha
|
29 |
|
30 |
* readme.txt, wp-cache.php: Bumped version to 0.9.6
|
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.8.2
|
5 |
-
Stable tag: 0.9.6
|
6 |
Requires at least: 2.6
|
7 |
Donate link: http://ocaoimh.ie/wordpress-plugins/gifts-and-donations/
|
8 |
|
@@ -28,6 +28,11 @@ The [changelog](http://svn.wp-plugins.org/wp-super-cache/trunk/Changelog.txt) is
|
|
28 |
|
29 |
== Changelog ==
|
30 |
|
|
|
|
|
|
|
|
|
|
|
31 |
= 0.9.6 =
|
32 |
* Add uninstall.php uninstall script.
|
33 |
* Updated cache/.htaccess rules (option to upgrade that)
|
2 |
Contributors: donncha
|
3 |
Tags: performance,caching,wp-cache,wp-super-cache,cache
|
4 |
Tested up to: 2.8.2
|
5 |
+
Stable tag: 0.9.6.1
|
6 |
Requires at least: 2.6
|
7 |
Donate link: http://ocaoimh.ie/wordpress-plugins/gifts-and-donations/
|
8 |
|
28 |
|
29 |
== Changelog ==
|
30 |
|
31 |
+
= 0.9.6.1 =
|
32 |
+
* Move "not logged in" message init below check for POST.
|
33 |
+
* Add is_admin() check so plugin definitely can't cache the backend.
|
34 |
+
* Add "do not cache" page type to admin page.
|
35 |
+
|
36 |
= 0.9.6 =
|
37 |
* Add uninstall.php uninstall script.
|
38 |
* Updated cache/.htaccess rules (option to upgrade that)
|
wp-cache-phase2.php
CHANGED
@@ -30,13 +30,14 @@ function wp_cache_phase2() {
|
|
30 |
do_cacheaction( 'add_cacheaction' );
|
31 |
}
|
32 |
|
33 |
-
if( $
|
|
|
|
|
|
|
34 |
register_shutdown_function( 'wpcache_logged_in_message' );
|
35 |
return false;
|
36 |
}
|
37 |
|
38 |
-
if( $_SERVER["REQUEST_METHOD"] == 'POST' || get_option('gzipcompression'))
|
39 |
-
return false;
|
40 |
$script = basename($_SERVER['PHP_SELF']);
|
41 |
if (!in_array($script, $cache_acceptable_files) && wp_cache_is_rejected($wp_cache_request_uri))
|
42 |
return false;
|
@@ -204,8 +205,25 @@ function get_current_url_supercache_dir() {
|
|
204 |
}
|
205 |
|
206 |
function wp_cache_ob_callback( $buffer ) {
|
|
|
207 |
if( defined( 'DONOTCACHEPAGE' ) )
|
208 |
return $buffer;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
$buffer = &wp_cache_get_ob( $buffer );
|
210 |
wp_cache_shutdown_callback();
|
211 |
return $buffer;
|
30 |
do_cacheaction( 'add_cacheaction' );
|
31 |
}
|
32 |
|
33 |
+
if( $_SERVER["REQUEST_METHOD"] == 'POST' || !empty( $_POST ) || get_option('gzipcompression'))
|
34 |
+
return false;
|
35 |
+
|
36 |
+
if ( $wp_cache_not_logged_in && is_user_logged_in() && !is_feed() && !is_admin() ) {
|
37 |
register_shutdown_function( 'wpcache_logged_in_message' );
|
38 |
return false;
|
39 |
}
|
40 |
|
|
|
|
|
41 |
$script = basename($_SERVER['PHP_SELF']);
|
42 |
if (!in_array($script, $cache_acceptable_files) && wp_cache_is_rejected($wp_cache_request_uri))
|
43 |
return false;
|
205 |
}
|
206 |
|
207 |
function wp_cache_ob_callback( $buffer ) {
|
208 |
+
global $wp_cache_pages;
|
209 |
if( defined( 'DONOTCACHEPAGE' ) )
|
210 |
return $buffer;
|
211 |
+
|
212 |
+
if ( isset( $wp_cache_pages[ 'single' ] ) && $wp_cache_pages[ 'single' ] == 1 && is_single() ) {
|
213 |
+
return $buffer;
|
214 |
+
} elseif ( isset( $wp_cache_pages[ 'pages' ] ) && $wp_cache_pages[ 'pages' ] == 1 && is_page() ) {
|
215 |
+
return $buffer;
|
216 |
+
} elseif ( isset( $wp_cache_pages[ 'archives' ] ) && $wp_cache_pages[ 'archives' ] == 1 && is_archive() ) {
|
217 |
+
return $buffer;
|
218 |
+
} elseif ( isset( $wp_cache_pages[ 'tag' ] ) && $wp_cache_pages[ 'tag' ] == 1 && is_tag() ) {
|
219 |
+
return $buffer;
|
220 |
+
} elseif ( isset( $wp_cache_pages[ 'category' ] ) && $wp_cache_pages[ 'category' ] == 1 && is_category() ) {
|
221 |
+
return $buffer;
|
222 |
+
} elseif ( isset( $wp_cache_pages[ 'frontpage' ] ) && $wp_cache_pages[ 'frontpage' ] == 1 && is_front_page() ) {
|
223 |
+
return $buffer;
|
224 |
+
} elseif ( isset( $wp_cache_pages[ 'home' ] ) && $wp_cache_pages[ 'home' ] == 1 && is_home() ) {
|
225 |
+
return $buffer;
|
226 |
+
}
|
227 |
$buffer = &wp_cache_get_ob( $buffer );
|
228 |
wp_cache_shutdown_callback();
|
229 |
return $buffer;
|
wp-cache.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WP Super Cache
|
4 |
Plugin URI: http://ocaoimh.ie/wp-super-cache/
|
5 |
Description: Very fast caching plugin for WordPress.
|
6 |
-
Version: 0.9.6
|
7 |
Author: Donncha O Caoimh
|
8 |
Author URI: http://ocaoimh.ie/
|
9 |
*/
|
@@ -381,8 +381,8 @@ jQuery(document).ready(function(){
|
|
381 |
<div style='background: #ffc; border: 1px solid #333; margin: 2px; padding: 5px'>
|
382 |
<h3 align='center'>Make WordPress Faster</h3>
|
383 |
<?php if( $wp_cache_hide_donation != 1 ) { ?>
|
384 |
-
<p><a href="http://ocaoimh.ie/wp-super-cache/?r=wpsc">WP Super Cache</a> really makes your blog go faster. Make it go faster<sup>*</sup> by buying me an <a href="
|
385 |
-
<p>If Amazon isn't your thing, there's also PayPal. Click the "Donate" button below or take a quick peek at my <a href="http://ocaoimh.ie/
|
386 |
<p>Thanks in advance!<br />Donncha<br />
|
387 |
<small>* Ok, it won't go any faster but you'll make this plugin author very happy!</small></p>
|
388 |
<div align='center'>
|
@@ -410,6 +410,8 @@ jQuery(document).ready(function(){
|
|
410 |
wp_cache_edit_max_time();
|
411 |
|
412 |
echo '<a name="files"></a><fieldset class="options"><h3>Accepted Filenames & Rejected URIs</h3>';
|
|
|
|
|
413 |
wp_cache_edit_rejected();
|
414 |
echo "\n";
|
415 |
wp_cache_edit_accepted();
|
@@ -847,6 +849,38 @@ function wp_cache_edit_rejected_ua() {
|
|
847 |
echo "</fieldset>\n";
|
848 |
}
|
849 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
850 |
|
851 |
function wp_cache_edit_rejected() {
|
852 |
global $cache_acceptable_files, $cache_rejected_uri, $wp_cache_config_file, $valid_nonce;
|
3 |
Plugin Name: WP Super Cache
|
4 |
Plugin URI: http://ocaoimh.ie/wp-super-cache/
|
5 |
Description: Very fast caching plugin for WordPress.
|
6 |
+
Version: 0.9.6.1
|
7 |
Author: Donncha O Caoimh
|
8 |
Author URI: http://ocaoimh.ie/
|
9 |
*/
|
381 |
<div style='background: #ffc; border: 1px solid #333; margin: 2px; padding: 5px'>
|
382 |
<h3 align='center'>Make WordPress Faster</h3>
|
383 |
<?php if( $wp_cache_hide_donation != 1 ) { ?>
|
384 |
+
<p><a href="http://ocaoimh.ie/wp-super-cache/?r=wpsc">WP Super Cache</a> really makes your blog go faster. Make it go faster<sup>*</sup> by buying me an <a href="http://ocaoimh.ie/agc">Amazon gift card</a>! Make it out to "donncha@ocaoimh.ie". A £10 card would be nice but it's up to you how much you think this plugin is worth to you.</p>
|
385 |
+
<p>If Amazon isn't your thing, there's also PayPal. Click the "Donate" button below or take a quick peek at my <a href="http://ocaoimh.ie/wish">wishlist</a>.</p>
|
386 |
<p>Thanks in advance!<br />Donncha<br />
|
387 |
<small>* Ok, it won't go any faster but you'll make this plugin author very happy!</small></p>
|
388 |
<div align='center'>
|
410 |
wp_cache_edit_max_time();
|
411 |
|
412 |
echo '<a name="files"></a><fieldset class="options"><h3>Accepted Filenames & Rejected URIs</h3>';
|
413 |
+
wp_cache_edit_rejected_pages();
|
414 |
+
echo "\n";
|
415 |
wp_cache_edit_rejected();
|
416 |
echo "\n";
|
417 |
wp_cache_edit_accepted();
|
849 |
echo "</fieldset>\n";
|
850 |
}
|
851 |
|
852 |
+
function wp_cache_edit_rejected_pages() {
|
853 |
+
global $wp_cache_config_file, $valid_nonce, $wp_cache_pages;
|
854 |
+
|
855 |
+
if ( isset( $_POST[ 'wp_edit_rejected_pages' ] ) && $valid_nonce ) {
|
856 |
+
$pages = array( 'single', 'pages', 'archives', 'tag', 'frontpage', 'home', 'category' );
|
857 |
+
foreach( $pages as $page ) {
|
858 |
+
if ( isset( $_POST[ 'wp_cache_pages' ][ $page ] ) ) {
|
859 |
+
$value = 1;
|
860 |
+
} else {
|
861 |
+
$value = 0;
|
862 |
+
}
|
863 |
+
wp_cache_replace_line('^ *\$wp_cache_pages\[ "' . $page . '" \]', "\$wp_cache_pages[ \"{$page}\" ] = $value;", $wp_cache_config_file);
|
864 |
+
$wp_cache_pages[ $page ] = $value;
|
865 |
+
}
|
866 |
+
}
|
867 |
+
|
868 |
+
echo '<p>Do not cache the following page types. See the <a href="http://codex.wordpress.org/Conditional_Tags">Conditional Tags</a> documentation for a complete discussion on each type.</p>';
|
869 |
+
echo '<form name="wp_edit_rejected_pages" action="'. $_SERVER["REQUEST_URI"] . '" method="post">';
|
870 |
+
echo '<input type="hidden" name="wp_edit_rejected_pages" value="1" />';
|
871 |
+
echo '<label><input type="checkbox" value="1" name="wp_cache_pages[single]" ' . checked( 1, $wp_cache_pages[ 'single' ], false ) . ' /> Single Posts (is_single)</label><br />';
|
872 |
+
echo '<label><input type="checkbox" value="1" name="wp_cache_pages[pages]" ' . checked( 1, $wp_cache_pages[ 'pages' ], false ) . ' /> Pages (is_page)</label><br />';
|
873 |
+
echo '<label><input type="checkbox" value="1" name="wp_cache_pages[frontpage]" ' . checked( 1, $wp_cache_pages[ 'frontpage' ], false ) . ' /> Front Page (is_front_page)</label><br />';
|
874 |
+
echo ' <label><input type="checkbox" value="1" name="wp_cache_pages[home]" ' . checked( 1, $wp_cache_pages[ 'home' ], false ) . ' /> Home (is_home)</label><br />';
|
875 |
+
echo '<label><input type="checkbox" value="1" name="wp_cache_pages[archives]" ' . checked( 1, $wp_cache_pages[ 'archives' ], false ) . ' /> Archives (is_archive)</label><br />';
|
876 |
+
echo ' <label><input type="checkbox" value="1" name="wp_cache_pages[tag]" ' . checked( 1, $wp_cache_pages[ 'tag' ], false ) . ' /> Tags (is_tag)</label><br />';
|
877 |
+
echo ' <label><input type="checkbox" value="1" name="wp_cache_pages[category]" ' . checked( 1, $wp_cache_pages[ 'category' ], false ) . ' /> Category (is_category)</label><br />';
|
878 |
+
|
879 |
+
echo '<div class="submit"><input type="submit" ' . SUBMITDISABLED . 'value="Save »" /></div>';
|
880 |
+
wp_nonce_field('wp-cache');
|
881 |
+
echo "</form>\n";
|
882 |
+
|
883 |
+
}
|
884 |
|
885 |
function wp_cache_edit_rejected() {
|
886 |
global $cache_acceptable_files, $cache_rejected_uri, $wp_cache_config_file, $valid_nonce;
|