WP Super Cache - Version 1.4.7

Version Description

Bugfix for layout changes on settings pages in WordPress 4.4.

=

Download this release

Release Info

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

Code changes from version 1.4.6 to 1.4.7

Files changed (4) hide show
  1. ossdl-cdn.php +1 -1
  2. readme.txt +7 -4
  3. wp-cache-phase1.php +1 -1
  4. wp-cache.php +48 -45
ossdl-cdn.php CHANGED
@@ -148,7 +148,7 @@ function scossdl_off_options() {
148
  $example_cdn_uri = get_option('ossdl_off_cdn_url') == get_option('siteurl') ? $example_cdn_uri : get_option('ossdl_off_cdn_url');
149
  $example_cdn_uri .= '/wp-includes/js/prototype.js';
150
  ?>
151
- <p><?php _e( 'Your website probably uses lots of static files. Image, Javascript and CSS files are usually static files that could just as easily be served from another site or CDN. Therefore this plugin replaces any links in the <code>wp-content</code> and <code>wp-includes</code> directories (except for PHP files) on your site with the URL you provide below. That way you can either copy all the static content to a dedicated host or mirror the files to a CDN by <a href="http://knowledgelayer.softlayer.com/questions/365/How+does+Origin+Pull+work%3F" target="_blank">origin pull</a>.', 'wp-super-cache' ); ?></p>
152
  <p><?php printf( __( '<strong style="color: red">WARNING:</strong> Test some static urls e.g., %s to ensure your CDN service is fully working before saving changes.', 'wp-super-cache' ), '<code>' . $example_cdn_uri . '</code>' ); ?></p>
153
  <p><?php _e( 'You can define different CDN URLs for each site on a multsite network.', 'wp-super-cache' ); ?></p>
154
  <p><form method="post" action="">
148
  $example_cdn_uri = get_option('ossdl_off_cdn_url') == get_option('siteurl') ? $example_cdn_uri : get_option('ossdl_off_cdn_url');
149
  $example_cdn_uri .= '/wp-includes/js/prototype.js';
150
  ?>
151
+ <p><?php _e( 'Your website probably uses lots of static files. Image, Javascript and CSS files are usually static files that could just as easily be served from another site or CDN. Therefore, this plugin replaces any links in the <code>wp-content</code> and <code>wp-includes</code> directories (except for PHP files) on your site with the URL you provide below. That way you can either copy all the static content to a dedicated host or mirror the files to a CDN by <a href="http://knowledgelayer.softlayer.com/questions/365/How+does+Origin+Pull+work%3F" target="_blank">origin pull</a>.', 'wp-super-cache' ); ?></p>
152
  <p><?php printf( __( '<strong style="color: red">WARNING:</strong> Test some static urls e.g., %s to ensure your CDN service is fully working before saving changes.', 'wp-super-cache' ), '<code>' . $example_cdn_uri . '</code>' ); ?></p>
153
  <p><?php _e( 'You can define different CDN URLs for each site on a multsite network.', 'wp-super-cache' ); ?></p>
154
  <p><form method="post" action="">
readme.txt CHANGED
@@ -1,8 +1,8 @@
1
  === WP Super Cache ===
2
  Contributors: donncha, automattic, kraftbj
3
  Tags: performance,caching,wp-cache,wp-super-cache,cache
4
- Tested up to: 4.3.1
5
- Stable tag: 1.4.6
6
  Requires at least: 3.0
7
 
8
  A very fast caching engine for WordPress that produces static html files.
@@ -58,11 +58,14 @@ The cache directory, usually wp-content/cache/ is only for temporary files. Do n
58
 
59
  == Upgrade Notice ==
60
 
61
- = 1.4.6 =
62
- Bugfix for sites that use mod_rewrite to serve compressed pages.
63
 
64
  == Changelog ==
65
 
 
 
 
66
  = 1.4.6 =
67
  * Generate the file cache/.htaccess even when one exists so gzip rules are created and gzipped pages are served correctly. Props Tigertech. https://wordpress.org/support/topic/all-website-pages-downloading-gz-file-after-latest-update?replies=36#post-7494087
68
 
1
  === WP Super Cache ===
2
  Contributors: donncha, automattic, kraftbj
3
  Tags: performance,caching,wp-cache,wp-super-cache,cache
4
+ Tested up to: 4.7
5
+ Stable tag: 1.4.7
6
  Requires at least: 3.0
7
 
8
  A very fast caching engine for WordPress that produces static html files.
58
 
59
  == Upgrade Notice ==
60
 
61
+ = 1.4.7 =
62
+ Bugfix for layout changes on settings pages in WordPress 4.4.
63
 
64
  == Changelog ==
65
 
66
+ = 1.4.7 =
67
+ * Update the settings page for WordPress 4.4. layout changes.
68
+
69
  = 1.4.6 =
70
  * Generate the file cache/.htaccess even when one exists so gzip rules are created and gzipped pages are served correctly. Props Tigertech. https://wordpress.org/support/topic/all-website-pages-downloading-gz-file-after-latest-update?replies=36#post-7494087
71
 
wp-cache-phase1.php CHANGED
@@ -580,7 +580,7 @@ function get_current_url_supercache_dir( $post_id = 0 ) {
580
  $uri = '';
581
  }
582
  } else {
583
- wp_cache_debug( "get_current_url_supercache_dir: Removing SERVER_NAME ({$WPSC_HTTP_HOST}) and $protocol from permalink ($permalink). Is the url right?", 1 );
584
  $uri = str_replace( $WPSC_HTTP_HOST, '', $permalink );
585
  $uri = str_replace( 'http://', '', $uri );
586
  $uri = str_replace( 'https://', '', $uri );
580
  $uri = '';
581
  }
