WP Super Cache - Version 0.3.1

Version Description

Download this release

Release Info

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

Code changes from version 0.3 to 0.3.1

Files changed (5) hide show
  1. Changelog.txt +114 -0
  2. readme.txt +16 -33
  3. wp-cache-config-sample.php +1 -1
  4. wp-cache-phase2.php +2 -2
  5. wp-cache.php +1 -1
Changelog.txt ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2007-11-07 15:27 donncha
2
+
3
+ * readme.txt: Bump version to 0.3.1 (getting to 1.0 far too
4
+ quickly!)
5
+ Change formatting again
6
+
7
+ 2007-11-07 15:26 donncha
8
+
9
+ * wp-cache.php: Bump version to 0.3.1
10
+
11
+ 2007-11-07 15:26 donncha
12
+
13
+ * wp-cache-config-sample.php, wp-cache-phase2.php: Use preg_match()
14
+ to match rejected URIs.
15
+ Change "wp-" to "wp-.*.php" to match files and paths starting
16
+ with "wp-" and ending in "php"
17
+
18
+ 2007-11-07 11:56 donncha
19
+
20
+ * wp-cache.php: Bump the version number
21
+
22
+ 2007-11-06 22:50 donncha
23
+
24
+ * readme.txt: Bump version
25
+
26
+ 2007-11-06 22:18 donncha
27
+
28
+ * wp-cache-phase2.php: Fix feed content-type, props Dougal,
29
+ (http://dougal.gunters.org/blog/2007/06/19/wp-cache-fix-for-content-type-in-feeds)
30
+
31
+ 2007-11-06 22:15 donncha
32
+
33
+ * wp-cache.php: Check the do_cacheaction() exists
34
+ Copy file if symlink is not found
35
+
36
+ 2007-11-06 21:44 donncha
37
+
38
+ * wp-cache.php: Move WP Super Cache to "Site Admin" menu on
39
+ WordPress MU,
40
+ http://www.darcynorman.net/2007/11/06/wordpress-super-cache/
41
+
42
+ 2007-11-06 21:19 donncha
43
+
44
+ * wp-cache-phase1.php: Don't compress WP-Cache data files is PHP is
45
+ already doing it
46
+
47
+ 2007-11-06 10:29 donncha
48
+
49
+ * readme.txt: Minor typo in tag
50
+
51
+ 2007-11-06 10:06 donncha
52
+
53
+ * readme.txt, wp-cache-phase1.php, wp-cache-phase2.php,
54
+ wp-cache.php: Bump the version to 0.2
55
+ Enable gzip support in WP-Cache data files, fix feed content
56
+ type, props tummbler:
57
+ http://www.tummblr.com/wordpress/improving-wp-super-cache-gzip-for-logged-in-users/
58
+ http://elliottback.com/wp/archives/2005/07/12/getting-wp-cache-to-work/
59
+ http://blog.saddey.net/2007/02/18/how-to-prevent-wpcache-from-changing-a-feeds-content-type-to-text-html/
60
+ When Super Cache is disabled, still write to WP-Cache files
61
+ Check that prune_super_cache() exists before calling it in
62
+ wp-cache.php, props Dougal
63
+
64
+ 2007-11-06 09:06 donncha
65
+
66
+ * readme.txt: Fix line endings
67
+
68
+ 2007-11-05 18:41 donncha
69
+
70
+ * wp-cache.php: Fixed display of "compression changed" message
71
+
72
+ 2007-11-05 18:06 donncha
73
+
74
+ * readme.txt: Convert to DOS mode
75
+ reformat lists for display on wporg
76
+
77
+ 2007-11-05 17:25 donncha
78
+
79
+ * readme.txt: Minor updates to the readme
80
+
81
+ 2007-11-05 15:21 donncha
82
+
83
+ * wp-cache.php: When disabling or enabling compression make sure
84
+ the user knows about .htaccess
85
+
86
+ 2007-11-05 15:11 donncha
87
+
88
+ * wp-cache-phase2.php: Rejected URIs must have .php in them now so
89
+ pages starting with "wp-" will be cached
90
+
91
+ 2007-11-05 15:10 donncha
92
+
93
+ * wp-cache.php: When disabling supercache, make sure wpcache is
94
+ enabled.
95
+ Avoid resetting cache_compression when submitting other forms
96
+ Reset supercache meta cache when compression modified
97
+
98
+ 2007-11-05 14:54 donncha
99
+
100
+ * wp-cache-config-sample.php, wp-cache.php: Fix weirdness with
101
+ radio buttons on admin page
102
+
103
+ 2007-11-05 11:35 donncha
104
+
105
+ * plugins, plugins/searchengine.php, readme.txt, wp-cache-base.php,
106
+ wp-cache-config-sample.php, wp-cache-phase1.php,
107
+ wp-cache-phase2.php, wp-cache.php: Initial import of WP Super
108
+ Cache
109
+
110
+ 2007-10-23 20:02 plugin-master
111
+
112
+ * wp-super-cache, wp-super-cache/branches, wp-super-cache/tags, .:
113
+ adding wp-super-cache by donncha
114
+
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: donncha
3
  Tags: performance,caching,wp-cache
4
  Tested up to: 2.3.1
5
- Stable tag: 0.3
6
 
7
  A modification of WP-Cache that produces static html files.
8
 
@@ -41,21 +41,13 @@ Original WP-Cache by Ricardo Galli Granada, http://mnm.uib.es/gallir/
41
  WP Super Cache by Donncha O Caoimh, http://ocaoimh.ie/
42
 
43
  == Installation ==
44
- 1. You must have fancy permalinks enabled for this to work.
45
- 2. If you have WP-Cache installed already, please disable it. Edit wp-config.php
46
- and make sure the WP_CACHE define is deleted, and remove the file
47
- wp-content/advanced-cache.php. These will be recreated when you install this
48
- plugin.
49
- 3. Upload this directory to your plugins directory. It will create a
50
- 'wp-content/plugins/wp-super-cache/' directory.
51
- 4. If you are using WordPress MU you will need to install this in
52
- 'wp-content/mu-plugins/wp-super-cache/' and the file wp-cache.php
53
- must be copied into the mu-plugins directory.
54
- 5. WordPress users should go to their Plugins page and activate "WP Super Cache".
55
- 6. Now go to Options->WP Super Cache and enable caching. If you see an error message
56
- or a blank screen you may need to fix it. See the "FAQ" section later in this
57
- readme for instructions.
58
- 7. Edit the .htaccess file in your root directory and add the following code:
59
 
60
  RewriteCond %{HTTP_COOKIE} !^.*comment_author_.*$
61
  RewriteCond %{HTTP_COOKIE} !^.*wordpressuser.*$
@@ -113,32 +105,23 @@ Your .htaccess should look similar to this:
113
 
114
  == Frequently Asked Questions ==
115
  If things don't work when you installed the plugin here are a few things to check:
 
116
  1. Is wp-content writable by the web server?
117
- 2. Is there a wp-content/wp-cache-config.php ? If not, copy the file
118
- wp-super-cache/wp-cache-config-sample.php to wp-content/wp-cache-config.php
119
- and make sure WPCACHEHOME points at the right place. "plugins" should be
120
- "mu-plugins" if you're using WordPress MU.
121
- 3. Is there a wp-content/advanced-cache.php ? If not, then you must symlink
122
- wp-super-cache/wp-cache-phase1.php to it with the command while in the
123
- wp-content folder:
124
- ln -s plugins/wp-super-cache/wp-cache-phase1.php advanced-cache.php
125
- If you can't do that, then copy the file. That will work too.
126
- 4. Make sure the following line is in wp-config.php
127
- define( 'WP_CACHE', true );
128
  5. Try the Options->WP Super Cache page again and enable cache.
129
  6. Look in wp-content/cache/supercache/. Are there directories and files there?
130
  7. Anything in your php error_log?
131
- 8. If your browser keeps asking you to save the file after the super cache is installed
132
- you must disable Super Cache compression. Go to the Options->WP Super Cache page and disable
133
- it there.
134
 
135
  == Custom Caching ==
136
  It is now possible to hook into the caching process using the add_cacheacton() function.
137
  Three hooks are available:
138
 
139
- 1. 'wp_cache_get_cookies_values' - modify the key used by WP Cache.
140
- 2. 'add_cacheaction' - runs in phase2. Allows a plugin to add WordPress hooks.
141
- 3. 'cache_admin_page' - runs in the admin page. Use it to add modify that page.
142
 
143
  There is one regular WordPress filter too. Use the "do_createsupercache" filter
144
  to customize the checks made before caching. The filter accepts one parameter.
2
  Contributors: donncha
3
  Tags: performance,caching,wp-cache
4
  Tested up to: 2.3.1
5
+ Stable tag: 0.3.1
6
 
7
  A modification of WP-Cache that produces static html files.
8
 
41
  WP Super Cache by Donncha O Caoimh, http://ocaoimh.ie/
42
 
43
  == Installation ==
44
+ 1. You must have fancy permalinks enabled for this to work.
45
+ 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 file wp-content/advanced-cache.php. These will be recreated when you install this plugin.
46
+ 3. Upload this directory to your plugins directory. It will create a 'wp-content/plugins/wp-super-cache/' directory.
47
+ 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.
48
+ 5. WordPress users should go to their Plugins page and activate "WP Super Cache".
49
+ 6. Now go to Options->WP Super Cache and enable caching. If you see an error message or a blank screen you may need to fix it. See the "FAQ" section later in this readme for instructions.
50
+ 7. Edit the .htaccess file in your root directory and add the following code:
 
 
 
 
 
 
 
 
51
 
52
  RewriteCond %{HTTP_COOKIE} !^.*comment_author_.*$
53
  RewriteCond %{HTTP_COOKIE} !^.*wordpressuser.*$
105
 
106
  == Frequently Asked Questions ==
107
  If things don't work when you installed the plugin here are a few things to check:
108
+
109
  1. Is wp-content writable by the web server?
110
+ 2. Is there a wp-content/wp-cache-config.php ? If not, copy the file wp-super-cache/wp-cache-config-sample.php to wp-content/wp-cache-config.php and make sure WPCACHEHOME points at the right place. "plugins" should be "mu-plugins" if you're using WordPress MU.
111
+ 3. Is there a wp-content/advanced-cache.php ? If not, then you must symlink wp-super-cache/wp-cache-phase1.php to it with the command while in the wp-content folder. `ln -s plugins/wp-super-cache/wp-cache-phase1.php advanced-cache.php` If you can't do that, then copy the file. That will work too.
112
+ 4. Make sure the following line is in wp-config.php : `define( 'WP_CACHE', true );`
 
 
 
 
 
 
 
 
113
  5. Try the Options->WP Super Cache page again and enable cache.
114
  6. Look in wp-content/cache/supercache/. Are there directories and files there?
115
  7. Anything in your php error_log?
116
+ 8. If your browser keeps asking you to save the file after the super cache is installed you must disable Super Cache compression. Go to the Options->WP Super Cache page and disable it there.
 
 
117
 
118
  == Custom Caching ==
119
  It is now possible to hook into the caching process using the add_cacheacton() function.
120
  Three hooks are available:
121
 
122
+ 1. 'wp_cache_get_cookies_values' - modify the key used by WP Cache.
123
+ 2. 'add_cacheaction' - runs in phase2. Allows a plugin to add WordPress hooks.
124
+ 3. 'cache_admin_page' - runs in the admin page. Use it to add modify that page.
125
 
126
  There is one regular WordPress filter too. Use the "do_createsupercache" filter
127
  to customize the checks made before caching. The filter accepts one parameter.
wp-cache-config-sample.php CHANGED
@@ -40,7 +40,7 @@ if( defined( 'VHOST' ) ) {
40
  // Array of files that have 'wp-' but should still be cached
41
  $cache_acceptable_files = array( 'wp-atom.php', 'wp-comments-popup.php', 'wp-commentsrss2.php', 'wp-links-opml.php', 'wp-locations.php', 'wp-rdf.php', 'wp-rss.php', 'wp-rss2.php');
42
 
43
- $cache_rejected_uri = array('wp-');
44
  $cache_rejected_user_agent = array ( 0 => 'bot', 1 => 'ia_archive', 2 => 'slurp', 3 => 'crawl', 4 => 'spider');
45
 
46
  // Just modify it if you have conflicts with semaphores
40
  // Array of files that have 'wp-' but should still be cached
41
  $cache_acceptable_files = array( 'wp-atom.php', 'wp-comments-popup.php', 'wp-commentsrss2.php', 'wp-links-opml.php', 'wp-locations.php', 'wp-rdf.php', 'wp-rss.php', 'wp-rss2.php');
42
 
43
+ $cache_rejected_uri = array('wp-.*.php');
44
  $cache_rejected_user_agent = array ( 0 => 'bot', 1 => 'ia_archive', 2 => 'slurp', 3 => 'crawl', 4 => 'spider');
45
 
46
  // Just modify it if you have conflicts with semaphores
wp-cache-phase2.php CHANGED
@@ -62,9 +62,9 @@ function wp_cache_is_rejected($uri) {
62
  global $cache_rejected_uri;
63
 
64
  if (strstr($uri, '/wp-admin/'))
65
- return true; //we don't allow cacheing wp-admin for security
66
  foreach ($cache_rejected_uri as $expr) {
67
- if (strlen($expr) > 0 && substr( $uri, 1, strlen($expr) ) == $expr && strpos( $uri, '.php' ) )
68
  return true;
69
  }
70
  return false;
62
  global $cache_rejected_uri;
63
 
64
  if (strstr($uri, '/wp-admin/'))
65
+ return true; // we don't allow caching of wp-admin for security reasons
66
  foreach ($cache_rejected_uri as $expr) {
67
+ if( preg_match( "/$expr/", $uri ) )
68
  return true;
69
  }
70
  return false;
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 cache module. It's composed of several modules, this plugin can configure and manage the whole system. Once enabled, you must <a href="options-general.php?page=wp-super-cache/wp-cache.php">enable the cache</a>. Based on WP-Cache by <a href="http://mnm.uib.es/gallir/">Ricardo Galli Granada</a>.
6
- Version: 0.1
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 cache module. It's composed of several modules, this plugin can configure and manage the whole system. Once enabled, you must <a href="options-general.php?page=wp-super-cache/wp-cache.php">enable the cache</a>. Based on WP-Cache by <a href="http://mnm.uib.es/gallir/">Ricardo Galli Granada</a>.
6
+ Version: 0.3.1
7
  Author: Donncha O Caoimh
8
  Author URI: http://ocaoimh.ie/
9
  */