' . __( 'You may experience problems running this plugin because SAFE MODE is enabled.', 'wp-super-cache' ) . ' '; if( !ini_get( 'safe_mode_gid' ) ) { _e( 'Your server is set up to check the owner of PHP scripts before allowing them to read and write files.', 'wp-super-cache' ) . " "; printf( __( 'You or an administrator may be able to make it work by changing the group owner of the plugin scripts to match that of the web server user. The group owner of the %s/cache/ directory must also be changed. See the safe mode manual page for further details.', 'wp-super-cache' ), WP_CONTENT_DIR ); } else { _e( 'You or an administrator must disable this. See the safe mode manual page for further details. This cannot be disabled in a .htaccess file unfortunately. It must be done in the php.ini config file.', 'wp-super-cache' ); } echo '
'; } if ( '' == get_option( 'permalink_structure' ) ) { echo '" . __( 'A custom url or permalink structure is required for this plugin to work correctly. Please go to the Permalinks Options Page to configure your permalinks.' ) . "
"; echo 'Troubleshooting section of the readme.txt', 'wp-super-cache' ), 'http://wordpress.org/extend/plugins/wp-super-cache/faq/' ); ?>
Troubleshooting section of the readme.txt', 'wp-super-cache' ), 'http://wordpress.org/extend/plugins/wp-super-cache/faq/' ); ?>
this page for instructions on modifying your php.ini.', 'wp-super-cache' ); ?>
%s/wp-cache-config.php and cannot be modified. That file must be writeable by the webserver to make any changes.', 'wp-super-cache' ), WP_CONTENT_DIR ); ?>
This page explains how to change file permissions.', 'wp-super-cache' ); ?>
chmod 666 /wp-cache-config.php
chmod 644 /wp-cache-config.php
chmod 755 /
This page explains how to change file permissions.', 'wp-super-cache' ); ?>
" . __( 'For best performance you should enable "Mobile device support" or delete the mobile rewrite rules in your .htaccess. Look for the 2 lines with the text "2.0\ MMP|240x320" and delete those.', 'wp-super-cache' ) . "
" . __( 'This will have no affect on ordinary users but mobile users will see uncached pages.', 'wp-super-cache' ) . "
"; } elseif ( $wp_cache_mod_rewrite && $cache_enabled && $wp_cache_mobile_enabled && $scrules != '' && ( false === strpos( $scrules, addcslashes( implode( '|', $wp_cache_mobile_prefixes ), ' ' ) ) || false === strpos( $scrules, addcslashes( implode( '|', $wp_cache_mobile_browsers ), ' ' ) ) ) ) { ?>
# END WPSuperCache
and let the plugin regenerate them by reloading this page.', 'wp-super-cache' ), $home_path ); ?># END WPSuperCache
. There are two sections that look very similar. Just below the line %%{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
add these lines: (do it twice, once for each section)', 'wp-super-cache' ), $home_path ); ?>
Update Mod_Rewrite Rules button.', 'wp-super-cache' ); ?>
zlib.output_compression
is enabled. See #21 in the Troubleshooting section of the readme file.", 'wp-super-cache' ) . '' . __( 'Notice: Mod_rewrite or Legacy caching enabled. Showing Advanced Settings Page by default.', 'wp-super-cache' ) . '
';
wp_cache_files();
break;
case "preload":
if ( !$cache_enabled )
wp_die( __( 'Caching must be enabled to use this feature', 'wp-super-cache' ) );
echo '';
if ( $super_cache_enabled == true && false == defined( 'DISABLESUPERCACHEPRELOADING' ) ) {
global $wp_cache_preload_interval, $wp_cache_preload_on, $wp_cache_preload_email_me, $wp_cache_preload_email_volume, $wp_cache_preload_posts, $wpdb;
$count = $wpdb->get_var( "SELECT count(*) FROM {$wpdb->posts} WHERE post_status = 'publish'" );
if ( $count > 1000 ) {
$min_refresh_interval = 720;
} else {
$min_refresh_interval = 30;
}
if ( array_key_exists('action', $_POST) && $_POST[ 'action' ] == 'preload' && $valid_nonce ) {
if ( $_POST[ 'posts_to_cache' ] == 'all' ) {
$wp_cache_preload_posts = 'all';
} else {
$wp_cache_preload_posts = (int)$_POST[ 'posts_to_cache' ];
}
wp_cache_replace_line('^ *\$wp_cache_preload_posts', "\$wp_cache_preload_posts = '$wp_cache_preload_posts';", $wp_cache_config_file);
if ( isset( $_POST[ 'preload' ] ) && $_POST[ 'preload' ] == __( 'Cancel Cache Preload', 'wp-super-cache' ) ) {
$next_preload = wp_next_scheduled( 'wp_cache_preload_hook' );
if ( $next_preload ) {
update_option( 'preload_cache_counter', array( 'c' => 0, 't' => time() ) );
wp_unschedule_event( $next_preload, 'wp_cache_preload_hook' );
}
$fp = @fopen( $cache_path . "stop_preload.txt", 'w' );
@fclose( $fp );
echo " " . __( 'Scheduled preloading of cache cancelled.', 'wp-super-cache' ) . " "; } elseif ( isset( $_POST[ 'custom_preload_interval' ] ) && ( $_POST[ 'custom_preload_interval' ] == 0 || $_POST[ 'custom_preload_interval' ] >= $min_refresh_interval ) ) { // if preload interval changes than unschedule any preload jobs and schedule any new one. $_POST[ 'custom_preload_interval' ] = (int)$_POST[ 'custom_preload_interval' ]; if ( $wp_cache_preload_interval != $_POST[ 'custom_preload_interval' ] ) { $next_preload = wp_next_scheduled( 'wp_cache_full_preload_hook' ); if ( $next_preload ) { update_option( 'preload_cache_counter', array( 'c' => 0, 't' => time() ) ); add_option( 'preload_cache_stop', 1 ); wp_unschedule_event( $next_preload, 'wp_cache_full_preload_hook' ); if ( $wp_cache_preload_interval == 0 ) { echo "" . __( 'Scheduled preloading of cache cancelled.', 'wp-super-cache' ) . " "; } } if ( $_POST[ 'custom_preload_interval' ] != 0 ) wp_schedule_single_event( time() + ( $_POST[ 'custom_preload_interval' ] * 60 ), 'wp_cache_full_preload_hook' ); } $wp_cache_preload_interval = (int)$_POST[ 'custom_preload_interval' ]; wp_cache_replace_line('^ *\$wp_cache_preload_interval', "\$wp_cache_preload_interval = $wp_cache_preload_interval;", $wp_cache_config_file); if ( isset( $_POST[ 'preload_email_me' ] ) ) { $wp_cache_preload_email_me = 1; } else { $wp_cache_preload_email_me = 0; } wp_cache_replace_line('^ *\$wp_cache_preload_email_me', "\$wp_cache_preload_email_me = $wp_cache_preload_email_me;", $wp_cache_config_file); if ( isset( $_POST[ 'wp_cache_preload_email_volume' ] ) && in_array( $_POST[ 'wp_cache_preload_email_volume' ], array( 'less', 'medium', 'many' ) ) ) { $wp_cache_preload_email_volume = $_POST[ 'wp_cache_preload_email_volume' ]; } else { $wp_cache_preload_email_volume = 'medium'; } wp_cache_replace_line('^ *\$wp_cache_preload_email_volume', "\$wp_cache_preload_email_volume = '$wp_cache_preload_email_volume';", $wp_cache_config_file); if ( isset( $_POST[ 'preload_on' ] ) ) { $wp_cache_preload_on = 1; } else { $wp_cache_preload_on = 0; } wp_cache_replace_line('^ *\$wp_cache_preload_on', "\$wp_cache_preload_on = $wp_cache_preload_on;", $wp_cache_config_file); if ( isset( $_POST[ 'preload' ] ) && $_POST[ 'preload' ] == __( 'Preload Cache Now', 'wp-super-cache' ) ) { @unlink( $cache_path . "preload_mutex.tmp" ); update_option( 'preload_cache_counter', array( 'c' => 0, 't' => time() ) ); wp_schedule_single_event( time() + 10, 'wp_cache_preload_hook' ); echo "" . __( 'Scheduled preloading of cache in 10 seconds.' ) . " "; } elseif ( (int)$_POST[ 'custom_preload_interval' ] ) { @unlink( $cache_path . "preload_mutex.tmp" ); update_option( 'preload_cache_counter', array( 'c' => 0, 't' => time() ) ); wp_schedule_single_event( time() + ( (int)$_POST[ 'custom_preload_interval' ] * 60 ), 'wp_cache_full_preload_hook' ); echo "" . sprintf( __( 'Scheduled preloading of cache in %d minutes', 'wp-super-cache' ), (int)$_POST[ 'custom_preload_interval' ] ) . " "; } } } echo '' . __( 'This will cache every published post and page on your site. It will create supercache static files so unknown visitors (including bots) will hit a cached page. This will probably help your Google ranking as they are using speed as a metric when judging websites now.', 'wp-super-cache' ) . ' '; echo '' . __( 'Preloading creates lots of files however. Caching is done from the newest post to the oldest so please consider only caching the newest if you have lots (10,000+) of posts. This is especially important on shared hosting.', 'wp-super-cache' ) . ' '; echo '' . __( 'In ’Preload Mode’ regular garbage collection will only clean out old legacy files for known users, not the preloaded supercache files. This is a recommended setting when the cache is preloaded.', 'wp-super-cache' ) . ' '; echo ''; } else { echo '' . __( 'Preloading of cache disabled. Please disable legacy page caching or talk to your host administrator.', 'wp-super-cache' ) . ' '; } break; case 'plugins': wpsc_plugins_tab(); break; case 'debug': wp_cache_debug_settings(); break; case 'settings': if ( isset( $wp_cache_front_page_checks ) == false ) $wp_cache_front_page_checks = true; echo ' '; wp_cache_edit_rejected_ua(); wp_lock_down(); wp_cache_restore(); break; case "easy": default: echo '"; if ( $cache_enabled ) { echo "" . __( 'Cache Tester', 'wp-super-cache' ) . ""; echo '' . __( 'Test your cached website by clicking the test button below.', 'wp-super-cache' ) . ' '; if ( array_key_exists('action', $_POST) && $_POST[ 'action' ] == 'test' && $valid_nonce ) { $url = trailingslashit( get_bloginfo( 'url' ) ); if ( isset( $_POST[ 'httponly' ] ) ) $url = str_replace( 'https://', 'http://', $url ); // Prime the cache echo "" . sprintf( __( 'Fetching %s to prime cache: ', 'wp-super-cache' ), $url ); $page = wp_remote_get( $url, array('timeout' => 60, 'blocking' => true ) ); echo '' . __( 'OK', 'wp-super-cache' ) . ' '; sleep( 1 ); // Get the first copy echo "" . sprintf( __( 'Fetching first copy of %s: ', 'wp-super-cache' ), $url ); $page = wp_remote_get( $url, array('timeout' => 60, 'blocking' => true ) ); $fp = fopen( $cache_path . "1.html", "w" ); fwrite( $fp, $page[ 'body' ] ); fclose( $fp ); echo '' . __( 'OK', 'wp-super-cache' ) . " (1.html) "; sleep( 1 ); // Get the second copy echo "" . sprintf( __( 'Fetching second copy of %s: ', 'wp-super-cache' ), $url ); $page2 = wp_remote_get( $url, array('timeout' => 60, 'blocking' => true ) ); $fp = fopen( $cache_path . "2.html", "w" ); fwrite( $fp, $page2[ 'body' ] ); fclose( $fp ); echo '' . __( 'OK', 'wp-super-cache' ) . " (2.html) "; if ( is_wp_error( $page ) || is_wp_error( $page2 ) || $page[ 'response' ][ 'code' ] != 200 || $page2[ 'response' ][ 'code' ] != 200 ) { echo '' . __( 'One or more page requests failed:', 'wp-super-cache' ) . ' '; $error = false; if ( is_wp_error( $page ) ) { $error = $page; } elseif ( is_wp_error( $page2 ) ) { $error = $page2; } if ( $error ) { $errors = ''; $messages = ''; foreach ( $error->get_error_codes() as $code ) { $severity = $error->get_error_data($code); foreach ( $error->get_error_messages( $code ) as $err ) { $errors .= ' ' . $err . "\n"; } } if ( !empty($err) ) echo ' ' . $errors . " \n";
} else {
echo '
' . sprintf( __( 'Page 1: %s', 'wp-super-cache' ), $matches1[ 2 ] ) . ' '; echo '' . sprintf( __( 'Page 2: %s', 'wp-super-cache' ), $matches2[ 2 ] ) . ' '; echo '' . __( 'The timestamps on both pages match!', 'wp-super-cache' ) . ' '; } else { echo '' . __( 'The pages do not match! Timestamps differ or were not found!', 'wp-super-cache' ) . ' '; } } echo ''; } echo "" . __( "Delete Cached Pages", 'wp-super-cache' ) . ""; echo "" . __( "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' ) . " "; echo '\n"; ?>
|
WP Super Cache', 'Donncha O Caoimh' ); ?> Holy Shmoly', 'In Photos.org' ); ?> Twitter' ); ?>
rate this plugin and tell me if it works for you or not. It really helps development.', 'wp-super-cache' ), 'http://wordpress.org/extend/plugins/wp-super-cache/' ); ?> %2$s', 'wp-super-cache' ), date( 'M j, Y', $start_date ), number_format( get_option( 'wpsupercache_count' ) ) ); ?> |
' . __( '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' ) . '
'; echo '' . __( 'This is strictly an advanced feature only and knowledge of both PHP and WordPress actions is required to create them.', 'wp-super-cache' ) . '
'; ob_start(); if( defined( 'WP_CACHE' ) ) { if( function_exists( 'do_cacheaction' ) ) { do_cacheaction( 'cache_admin_page' ); } } $out = ob_get_contents(); ob_end_clean(); if( SUBMITDISABLED == ' ' && $out != '' ) { echo '' . sprintf( __( 'Notice: WP Super Cache mod_rewrite rule checks disabled unless running on the main site of this network.', 'wp-super-cache' ), $link_to_admin ) . '
" . __( 'Thank you for upgrading.', 'wp-super-cache' ) . " " . 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’s backwards compatible with older versions if you’re brave enough to use them.', 'wp-super-cache' ), '
RewriteCond %{HTTP_COOKIE} !^.*wordpressuser.*$
', 'RewriteCond %{HTTP:Cookie} !^.*wordpress.*$
' ) . "";
echo "" . __( 'It looks like your blog has URLs that end with a "/". Unfortunately since you installed this plugin a duplicate content bug has been found where URLs not ending in a "/" end serve the same content as those with the "/" and do not redirect to the proper URL. To fix, you must edit your .htaccess file and add these two rules to the two groups of Super Cache rules:', 'wp-super-cache' ) . "
"; echo "RewriteCond %{REQUEST_URI} !^.*[^/]$RewriteCond %{REQUEST_URI} !^.*//.*$
";
echo "" . __( 'You can see where the rules go and examine the complete rules by clicking the "View mod_rewrite rules" link below.', 'wp-super-cache' ) . "
" . sprintf( __( '%s.htaccess has been updated with the necessary mod_rewrite rules. Please verify they are correct. They should look like this:', 'wp-super-cache' ), $home_path ) . "
\n"; } else { echo "" . sprintf( __( 'Your %s.htaccess is not writable by the webserver and must be updated with the necessary mod_rewrite rules. The new rules go above the regular WordPress rules as shown in the code below:', 'wp-super-cache' ), $home_path ) . "
\n"; } echo "" . esc_html( $rules ) . "\n
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 ); ?>
" . sprintf( __( 'Gzip encoding rules in %s.htaccess created.', 'wp-super-cache' ), $cache_path ) . ""; } ?>