582
  } else {
583
+ wp_cache_debug( "get_current_url_supercache_dir: Removing SERVER_NAME ({$WPSC_HTTP_HOST}) from permalink ($permalink). Is the url right?", 1 );
584
  $uri = str_replace( $WPSC_HTTP_HOST, '', $permalink );
585
  $uri = str_replace( 'http://', '', $uri );
586
  $uri = str_replace( 'https://', '', $uri );
wp-cache.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
  /*
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.6
7
  Author: Automattic
8
- Author URI: http://automattic.com/
9
  License: GPL2+
10
  Text Domain: wp-super-cache
11
  */
@@ -242,7 +242,7 @@ function wp_cache_manager_error_checks() {
242
  if( is_array( $cron ) ) {
243
  if( $cron[ 'response' ][ 'code' ] == '404' ) {
244
  ?><div id="message" class="updated fade"><h3>Warning! wp-cron.php not found!</h3>
245
- <p><?php _e( 'Unfortunately WordPress cannot find the file wp-cron.php. This script is required for the the correct operation of garbage collection by this plugin, WordPress scheduled posts as well as other critical activities.', 'wp-super-cache' ); ?></p>
246
  <p><?php printf( __( 'Please see entry 16 in the <a href="%s">Troubleshooting section</a> of the readme.txt', 'wp-super-cache' ), 'http://wordpress.org/plugins/wp-super-cache/faq/' ); ?></p>
247
  </div>
248
  <?php
@@ -278,11 +278,11 @@ function wp_cache_manager_error_checks() {
278
  if ( !defined( 'SUBMITDISABLED' ) )
279
  define( "SUBMITDISABLED", 'disabled style="color: #aaa" ' );
280
  ?><div id="message" class="updated fade"><h3><?php _e( 'Read Only Mode. Configuration cannot be changed.', 'wp-super-cache' ); ?></h3>
281
- <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 ); ?>
282
  <?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>
283
  <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>
284
  <?php _e( 'Writeable:', 'wp-super-cache' ); ?> <code>chmod 666 <?php echo WP_CONTENT_DIR; ?>/wp-cache-config.php</code>
285
- <?php _e( 'Readonly:', 'wp-super-cache' ); ?> <code>chmod 644 <?php echo WP_CONTENT_DIR; ?>/wp-cache-config.php</code></p>
286
  </div><?php
287
  } elseif ( !defined( 'SUBMITDISABLED' ) ) {
288
  define( "SUBMITDISABLED", ' ' );
@@ -401,7 +401,7 @@ function wp_cache_manager_error_checks() {
401
  if ( $dismiss_htaccess_warning == 0 && $wp_cache_mod_rewrite && $super_cache_enabled && $disable_supercache_htaccess_warning == false && get_option( 'siteurl' ) != get_option( 'home' ) ) {
402
  $home_dir = str_replace( get_option( 'home' ), '', get_option( 'siteurl' ) );
403
  ?><div id="message" class="updated fade"><h3><?php _e( '.htaccess file may need to be moved', 'wp-super-cache' ); ?></h3>
404
- <p><?php _e( 'It appears you have WordPress installed in a sub directory as described <a href="http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory">here</a>. Unfortunately WordPress writes to the .htaccess in the install directory, not where your site is served from.<br />When you update the rewrite rules in this plugin you will have to copy the file to where your site is hosted. This will be fixed in the future.', 'wp-super-cache' ); ?></p>
405
  <form action="" method="POST">
406
  <input type="hidden" name="action" value="dismiss_htaccess_warning" />
407
  <input type="hidden" name="page" value="wpsupercache" />
@@ -754,6 +754,9 @@ jQuery(document).ready(function(){
754
  border-bottom: 1px solid #ccc;
755
  padding-bottom: 0;
756
  }
 
 
 
757
  </style>
758
  <?php
759
  echo '<a name="top"></a>';
@@ -803,7 +806,7 @@ jQuery(document).ready(function(){
803
  update_cached_mobile_ua_list( $wp_cache_mobile_browsers, $wp_cache_mobile_prefixes, $mobile_groups );
804
  }
805
 
806
- ?> <table><td valign='top'><?php
807
  switch( $_GET[ 'tab' ] ) {
808
  case "cdn":
809
  scossdl_off_options();
@@ -1016,7 +1019,7 @@ jQuery(document).ready(function(){
1016
  <legend class="hidden">Miscellaneous</legend>
1017
  <?php if ( false == defined( 'WPSC_DISABLE_COMPRESSION' ) ) { ?>
1018
  <?php if ( false == function_exists( 'gzencode' ) ) { ?>
1019
- <em><?php _e( 'Warning! Compression is disabled as gzencode() function not found.', 'wp-super-cache' ); ?></em><br />
1020
  <?php } else { ?>
1021
  <label><input type='checkbox' name='cache_compression' <?php if( $cache_compression ) echo "checked"; ?> value='1'> <?php _e( 'Compress pages so they&#8217;re served more quickly to visitors.', 'wp-super-cache' ); echo " <em>(" . __( "Recommended", "wp-super-cache" ) . ")</em>"; ?></label><br />
1022
  <em><?php _e( 'Compression is disabled by default because some hosts have problems with compressed files. Switching it on and off clears the cache.', 'wp-super-cache' ); ?></em><br />
@@ -1027,10 +1030,10 @@ jQuery(document).ready(function(){
1027
  $disable_304 = false;
1028
  if ( $disable_304 )
1029
  echo "<strike>";
1030
- ?><label><input <?php if ( $disable_304 ) { echo "disabled"; } ?> type='checkbox' name='wp_supercache_304' <?php if( $wp_supercache_304 ) echo "checked"; ?> value='1'> <?php _e( '304 Not Modified browser caching. Indicate when a page has not been modified since last requested.', 'wp-super-cache' ); echo " <em>(" . __( "Recommended", "wp-super-cache" ) . ")</em>"; ?></label><br /><?php
1031
  if ( $disable_304 ) {
1032
  echo "</strike>";
1033
- echo "<p><strong>" . __( 'Warning! 304 browser caching is only supported when not using mod_rewrite caching.', 'wp-super-cache' ) . "</strong></p>";
1034
  } else {
1035
  ?><em><?php _e( '304 support is disabled by default because some hosts have had problems with the headers used in the past.', 'wp-super-cache' ); ?></em><br /><?php
1036
  }
@@ -1077,22 +1080,22 @@ jQuery(document).ready(function(){
1077
  <input type='text' size=80 name='wp_cache_location' value='<?php echo esc_attr( $cache_path ); ?>' />
1078
  <p><?php printf( __( 'Change the location of your cache files. The default is WP_CONTENT_DIR . /cache/ which translates to %s.', 'wp-super-cache' ), WP_CONTENT_DIR . '/cache/' ); ?></p>
1079
  <ol><li><?php _e( 'You must give the full path to the directory.', 'wp-super-cache' ); ?></li>
1080
- <li><?php _e( 'If the directory does not exist it will be created so make sure your webserver user has write access to the parent directory. The parent directory must exist.', 'wp-super-cache' ); ?></li>
1081
  <li><?php _e( 'If the new cache directory does not exist, it will be created and the contents of the old cache directory will be moved there. Otherwise, the old cache directory will be left where it is.', 'wp-super-cache' ); ?></li>
1082
  <li><?php _e( 'Submit a blank entry to set it to the default directory, WP_CONTENT_DIR . /cache/.', 'wp-super-cache' ); ?></li>
1083
  <?php if ( get_site_option( 'wp_super_cache_index_detected' ) && strlen( $cache_path ) > strlen( ABSPATH ) && ABSPATH == substr( $cache_path, 0, strlen( ABSPATH ) ) ) {
1084
- $msg = __( 'The plugin detected a bare directory index in your cache directory which would let visitors see your cache files directly and might expose private posts.', 'wp-super-cache' );
1085
  if ( $super_cache_enabled && $wp_cache_mod_rewrite == 1 ) {
1086
- $msg .= ' ' . __( 'You are using mod_rewrite to serve cache files so the plugin has added <q>Options -Indexes</q> to the .htaccess file in the cache directory to disable indexes. However if that does not work you should contact your system administrator or support and ask for them to be disabled, or use PHP mode and move the cache outside of the web root.' );
1087
  } else {
1088
- $msg .= ' <strong>' . sprintf( __( 'index.html files have been added in key directories but unless directory indexes are disabled it is probably better to store the cache files outside of the web root of %s' ), ABSPATH ) . '</strong>';
1089
  }
1090
  echo "<li>$msg</li>";
1091
  } ?>
1092
 
1093
-
1094
  <?php if ( $super_cache_enabled && $wp_cache_mod_rewrite == 1 ) { ?>
1095
- <li><?php printf( __( 'Since you are using mod_rewrite to serve cache files you must choose a directory in your web root which is <q>%s</q> and update the mod_rewrite rules in the .htaccess file.', 'wp-super-cache' ), ABSPATH ); ?></li>
1096
  <?php } ?>
1097
  </ol>
1098
  <p><?php _e( '', 'wp-super-cache' ); ?></p>
@@ -1102,8 +1105,8 @@ jQuery(document).ready(function(){
1102
  </table>
1103
  <h3><?php _e( 'Note:', 'wp-super-cache' ); ?></h3>
1104
  <ol>
1105
- <li><?php _e( 'Uninstall this plugin on the plugins page. It will automatically clean up after itself. If manual intervention is required then simple instructions are provided.', 'wp-super-cache' ); ?></li>
1106
- <li><?php printf( __( 'If uninstalling this plugin, make sure the directory <em>%s</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!)', 'wp-super-cache' ), WP_CONTENT_DIR ); ?></li>
1107
  <li><?php printf( __( 'Please see the <a href="%1$s/wp-super-cache/readme.txt">readme.txt</a> for instructions on uninstalling this script. Look for the heading, "How to uninstall WP Super Cache".', 'wp-super-cache' ), WP_PLUGIN_URL ); ?></li><?php
1108
  echo "<li><em>" . sprintf( __( 'Need help? Check the <a href="%1$s">Super Cache readme file</a>. It includes installation documentation, a FAQ and Troubleshooting tips. The <a href="%2$s">support forum</a> is also available. Your question may already have been answered.', 'wp-super-cache' ), 'http://wordpress.org/plugins/wp-super-cache/', 'http://wordpress.org/tags/wp-super-cache?forum_id=10' ) . "</em></li>";
1109
  echo "</ol>";
@@ -1152,7 +1155,7 @@ jQuery(document).ready(function(){
1152
  if ( $cache_enabled && !$wp_cache_mod_rewrite ) {
1153
  $scrules = trim( implode( "\n", extract_from_markers( trailingslashit( get_home_path() ) . '.htaccess', 'WPSuperCache' ) ) );
1154
  if ( $scrules != '' ) {
1155
- echo "<p><strong>" . __( 'Notice: PHP caching enabled but Supercache mod_rewrite rules detected. Cached files will be served using those rules. If your site is working ok please ignore this message or you can edit the .htaccess file in the root of your install and remove the SuperCache rules.', 'wp-super-cache' ) . '</strong></p>';
1156
  }
1157
  }
1158
  echo "<div class='submit'><input class='button-primary' type='submit' " . SUBMITDISABLED . " value='" . __( 'Update Status', 'wp-super-cache' ) . "' /></div></form>";
@@ -1241,7 +1244,7 @@ jQuery(document).ready(function(){
1241
  echo '</form>';
1242
  }
1243
  echo "<h3>" . __( "Delete Cached Pages", 'wp-super-cache' ) . "</h3>";
1244
- echo "<p>" . __( "Cached pages are stored on your server as html and PHP files. If you need to delete them use the button below.", 'wp-super-cache' ) . "</p>";
1245
  echo '<form name="wp_cache_content_delete" action="?page=wpsupercache&tab=contents" method="post">';
1246
  echo '<input type="hidden" name="wp_delete_cache" />';
1247
  echo '<div class="submit"><input id="deletepost" class="button-secondary" type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Delete Cache', 'wp-super-cache' ) . ' " /></div>';
@@ -1259,7 +1262,7 @@ jQuery(document).ready(function(){
1259
  <h3 class="clear"><?php _e( 'Recommended Links and Plugins', 'wp-super-cache' ); ?></h3>
1260
  <p><?php _e( 'Caching is only one part of making a website faster. Here are some other plugins that will help:', 'wp-super-cache' ); ?></p>
1261
  <li><?php printf( __( '<a href="%s">Yahoo! Yslow</a> is an extension for the Firefox add-on Firebug. It analyzes web pages and suggests ways to improve their performance based on a set of rules for high performance web pages. Also try the performance tools online at <a href="%s">GTMetrix</a>.', 'wp-super-cache' ), 'http://developer.yahoo.com/yslow/', 'http://gtmetrix.com/' ); ?></li>
1262
- <li><?php printf( __( '<a href="%s">Use Google Libraries</a> allows you to load some commonly used Javascript libraries from Google webservers. Ironically it may reduce your Yslow score.', 'wp-super-cache' ), 'http://wordpress.org/plugins/use-google-libraries/' ); ?></li>
1263
  <li><?php printf( __( '<strong>Advanced users only:</strong> <a href="%s">Speed up your site with Caching and cache-control</a> explains how to make your site more cacheable with .htaccess rules.', 'wp-super-cache' ), 'http://www.askapache.com/htaccess/speed-up-your-site-with-caching-and-cache-control.html' ); ?></li>
1264
  <li><?php printf( __( '<strong>Advanced users only:</strong> Install an object cache. Choose from <a href="%s">Memcached</a>, <a href="%s">XCache</a>, <a href="%s">eAcccelerator</a> and others.', 'wp-super-cache' ), 'http://wordpress.org/plugins/memcached/', 'http://neosmart.net/dl.php?id=12', 'http://neosmart.net/dl.php?id=13' ); ?></li>
1265
  <li><?php printf( __( '<a href="%s">Cron View</a> is a useful plugin to use when trying to debug garbage collection and preload problems.', 'wp-super-cache' ), 'http://wordpress.org/plugins/cron-view/' ); ?></li>
@@ -1317,7 +1320,7 @@ jQuery(document).ready(function(){
1317
  function wpsc_plugins_tab() {
1318
  echo '<p>' . __( 'Cache plugins are PHP scripts that live in a plugins folder inside the wp-super-cache folder. They are loaded when Supercache loads, much sooner than regular WordPress plugins.', 'wp-super-cache' ) . '</p>';
1319
  echo '<p>' . __( 'This is strictly an advanced feature only and knowledge of both PHP and WordPress actions is required to create them.', 'wp-super-cache' ) . '</p>';
1320
- echo '<p>' . __( '<strong>Warning</strong>! Due to the way WordPress upgrades plugins the plugins you upload to wp-super-cache/plugins/ will be deleted when you upgrade WP Super Cache. You can avoid this by loading the plugins from elsewhere. Set <strong>$wp_cache_plugins_dir</strong> to the new location in wp-config.php and WP Super Cache will look there instead.<br />More info available in the <a href="http://ocaoimh.ie/wp-super-cache-developers/">developer documentation</a>.', 'wp-super-cache' ) . '</p>';
1321
  ob_start();
1322
  if( defined( 'WP_CACHE' ) ) {
1323
  if( function_exists( 'do_cacheaction' ) ) {
@@ -1397,7 +1400,7 @@ function wsc_mod_rewrite() {
1397
  $dohtaccess = true;
1398
  global $wpmu_version;
1399
  if( isset( $wpmu_version ) ) {
1400
- echo "<h4 style='color: #a00'>" . __( 'WordPress MU Detected', 'wp-super-cache' ) . "</h4><p>" . __( "Unfortunately the rewrite rules cannot be updated automatically when running WordPress MU. Please open your .htaccess and add the following mod_rewrite rules above any other rules in that file.", 'wp-super-cache' ) . "</p>";
1401
  } elseif( !$wprules || $wprules == '' ) {
1402
  echo "<h4 style='color: #a00'>" . __( 'Mod Rewrite rules cannot be updated!', 'wp-super-cache' ) . "</h4>";
1403
  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 );
@@ -1406,7 +1409,7 @@ function wsc_mod_rewrite() {
1406
  echo "</fieldset>";
1407
  $dohtaccess = false;
1408
  } elseif( strpos( $wprules, 'wordpressuser' ) ) { // Need to clear out old mod_rewrite rules
1409
- 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>";
1410
  echo "</fieldset></div>";
1411
  return;
1412
  } elseif( $scrules != '' && strpos( $scrules, '%{REQUEST_URI} !^.*[^/]$' ) === false && substr( get_option( 'permalink_structure' ), -1 ) == '/' ) { // permalink structure has a trailing slash, need slash check in rules.
@@ -1435,10 +1438,10 @@ function wsc_mod_rewrite() {
1435
  echo "<p><pre>" . esc_html( $rules ) . "</pre></p>\n</div>";
1436
  } else {
1437
  ?>
1438
- <p><?php printf( __( 'WP Super Cache mod rewrite rules were detected in your %s.htaccess file.<br /> Click the following link to see the lines added to that file. If you have upgraded the plugin make sure these rules match.', 'wp-super-cache' ), $home_path ); ?></p>
1439
  <?php
1440
  if ( $rules != $scrules ) {
1441
- ?><p style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'><?php _e( 'A difference between the rules in your .htaccess file and the plugin rewrite rules has been found. This could be simple whitespace differences but you should compare the rules in the file with those below as soon as possible. Click the &#8217;Update Mod_Rewrite Rules&#8217; button to update the rules.', 'wp-super-cache' ); ?></p><?php
1442
  }
1443
  ?><a href="javascript:toggleLayer('rewriterules');" class="button"><?php _e( 'View Mod_Rewrite Rules', 'wp-super-cache' ); ?></a><?php
1444
  wpsc_update_htaccess_form();
@@ -1587,7 +1590,7 @@ function wp_lock_down() {
1587
  $readonly = '';
1588
  if( !is_writeable_ACLSafe( ABSPATH ) ) {
1589
  $readonly = 'READONLY';
1590
- ?><p style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'><strong><?php _e( 'Warning!', 'wp-super-cache' ); ?></strong> <?php printf( __( 'You must make %s writable to enable this feature. As this is a security risk please make it readonly after your page is generated.', 'wp-super-cache' ), ABSPATH ); ?></p><?php
1591
  } else {
1592
  $abspath_stat = stat(ABSPATH . '/');
1593
  $abspath_mode = decoct( $abspath_stat[ 'mode' ] & 0777 );
@@ -1651,7 +1654,7 @@ function wp_cache_edit_max_time () {
1651
  global $cache_max_time, $wp_cache_config_file, $valid_nonce, $cache_enabled, $super_cache_enabled, $cache_schedule_type, $cache_scheduled_time, $cache_schedule_interval, $cache_time_interval, $cache_gc_email_me, $wp_cache_preload_on;
1652
 
1653
  $timezone_format = _x('Y-m-d G:i:s', 'timezone date format');
1654
-
1655
  if ( isset( $_POST[ 'action' ] ) && $_POST[ 'action' ] == 'expirytime' ) {
1656
 
1657
  if( !isset( $cache_schedule_type ) ) {
@@ -1772,7 +1775,7 @@ function wp_cache_edit_max_time () {
1772
  echo "<li>" . __( 'Stale cached files are not removed as soon as they become stale. They have to be removed by the garbage collecter. That is why you have to tell the plugin when the garbage collector should run.', 'wp-super-cache' ) . "</li>\n";
1773
  echo "<li>" . __( 'Use the <em>Timer</em> or <em>Clock</em> schedulers to define when the garbage collector should run.', 'wp-super-cache' ) . "</li>\n";
1774
  echo "<li>" . __( 'The <em>Timer</em> scheduler tells the plugin to run the garbage collector at regular intervals. When one garbage collection is done, the next run is scheduled.', 'wp-super-cache' ) . "</li>\n";
1775
- echo "<li>" . __( 'Or, the <em>Clock</em> scheduler allows the garbage collection to run at specific times. If set to run hourly or twicedaily the garbage collector will be first scheduled for the time you enter here. It will then run again at the indicated interval. If set to run daily it will run once a day at the time specified.', 'wp-super-cache' ) . "</li>\n";
1776
  echo "</ol>";
1777
  echo "<p>" . __( 'There are no best garbage collection settings but here are a few scenarios. Garbage collection is separate to other actions that clear our cached files like leaving a comment or publishing a post.', 'wp-super-cache' ) . "</p>\n";
1778
  echo "<ol>";
@@ -1781,7 +1784,7 @@ function wp_cache_edit_max_time () {
1781
  echo "<li>" . __( 'Sites with lots of static content, no widgets or rss feeds in their sidebar can use a timeout of 86400 seconds or even more and set the timer to something equally long.', 'wp-super-cache' ) . "</li>\n";
1782
  echo "<li>" . __( 'Sites where an external data source updates at a particular time every day should set the timeout to 86400 seconds and use the Clock scheduler set appropriately.', 'wp-super-cache' ) . "</li>\n";
1783
  echo "</ol>";
1784
- echo "<p>" . __( 'Checking for and deleting expired files is expensive, but it&#8217;s expensive leaving them there too. On a very busy site you should set the expiry time to <em>600 seconds</em>. Experiment with different values and visit this page to see how many expired files remain at different times during the day. If you are using legacy caching aim to have less than 500 cached files if possible. You can have many times more cached files when using mod_rewrite or PHP caching.', 'wp-super-cache' ) . "</p>";
1785
  echo "<p>" . __( 'Set the expiry time to 0 seconds to disable garbage collection.', 'wp-super-cache' ) . "</p>";
1786
  echo '<div class="submit"><input class="button-primary" type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Change Expiration', 'wp-super-cache' ) . '" /></div>';
1787
  wp_nonce_field('wp-cache');
@@ -1980,7 +1983,7 @@ function wp_cache_debug_settings() {
1980
  echo "<p>" . __( 'I&#8217;m 99% certain that they aren&#8217;t bugs in WP Super Cache and they only happen in very rare cases but you can run a simple check once every 5 minutes to verify that your site is ok if you&#8217;re worried. You will be emailed if there is a problem.', 'wp-super-cache' ) . "</p>";
1981
  echo "<table class='form-table'>";
1982
  echo "<tr><td valign='top' colspan='2'><input type='checkbox' name='wp_super_cache_front_page_check' value='1' " . checked( 1, $wp_super_cache_front_page_check, false ) . " /> " . __( 'Check front page every 5 minutes.', 'wp-super-cache' ) . "</td></tr>";
1983
- echo "<tr><td valign='top'>" . __( 'Front page text', 'wp-super-cache' ) . "</td><td> <input type='text' size='30' name='wp_super_cache_front_page_text' value='{$wp_super_cache_front_page_text}' /> (" . __( 'Text to search for on your front page. If this text is missing the cache will be cleared. Leave blank to disable.', 'wp-super-cache' ) . ")</td></tr>";
1984
  echo "<tr><td valign='top' colspan='2'><input type='checkbox' name='wp_super_cache_front_page_clear' value='1' " . checked( 1, $wp_super_cache_front_page_clear, false ) . " /> " . __( 'Clear cache on error.', 'wp-super-cache' ) . "</td></tr>";
1985
  echo "<tr><td valign='top' colspan='2'><input type='checkbox' name='wp_super_cache_front_page_notification' value='1' " . checked( 1, $wp_super_cache_front_page_notification, false ) . " /> " . __( 'Email the blog admin when checks are made. (useful for testing)', 'wp-super-cache' ) . "</td></tr>";
1986
 
@@ -1996,7 +1999,7 @@ function wp_cache_enable() {
1996
  global $wp_cache_config_file, $cache_enabled, $supercachedir;
1997
 
1998
  if(get_option('gzipcompression')) {
1999
- echo "<strong>" . __( 'Error: GZIP compression is enabled, disable it if you want to enable wp-cache.', 'wp-super-cache' ) . "</strong>";
2000
  return false;
2001
  }
2002
  if( wp_cache_replace_line('^ *\$cache_enabled', '$cache_enabled = true;', $wp_cache_config_file) ) {
@@ -2136,7 +2139,7 @@ function wp_cache_index_notice() {
2136
  if ( false == get_site_option( 'wp_super_cache_index_detected' ) )
2137
  return false;
2138
 
2139
- if ( strlen( $cache_path ) < strlen( ABSPATH )
2140
  || ABSPATH != substr( $cache_path, 0, strlen( ABSPATH ) ) )
2141
  return false; // cache stored outside web root
2142
 
@@ -2150,14 +2153,14 @@ function wp_cache_index_notice() {
2150
  } elseif ( get_site_option( 'wp_super_cache_index_detected' ) != 3 ) {
2151
  echo "<div id='wpsc-index-warning' class='error notice' style='padding: 10px 10px 50px 10px'>";
2152
  echo "<h1>" . __( 'WP Super Cache Warning!', 'wp-super-cache' ) . '</h1>';
2153
- echo '<p>' . __( 'Your server is configured to show files and directories which may expose sensitive data such as login cookies to attackers in the cache directories. That has been fixed by adding a file named index.html to each directory. If you use PHP or legacy caching consider moving the location of the cache directory on the Advanced Settings page.', 'wp-super-cache' ) . '</p>';
2154
  echo "<p><strong>";
2155
- _e( 'If you just installed WP Super Cache for the first time you can dismiss this message. Otherwise you should probably refresh the login cookies of all logged in WordPress users here by clicking the logout link below.', 'wp-super-cache' );
2156
  echo "</strong></p>";
2157
  if ( -1 == version_compare( $wp_version, '4.0' ) ) {
2158
  echo '<p>' . __( 'Your site is using a very old version of WordPress. When you update to the latest version everyone will be logged out and cookie information updated.', 'wp-super-cache' ) . '</p>';
2159
  } else {
2160
- echo '<p>' . __( 'The logout link will log out all WordPress users on this site except you. Your authentication cookie will be updated but you will not be logged out.', 'wp-super-cache' ) . '</p>';
2161
  }
2162
  echo "<a id='wpsc-dismiss' href='#'>" . __( 'Dismiss', 'wp-super-cache' ) . "</a>";
2163
  if ( 1 == version_compare( $wp_version, '4.0' ) ) {
@@ -2209,13 +2212,13 @@ function wp_cache_add_index_protection() {
2209
  $page = wp_remote_get( home_url( "/wp-content/cache/" ) );
2210
  if ( false == is_wp_error( $page ) ) {
2211
  if ( false == get_site_option( 'wp_super_cache_index_detected' )
2212
- && $page[ 'response' ][ 'code' ] == 200
2213
  && stripos( $page[ 'body' ], 'index of' ) ) {
2214
  add_site_option( 'wp_super_cache_index_detected', 1 ); // only show this once
2215
  }
2216
  }
2217
  insert_with_markers( $cache_path . '.htaccess', "INDEX", array( 'Options -Indexes' ) );
2218
- }
2219
 
2220
  $directories = array( $cache_path, $cache_path . '/supercache/', $cache_path . '/blogs/', $blog_cache_dir, $blog_cache_dir . "/meta" );
2221
  foreach( $directories as $dir ) {
@@ -2304,18 +2307,18 @@ function wp_cache_verify_config_file() {
2304
  if( is_writeable_ACLSafe( $wp_cache_config_file ) ) {
2305
  @unlink( $wp_cache_config_file );
2306
  } else {
2307
- echo "<strong>" . __( 'Error', 'wp-super-cache' ) . ":</strong> " . sprintf( __( 'Your WP-Cache config file (<strong>%s</strong>) is out of date and not writable by the Web server.Please delete it and refresh this page.', 'wp-super-cache' ), $wp_cache_config_file );
2308
  return false;
2309
  }
2310
  }
2311
  } elseif( !is_writeable_ACLSafe($dir)) {
2312
- echo "<strong>" . __( 'Error', 'wp-super-cache' ) . ":</strong> " . sprintf( __( 'Configuration file missing and %1$s directory (<strong>%2$s</strong>) is not writable by the Web server.Check its permissions.', 'wp-super-cache' ), WP_CONTENT_DIR, $dir );
2313
  return false;
2314
  }
2315
 
2316
  if ( !file_exists($wp_cache_config_file) ) {
2317
  if ( !file_exists($wp_cache_config_file_sample) ) {
2318
- echo "<strong>" . __( 'Error', 'wp-super-cache' ) . ":</strong> " . sprintf( __( 'Sample WP-Cache config file (<strong>%s</strong>) does not exist.Verify you installation.', 'wp-super-cache' ), $wp_cache_config_file_sample );
2319
  return false;
2320
  }
2321
  copy($wp_cache_config_file_sample, $wp_cache_config_file);
@@ -2382,7 +2385,7 @@ function wp_cache_check_link() {
2382
 
2383
  if( false == $ret ) {
2384
  echo '<div id="message" class="updated fade"><h3>' . __( 'Warning', 'wp-super-cache' ) . "! <em>" . sprintf( __( '%s/advanced-cache.php</em> does not exist or cannot be updated.', 'wp-super-cache' ), WP_CONTENT_DIR ) . "</h3>";
2385
- echo "<p><ul><li>" . __( '1. If it already exists please delete the file first.', 'wp-super-cache' ) . "</li>";
2386
  echo "<li>" . sprintf( __( '2. Make %1$s writable using the chmod command through your ftp or server software. (<em>chmod 777 %1$s</em>) and refresh this page. This is only a temporary measure and you&#8217;ll have to make it read only afterwards again. (Change 777 to 755 in the previous command)', 'wp-super-cache' ), WP_CONTENT_DIR ) . "</li>";
2387
  echo "<li>" . sprintf( __( '3. Refresh this page to update <em>%s/advanced-cache.php</em>', 'wp-super-cache' ), WP_CONTENT_DIR ) . "</li></ul>";
2388
  echo sprintf( __( 'If that doesn&#8217;t work, make sure the file <em>%s/advanced-cache.php</em> doesn&#8217;t exist:', 'wp-super-cache' ), WP_CONTENT_DIR ) . "<ol>";
@@ -2409,7 +2412,7 @@ function wp_cache_check_global_config() {
2409
  $line = 'define(\'WP_CACHE\', true);';
2410
  if (!is_writeable_ACLSafe($global) || !wp_cache_replace_line('define *\( *\'WP_CACHE\'', $line, $global) ) {
2411
  if ( defined( 'WP_CACHE' ) && constant( 'WP_CACHE' ) == false ) {
2412
- echo '<div id="message" class="updated fade">' . __( "<h3>WP_CACHE constant set to false</h3><p>The WP_CACHE constant is used by WordPress to load the code that serves cached pages. Unfortunately it is set to false. Please edit your wp-config.php and add or edit the following line above the final require_once command:<br /><br /><code>define('WP_CACHE', true);</code></p>", 'wp-super-cache' ) . "</div>";
2413
  } else {
2414
  echo "<p>" . __( "<strong>Error: WP_CACHE is not enabled</strong> in your <code>wp-config.php</code> file and I couldn&#8217;t modify it.", 'wp-super-cache' ) . "</p>";;
2415
  echo "<p>" . sprintf( __( "Edit <code>%s</code> and add the following line:<br /> <code>define('WP_CACHE', true);</code><br />Otherwise, <strong>WP-Cache will not be executed</strong> by WordPress core. ", 'wp-super-cache' ), $global ) . "</p>";
@@ -3007,7 +3010,7 @@ function wpsc_update_htaccess_form( $short_form = true ) {
3007
  } else {
3008
  if ( $short_form == false ) {
3009
  echo "<div style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'><p>" . sprintf( __( 'To serve static html files your server must have the correct mod_rewrite rules added to a file called <code>%s.htaccess</code>', 'wp-super-cache' ), $home_path ) . " ";
3010
- _e( "You can edit the file yourself add the following rules.", 'wp-super-cache' );
3011
  echo __( " Make sure they appear before any existing WordPress rules. ", 'wp-super-cache' ) . "</p>";
3012
  echo "<pre># BEGIN WPSuperCache\n" . esc_html( $rules ) . "# END WPSuperCache</pre></p>";
3013
  echo "<p>" . sprintf( __( 'Rules must be added to %s too:', 'wp-super-cache' ), WP_CONTENT_DIR . "/cache/.htaccess" ) . "</p>";
1
  <?php
2
  /*
3
  Plugin Name: WP Super Cache
4
+ Plugin URI: https://wordpress.org/plugins/wp-super-cache/
5
  Description: Very fast caching plugin for WordPress.
6
+ Version: 1.4.7
7
  Author: Automattic
8
+ Author URI: https://automattic.com/
9
  License: GPL2+
10
  Text Domain: wp-super-cache
11
  */
242
  if( is_array( $cron ) ) {
243
  if( $cron[ 'response' ][ 'code' ] == '404' ) {
244
  ?><div id="message" class="updated fade"><h3>Warning! wp-cron.php not found!</h3>
245
+ <p><?php _e( 'Unfortunately, WordPress cannot find the file wp-cron.php. This script is required for the correct operation of garbage collection by this plugin, WordPress scheduled posts as well as other critical activities.', 'wp-super-cache' ); ?></p>
246
  <p><?php printf( __( 'Please see entry 16 in the <a href="%s">Troubleshooting section</a> of the readme.txt', 'wp-super-cache' ), 'http://wordpress.org/plugins/wp-super-cache/faq/' ); ?></p>
247
  </div>
248
  <?php
278
  if ( !defined( 'SUBMITDISABLED' ) )
279
  define( "SUBMITDISABLED", 'disabled style="color: #aaa" ' );
280
  ?><div id="message" class="updated fade"><h3><?php _e( 'Read Only Mode. Configuration cannot be changed.', 'wp-super-cache' ); ?></h3>
281
+ <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 web server to make any changes.', 'wp-super-cache' ), WP_CONTENT_DIR ); ?>
282
  <?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>
283
  <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>
284
  <?php _e( 'Writeable:', 'wp-super-cache' ); ?> <code>chmod 666 <?php echo WP_CONTENT_DIR; ?>/wp-cache-config.php</code>
285
+ <?php _e( 'Read-only:', 'wp-super-cache' ); ?> <code>chmod 644 <?php echo WP_CONTENT_DIR; ?>/wp-cache-config.php</code></p>
286
  </div><?php
287
  } elseif ( !defined( 'SUBMITDISABLED' ) ) {
288
  define( "SUBMITDISABLED", ' ' );
401
  if ( $dismiss_htaccess_warning == 0 && $wp_cache_mod_rewrite && $super_cache_enabled && $disable_supercache_htaccess_warning == false && get_option( 'siteurl' ) != get_option( 'home' ) ) {
402
  $home_dir = str_replace( get_option( 'home' ), '', get_option( 'siteurl' ) );
403
  ?><div id="message" class="updated fade"><h3><?php _e( '.htaccess file may need to be moved', 'wp-super-cache' ); ?></h3>
404
+ <p><?php _e( 'It appears you have WordPress installed in a sub directory as described <a href="http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory">here</a>. Unfortunately, WordPress writes to the .htaccess in the install directory, not where your site is served from.<br />When you update the rewrite rules in this plugin you will have to copy the file to where your site is hosted. This will be fixed in the future.', 'wp-super-cache' ); ?></p>
405
  <form action="" method="POST">
406
  <input type="hidden" name="action" value="dismiss_htaccess_warning" />
407
  <input type="hidden" name="page" value="wpsupercache" />
754
  border-bottom: 1px solid #ccc;
755
  padding-bottom: 0;
756
  }
757
+ table.wpsc-settings-table {
758
+ clear: both;
759
+ }
760
  </style>
761
  <?php
762
  echo '<a name="top"></a>';
806
  update_cached_mobile_ua_list( $wp_cache_mobile_browsers, $wp_cache_mobile_prefixes, $mobile_groups );
807
  }
808
 
809
+ ?> <table class="wpsc-settings-table"><td valign='top'><?php
810
  switch( $_GET[ 'tab' ] ) {
811
  case "cdn":
812
  scossdl_off_options();
1019
  <legend class="hidden">Miscellaneous</legend>
1020
  <?php if ( false == defined( 'WPSC_DISABLE_COMPRESSION' ) ) { ?>
1021
  <?php if ( false == function_exists( 'gzencode' ) ) { ?>
1022
+ <em><?php _e( 'Warning! Compression is disabled as gzencode() function was not found.', 'wp-super-cache' ); ?></em><br />
1023
  <?php } else { ?>
1024
  <label><input type='checkbox' name='cache_compression' <?php if( $cache_compression ) echo "checked"; ?> value='1'> <?php _e( 'Compress pages so they&#8217;re served more quickly to visitors.', 'wp-super-cache' ); echo " <em>(" . __( "Recommended", "wp-super-cache" ) . ")</em>"; ?></label><br />
1025
  <em><?php _e( 'Compression is disabled by default because some hosts have problems with compressed files. Switching it on and off clears the cache.', 'wp-super-cache' ); ?></em><br />
1030
  $disable_304 = false;
1031
  if ( $disable_304 )
1032
  echo "<strike>";
1033
+ ?><label><input <?php if ( $disable_304 ) { echo "disabled"; } ?> type='checkbox' name='wp_supercache_304' <?php if( $wp_supercache_304 ) echo "checked"; ?> value='1'> <?php _e( '304 Not Modified browser caching. Indicate when a page has not been modified since it was last requested.', 'wp-super-cache' ); echo " <em>(" . __( "Recommended", "wp-super-cache" ) . ")</em>"; ?></label><br /><?php
1034
  if ( $disable_304 ) {
1035
  echo "</strike>";
1036
+ echo "<p><strong>" . __( 'Warning! 304 browser caching is only supported when mod_rewrite caching is not used.', 'wp-super-cache' ) . "</strong></p>";
1037
  } else {
1038
  ?><em><?php _e( '304 support is disabled by default because some hosts have had problems with the headers used in the past.', 'wp-super-cache' ); ?></em><br /><?php
1039
  }
1080
  <input type='text' size=80 name='wp_cache_location' value='<?php echo esc_attr( $cache_path ); ?>' />
1081
  <p><?php printf( __( 'Change the location of your cache files. The default is WP_CONTENT_DIR . /cache/ which translates to %s.', 'wp-super-cache' ), WP_CONTENT_DIR . '/cache/' ); ?></p>
1082
  <ol><li><?php _e( 'You must give the full path to the directory.', 'wp-super-cache' ); ?></li>
1083
+ <li><?php _e( 'If the directory does not exist, it will be created. Please make sure your web server user has write access to the parent directory. The parent directory must exist.', 'wp-super-cache' ); ?></li>
1084
  <li><?php _e( 'If the new cache directory does not exist, it will be created and the contents of the old cache directory will be moved there. Otherwise, the old cache directory will be left where it is.', 'wp-super-cache' ); ?></li>
1085
  <li><?php _e( 'Submit a blank entry to set it to the default directory, WP_CONTENT_DIR . /cache/.', 'wp-super-cache' ); ?></li>
1086
  <?php if ( get_site_option( 'wp_super_cache_index_detected' ) && strlen( $cache_path ) > strlen( ABSPATH ) && ABSPATH == substr( $cache_path, 0, strlen( ABSPATH ) ) ) {
1087
+ $msg = __( 'The plugin detected a bare directory index in your cache directory, which would let visitors see your cache files directly and might expose private posts.', 'wp-super-cache' );
1088
  if ( $super_cache_enabled && $wp_cache_mod_rewrite == 1 ) {
1089
+ $msg .= ' ' . __( 'You are using mod_rewrite to serve cache files so the plugin has added <q>Options -Indexes</q> to the .htaccess file in the cache directory to disable indexes. However, if that does not work, you should contact your system administrator or support and ask for them to be disabled, or use PHP mode and move the cache outside of the web root.' );
1090
  } else {
1091
+ $msg .= ' <strong>' . sprintf( __( 'index.html files have been added in key directories, but unless directory indexes are disabled, it is probably better to store the cache files outside of the web root of %s' ), ABSPATH ) . '</strong>';
1092
  }
1093
  echo "<li>$msg</li>";
1094
  } ?>
1095
 
1096
+
1097
  <?php if ( $super_cache_enabled && $wp_cache_mod_rewrite == 1 ) { ?>
1098
+ <li><?php printf( __( 'Since you are using mod_rewrite to serve cache files, you must choose a directory in your web root which is <q>%s</q> and update the mod_rewrite rules in the .htaccess file.', 'wp-super-cache' ), ABSPATH ); ?></li>
1099
  <?php } ?>
1100
  </ol>
1101
  <p><?php _e( '', 'wp-super-cache' ); ?></p>
1105
  </table>
1106
  <h3><?php _e( 'Note:', 'wp-super-cache' ); ?></h3>
1107
  <ol>
1108
+ <li><?php _e( 'Uninstall this plugin on the plugins page. It will automatically clean up after itself. If manual intervention is required, then simple instructions are provided.', 'wp-super-cache' ); ?></li>
1109
+ <li><?php printf( __( 'If uninstalling this plugin, make sure the directory <em>%s</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 is probably a good idea!)', 'wp-super-cache' ), WP_CONTENT_DIR ); ?></li>
1110
  <li><?php printf( __( 'Please see the <a href="%1$s/wp-super-cache/readme.txt">readme.txt</a> for instructions on uninstalling this script. Look for the heading, "How to uninstall WP Super Cache".', 'wp-super-cache' ), WP_PLUGIN_URL ); ?></li><?php
1111
  echo "<li><em>" . sprintf( __( 'Need help? Check the <a href="%1$s">Super Cache readme file</a>. It includes installation documentation, a FAQ and Troubleshooting tips. The <a href="%2$s">support forum</a> is also available. Your question may already have been answered.', 'wp-super-cache' ), 'http://wordpress.org/plugins/wp-super-cache/', 'http://wordpress.org/tags/wp-super-cache?forum_id=10' ) . "</em></li>";
1112
  echo "</ol>";
1155
  if ( $cache_enabled && !$wp_cache_mod_rewrite ) {
1156
  $scrules = trim( implode( "\n", extract_from_markers( trailingslashit( get_home_path() ) . '.htaccess', 'WPSuperCache' ) ) );
1157
  if ( $scrules != '' ) {
1158
+ echo "<p><strong>" . __( 'Notice: PHP caching enabled but Supercache mod_rewrite rules detected. Cached files will be served using those rules. If your site is working ok, please ignore this message. Otherwise, you can edit the .htaccess file in the root of your install and remove the SuperCache rules.', 'wp-super-cache' ) . '</strong></p>';
1159
  }
1160
  }
1161
  echo "<div class='submit'><input class='button-primary' type='submit' " . SUBMITDISABLED . " value='" . __( 'Update Status', 'wp-super-cache' ) . "' /></div></form>";
1244
  echo '</form>';
1245
  }
1246
  echo "<h3>" . __( "Delete Cached Pages", 'wp-super-cache' ) . "</h3>";
1247
+ echo "<p>" . __( "Cached pages are stored on your server as html and PHP files. If you need to delete them, use the button below.", 'wp-super-cache' ) . "</p>";
1248
  echo '<form name="wp_cache_content_delete" action="?page=wpsupercache&tab=contents" method="post">';
1249
  echo '<input type="hidden" name="wp_delete_cache" />';
1250
  echo '<div class="submit"><input id="deletepost" class="button-secondary" type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Delete Cache', 'wp-super-cache' ) . ' " /></div>';
1262
  <h3 class="clear"><?php _e( 'Recommended Links and Plugins', 'wp-super-cache' ); ?></h3>
1263
  <p><?php _e( 'Caching is only one part of making a website faster. Here are some other plugins that will help:', 'wp-super-cache' ); ?></p>
1264
  <li><?php printf( __( '<a href="%s">Yahoo! Yslow</a> is an extension for the Firefox add-on Firebug. It analyzes web pages and suggests ways to improve their performance based on a set of rules for high performance web pages. Also try the performance tools online at <a href="%s">GTMetrix</a>.', 'wp-super-cache' ), 'http://developer.yahoo.com/yslow/', 'http://gtmetrix.com/' ); ?></li>
1265
+ <li><?php printf( __( '<a href="%s">Use Google Libraries</a> allows you to load some commonly used Javascript libraries from Google webservers. Ironically, it may reduce your Yslow score.', 'wp-super-cache' ), 'http://wordpress.org/plugins/use-google-libraries/' ); ?></li>
1266
  <li><?php printf( __( '<strong>Advanced users only:</strong> <a href="%s">Speed up your site with Caching and cache-control</a> explains how to make your site more cacheable with .htaccess rules.', 'wp-super-cache' ), 'http://www.askapache.com/htaccess/speed-up-your-site-with-caching-and-cache-control.html' ); ?></li>
1267
  <li><?php printf( __( '<strong>Advanced users only:</strong> Install an object cache. Choose from <a href="%s">Memcached</a>, <a href="%s">XCache</a>, <a href="%s">eAcccelerator</a> and others.', 'wp-super-cache' ), 'http://wordpress.org/plugins/memcached/', 'http://neosmart.net/dl.php?id=12', 'http://neosmart.net/dl.php?id=13' ); ?></li>
1268
  <li><?php printf( __( '<a href="%s">Cron View</a> is a useful plugin to use when trying to debug garbage collection and preload problems.', 'wp-super-cache' ), 'http://wordpress.org/plugins/cron-view/' ); ?></li>
1320
  function wpsc_plugins_tab() {
1321
  echo '<p>' . __( 'Cache plugins are PHP scripts that live in a plugins folder inside the wp-super-cache folder. They are loaded when Supercache loads, much sooner than regular WordPress plugins.', 'wp-super-cache' ) . '</p>';
1322
  echo '<p>' . __( 'This is strictly an advanced feature only and knowledge of both PHP and WordPress actions is required to create them.', 'wp-super-cache' ) . '</p>';
1323
+ echo '<p>' . __( '<strong>Warning</strong>! Due to the way WordPress upgrades plugins, the plugins you upload to wp-super-cache/plugins/ will be deleted when you upgrade WP Super Cache. You can avoid this by loading the plugins from elsewhere. Set <strong>$wp_cache_plugins_dir</strong> to the new location in wp-config.php and WP Super Cache will look there instead.<br />More info available in the <a href="http://ocaoimh.ie/wp-super-cache-developers/">developer documentation</a>.', 'wp-super-cache' ) . '</p>';
1324
  ob_start();
1325
  if( defined( 'WP_CACHE' ) ) {
1326
  if( function_exists( 'do_cacheaction' ) ) {
1400
  $dohtaccess = true;
1401
  global $wpmu_version;
1402
  if( isset( $wpmu_version ) ) {
1403
+ echo "<h4 style='color: #a00'>" . __( 'WordPress MU Detected', 'wp-super-cache' ) . "</h4><p>" . __( "Unfortunately, the rewrite rules cannot be updated automatically when running WordPress MU. Please open your .htaccess and add the following mod_rewrite rules above any other rules in that file.", 'wp-super-cache' ) . "</p>";
1404
  } elseif( !$wprules || $wprules == '' ) {
1405
  echo "<h4 style='color: #a00'>" . __( 'Mod Rewrite rules cannot be updated!', 'wp-super-cache' ) . "</h4>";
1406
  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 );
1409
  echo "</fieldset>";
1410
  $dohtaccess = false;
1411
  } elseif( strpos( $wprules, 'wordpressuser' ) ) { // Need to clear out old mod_rewrite rules
1412
+ 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>";
1413
  echo "</fieldset></div>";
1414
  return;
1415
  } elseif( $scrules != '' && strpos( $scrules, '%{REQUEST_URI} !^.*[^/]$' ) === false && substr( get_option( 'permalink_structure' ), -1 ) == '/' ) { // permalink structure has a trailing slash, need slash check in rules.
1438
  echo "<p><pre>" . esc_html( $rules ) . "</pre></p>\n</div>";
1439
  } else {
1440
  ?>
1441
+ <p><?php printf( __( 'WP Super Cache mod rewrite rules were detected in your %s.htaccess file.<br /> Click the following link to see the lines added to that file. If you have upgraded the plugin, make sure these rules match.', 'wp-super-cache' ), $home_path ); ?></p>
1442
  <?php
1443
  if ( $rules != $scrules ) {
1444
+ ?><p style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'><?php _e( 'A difference between the rules in your .htaccess file and the plugin rewrite rules has been found. This could be simple whitespace differences, but you should compare the rules in the file with those below as soon as possible. Click the &#8217;Update Mod_Rewrite Rules&#8217; button to update the rules.', 'wp-super-cache' ); ?></p><?php
1445
  }
1446
  ?><a href="javascript:toggleLayer('rewriterules');" class="button"><?php _e( 'View Mod_Rewrite Rules', 'wp-super-cache' ); ?></a><?php
1447
  wpsc_update_htaccess_form();
1590
  $readonly = '';
1591
  if( !is_writeable_ACLSafe( ABSPATH ) ) {
1592
  $readonly = 'READONLY';
1593
+ ?><p style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'><strong><?php _e( 'Warning!', 'wp-super-cache' ); ?></strong> <?php printf( __( 'You must make %s writable to enable this feature. As this is a security risk, please make it read-only after your page is generated.', 'wp-super-cache' ), ABSPATH ); ?></p><?php
1594
  } else {
1595
  $abspath_stat = stat(ABSPATH . '/');
1596
  $abspath_mode = decoct( $abspath_stat[ 'mode' ] & 0777 );
1654
  global $cache_max_time, $wp_cache_config_file, $valid_nonce, $cache_enabled, $super_cache_enabled, $cache_schedule_type, $cache_scheduled_time, $cache_schedule_interval, $cache_time_interval, $cache_gc_email_me, $wp_cache_preload_on;
1655
 
1656
  $timezone_format = _x('Y-m-d G:i:s', 'timezone date format');
1657
+
1658
  if ( isset( $_POST[ 'action' ] ) && $_POST[ 'action' ] == 'expirytime' ) {
1659
 
1660
  if( !isset( $cache_schedule_type ) ) {
1775
  echo "<li>" . __( 'Stale cached files are not removed as soon as they become stale. They have to be removed by the garbage collecter. That is why you have to tell the plugin when the garbage collector should run.', 'wp-super-cache' ) . "</li>\n";
1776
  echo "<li>" . __( 'Use the <em>Timer</em> or <em>Clock</em> schedulers to define when the garbage collector should run.', 'wp-super-cache' ) . "</li>\n";
1777
  echo "<li>" . __( 'The <em>Timer</em> scheduler tells the plugin to run the garbage collector at regular intervals. When one garbage collection is done, the next run is scheduled.', 'wp-super-cache' ) . "</li>\n";
1778
+ echo "<li>" . __( 'Or, the <em>Clock</em> scheduler allows the garbage collection to run at specific times. If set to run hourly or twice daily, the garbage collector will be first scheduled for the time you enter here. It will then run again at the indicated interval. If set to run daily, it will run once a day at the time specified.', 'wp-super-cache' ) . "</li>\n";
1779
  echo "</ol>";
1780
  echo "<p>" . __( 'There are no best garbage collection settings but here are a few scenarios. Garbage collection is separate to other actions that clear our cached files like leaving a comment or publishing a post.', 'wp-super-cache' ) . "</p>\n";
1781
  echo "<ol>";
1784
  echo "<li>" . __( 'Sites with lots of static content, no widgets or rss feeds in their sidebar can use a timeout of 86400 seconds or even more and set the timer to something equally long.', 'wp-super-cache' ) . "</li>\n";
1785
  echo "<li>" . __( 'Sites where an external data source updates at a particular time every day should set the timeout to 86400 seconds and use the Clock scheduler set appropriately.', 'wp-super-cache' ) . "</li>\n";
1786
  echo "</ol>";
1787
+ echo "<p>" . __( 'Checking for and deleting expired files is expensive, but it&#8217;s expensive leaving them there too. On a very busy site, you should set the expiry time to <em>600 seconds</em>. Experiment with different values and visit this page to see how many expired files remain at different times during the day. If you are using legacy caching, aim to have less than 500 cached files if possible. You can have many times more cached files when using mod_rewrite or PHP caching.', 'wp-super-cache' ) . "</p>";
1788
  echo "<p>" . __( 'Set the expiry time to 0 seconds to disable garbage collection.', 'wp-super-cache' ) . "</p>";
1789
  echo '<div class="submit"><input class="button-primary" type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Change Expiration', 'wp-super-cache' ) . '" /></div>';
1790
  wp_nonce_field('wp-cache');
1983
  echo "<p>" . __( 'I&#8217;m 99% certain that they aren&#8217;t bugs in WP Super Cache and they only happen in very rare cases but you can run a simple check once every 5 minutes to verify that your site is ok if you&#8217;re worried. You will be emailed if there is a problem.', 'wp-super-cache' ) . "</p>";
1984
  echo "<table class='form-table'>";
1985
  echo "<tr><td valign='top' colspan='2'><input type='checkbox' name='wp_super_cache_front_page_check' value='1' " . checked( 1, $wp_super_cache_front_page_check, false ) . " /> " . __( 'Check front page every 5 minutes.', 'wp-super-cache' ) . "</td></tr>";
1986
+ echo "<tr><td valign='top'>" . __( 'Front page text', 'wp-super-cache' ) . "</td><td> <input type='text' size='30' name='wp_super_cache_front_page_text' value='{$wp_super_cache_front_page_text}' /> (" . __( 'Text to search for on your front page. If this text is missing, the cache will be cleared. Leave blank to disable.', 'wp-super-cache' ) . ")</td></tr>";
1987
  echo "<tr><td valign='top' colspan='2'><input type='checkbox' name='wp_super_cache_front_page_clear' value='1' " . checked( 1, $wp_super_cache_front_page_clear, false ) . " /> " . __( 'Clear cache on error.', 'wp-super-cache' ) . "</td></tr>";
1988
  echo "<tr><td valign='top' colspan='2'><input type='checkbox' name='wp_super_cache_front_page_notification' value='1' " . checked( 1, $wp_super_cache_front_page_notification, false ) . " /> " . __( 'Email the blog admin when checks are made. (useful for testing)', 'wp-super-cache' ) . "</td></tr>";
1989
 
1999
  global $wp_cache_config_file, $cache_enabled, $supercachedir;
2000
 
2001
  if(get_option('gzipcompression')) {
2002
+ echo "<strong>" . __( 'Error: GZIP compression is enabled. Disable it if you want to enable wp-cache.', 'wp-super-cache' ) . "</strong>";
2003
  return false;
2004
  }
2005
  if( wp_cache_replace_line('^ *\$cache_enabled', '$cache_enabled = true;', $wp_cache_config_file) ) {
2139
  if ( false == get_site_option( 'wp_super_cache_index_detected' ) )
2140
  return false;
2141
 
2142
+ if ( strlen( $cache_path ) < strlen( ABSPATH )
2143
  || ABSPATH != substr( $cache_path, 0, strlen( ABSPATH ) ) )
2144
  return false; // cache stored outside web root
2145
 
2153
  } elseif ( get_site_option( 'wp_super_cache_index_detected' ) != 3 ) {
2154
  echo "<div id='wpsc-index-warning' class='error notice' style='padding: 10px 10px 50px 10px'>";
2155
  echo "<h1>" . __( 'WP Super Cache Warning!', 'wp-super-cache' ) . '</h1>';
2156
+ echo '<p>' . __( 'Your server is configured to show files and directories, which may expose sensitive data such as login cookies to attackers in the cache directories. That has been fixed by adding a file named index.html to each directory. If you use PHP or legacy caching, consider moving the location of the cache directory on the Advanced Settings page.', 'wp-super-cache' ) . '</p>';
2157
  echo "<p><strong>";
2158
+ _e( 'If you just installed WP Super Cache for the first time, you can dismiss this message. Otherwise, you should probably refresh the login cookies of all logged in WordPress users here by clicking the logout link below.', 'wp-super-cache' );
2159
  echo "</strong></p>";
2160
  if ( -1 == version_compare( $wp_version, '4.0' ) ) {
2161
  echo '<p>' . __( 'Your site is using a very old version of WordPress. When you update to the latest version everyone will be logged out and cookie information updated.', 'wp-super-cache' ) . '</p>';
2162
  } else {
2163
+ echo '<p>' . __( 'The logout link will log out all WordPress users on this site except you. Your authentication cookie will be updated, but you will not be logged out.', 'wp-super-cache' ) . '</p>';
2164
  }
2165
  echo "<a id='wpsc-dismiss' href='#'>" . __( 'Dismiss', 'wp-super-cache' ) . "</a>";
2166
  if ( 1 == version_compare( $wp_version, '4.0' ) ) {
2212
  $page = wp_remote_get( home_url( "/wp-content/cache/" ) );
2213
  if ( false == is_wp_error( $page ) ) {
2214
  if ( false == get_site_option( 'wp_super_cache_index_detected' )
2215
+ && $page[ 'response' ][ 'code' ] == 200
2216
  && stripos( $page[ 'body' ], 'index of' ) ) {
2217
  add_site_option( 'wp_super_cache_index_detected', 1 ); // only show this once
2218
  }
2219
  }
2220
  insert_with_markers( $cache_path . '.htaccess', "INDEX", array( 'Options -Indexes' ) );
2221
+ }
2222
 
2223
  $directories = array( $cache_path, $cache_path . '/supercache/', $cache_path . '/blogs/', $blog_cache_dir, $blog_cache_dir . "/meta" );
2224
  foreach( $directories as $dir ) {
2307
  if( is_writeable_ACLSafe( $wp_cache_config_file ) ) {
2308
  @unlink( $wp_cache_config_file );
2309
  } else {
2310
+ echo "<strong>" . __( 'Error', 'wp-super-cache' ) . ":</strong> " . sprintf( __( 'Your WP-Cache config file (<strong>%s</strong>) is out of date and not writable by the Web server. Please delete it and refresh this page.', 'wp-super-cache' ), $wp_cache_config_file );
2311
  return false;
2312
  }
2313
  }
2314
  } elseif( !is_writeable_ACLSafe($dir)) {
2315
+ echo "<strong>" . __( 'Error', 'wp-super-cache' ) . ":</strong> " . sprintf( __( 'Configuration file missing and %1$s directory (<strong>%2$s</strong>) is not writable by the web server. Check its permissions.', 'wp-super-cache' ), WP_CONTENT_DIR, $dir );
2316
  return false;
2317
  }
2318
 
2319
  if ( !file_exists($wp_cache_config_file) ) {
2320
  if ( !file_exists($wp_cache_config_file_sample) ) {
2321
+ echo "<strong>" . __( 'Error', 'wp-super-cache' ) . ":</strong> " . sprintf( __( 'Sample WP-Cache config file (<strong>%s</strong>) does not exist. Verify your installation.', 'wp-super-cache' ), $wp_cache_config_file_sample );
2322
  return false;
2323
  }
2324
  copy($wp_cache_config_file_sample, $wp_cache_config_file);
2385
 
2386
  if( false == $ret ) {
2387
  echo '<div id="message" class="updated fade"><h3>' . __( 'Warning', 'wp-super-cache' ) . "! <em>" . sprintf( __( '%s/advanced-cache.php</em> does not exist or cannot be updated.', 'wp-super-cache' ), WP_CONTENT_DIR ) . "</h3>";
2388
+ echo "<p><ul><li>" . __( '1. If it already exists, please delete the file first.', 'wp-super-cache' ) . "</li>";
2389
  echo "<li>" . sprintf( __( '2. Make %1$s writable using the chmod command through your ftp or server software. (<em>chmod 777 %1$s</em>) and refresh this page. This is only a temporary measure and you&#8217;ll have to make it read only afterwards again. (Change 777 to 755 in the previous command)', 'wp-super-cache' ), WP_CONTENT_DIR ) . "</li>";
2390
  echo "<li>" . sprintf( __( '3. Refresh this page to update <em>%s/advanced-cache.php</em>', 'wp-super-cache' ), WP_CONTENT_DIR ) . "</li></ul>";
2391
  echo sprintf( __( 'If that doesn&#8217;t work, make sure the file <em>%s/advanced-cache.php</em> doesn&#8217;t exist:', 'wp-super-cache' ), WP_CONTENT_DIR ) . "<ol>";
2412
  $line = 'define(\'WP_CACHE\', true);';
2413
  if (!is_writeable_ACLSafe($global) || !wp_cache_replace_line('define *\( *\'WP_CACHE\'', $line, $global) ) {
2414
  if ( defined( 'WP_CACHE' ) && constant( 'WP_CACHE' ) == false ) {
2415
+ echo '<div id="message" class="updated fade">' . __( "<h3>WP_CACHE constant set to false</h3><p>The WP_CACHE constant is used by WordPress to load the code that serves cached pages. Unfortunately, it is set to false. Please edit your wp-config.php and add or edit the following line above the final require_once command:<br /><br /><code>define('WP_CACHE', true);</code></p>", 'wp-super-cache' ) . "</div>";
2416
  } else {
2417
  echo "<p>" . __( "<strong>Error: WP_CACHE is not enabled</strong> in your <code>wp-config.php</code> file and I couldn&#8217;t modify it.", 'wp-super-cache' ) . "</p>";;
2418
  echo "<p>" . sprintf( __( "Edit <code>%s</code> and add the following line:<br /> <code>define('WP_CACHE', true);</code><br />Otherwise, <strong>WP-Cache will not be executed</strong> by WordPress core. ", 'wp-super-cache' ), $global ) . "</p>";
3010
  } else {
3011
  if ( $short_form == false ) {
3012
  echo "<div style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'><p>" . sprintf( __( 'To serve static html files your server must have the correct mod_rewrite rules added to a file called <code>%s.htaccess</code>', 'wp-super-cache' ), $home_path ) . " ";
3013
+ _e( "You can edit the file yourself. Add the following rules.", 'wp-super-cache' );
3014
  echo __( " Make sure they appear before any existing WordPress rules. ", 'wp-super-cache' ) . "</p>";
3015
  echo "<pre># BEGIN WPSuperCache\n" . esc_html( $rules ) . "# END WPSuperCache</pre></p>";
3016
  echo "<p>" . sprintf( __( 'Rules must be added to %s too:', 'wp-super-cache' ), WP_CONTENT_DIR . "/cache/.htaccess" ) . "</p>";