Commit 0585f861 authored by shammash's avatar shammash Committed by lechuck

updated wp-super-cache to 0.9.9.9

parent 6a561172
2011-01-26 11:42 donncha
* wp-cache-phase2.php: Remove the 5 second old check on existing
cache files as it may cause problems on pages with frequent
comments
2011-01-25 21:23 donncha
* ossdl-cdn.php: Add osscdl option to skip https loaded static
content, see
http://wordpress.org/support/topic/plugin-wp-super-cache-toggle-for-conditional-cdn-for-sites-with-some-ssl-https-content?replies=3
2011-01-25 20:40 donncha
* wp-cache-phase2.php: If caching disabled leave a html comment at
the end of the page. Remove a caching check that's no longer
needed
2011-01-25 20:27 donncha
* wp-cache-phase1.php: Make the supercachedir lowercase to avoid
problems with unicode characters. See
http://wordpress.org/support/topic/plugin-wp-super-cache-not-deleting-cache-on-comment-post
and
http://wordpress.org/support/topic/plugin-wp-super-cache-still-not-corrected-bug-about-unicode-range-letters-in-permalink
2011-01-18 16:08 donncha
* readme.txt, wp-cache.php: Added link to
http://codex.wordpress.org/Changing_File_Permissions where
permissions need to be changed, see
http://wordpress.org/support/topic/wp-super-cache-getting-warning-message,
props Samuel B
2011-01-18 15:59 donncha
* wp-cache-phase1.php: Cache get_current_url_supercache_dir() as
it's called several times during a request.
2011-01-17 16:29 donncha
* wp-cache.php: Show mod_rewrite rules even when WordPress rules
are not detected.
http://wordpress.org/support/topic/plugin-wp-super-cache-module-is-painful-to-use-if-you-dont-use-htaccess?replies=4#post-1890602
2011-01-17 13:35 donncha
* wp-cache.php: Show the right url to older MU sites, props Raphaël
Hertzog,
http://twitter.com/#!/raphaelhertzog/statuses/26993300657414145
2011-01-11 11:33 donncha
* wp-cache-phase2.php: If we're serving a feed we always want to
cache that.
2011-01-10 12:13 donncha
* languages/wp-super-cache-de_DE.mo,
languages/wp-super-cache-de_DE.po: Updated German translation by
Mathias Roth
2011-01-10 12:09 donncha
* ossdl-cdn.php: If an image appears more than once on a page serve
it from the same CDN hostname. See
http://wordpress.org/support/topic/plugin-wp-super-cache-start-page-and-rejected-user-agent?replies=3
2011-01-07 17:04 donncha
* wp-cache.php: Make sure to use is_front_page(), the function.
Props Backie.
http://wordpress.org/support/topic/plugin-wp-super-cache-wp_cache_is_home-always-true?replies=2#post-1873743
2011-01-07 12:24 donncha
* uninstall.php: No need for this uninstall script any more!
2011-01-07 12:20 donncha
* readme.txt: Bump the tested version
2011-01-07 12:07 donncha
* readme.txt: Minor typo
2011-01-07 12:02 donncha
* Changelog.txt: Updated changelog
2011-01-06 17:37 donncha
* wp-cache.php: Print the text, not __() it, and check if rewrite
......
......@@ -18,6 +18,7 @@ $arr_of_excludes = array_map('trim', explode(',', $ossdl_off_exclude));
if ( get_option( 'ossdl_cname' ) == false )
add_option('ossdl_cname', '');
$ossdl_cname = trim(get_option('ossdl_cname'));
$ossdl_https = trim(get_option('ossdl_https'));
$arr_of_cnames = array_map('trim', explode(',', $ossdl_cname));
if ($arr_of_cnames[0] == '') $arr_of_cnames = array();
......@@ -43,8 +44,15 @@ function scossdl_off_exclude_match($match, $excludes) {
* Called by #scossdl_off_filter.
*/
function scossdl_off_rewriter($match) {
global $ossdl_off_blog_url, $ossdl_off_cdn_url, $arr_of_excludes, $arr_of_cnames, $ossdl_https;
static $offset = -1;
global $ossdl_off_blog_url, $ossdl_off_cdn_url, $arr_of_excludes, $arr_of_cnames;
static $rewritten_urls = array();
if ( $ossdl_https && substr( $match[0], 0, 5 ) == 'https' )
return $match[0];
if ( isset( $rewritten_urls[ $match[ 0 ] ] ) )
return $rewritten_urls[ $match[ 0 ] ];
if ( false == in_array( $ossdl_off_cdn_url, $arr_of_cnames ) )
$arr_of_cnames[] = $ossdl_off_cdn_url;
......@@ -56,7 +64,11 @@ function scossdl_off_rewriter($match) {
if ( preg_match( '/' . $include_dirs . '/', $match[0] ) ) {
$offset++;
$offset %= count($arr_of_cnames);
return str_replace($ossdl_off_blog_url, $arr_of_cnames[$offset], $match[0]);
$url = str_replace($ossdl_off_blog_url, $arr_of_cnames[$offset], $match[0]);
if ( count( $rewritten_urls ) < 30 ) // don't use too much memory please
$rewritten_urls[ $match[ 0 ] ] = $url;
return $url;
} else {
return $match[0];
}
......@@ -115,6 +127,7 @@ function scossdl_off_options() {
update_option('ossdl_off_include_dirs', $_POST['ossdl_off_include_dirs'] == '' ? 'wp-content,wp-includes' : $_POST['ossdl_off_include_dirs']);
update_option('ossdl_off_exclude', $_POST['ossdl_off_exclude']);
update_option('ossdl_cname', $_POST['ossdl_cname']);
update_option('ossdl_https', (int)$_POST['ossdl_https']);
if ( isset( $_POST[ 'ossdlcdn' ] ) ) {
$ossdlcdn = 1;
} else {
......@@ -171,6 +184,9 @@ function scossdl_off_options() {
<span class="description"><?php printf( __( 'These <a href="http://en.wikipedia.org/wiki/CNAME_record">CNAMES</a> will be used in place of %1$s for rewriting (in addition to the off-site URL above). Use a comma as the delimiter. For pages with a large number of static files, this can improve browser performance. CNAMEs may also need to be configured on your CDN.<br />Example: %2$s', 'wp-super-cache' ), get_option( 'siteurl' ), $example_cnames ); ?></span>
</td>
</tr>
<tr valign="top">
<th scope="row" colspan='2'><label><input type='checkbox' name='ossdl_https' value='1' <?php if ( get_option( 'ossdl_https' ) ) { echo 'checked'; } ?> /> <?php _e( 'Skip https URLs to avoid "mixed content" errors', 'wp-super-cache' ); ?></label></th>
</tr>
</tbody></table>
<input type="hidden" name="action" value="update_ossdl_off" />
<p class="submit"><input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /></p>
......
=== WP Super Cache ===
Contributors: donncha, automattic
Tags: performance,caching,wp-cache,wp-super-cache,cache
Tested up to: 3.0.4
Stable tag: 0.9.9.8
Tested up to: 3.2
Stable tag: 0.9.9.9
Requires at least: 2.9.2
A very fast caching engine for WordPress that produces static html files.
......@@ -54,11 +54,20 @@ Interested in translating WP Super Cache to your language? Grab the [development
== Upgrade Notice ==
= 0.9.9.8 =
CDN code can be switched off, better uninstall process, compress dynamic pages, 1and1 webhosting fix, use Supercache files for dynamic pages
= 0.9.9.9 =
Serve repeated static files from the same CDN hostname, translations, lots of bug fixes
== Changelog ==
= 0.9.9.9 =
* Fixed typo, is_front_page.
* Serve repeated static files from the same CDN hostname.
* Updated translations.
* Make supercache dir lowercase to avoid problems with unicode URLs.
* Add option to skip https loaded static content.
* Remove 5 second check on age of existing cache files. Should help with posts that get lots of comments and traffic.
* Lots of bugs fixed.
= 0.9.9.8 =
* CDN updates: can be switched off, multiple CNAMEs.
* Uninstall process improved. It removes generated files and fixes edited files.
......@@ -235,11 +244,11 @@ CDN code can be switched off, better uninstall process, compress dynamic pages,
` SetEnvIfNoCase Request_URI \.gz$ no-gzip`
`</IfModule>`
`<IfModule mod_headers.c>`
` Header set Cache-Control 'max-age=300, must-revalidate'`
` Header set Cache-Control 'max-age=3, must-revalidate'`
`</IfModule>`
`<IfModule mod_expires.c>`
` ExpiresActive On`
` ExpiresByType text/html A300`
` ExpiresByType text/html A3`
`</IfModule>`
``
`# END supercache`
......@@ -387,6 +396,15 @@ Load your desktop ftp client and connect to your site. Navigate to the root (or
Load your desktop ftp client and connect to your site. You may need to enable "Show hidden files" in the preferences of the ftp client. Navigate to the root of your site where you'll find the .htaccess file. Download that file and edit it in a text editor. Delete the lines between "# BEGIN WPSuperCache" and "# END WPSuperCache" and save the file. Now upload it, overwriting the .htaccess file on your server.
= How do I change file permissions? =
This [page](http://codex.wordpress.org/Changing_File_Permissions) on the WordPress Codex explains everything you need to know about file permissions on your server and various ways of changing them.
= Why do I get load spikes when new posts are made? =
You may have the "clear all cached files when new posts are made" option set. Clearing those files can take time plus your visitors will now be visiting uncached pages. Are you using Google Analytics campaign tracking with utm_source in the url? Those pages aren't cached. See the question, "How should I best use the utm_source tracking tools in Google Analytics with this plugin" above for how to use them properly.
Cached pages have to be refreshed when posts are made. Perhaps your server just isn't up to the job of serving the amount of traffic you get. Enable the "cache rebuild" feature as that may help.
= Troubleshooting =
If things don't work when you installed the plugin here are a few things to check:
......@@ -472,3 +490,6 @@ Translators who did a great job converting the text of the plugin to their nativ
* [Pseric](http://pseric.com/) and [Priv](http://priv.tw/blog) (Traditional Chinese)
* [Maître Mô](http://maitremo.fr/) (French)
* [Mathias Roth](http://trade-service.eu/) (German)
* Bar¿¿ Ünver (Turkish)
* [Elvis Fweb](http://fweb.org.ru/blog/super-cache-rus) (Russian)
* Fredrik Forséll (Swedish)
......@@ -164,7 +164,7 @@ function wp_cache_serve_cache_file() {
{
header( "Content-type: text/html; charset=UTF-8" ); // UTF-8 hard coded is bad but we don't know what it is this early in the process
header( "Vary: Accept-Encoding, Cookie" );
header( "Cache-Control: max-age=300, must-revalidate" );
header( "Cache-Control: max-age=3, must-revalidate" );
header( "WP-Super-Cache: Served supercache file from PHP" );
if ( file_exists( $file . '.gz' ) && $wp_cache_gzip_encoding ) {
$file = $file . '.gz';
......@@ -250,7 +250,7 @@ function wp_cache_serve_cache_file() {
if ( isset( $wp_super_cache_debug ) && $wp_super_cache_debug ) wp_cache_debug( "Serving wp-cache dynamic file", 5 );
if ( $ungzip ) {
$cache = file_get_contents( $cache_file );
$uncompressed = gzuncompress( $cache );
$uncompressed = @gzuncompress( $cache );
if ( $uncompressed ) {
if ( isset( $wp_super_cache_debug ) && $wp_super_cache_debug ) wp_cache_debug( "Uncompressed gzipped cache file from wp-cache", 1 );
unset( $cache );
......@@ -263,20 +263,6 @@ function wp_cache_serve_cache_file() {
}
} else {
if ( isset( $wp_super_cache_debug ) && $wp_super_cache_debug ) wp_cache_debug( "Serving wp-cache static file", 5 );
if ( $wp_supercache_304 ) {
if ( function_exists( 'apache_request_headers' ) ) {
$request = apache_request_headers();
$remote_mod_time = $request[ 'If-Modified-Since' ];
} else {
$remote_mod_time = $_SERVER[ 'HTTP_IF_MODIFIED_SINCE' ];
}
$local_mod_time = gmdate("D, d M Y H:i:s",filemtime( $cache_file )).' GMT';
if ( $remote_mod_time == $local_mod_time ) {
header("HTTP/1.0 304 Not Modified");
exit();
}
header( 'Last-Modified: ' . $local_mod_time );
}
if ( $ungzip ) {
$cache = file_get_contents( $cache_file );
$uncompressed = gzuncompress( $cache );
......@@ -460,15 +446,20 @@ function wp_cache_user_agent_is_rejected() {
function get_current_url_supercache_dir( $post_id = 0 ) {
global $cached_direct_pages, $cache_path, $wp_cache_request_uri;
static $saved_supercache_dir = array();
if ( isset( $saved_supercache_dir[ $post_id ] ) ) {
return $saved_supercache_dir[ $post_id ];
}
if ( $post_id != 0 ) {
$uri = str_replace( site_url(), '', get_permalink( $post_id ) );
} else {
$uri = $wp_cache_request_uri;
$uri = strtolower( $wp_cache_request_uri );
}
$uri = preg_replace('/[ <>\'\"\r\n\t\(\)]/', '', str_replace( '/index.php', '/', str_replace( '..', '', preg_replace("/(\?.*)?$/", '', $uri ) ) ) );
$uri = str_replace( '\\', '', $uri );
$dir = strtolower(preg_replace('/:.*$/', '', $_SERVER["HTTP_HOST"])) . $uri; // To avoid XSS attacks
$dir = preg_replace( '/:.*$/', '', $_SERVER["HTTP_HOST"] ) . $uri; // To avoid XSS attacks
if ( function_exists( "apply_filters" ) )
$dir = apply_filters( 'supercache_dir', $dir );
$dir = $cache_path . 'supercache/' . $dir . '/';
......@@ -477,6 +468,7 @@ function get_current_url_supercache_dir( $post_id = 0 ) {
}
$dir = str_replace( '//', '/', $dir );
if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "supercache dir: $dir", 5 );
$saved_supercache_dir[ $post_id ] = $dir;
return $dir;
}
......
......@@ -356,6 +356,11 @@ function wp_cache_get_ob(&$buffer) {
return $buffer;
}
if ( $wp_cache_not_logged_in && is_feed() ) {
if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Feed detected. Writing legacy cache files.", 5 );
$wp_cache_not_logged_in = false;
}
$home_url = parse_url( trailingslashit( get_bloginfo( 'url' ) ) );
$dir = get_current_url_supercache_dir();
......@@ -390,53 +395,55 @@ function wp_cache_get_ob(&$buffer) {
wp_cache_init(); // PHP5 destroys objects during shutdown
}
if ( !$cache_enabled ) {
if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( '', 5 );
wp_cache_writers_exit();
return $buffer . "\n<!-- Page not cached by WP Super Cache. Check your settings page. -->";
}
if( @is_dir( $dir ) == false )
@wp_mkdir_p( $dir );
$fr = $fr2 = $gz = false;
if ( $cache_enabled ) {
// Open wp-cache cache file
if ( !$supercacheonly && ( !@file_exists( $blog_cache_dir . $cache_filename ) || ( @file_exists( $blog_cache_dir . $cache_filename ) && ( time() - @filemtime( $blog_cache_dir . $cache_filename ) ) > 5 ) ) ) {
if ( false == $wp_cache_object_cache ) {
$fr = @fopen($tmp_wpcache_filename, 'w');
if (!$fr) {
if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Error. Supercache could not write to " . str_replace( ABSPATH, '', $cache_path ) . $cache_filename, 1 );
$buffer .= "<!-- File not cached! Super Cache Couldn't write to: " . str_replace( ABSPATH, '', $cache_path ) . $cache_filename . " -->\n";
// Open wp-cache cache file
if ( !$supercacheonly ) {
if ( false == $wp_cache_object_cache ) {
$fr = @fopen($tmp_wpcache_filename, 'w');
if (!$fr) {
if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Error. Supercache could not write to " . str_replace( ABSPATH, '', $cache_path ) . $cache_filename, 1 );
$buffer .= "<!-- File not cached! Super Cache Couldn't write to: " . str_replace( ABSPATH, '', $cache_path ) . $cache_filename . " -->\n";
wp_cache_writers_exit();
return $buffer;
}
}
} else {
$user_info = wp_cache_get_cookies_values();
$do_cache = apply_filters( 'do_createsupercache', $user_info );
if ( $super_cache_enabled && ( $user_info == '' || $do_cache === true ) ) {
$cache_fname = "{$dir}index.html";
$tmp_cache_filename = $dir . uniqid( mt_rand(), true ) . '.tmp';
$fr2 = @fopen( $tmp_cache_filename, 'w' );
if ( !$fr2 ) {
if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Error. Supercache could not write to " . str_replace( ABSPATH, '', $tmp_cache_filename ), 1 );
$buffer .= "<!-- File not cached! Super Cache Couldn't write to: " . str_replace( ABSPATH, '', $tmp_cache_filename ) . " -->\n";
@fclose( $fr );
@unlink( $tmp_wpcache_filename );
wp_cache_writers_exit();
return $buffer;
} elseif ( $cache_compression ) {
$gz = @fopen( $tmp_cache_filename . ".gz", 'w');
if (!$gz) {
if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Error. Supercache could not write to " . str_replace( ABSPATH, '', $tmp_cache_filename ) . ".gz", 1 );
$buffer .= "<!-- File not cached! Super Cache Couldn't write to: " . str_replace( ABSPATH, '', $tmp_cache_filename ) . ".gz -->\n";
@fclose( $fr );
@unlink( $tmp_wpcache_filename );
@fclose( $fr2 );
@unlink( $tmp_cache_filename );
wp_cache_writers_exit();
return $buffer;
}
}
} else {
$user_info = wp_cache_get_cookies_values();
$do_cache = apply_filters( 'do_createsupercache', $user_info );
if ( $super_cache_enabled && ( $user_info == '' || $do_cache === true ) ) {
if( @is_dir( $dir ) == false )
@wp_mkdir_p( $dir );
$cache_fname = "{$dir}index.html";
$tmp_cache_filename = $dir . uniqid( mt_rand(), true ) . '.tmp';
if ( !@file_exists( $cache_fname ) || ( @file_exists( $cache_fname ) && ( time() - @filemtime( $cache_fname ) ) > 5 ) ) {
$fr2 = @fopen( $tmp_cache_filename, 'w' );
if (!$fr2) {
if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Error. Supercache could not write to " . str_replace( ABSPATH, '', $tmp_cache_filename ), 1 );
$buffer .= "<!-- File not cached! Super Cache Couldn't write to: " . str_replace( ABSPATH, '', $tmp_cache_filename ) . " -->\n";
@fclose( $fr );
@unlink( $tmp_wpcache_filename );
wp_cache_writers_exit();
return $buffer;
} elseif ( $cache_compression ) {
$gz = @fopen( $tmp_cache_filename . ".gz", 'w');
if (!$gz) {
if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Error. Supercache could not write to " . str_replace( ABSPATH, '', $tmp_cache_filename ) . ".gz", 1 );
$buffer .= "<!-- File not cached! Super Cache Couldn't write to: " . str_replace( ABSPATH, '', $tmp_cache_filename ) . ".gz -->\n";
@fclose( $fr );
@unlink( $tmp_wpcache_filename );
@fclose( $fr2 );
@unlink( $tmp_cache_filename );
wp_cache_writers_exit();
return $buffer;
}
}
}
}
}
}
......@@ -766,6 +773,9 @@ function wp_cache_shutdown_callback() {
$wp_cache_meta[ 'headers' ][ $key ] = "$key: " . $response[$key];
}
}
if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "wp_cache_shutdown_callback: collecting meta data.", 2 );
if (!isset( $response['Last-Modified'] )) {
$value = gmdate('D, d M Y H:i:s') . ' GMT';
/* Dont send this the first time */
......
......@@ -3,7 +3,7 @@
Plugin Name: WP Super Cache
Plugin URI: http://ocaoimh.ie/wp-super-cache/
Description: Very fast caching plugin for WordPress.
Version: 0.9.9.8
Version: 0.9.9.9
Author: Donncha O Caoimh
Author URI: http://ocaoimh.ie/
*/
......@@ -59,7 +59,7 @@ add_action( 'init', 'wp_super_cache_text_domain' );
function wp_cache_set_home() {
global $wp_cache_is_home;
$wp_cache_is_home = ( is_front_page || is_home() );
$wp_cache_is_home = ( is_front_page() || is_home() );
if ( $wp_cache_is_home && is_paged() )
$wp_cache_is_home = false;
}
......@@ -239,6 +239,7 @@ function wp_cache_manager_error_checks() {
?><div id="message" class="updated fade"><h3><?php _e( 'Read Only Mode. Configuration cannot be changed.', 'wp-super-cache' ); ?></h3>
<p><?php printf( __( 'The WP Super Cache configuration file is <code>%s/wp-cache-config.php</code> and cannot be modified. That file must be writeable by the webserver to make any changes.', 'wp-super-cache' ), WP_CONTENT_DIR ); ?>
<?php _e( 'A simple way of doing that is by changing the permissions temporarily using the CHMOD command or through your ftp client. Make sure it&#8217;s globally writeable and it should be fine.', 'wp-super-cache' ); ?></p>
<p><?php _e( '<a href="http://codex.wordpress.org/Changing_File_Permissions">This page</a> explains how to change file permissions.', 'wp-super-cache' ); ?></p>
<?php _e( 'Writeable:', 'wp-super-cache' ); ?> <code>chmod 666 <?php echo WP_CONTENT_DIR; ?>/wp-cache-config.php</code>
<?php _e( 'Readonly:', 'wp-super-cache' ); ?> <code>chmod 644 <?php echo WP_CONTENT_DIR; ?>/wp-cache-config.php</code></p>
</div><?php
......@@ -253,7 +254,9 @@ function wp_cache_manager_error_checks() {
$wp_content_mode = ( $wp_content_stat[ 'mode' ] & 0777 );
if( $wp_content_mode != 0755 ) {
?><div id="message" class="updated fade"><h3><?php printf( __( 'Warning! %s is writeable!', 'wp-super-cache' ), WP_CONTENT_DIR ); ?></h3>
<p><?php printf( __( 'You should change the permissions on %s and make it more restrictive. Use your ftp client, or the following command to fix things:', 'wp-super-cache' ), WP_CONTENT_DIR ); ?> <code>chmod 755 <?php echo WP_CONTENT_DIR; ?>/</code></p></div><?php
<p><?php printf( __( 'You should change the permissions on %s and make it more restrictive. Use your ftp client, or the following command to fix things:', 'wp-super-cache' ), WP_CONTENT_DIR ); ?> <code>chmod 755 <?php echo WP_CONTENT_DIR; ?>/</code></p>
<p><?php _e( '<a href="http://codex.wordpress.org/Changing_File_Permissions">This page</a> explains how to change file permissions.', 'wp-super-cache' ); ?></p></div>
<?php
}
}
......@@ -1081,10 +1084,11 @@ function wsc_mod_rewrite() {
global $current_site;
$protocol = ( 'on' == strtolower( $_SERVER['HTTPS' ] ) ) ? 'https://' : 'http://';
if ( isset( $wpmu_version ) ) {
echo '<div id="message" class="updated fade"><p>' . sprintf( __( 'Notice: WP Super Cache mod_rewrite rule checks disabled unless running on <a href="%s">the main site</a> of this network.', 'wp-super-cache' ), admin_url( "ms-admin.php?page=wpsupercache" ) ) . '</p></div>';
$link_to_admin = admin_url( "wpmu-admin.php?page=wpsupercache" );
} else {
echo '<div id="message" class="updated fade"><p>' . sprintf( __( 'Notice: WP Super Cache mod_rewrite rule checks disabled unless running on <a href="%s">on the main site</a> of this network.', 'wp-super-cache' ), admin_url( "wpmu-admin.php?page=wpsupercache" ) ) . '</p></div>';
$link_to_admin = admin_url( "ms-admin.php?page=wpsupercache" );
}
echo '<div id="message" class="updated fade"><p>' . sprintf( __( 'Notice: WP Super Cache mod_rewrite rule checks disabled unless running on <a href="%s">the main site</a> of this network.', 'wp-super-cache' ), $link_to_admin ) . '</p></div>';
return false;
}
}
......@@ -1105,8 +1109,8 @@ function wsc_mod_rewrite() {
echo "<p>" . sprintf( __( "You must have <strong>BEGIN</strong> and <strong>END</strong> markers in %s.htaccess for the auto update to work. They look like this and surround the main WordPress mod_rewrite rules:", 'wp-super-cache' ), $home_path );
echo "<blockquote><pre><em># BEGIN WordPress</em>\n RewriteCond %{REQUEST_FILENAME} !-f\n RewriteCond %{REQUEST_FILENAME} !-d\n RewriteRule . /index.php [L]\n <em># END WordPress</em></pre></blockquote>";
_e( 'Refresh this page when you have updated your .htaccess file.', 'wp-super-cache' );
echo "</fieldset></div>";
return;
echo "</fieldset>";
$dohtaccess = false;
} elseif( strpos( $wprules, 'wordpressuser' ) ) { // Need to clear out old mod_rewrite rules
echo "<p><strong>" . __( 'Thank you for upgrading.', 'wp-super-cache' ) . "</strong> " . sprintf( __( 'The mod_rewrite rules changed since you last installed this plugin. Unfortunately you must remove the old supercache rules before the new ones are updated. Refresh this page when you have edited your .htaccess file. If you wish to manually upgrade, change the following line: %1$s so it looks like this: %2$s The only changes are "HTTP_COOKIE" becomes "HTTP:Cookie" and "wordpressuser" becomes "wordpress". This is a WordPress 2.5 change but it&#8217;s backwards compatible with older versions if you&#8217;re brave enough to use them.', 'wp-super-cache' ), '<blockquote><code>RewriteCond %{HTTP_COOKIE} !^.*wordpressuser.*$</code></blockquote>', '<blockquote><code>RewriteCond %{HTTP:Cookie} !^.*wordpress.*$</code></blockquote>' ) . "</p>";
echo "</fieldset></div>";
......@@ -1685,7 +1689,7 @@ function wp_cache_verify_cache_dir() {
$dir = dirname($cache_path);
if ( !file_exists($cache_path) ) {
if ( !is_writeable_ACLSafe( $dir ) || !($dir = mkdir( $cache_path ) ) ) {
echo "<strong>" . __( 'Error', 'wp-super-cache' ) . ":</strong> " . sprintf( __( 'Your cache directory (<strong>$cache_path</strong>) did not exist and couldn&#8217;t be created by the web server. Check %s permissions.', 'wp-super-cache' ), $dir );
echo "<strong>" . __( 'Error', 'wp-super-cache' ) . ":</strong> " . sprintf( __( 'Your cache directory (<strong>%1$s</strong>) did not exist and couldn&#8217;t be created by the web server. Check %1$s permissions.', 'wp-super-cache' ), $dir );
return false;
}
}
......@@ -2461,8 +2465,8 @@ function wpsc_get_htaccess_info() {
$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";
$gziprules .= "<IfModule mod_deflate.c>\n SetEnvIfNoCase Request_URI \.gz$ no-gzip\n</IfModule>\n";
$gziprules .= "<IfModule mod_headers.c>\n Header set Vary \"Accept-Encoding, Cookie\"\n Header set Cache-Control 'max-age=300, must-revalidate'\n</IfModule>\n";
$gziprules .= "<IfModule mod_expires.c>\n ExpiresActive On\n ExpiresByType text/html A300\n</IfModule>\n";
$gziprules .= "<IfModule mod_headers.c>\n Header set Vary \"Accept-Encoding, Cookie\"\n Header set Cache-Control 'max-age=3, must-revalidate'\n</IfModule>\n";
$gziprules .= "<IfModule mod_expires.c>\n ExpiresActive On\n ExpiresByType text/html A3\n</IfModule>\n";
return array( "document_root" => $document_root, "apache_root" => $apache_root, "home_path" => $home_path, "home_root" => $home_root, "inst_root" => $inst_root, "wprules" => $wprules, "scrules" => $scrules, "condition_rules" => $condition_rules, "rules" => $rules, "gziprules" => $gziprules );
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment