Version Description
- Add uninstall.php uninstall script.
- Updated cache/.htaccess rules (option to upgrade that)
- Added FAQ about category and static homepage problem.
- Add wp_cache_user_agent_is_rejected() back to wp-cache-phase2.php
- Show message for logged in users when caching disable for them.
- Check filemtime on correct supercache file
Download this release
Release Info
Developer | donncha |
Plugin | WP Super Cache |
Version | 0.9.6 |
Comparing to | |
See all releases |
Code changes from version 0.9.5 to 0.9.6
- Changelog.txt +92 -0
- readme.txt +35 -2
- uninstall.php +88 -0
- wp-cache-phase1.php +26 -26
- wp-cache-phase2.php +23 -4
- wp-cache.php +4 -8
Changelog.txt
CHANGED
@@ -1,3 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
2009-07-17 15:30 donncha
|
2 |
|
3 |
* readme.txt: Added changelog to readme.txt
|
1 |
+
2009-07-27 11:50 donncha
|
2 |
+
|
3 |
+
* readme.txt, wp-cache.php: Bumped version to 0.9.6
|
4 |
+
|
5 |
+
2009-07-27 11:49 donncha
|
6 |
+
|
7 |
+
* Changelog.txt: Updated changelog.txt
|
8 |
+
|
9 |
+
2009-07-27 11:46 donncha
|
10 |
+
|
11 |
+
* wp-cache.php: I prefer pretty links
|
12 |
+
|
13 |
+
2009-07-27 11:43 donncha
|
14 |
+
|
15 |
+
* readme.txt: Added 0.9.6 changelog
|
16 |
+
|
17 |
+
2009-07-27 11:38 donncha
|
18 |
+
|
19 |
+
* wp-cache-phase2.php: Only show "not cached" message to logged in
|
20 |
+
users if not a feed.
|
21 |
+
|
22 |
+
2009-07-27 11:34 donncha
|
23 |
+
|
24 |
+
* wp-cache.php: Add link to uninstall script to admin page
|
25 |
+
|
26 |
+
2009-07-27 11:33 donncha
|
27 |
+
|
28 |
+
* readme.txt: Added filesmatch rules to docs
|
29 |
+
|
30 |
+
2009-07-27 11:26 donncha
|
31 |
+
|
32 |
+
* readme.txt: Added docs for using uninstall script
|
33 |
+
|
34 |
+
2009-07-27 11:25 donncha
|
35 |
+
|
36 |
+
* uninstall.php: Check if user can install plugins in uninstall
|
37 |
+
script
|
38 |
+
|
39 |
+
2009-07-27 11:17 donncha
|
40 |
+
|
41 |
+
* uninstall.php: Added uninstall script
|
42 |
+
|
43 |
+
2009-07-27 10:42 donncha
|
44 |
+
|
45 |
+
* wp-cache-phase2.php: Removed check of filemtime that's not needed
|
46 |
+
any more.
|
47 |
+
|
48 |
+
2009-07-27 10:41 donncha
|
49 |
+
|
50 |
+
* wp-cache.php: Added "ForceType" in cache .htaccess to force
|
51 |
+
supercache html.gz files to be served as html files.
|
52 |
+
|
53 |
+
2009-07-27 10:39 donncha
|
54 |
+
|
55 |
+
* readme.txt: Added category page and static page problem to FAQ
|
56 |
+
|
57 |
+
2009-07-21 11:57 donncha
|
58 |
+
|
59 |
+
* wp-cache-phase1.php: Fix indentation
|
60 |
+
|
61 |
+
2009-07-21 11:55 donncha
|
62 |
+
|
63 |
+
* wp-cache-phase2.php: Add back in
|
64 |
+
wp_cache_user_agent_is_rejected() if it doesn't exist (shouldn't
|
65 |
+
happen but it does)
|
66 |
+
|
67 |
+
2009-07-21 10:58 donncha
|
68 |
+
|
69 |
+
* wp-cache-phase2.php: Added message to show to logged in users
|
70 |
+
when caching disabled for them.
|
71 |
+
|
72 |
+
2009-07-21 10:34 donncha
|
73 |
+
|
74 |
+
* wp-cache-phase2.php: Check the filemtime on the right file, props
|
75 |
+
Simone Marx
|
76 |
+
|
77 |
+
2009-07-20 16:37 donncha
|
78 |
+
|
79 |
+
* wp-cache.php: Remove "get_comment_author_url" filter
|
80 |
+
|
81 |
+
2009-07-17 15:42 donncha
|
82 |
+
|
83 |
+
* wp-cache.php: Silly typo
|
84 |
+
|
85 |
+
2009-07-17 15:41 donncha
|
86 |
+
|
87 |
+
* wp-cache.php: Use Amazon UK link rather than US one
|
88 |
+
|
89 |
+
2009-07-17 15:31 donncha
|
90 |
+
|
91 |
+
* Changelog.txt: Updated changelog
|
92 |
+
|
93 |
2009-07-17 15:30 donncha
|
94 |
|
95 |
* readme.txt: Added changelog to readme.txt
|
readme.txt
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
=== WP Super Cache ===
|
2 |
Contributors: donncha
|
3 |
Tags: performance,caching,wp-cache,wp-super-cache,cache
|
4 |
-
Tested up to: 2.8.
|
5 |
-
Stable tag: 0.9.
|
6 |
Requires at least: 2.6
|
7 |
Donate link: http://ocaoimh.ie/wordpress-plugins/gifts-and-donations/
|
8 |
|
@@ -28,6 +28,14 @@ The [changelog](http://svn.wp-plugins.org/wp-super-cache/trunk/Changelog.txt) is
|
|
28 |
|
29 |
== Changelog ==
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
= 0.9.5 =
|
32 |
* Show next and last GC times in minutes, not local time.
|
33 |
* Don't serve wp_cache cache files to rejected user agents. Supercache files are still served to them.
|
@@ -81,6 +89,10 @@ The [changelog](http://svn.wp-plugins.org/wp-super-cache/trunk/Changelog.txt) is
|
|
81 |
|
82 |
`# BEGIN supercache`
|
83 |
`<IfModule mod_mime.c>`
|
|
|
|
|
|
|
|
|
84 |
` AddEncoding gzip .gz`
|
85 |
` AddType text/html .gz`
|
86 |
`</IfModule>`
|
@@ -105,6 +117,18 @@ The [changelog](http://svn.wp-plugins.org/wp-super-cache/trunk/Changelog.txt) is
|
|
105 |
|
106 |
== How to uninstall WP Super Cache ==
|
107 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
1. Remove the WP_CACHE define from wp-config.php. It looks like `define( 'WP_CACHE', true );`
|
109 |
2. Clear the cache in the backend page and then deactivate the plugin on the plugins page.
|
110 |
3. Remove the Super Cache mod_rewrite rules from your .htaccess file.
|
@@ -148,6 +172,15 @@ Those bots usually only visit each page once and if the page is not popular ther
|
|
148 |
|
149 |
Like the previous question, there's no point caching pages that won't be visited. The large number of cache files will slow down the garbage collection system as it attempts to check each file. It also causes problems for hosting companies. In the event of a disk failure on your server it may take much longer to check the files. Remember how long a scandisk or a fsck took on a large drive?
|
150 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
= Troubleshooting =
|
152 |
|
153 |
If things don't work when you installed the plugin here are a few things to check:
|
1 |
=== WP Super Cache ===
|
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 |
|
29 |
== Changelog ==
|
30 |
|
31 |
+
= 0.9.6 =
|
32 |
+
* Add uninstall.php uninstall script.
|
33 |
+
* Updated cache/.htaccess rules (option to upgrade that)
|
34 |
+
* Added FAQ about category and static homepage problem.
|
35 |
+
* Add wp_cache_user_agent_is_rejected() back to wp-cache-phase2.php
|
36 |
+
* Show message for logged in users when caching disable for them.
|
37 |
+
* Check filemtime on correct supercache file
|
38 |
+
|
39 |
= 0.9.5 =
|
40 |
* Show next and last GC times in minutes, not local time.
|
41 |
* Don't serve wp_cache cache files to rejected user agents. Supercache files are still served to them.
|
89 |
|
90 |
`# BEGIN supercache`
|
91 |
`<IfModule mod_mime.c>`
|
92 |
+
` <FilesMatch "\.html\.gz$">`
|
93 |
+
` ForceType text/html`
|
94 |
+
` FileETag None`
|
95 |
+
` </FilesMatch>`
|
96 |
` AddEncoding gzip .gz`
|
97 |
` AddType text/html .gz`
|
98 |
`</IfModule>`
|
117 |
|
118 |
== How to uninstall WP Super Cache ==
|
119 |
|
120 |
+
Edit the file uninstall.php in your plugins/wp-super-cache/ directory and set
|
121 |
+
UNINSTALL_WPSUPERCACHE to a non blank value.
|
122 |
+
|
123 |
+
`define( 'UNINSTALL_WPSUPERCACHE', '1' );`
|
124 |
+
|
125 |
+
Open your browser and load wp-content/plugins/wp-super-cache/uninstall.php directly.
|
126 |
+
You must be logged in, and you must confirm the action. If you do not delete the plugin
|
127 |
+
immediately, after the script runs, please comment out the define() above to stop
|
128 |
+
someone else running it.
|
129 |
+
|
130 |
+
To manually uninstall:
|
131 |
+
|
132 |
1. Remove the WP_CACHE define from wp-config.php. It looks like `define( 'WP_CACHE', true );`
|
133 |
2. Clear the cache in the backend page and then deactivate the plugin on the plugins page.
|
134 |
3. Remove the Super Cache mod_rewrite rules from your .htaccess file.
|
172 |
|
173 |
Like the previous question, there's no point caching pages that won't be visited. The large number of cache files will slow down the garbage collection system as it attempts to check each file. It also causes problems for hosting companies. In the event of a disk failure on your server it may take much longer to check the files. Remember how long a scandisk or a fsck took on a large drive?
|
174 |
|
175 |
+
= A category page is showing instead of my homepage =
|
176 |
+
|
177 |
+
A tiny proportion of websites will have problems with the following configuration:
|
178 |
+
|
179 |
+
1. Uses a static page for the front page.
|
180 |
+
2. Uses /%category%/%postname%/ permalink structure.
|
181 |
+
|
182 |
+
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.
|
183 |
+
|
184 |
= Troubleshooting =
|
185 |
|
186 |
If things don't work when you installed the plugin here are a few things to check:
|
uninstall.php
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html>
|
2 |
+
<head>
|
3 |
+
<title>WP Super Cache Uninstall Script</title>
|
4 |
+
</head>
|
5 |
+
<body>
|
6 |
+
<?php
|
7 |
+
/** Include the bootstrap for setting up WordPress environment */
|
8 |
+
include( '../../../wp-load.php' );
|
9 |
+
|
10 |
+
if ( !is_user_logged_in() )
|
11 |
+
wp_die( 'You must be logged in to run this script.' );
|
12 |
+
|
13 |
+
if ( !current_user_can( 'install_plugins' ) )
|
14 |
+
wp_die( 'You do not have permission to run this script.' );
|
15 |
+
|
16 |
+
if ( defined( 'UNINSTALL_WPSUPERCACHE' ) )
|
17 |
+
wp_die( 'UNINSTALL_WPSUPERCACHE set somewhere else! It must only be set in uninstall.php' );
|
18 |
+
|
19 |
+
define( 'UNINSTALL_WPSUPERCACHE', '' );
|
20 |
+
|
21 |
+
if ( !defined( 'UNINSTALL_WPSUPERCACHE' ) || constant( 'UNINSTALL_WPSUPERCACHE' ) == '' )
|
22 |
+
wp_die( 'UNINSTALL_WPSUPERCACHE must be set to a non-blank value in uninstall.php' );
|
23 |
+
|
24 |
+
?>
|
25 |
+
<p>This script will uninstall the files and directories created by <a href='http://ocaoimh.ie/wp-super-cache/'>WP Super Cache</a>.</p>
|
26 |
+
<?php
|
27 |
+
if ( $_POST[ 'uninstall' ] ) {
|
28 |
+
$plugins = (array)get_option( 'active_plugins' );
|
29 |
+
$key = array_search( 'wp-super-cache/wp-cache.php', $plugins );
|
30 |
+
if ( $key !== false ) {
|
31 |
+
unset( $plugins[ $key ] );
|
32 |
+
update_option( 'active_plugins', $plugins );
|
33 |
+
echo "Disabled WP Super Cache plugin : <strong>DONE</strong><br />";
|
34 |
+
}
|
35 |
+
|
36 |
+
if ( in_array( 'wp-super-cache/wp-cache.php', get_option( 'active_plugins' ) ) )
|
37 |
+
wp_die( 'WP Super Cache is still active. Please disable it on your plugins page first.' );
|
38 |
+
echo "Removing " . WP_CONTENT_DIR . "/cache/ :";
|
39 |
+
uninstall_supercache( WP_CONTENT_DIR . '/cache' );
|
40 |
+
echo " <strong>DONE</strong><br />";
|
41 |
+
echo "Removing " . WP_CONTENT_DIR . "/advanced-cache.php :";
|
42 |
+
@unlink( WP_CONTENT_DIR . "/advanced-cache.php" );
|
43 |
+
echo " <strong>DONE</strong><br />";
|
44 |
+
echo "Removing " . WP_CONTENT_DIR . "/wp-cache-config.php :";
|
45 |
+
@unlink( WP_CONTENT_DIR . "/wp-cache-config.php" );
|
46 |
+
echo " <strong>DONE</strong><br />";
|
47 |
+
echo "<p>Make sure you remove the following line from " . ABSPATH . "wp-config.php too.</p>";
|
48 |
+
echo "<blockquote><code>define('WP_CACHE', true);</code></blockquote>";
|
49 |
+
echo "<p><strong>Please comment out the UNINSTALL_WPSUPERCACHE <em>define()</em> in this file!</strong></p>";
|
50 |
+
wp_mail( $current_user->user_email, 'WP Super Cache Uninstalled', '' );
|
51 |
+
} else {
|
52 |
+
?>
|
53 |
+
<form action='uninstall.php' method='POST'>
|
54 |
+
<p>Click UNINSTALL to delete the following files and directories:
|
55 |
+
<ol>
|
56 |
+
<li> <?php echo WP_CONTENT_DIR . "/advanced-cache.php"; ?></li>
|
57 |
+
<li> <?php echo WP_CONTENT_DIR . "/wp-cache-config.php"; ?></li>
|
58 |
+
<li> <?php echo WP_CONTENT_DIR . '/cache'; ?></li>
|
59 |
+
</ol>
|
60 |
+
<input type='hidden' name='uninstall' value='1' />
|
61 |
+
<input type='submit' value='UNINSTALL' />
|
62 |
+
</form>
|
63 |
+
<?php
|
64 |
+
}
|
65 |
+
|
66 |
+
function uninstall_supercache( $folderPath ) { // from http://www.php.net/manual/en/function.rmdir.php
|
67 |
+
if ( trailingslashit( constant( 'ABSPATH' ) ) == trailingslashit( $folderPath ) )
|
68 |
+
return false;
|
69 |
+
if ( @is_dir ( $folderPath ) ) {
|
70 |
+
$dh = @opendir($folderPath);
|
71 |
+
while( false !== ( $value = @readdir( $dh ) ) ) {
|
72 |
+
if ( $value != "." && $value != ".." ) {
|
73 |
+
$value = $folderPath . "/" . $value;
|
74 |
+
if ( @is_dir ( $value ) ) {
|
75 |
+
uninstall_supercache( $value );
|
76 |
+
} else {
|
77 |
+
@unlink( $value );
|
78 |
+
}
|
79 |
+
}
|
80 |
+
}
|
81 |
+
return @rmdir( $folderPath );
|
82 |
+
} else {
|
83 |
+
return false;
|
84 |
+
}
|
85 |
+
}
|
86 |
+
?>
|
87 |
+
</body>
|
88 |
+
</html>
|
wp-cache-phase1.php
CHANGED
@@ -81,32 +81,32 @@ $meta_pathname = realpath( $blog_cache_dir . 'meta/' . $meta_file );
|
|
81 |
|
82 |
$wp_start_time = microtime();
|
83 |
if( file_exists( $cache_file ) && !wp_cache_user_agent_is_rejected() ) {
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
}
|
111 |
|
112 |
function wp_cache_postload() {
|
81 |
|
82 |
$wp_start_time = microtime();
|
83 |
if( file_exists( $cache_file ) && !wp_cache_user_agent_is_rejected() ) {
|
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.
|
93 |
+
if( $wp_cache_gzip_encoding && !in_array( 'Content-Encoding: ' . $wp_cache_gzip_encoding, $meta[ 'headers' ] ) ) {
|
94 |
+
$meta[ 'headers' ][ 'Content-Encoding' ] = 'Content-Encoding: ' . $wp_cache_gzip_encoding;
|
95 |
+
$meta[ 'headers' ][ 'Vary' ] = 'Vary: Accept-Encoding, Cookie';
|
96 |
+
wp_cache_debug( "Had to add gzip headers to the page {$_SERVER[ 'REQUEST_URI' ]}." );
|
97 |
+
}
|
98 |
+
foreach ($meta[ 'headers' ] as $t => $header) {
|
99 |
+
// godaddy fix, via http://blog.gneu.org/2008/05/wp-supercache-on-godaddy/ and http://www.littleredrails.com/blog/2007/09/08/using-wp-cache-on-godaddy-500-error/
|
100 |
+
if( strpos( $header, 'Last-Modified:' ) === false )
|
101 |
+
header($header);
|
102 |
+
}
|
103 |
+
header( 'WP-Super-Cache: WP-Cache' );
|
104 |
+
if ( $meta[ 'dynamic' ] ) {
|
105 |
+
include($cache_file);
|
106 |
+
} else {
|
107 |
+
readfile( $cache_file );
|
108 |
+
}
|
109 |
+
die();
|
110 |
}
|
111 |
|
112 |
function wp_cache_postload() {
|
wp-cache-phase2.php
CHANGED
@@ -30,8 +30,10 @@ function wp_cache_phase2() {
|
|
30 |
do_cacheaction( 'add_cacheaction' );
|
31 |
}
|
32 |
|
33 |
-
if( $wp_cache_not_logged_in && is_user_logged_in() )
|
|
|
34 |
return false;
|
|
|
35 |
|
36 |
if( $_SERVER["REQUEST_METHOD"] == 'POST' || get_option('gzipcompression'))
|
37 |
return false;
|
@@ -88,6 +90,25 @@ function wp_cache_phase2() {
|
|
88 |
}
|
89 |
}
|
90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
function wp_cache_get_response_headers() {
|
92 |
if(function_exists('apache_response_headers')) {
|
93 |
flush();
|
@@ -226,7 +247,6 @@ function wp_cache_get_ob(&$buffer) {
|
|
226 |
return $buffer;
|
227 |
}
|
228 |
|
229 |
-
//if( !((!$file_expired && $mtime) || ($mtime && $file_expired && (time() - $mtime) < 5)) ) {
|
230 |
$dir = get_current_url_supercache_dir();
|
231 |
$supercachedir = $cache_path . 'supercache/' . preg_replace('/:.*$/', '', $_SERVER["HTTP_HOST"]);
|
232 |
if( !empty( $_GET ) || is_feed() || ( $super_cache_enabled == true && is_dir( substr( $supercachedir, 0, -1 ) . '.disabled' ) ) )
|
@@ -258,7 +278,7 @@ function wp_cache_get_ob(&$buffer) {
|
|
258 |
|
259 |
$cache_fname = "{$dir}index.html";
|
260 |
$tmp_cache_filename = $dir . uniqid( mt_rand(), true ) . '.tmp';
|
261 |
-
if ( !@file_exists( $cache_fname ) || ( @file_exists( $cache_fname ) && ( time() - @filemtime( $
|
262 |
$fr2 = @fopen( $tmp_cache_filename, 'w' );
|
263 |
if (!$fr2) {
|
264 |
$buffer .= "<!-- File not cached! Super Cache Couldn't write to: " . str_replace( ABSPATH, '', $tmp_cache_filename ) . " -->\n";
|
@@ -344,7 +364,6 @@ function wp_cache_get_ob(&$buffer) {
|
|
344 |
@rename( $tmp_cache_filename . '.gz', $cache_fname . '.gz' );
|
345 |
}
|
346 |
}
|
347 |
-
//}
|
348 |
wp_cache_writers_exit();
|
349 |
if ( !headers_sent() && isset( $wp_cache_gzip_first ) && 1 == $wp_cache_gzip_first && $wp_cache_gzip_encoding && $gzdata) {
|
350 |
header( 'Content-Encoding: ' . $wp_cache_gzip_encoding );
|
30 |
do_cacheaction( 'add_cacheaction' );
|
31 |
}
|
32 |
|
33 |
+
if( $wp_cache_not_logged_in && is_user_logged_in() && !is_feed() ) {
|
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;
|
90 |
}
|
91 |
}
|
92 |
|
93 |
+
function wpcache_logged_in_message() {
|
94 |
+
echo '<!-- WP Super Cache did not cache this page because you are logged in and "Don\'t cache pages for logged in users" is enabled. -->';
|
95 |
+
}
|
96 |
+
|
97 |
+
if ( !function_exists( 'wp_cache_user_agent_is_rejected' ) ) {
|
98 |
+
function wp_cache_user_agent_is_rejected() {
|
99 |
+
global $cache_rejected_user_agent;
|
100 |
+
|
101 |
+
if (!function_exists('apache_request_headers')) return false;
|
102 |
+
$headers = apache_request_headers();
|
103 |
+
if (!isset($headers["User-Agent"])) return false;
|
104 |
+
foreach ($cache_rejected_user_agent as $expr) {
|
105 |
+
if (strlen($expr) > 0 && stristr($headers["User-Agent"], $expr))
|
106 |
+
return true;
|
107 |
+
}
|
108 |
+
return false;
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
function wp_cache_get_response_headers() {
|
113 |
if(function_exists('apache_response_headers')) {
|
114 |
flush();
|
247 |
return $buffer;
|
248 |
}
|
249 |
|
|
|
250 |
$dir = get_current_url_supercache_dir();
|
251 |
$supercachedir = $cache_path . 'supercache/' . preg_replace('/:.*$/', '', $_SERVER["HTTP_HOST"]);
|
252 |
if( !empty( $_GET ) || is_feed() || ( $super_cache_enabled == true && is_dir( substr( $supercachedir, 0, -1 ) . '.disabled' ) ) )
|
278 |
|
279 |
$cache_fname = "{$dir}index.html";
|
280 |
$tmp_cache_filename = $dir . uniqid( mt_rand(), true ) . '.tmp';
|
281 |
+
if ( !@file_exists( $cache_fname ) || ( @file_exists( $cache_fname ) && ( time() - @filemtime( $cache_fname ) ) > 5 ) ) {
|
282 |
$fr2 = @fopen( $tmp_cache_filename, 'w' );
|
283 |
if (!$fr2) {
|
284 |
$buffer .= "<!-- File not cached! Super Cache Couldn't write to: " . str_replace( ABSPATH, '', $tmp_cache_filename ) . " -->\n";
|
364 |
@rename( $tmp_cache_filename . '.gz', $cache_fname . '.gz' );
|
365 |
}
|
366 |
}
|
|
|
367 |
wp_cache_writers_exit();
|
368 |
if ( !headers_sent() && isset( $wp_cache_gzip_first ) && 1 == $wp_cache_gzip_first && $wp_cache_gzip_encoding && $gzdata) {
|
369 |
header( 'Content-Encoding: ' . $wp_cache_gzip_encoding );
|
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.
|
7 |
Author: Donncha O Caoimh
|
8 |
Author URI: http://ocaoimh.ie/
|
9 |
*/
|
@@ -350,6 +350,7 @@ jQuery(document).ready(function(){
|
|
350 |
<div style='border: 1px solid #333; width:400px; overflow: scroll'><pre>RewriteCond %{HTTP_user_agent} !^.*(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).*</pre></div></li></ol></blockquote>
|
351 |
<?php } ?>
|
352 |
<p><strong>Note:</strong> 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>
|
|
|
353 |
<?php
|
354 |
echo "<div class='submit'><input type='submit' " . SUBMITDISABLED . " value='Update Status »' /></div>";
|
355 |
wp_nonce_field('wp-cache');
|
@@ -395,7 +396,7 @@ jQuery(document).ready(function(){
|
|
395 |
</div>
|
396 |
<?php } else { ?>
|
397 |
<p><a href="http://ocaoimh.ie/wp-super-cache/?r=supercache">WP Super Cache</a> is maintained and developed by <a href="http://ocaoimh.ie/?r=supercache">Donncha O Caoimh</a> with contributions from many others.</p>
|
398 |
-
<p>He blogs at <a href="http://ocaoimh.ie/?r=supercache">Holy Shmoly</a>, posts photos at <a href="http://inphotos.org/?r=supercache">In Photos.org</a> and <a href="http://ocaoimh.ie/
|
399 |
<?php } ?>
|
400 |
</div>
|
401 |
|
@@ -533,7 +534,7 @@ function wsc_mod_rewrite() {
|
|
533 |
$dohtaccess = false;
|
534 |
}
|
535 |
// cache/.htaccess rules
|
536 |
-
$gziprules = "<IfModule mod_mime.c>\n AddEncoding gzip .gz\n AddType text/html .gz\n</IfModule>\n";
|
537 |
$gziprules .= "<IfModule mod_deflate.c>\n SetEnvIfNoCase Request_URI \.gz$ no-gzip\n</IfModule>\n";
|
538 |
$gziprules .= "<IfModule mod_headers.c>\n Header set Cache-Control 'max-age=300, must-revalidate'\n</IfModule>\n";
|
539 |
$gziprules .= "<IfModule mod_expires.c>\n ExpiresActive On\n ExpiresByType text/html A300\n</IfModule>\n";
|
@@ -1472,11 +1473,6 @@ function wp_cache_plugin_actions( $links, $file ) {
|
|
1472 |
}
|
1473 |
add_filter( 'plugin_action_links', 'wp_cache_plugin_actions', 10, 2 );
|
1474 |
|
1475 |
-
function wpsc_author_url( $url ) {
|
1476 |
-
return clean_url( $url );
|
1477 |
-
}
|
1478 |
-
add_filter( 'get_comment_author_url' , 'wpsc_author_url' );
|
1479 |
-
|
1480 |
function wp_cache_admin_notice() {
|
1481 |
global $cache_enabled;
|
1482 |
if( substr( $_SERVER["PHP_SELF"], -11 ) == 'plugins.php' && !$cache_enabled && function_exists( "admin_url" ) )
|
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 |
*/
|
350 |
<div style='border: 1px solid #333; width:400px; overflow: scroll'><pre>RewriteCond %{HTTP_user_agent} !^.*(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).*</pre></div></li></ol></blockquote>
|
351 |
<?php } ?>
|
352 |
<p><strong>Note:</strong> 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>
|
353 |
+
<p>Uninstall using the <a href="<?php echo WP_PLUGIN_URL; ?>/wp-super-cache/uninstall.php">uninstall script</a> to remove files and directories created by the plugin. (Please see <a href="<?php echo WP_PLUGIN_URL; ?>/wp-super-cache/readme.txt">readme.txt</a> for instructions on uninstalling this script.)</p>
|
354 |
<?php
|
355 |
echo "<div class='submit'><input type='submit' " . SUBMITDISABLED . " value='Update Status »' /></div>";
|
356 |
wp_nonce_field('wp-cache');
|
396 |
</div>
|
397 |
<?php } else { ?>
|
398 |
<p><a href="http://ocaoimh.ie/wp-super-cache/?r=supercache">WP Super Cache</a> is maintained and developed by <a href="http://ocaoimh.ie/?r=supercache">Donncha O Caoimh</a> with contributions from many others.</p>
|
399 |
+
<p>He blogs at <a href="http://ocaoimh.ie/?r=supercache">Holy Shmoly</a>, posts photos at <a href="http://inphotos.org/?r=supercache">In Photos.org</a> and <a href="http://ocaoimh.ie/gad">wishes</a> he had more time to read and relax.</p><p>Please say hi to him on <a href="http://twitter.com/donncha/">Twitter</a> too!</p>
|
400 |
<?php } ?>
|
401 |
</div>
|
402 |
|
534 |
$dohtaccess = false;
|
535 |
}
|
536 |
// cache/.htaccess rules
|
537 |
+
$gziprules = "<IfModule mod_mime.c>\n <FilesMatch \"\\.html\\.gz\$\">\n ForceType text/html\n FileETag None\n </FilesMatch>\n AddEncoding gzip .gz\n AddType text/html .gz\n</IfModule>\n";
|
538 |
$gziprules .= "<IfModule mod_deflate.c>\n SetEnvIfNoCase Request_URI \.gz$ no-gzip\n</IfModule>\n";
|
539 |
$gziprules .= "<IfModule mod_headers.c>\n Header set Cache-Control 'max-age=300, must-revalidate'\n</IfModule>\n";
|
540 |
$gziprules .= "<IfModule mod_expires.c>\n ExpiresActive On\n ExpiresByType text/html A300\n</IfModule>\n";
|
1473 |
}
|
1474 |
add_filter( 'plugin_action_links', 'wp_cache_plugin_actions', 10, 2 );
|
1475 |
|
|
|
|
|
|
|
|
|
|
|
1476 |
function wp_cache_admin_notice() {
|
1477 |
global $cache_enabled;
|
1478 |
if( substr( $_SERVER["PHP_SELF"], -11 ) == 'plugins.php' && !$cache_enabled && function_exists( "admin_url" ) )
|