Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wp-super.../partials
File: advanced.php
<div class="wpsc-settings-inner">
[0] Fix | Delete
<?php
[1] Fix | Delete
global $wp_cache_mod_rewrite, $wp_cache_mfunc_enabled, $wp_cache_mobile_enabled, $cache_enabled, $cache_path, $cache_time_interval, $cache_schedule_type;
[2] Fix | Delete
[3] Fix | Delete
$faq_url = 'https://jetpack.com/support/wp-super-cache/wp-super-cache-faq/';
[4] Fix | Delete
$kses_allow_links = array( 'a' => array( 'href' => array() ) ); // Arguments for wp_kses to allow links.
[5] Fix | Delete
[6] Fix | Delete
if ( isset( $wp_cache_front_page_checks ) == false ) {
[7] Fix | Delete
$wp_cache_front_page_checks = true;
[8] Fix | Delete
}
[9] Fix | Delete
echo '<div class="wpsc-card">';
[10] Fix | Delete
echo '<form name="wp_manager" action="' . esc_url_raw( add_query_arg( 'tab', 'settings', $admin_url ) ) . '" method="post">';
[11] Fix | Delete
wp_nonce_field( 'wp-cache' );
[12] Fix | Delete
echo '<input type="hidden" name="action" value="scupdates" />';
[13] Fix | Delete
?>
[14] Fix | Delete
<table class="form-table">
[15] Fix | Delete
<tr valign="top">
[16] Fix | Delete
<th scope="row"><label for="wp_cache_enabled"><?php _e( 'Caching', 'wp-super-cache' ); ?></label></th>
[17] Fix | Delete
<td>
[18] Fix | Delete
<fieldset>
[19] Fix | Delete
<legend class="hidden"><?php _e( 'Caching', 'wp-super-cache' ); ?></legend>
[20] Fix | Delete
<label><input type='checkbox' name='wp_cache_enabled' id='wp_cache_enabled' value='1' <?php checked( $cache_enabled, true ); ?>> <?php esc_html_e( 'Enable Caching', 'wp-super-cache' ); ?><br />
[21] Fix | Delete
</fieldset>
[22] Fix | Delete
</td>
[23] Fix | Delete
</tr>
[24] Fix | Delete
<tr valign="top">
[25] Fix | Delete
<th scope="row"><?php esc_html_e( 'Cache Delivery Method', 'wp-super-cache' ); ?></th>
[26] Fix | Delete
<td>
[27] Fix | Delete
<fieldset>
[28] Fix | Delete
<label><input type='radio' name='wp_cache_mod_rewrite' <?php if ( $wp_cache_mod_rewrite == 0 ) echo "checked"; ?> value='0'> <?php _e( '<acronym title="Use PHP to serve cached files">Simple</acronym>', 'wp-super-cache' ); echo " <em>(" . __( "Recommended", "wp-super-cache" ) . ")</em>"; ?></label><br />
[29] Fix | Delete
<label><input type='radio' name='wp_cache_mod_rewrite' <?php if ( $wp_cache_mod_rewrite == 1 ) echo "checked"; ?> value='1'> <?php _e( '<acronym title="Use mod_rewrite to serve cached files">Expert</acronym>', 'wp-super-cache' ); ?></label><br />
[30] Fix | Delete
<em><small class='description'><?php _e( 'Expert caching requires changes to important server files and may require manual intervention if enabled.', 'wp-super-cache' ); ?></small></em>
[31] Fix | Delete
<?php if ( $is_nginx ) { ?>
[32] Fix | Delete
<em><small class='description'>
[33] Fix | Delete
<?php
[34] Fix | Delete
echo wp_kses(
[35] Fix | Delete
sprintf(
[36] Fix | Delete
/* Translators: placeholder is a link to a support document. */
[37] Fix | Delete
__( 'Nginx rules can be found <a href="%s">here</a> but are not officially supported.', 'wp-super-cache' ),
[38] Fix | Delete
'https://wordpress.org/documentation/article/nginx/#wp-super-cache-rules'
[39] Fix | Delete
),
[40] Fix | Delete
array(
[41] Fix | Delete
'a' => array(
[42] Fix | Delete
'href' => array(),
[43] Fix | Delete
),
[44] Fix | Delete
)
[45] Fix | Delete
);
[46] Fix | Delete
?>
[47] Fix | Delete
</small></em>
[48] Fix | Delete
<?php } ?>
[49] Fix | Delete
</fieldset>
[50] Fix | Delete
</td>
[51] Fix | Delete
</tr>
[52] Fix | Delete
<tr valign="top">
[53] Fix | Delete
<th scope="row"><?php esc_html_e( 'Miscellaneous', 'wp-super-cache' ); ?></th>
[54] Fix | Delete
<td>
[55] Fix | Delete
<fieldset>
[56] Fix | Delete
<legend class="hidden">Miscellaneous</legend>
[57] Fix | Delete
<strong><?php echo __( 'Cache Restrictions', 'wp-super-cache' ); ?></strong><br />
[58] Fix | Delete
<label><input type='radio' name='wp_cache_not_logged_in' <?php checked( $wp_cache_not_logged_in, 0 ); ?> value='0'> <?php echo __( 'Enable caching for all visitors.', 'wp-super-cache' ); ?></label><br />
[59] Fix | Delete
<label><input type='radio' name='wp_cache_not_logged_in' <?php checked( $wp_cache_not_logged_in, 1 ); ?> value='1'> <?php echo __( 'Disable caching for visitors who have a cookie set in their browser.', 'wp-super-cache' ); ?></label><br />
[60] Fix | Delete
<label><input type='radio' name='wp_cache_not_logged_in' <?php checked( $wp_cache_not_logged_in, 2 ); ?> value='2'> <?php echo __( 'Disable caching for logged in visitors.', 'wp-super-cache' ) . ' <em>(' . esc_html__( 'Recommended', 'wp-super-cache' ) . ')</em>'; ?></label><br /><br />
[61] Fix | Delete
<label><input type='checkbox' name='wp_cache_no_cache_for_get' <?php checked( $wp_cache_no_cache_for_get ); ?> value='1'> <?php _e( 'Don&#8217;t cache pages with GET parameters. (?x=y at the end of a url)', 'wp-super-cache' ); ?></label><br />
[62] Fix | Delete
<?php if ( ! defined( 'WPSC_DISABLE_COMPRESSION' ) ) : ?>
[63] Fix | Delete
<?php if ( ! function_exists( 'gzencode' ) ) : ?>
[64] Fix | Delete
<em><?php esc_html_e( 'Warning! Compression is disabled as gzencode() function was not found.', 'wp-super-cache' ); ?></em><br />
[65] Fix | Delete
<?php else : ?>
[66] Fix | Delete
<label><input type='checkbox' name='cache_compression' <?php checked( $cache_compression ); ?> value='1'> <?php echo __( 'Compress pages so they&#8217;re served more quickly to visitors.', 'wp-super-cache' ) . ' <em>(' . esc_html__( 'Recommended', 'wp-super-cache' ) . ')</em>'; ?></label><br />
[67] Fix | Delete
<em><?php esc_html_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 />
[68] Fix | Delete
<?php endif; ?>
[69] Fix | Delete
<?php endif; ?>
[70] Fix | Delete
<label><input type='checkbox' name='cache_rebuild_files' <?php checked( $cache_rebuild_files ); ?> value='1'> <?php echo esc_html__( 'Cache rebuild. Serve a supercache file to anonymous users while a new file is being generated.', 'wp-super-cache' ) . ' <em>(' . esc_html__( 'Recommended', 'wp-super-cache' ) . ')</em>'; ?></label><br />
[71] Fix | Delete
<?php if ( $wp_cache_mod_rewrite ) { ?>
[72] Fix | Delete
<br />
[73] Fix | Delete
<p><strong><?php esc_html_e( 'Warning! The following settings are disabled because Expert caching is enabled.', 'wp-super-cache' ); ?></strong></p>
[74] Fix | Delete
<br />
[75] Fix | Delete
<?php } ?>
[76] Fix | Delete
<label><input <?php disabled( $wp_cache_mod_rewrite ); ?> type='checkbox' name='wpsc_save_headers' <?php checked( $wpsc_save_headers ); ?> value='1' /> <?php esc_html_e( 'Cache HTTP headers with page content.', 'wp-super-cache' ); ?></label><br />
[77] Fix | Delete
<label><input <?php disabled( $wp_cache_mod_rewrite ); ?> type='checkbox' name='wp_supercache_304' <?php checked( $wp_supercache_304 ); ?> value='1'> <?php echo esc_html__( '304 Browser caching. Improves site performance by checking if the page has changed since the browser last requested it.', 'wp-super-cache' ) . ' <em>(' . esc_html__( 'Recommended', 'wp-super-cache' ) . ')</em>'; ?></label><br />
[78] Fix | Delete
<?php echo '<em>' . esc_html__( '304 support is disabled by default because some hosts have had problems with the headers used in the past.', 'wp-super-cache' ) . '</em><br />'; ?>
[79] Fix | Delete
<label><input <?php disabled( $wp_cache_mod_rewrite ); ?> type='checkbox' name='wp_cache_make_known_anon' <?php checked( $wp_cache_make_known_anon ); ?> value='1'> <?php _e( 'Make known users anonymous so they&#8217;re served supercached static files.', 'wp-super-cache' ); ?></label><br />
[80] Fix | Delete
</legend>
[81] Fix | Delete
</fieldset>
[82] Fix | Delete
</td>
[83] Fix | Delete
</tr>
[84] Fix | Delete
<tr valign="top">
[85] Fix | Delete
<th scope="row"><?php esc_html_e( 'Advanced', 'wp-super-cache' ); ?></th>
[86] Fix | Delete
<td>
[87] Fix | Delete
<fieldset>
[88] Fix | Delete
<legend class="hidden">Advanced</legend>
[89] Fix | Delete
[90] Fix | Delete
<label>
[91] Fix | Delete
<input
[92] Fix | Delete
type='checkbox'
[93] Fix | Delete
name='wp_cache_mfunc_enabled'
[94] Fix | Delete
value='1'
[95] Fix | Delete
<?php disabled( $wp_cache_mod_rewrite ); ?>
[96] Fix | Delete
<?php checked( $wp_cache_mfunc_enabled ); ?>
[97] Fix | Delete
>
[98] Fix | Delete
<?php
[99] Fix | Delete
echo wp_kses(
[100] Fix | Delete
sprintf(
[101] Fix | Delete
/* translators: %s is the URL of the FAQ */
[102] Fix | Delete
__(
[103] Fix | Delete
'Enable dynamic caching. (See <a href="%s">FAQ</a> or wp-super-cache/plugins/dynamic-cache-test.php for example code.)',
[104] Fix | Delete
'wp-super-cache'
[105] Fix | Delete
),
[106] Fix | Delete
$faq_url
[107] Fix | Delete
),
[108] Fix | Delete
$kses_allow_links
[109] Fix | Delete
);
[110] Fix | Delete
?>
[111] Fix | Delete
</label>
[112] Fix | Delete
<br />
[113] Fix | Delete
[114] Fix | Delete
<label>
[115] Fix | Delete
<input
[116] Fix | Delete
type='checkbox'
[117] Fix | Delete
name='wp_cache_mobile_enabled'
[118] Fix | Delete
value='1'
[119] Fix | Delete
<?php checked( $wp_cache_mobile_enabled ); ?>
[120] Fix | Delete
>
[121] Fix | Delete
<?php
[122] Fix | Delete
echo wp_kses(
[123] Fix | Delete
sprintf(
[124] Fix | Delete
/* translators: %s is the URL of the FAQ */
[125] Fix | Delete
__(
[126] Fix | Delete
'Mobile device support. (External plugin or theme required. See the <a href="https://jetpack.com/support/wp-super-cache/wp-super-cache-faq/">FAQ</a> for further details.)',
[127] Fix | Delete
'wp-super-cache'
[128] Fix | Delete
),
[129] Fix | Delete
$faq_url
[130] Fix | Delete
),
[131] Fix | Delete
$kses_allow_links
[132] Fix | Delete
);
[133] Fix | Delete
?>
[134] Fix | Delete
</label>
[135] Fix | Delete
<br />
[136] Fix | Delete
[137] Fix | Delete
<?php if ( $wp_cache_mobile_enabled ) {
[138] Fix | Delete
echo '<blockquote><h5>' . __( 'Mobile Browsers', 'wp-super-cache' ) . '</h5>' . esc_html( $wp_cache_mobile_browsers ) . "<br /><h5>" . __( 'Mobile Prefixes', 'wp-super-cache' ) . "</h5>" . esc_html( $wp_cache_mobile_prefixes ) . "<br /></blockquote>";
[139] Fix | Delete
} ?>
[140] Fix | Delete
<label><input type='checkbox' name='wp_cache_disable_utf8' <?php if( $wp_cache_disable_utf8 ) echo "checked"; ?> value='1'> <?php _e( 'Remove UTF8/blog charset support from .htaccess file. Only necessary if you see odd characters or punctuation looks incorrect. Requires rewrite rules update.', 'wp-super-cache' ); ?></label><br />
[141] Fix | Delete
<label><input type='checkbox' name='wp_cache_clear_on_post_edit' <?php if( $wp_cache_clear_on_post_edit ) echo "checked"; ?> value='1'> <?php _e( 'Clear all cache files when a post or page is published or updated.', 'wp-super-cache' ); ?></label><br />
[142] Fix | Delete
<label><input type='checkbox' name='wp_cache_front_page_checks' <?php if( $wp_cache_front_page_checks ) echo "checked"; ?> value='1'> <?php _e( 'Extra homepage checks. (Very occasionally stops homepage caching)', 'wp-super-cache' ); ?></label><?php echo " <em>(" . __( "Recommended", "wp-super-cache" ) . ")</em>"; ?><br />
[143] Fix | Delete
<label><input type='checkbox' name='wp_cache_refresh_single_only' <?php if( $wp_cache_refresh_single_only ) echo "checked"; ?> value='1'> <?php _e( 'Only refresh current page when comments made.', 'wp-super-cache' ); ?></label><br />
[144] Fix | Delete
<label><input type='checkbox' name='wp_supercache_cache_list' <?php if( $wp_supercache_cache_list ) echo "checked"; ?> value='1'> <?php _e( 'List the newest cached pages on this page.', 'wp-super-cache' ); ?></label><br />
[145] Fix | Delete
<?php if( false == defined( 'WPSC_DISABLE_LOCKING' ) ) { ?>
[146] Fix | Delete
<label><input type='checkbox' name='wp_cache_mutex_disabled' <?php if( !$wp_cache_mutex_disabled ) echo "checked"; ?> value='0'> <?php _e( 'Coarse file locking. You do not need this as it will slow down your website.', 'wp-super-cache' ); ?></label><br />
[147] Fix | Delete
<?php } ?>
[148] Fix | Delete
<label><input type='checkbox' name='wp_super_cache_late_init' <?php if( $wp_super_cache_late_init ) echo "checked"; ?> value='1'> <?php _e( 'Late init. Display cached files after WordPress has loaded.', 'wp-super-cache' ); ?></label><br />
[149] Fix | Delete
<?php printf( __( '<strong>DO NOT CACHE PAGE</strong> secret key: <a href="%s">%s</a>', 'wp-super-cache' ), trailingslashit( get_bloginfo( 'url' ) ) . "?donotcachepage={$cache_page_secret}", $cache_page_secret ); ?>
[150] Fix | Delete
</fieldset>
[151] Fix | Delete
</td>
[152] Fix | Delete
</tr>
[153] Fix | Delete
<tr valign="top">
[154] Fix | Delete
<th scope="row"><label for="wp_cache_location"><?php _e( 'Cache Location', 'wp-super-cache' ); ?></label></th>
[155] Fix | Delete
<td>
[156] Fix | Delete
<fieldset>
[157] Fix | Delete
<legend class="hidden">Cache Location</legend>
[158] Fix | Delete
<input type='text' size=80 name='wp_cache_location' id='wp_cache_location' value='<?php echo esc_attr( $cache_path ); ?>' />
[159] Fix | Delete
<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>
[160] Fix | Delete
<ol>
[161] Fix | Delete
<li><?php _e( 'Warning: do not use a shared directory like /tmp/ where other users on this server can modify files. Your cache files could be modified to deface your website.', 'wp-super-cache' ); ?></li>
[162] Fix | Delete
<li><?php _e( 'You must give the full path to the directory.', 'wp-super-cache' ); ?></li>
[163] Fix | Delete
<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>
[164] Fix | Delete
<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>
[165] Fix | Delete
<li><?php _e( 'Submit a blank entry to set it to the default directory, WP_CONTENT_DIR . /cache/.', 'wp-super-cache' ); ?></li>
[166] Fix | Delete
<?php
[167] Fix | Delete
if ( get_site_option( 'wp_super_cache_index_detected' ) && strlen( $cache_path ) > strlen( ABSPATH ) && ABSPATH == substr( $cache_path, 0, strlen( ABSPATH ) ) ) {
[168] Fix | Delete
$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' );
[169] Fix | Delete
if ( ! $is_nginx && $super_cache_enabled && $wp_cache_mod_rewrite == 1 ) {
[170] Fix | Delete
$msg .= ' ' . __( 'You are using expert mode 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 simple mode and move the cache outside of the web root.', 'wp-super-cache' );
[171] Fix | Delete
} else {
[172] Fix | Delete
$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', 'wp-super-cache' ), ABSPATH ) . '</strong>';
[173] Fix | Delete
}
[174] Fix | Delete
echo "<li>$msg</li>";
[175] Fix | Delete
}
[176] Fix | Delete
?>
[177] Fix | Delete
[178] Fix | Delete
<?php if ( $super_cache_enabled && $wp_cache_mod_rewrite == 1 ) { ?>
[179] Fix | Delete
<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>
[180] Fix | Delete
<?php } ?>
[181] Fix | Delete
</ol>
[182] Fix | Delete
</fieldset>
[183] Fix | Delete
</td>
[184] Fix | Delete
</tr>
[185] Fix | Delete
</table>
[186] Fix | Delete
<h4><?php esc_html_e( 'Note:', 'wp-super-cache' ); ?></h4>
[187] Fix | Delete
<ol>
[188] Fix | Delete
<li><?php esc_html_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>
[189] Fix | Delete
<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' ), esc_attr( WP_CONTENT_DIR ) ); ?></li>
[190] Fix | Delete
<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' ), plugins_url() ); ?></li>
[191] Fix | Delete
<li>
[192] Fix | Delete
<em>
[193] Fix | Delete
<?php
[194] Fix | Delete
echo wp_kses(
[195] Fix | Delete
sprintf(
[196] Fix | Delete
/* translators: %1$s is the URL for the documentation, %2$s is a link to the support forums. */
[197] Fix | Delete
__(
[198] Fix | Delete
'Need help? Check out <a href="%1$s">the documentation</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.',
[199] Fix | Delete
'wp-super-cache'
[200] Fix | Delete
),
[201] Fix | Delete
'https://jetpack.com/support/wp-super-cache/',
[202] Fix | Delete
'https://wordpress.org/support/plugin/wp-super-cache/'
[203] Fix | Delete
),
[204] Fix | Delete
$kses_allow_links
[205] Fix | Delete
);
[206] Fix | Delete
?>
[207] Fix | Delete
</em>
[208] Fix | Delete
</li>
[209] Fix | Delete
<li><?php _e( 'The location of the plugin configuration file can be changed by defining the WPCACHECONFIGPATH constant in wp-config.php. If not defined it will be set to WP_CONTENT_DIR.', 'wp-super-cache' ); ?></li>
[210] Fix | Delete
</ol>
[211] Fix | Delete
[212] Fix | Delete
<?php
[213] Fix | Delete
echo '<div class="submit"><input class="button-primary" type="submit" ' . SUBMITDISABLED . ' value="' . esc_html__( 'Update Status', 'wp-super-cache' ) . '" /></div>';
[214] Fix | Delete
wp_nonce_field( 'wp-cache' );
[215] Fix | Delete
?>
[216] Fix | Delete
</form>
[217] Fix | Delete
</div>
[218] Fix | Delete
<?php
[219] Fix | Delete
[220] Fix | Delete
if ( ! $GLOBALS['is_nginx'] && ! defined( 'WPSC_DISABLE_HTACCESS_UPDATE' ) && $GLOBALS['cache_enabled'] === true && $GLOBALS['wp_cache_mod_rewrite'] === 1 ) {
[221] Fix | Delete
?>
[222] Fix | Delete
<a name="modrewrite"></a><fieldset class="options">
[223] Fix | Delete
<h4><?php _e( 'Mod Rewrite Rules', 'wp-super-cache' ); ?></h4>
[224] Fix | Delete
<p><?php _e( 'When Expert cache delivery is enabled a file called <em>.htaccess</em> is modified. It should probably be in the same directory as your wp-config.php. This file has special rules that serve the cached files very quickly to visitors without ever executing PHP. The .htaccess file can be updated automatically, but if that fails, the rules will be displayed here and it can be edited by you. You will not need to update the rules unless a warning shows here.', 'wp-super-cache' ); ?></p>
[225] Fix | Delete
[226] Fix | Delete
<?php
[227] Fix | Delete
extract( wpsc_get_htaccess_info() ); // $document_root, $apache_root, $home_path, $home_root, $home_root_lc, $inst_root, $wprules, $scrules, $condition_rules, $rules, $gziprules
[228] Fix | Delete
$dohtaccess = true;
[229] Fix | Delete
if ( strpos( $wprules, 'wordpressuser' ) ) { // Need to clear out old mod_rewrite rules
[230] Fix | Delete
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>";
[231] Fix | Delete
} else {
[232] Fix | Delete
[233] Fix | Delete
global $valid_nonce;
[234] Fix | Delete
if ( $dohtaccess && ! isset( $_POST[ 'updatehtaccess' ] ) ){
[235] Fix | Delete
if ( $scrules == '' ) {
[236] Fix | Delete
wpsc_update_htaccess_form( 0 ); // don't hide the update htaccess form
[237] Fix | Delete
} else {
[238] Fix | Delete
wpsc_update_htaccess_form();
[239] Fix | Delete
}
[240] Fix | Delete
} elseif ( $valid_nonce && isset( $_POST[ 'updatehtaccess' ] ) ) {
[241] Fix | Delete
if ( add_mod_rewrite_rules() ) {
[242] Fix | Delete
echo "<h5>" . __( 'Mod Rewrite rules updated!', 'wp-super-cache' ) . "</h5>";
[243] Fix | Delete
echo "<p><strong>" . 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 ) . "</strong></p>\n";
[244] Fix | Delete
} else {
[245] Fix | Delete
global $update_mod_rewrite_rules_error;
[246] Fix | Delete
echo "<h5>" . __( 'Mod Rewrite rules must be updated!', 'wp-super-cache' ) . "</h5>";
[247] Fix | Delete
echo "<p>" . sprintf( __( 'The plugin could not update %1$s.htaccess file: %2$s.<br /> The new rules go above the regular WordPress rules as shown in the code below:', 'wp-super-cache' ), $home_path, "<strong>" . $update_mod_rewrite_rules_error . "</strong>" ) . "</p>\n";
[248] Fix | Delete
}
[249] Fix | Delete
echo "<div style='overflow: auto; width: 800px; height: 400px; padding:0 8px;color:#4f8a10;background-color:#dff2bf;border:1px solid #4f8a10;'>";
[250] Fix | Delete
echo "<p><pre>" . esc_html( $rules ) . "</pre></p>\n</div>";
[251] Fix | Delete
} else {
[252] Fix | Delete
?>
[253] Fix | Delete
<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>
[254] Fix | Delete
<?php
[255] Fix | Delete
if ( $rules != $scrules ) {
[256] Fix | Delete
?><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
[257] Fix | Delete
}
[258] Fix | Delete
?><a href="javascript:toggleLayer('rewriterules');" class="button"><?php _e( 'View Mod_Rewrite Rules', 'wp-super-cache' ); ?></a><?php
[259] Fix | Delete
wpsc_update_htaccess_form();
[260] Fix | Delete
echo "<div id='rewriterules' style='display: none;'>";
[261] Fix | Delete
if ( $rules != $scrules )
[262] Fix | Delete
echo '<div style="background: #fff; border: 1px solid #333; margin: 2px;">' . wp_text_diff( $scrules, $rules, array( 'title' => __( 'Rewrite Rules', 'wp-super-cache' ), 'title_left' => __( 'Current Rules', 'wp-super-cache' ), 'title_right' => __( 'New Rules', 'wp-super-cache' ) ) ) . "</div>";
[263] Fix | Delete
echo "<p><pre># BEGIN WPSuperCache\n" . esc_html( $rules ) . "# END WPSuperCache</pre></p>\n";
[264] Fix | Delete
echo "<p>" . sprintf( __( 'Rules must be added to %s too:', 'wp-super-cache' ), WP_CONTENT_DIR . "/cache/.htaccess" ) . "</p>";
[265] Fix | Delete
echo "<pre># BEGIN supercache\n" . esc_html( $gziprules ) . "# END supercache</pre></p>";
[266] Fix | Delete
echo '</div>';
[267] Fix | Delete
}
[268] Fix | Delete
[269] Fix | Delete
}
[270] Fix | Delete
?></fieldset><?php
[271] Fix | Delete
}
[272] Fix | Delete
[273] Fix | Delete
[274] Fix | Delete
$timezone_format = _x('Y-m-d G:i:s', 'timezone date format');
[275] Fix | Delete
[276] Fix | Delete
?>
[277] Fix | Delete
<div class="wpsc-card">
[278] Fix | Delete
<fieldset class="options">
[279] Fix | Delete
<a name='expirytime'></a>
[280] Fix | Delete
<h4><?php _e( 'Expiry Time &amp; Garbage Collection', 'wp-super-cache' ); ?></h4><?php
[281] Fix | Delete
[282] Fix | Delete
?><span id="utc-time"><?php printf( __( '<abbr title="Coordinated Universal Time">UTC</abbr> time is <code>%s</code>', 'wp-super-cache' ), date_i18n( $timezone_format, false, 'gmt' ) ); ?></span><?php
[283] Fix | Delete
$current_offset = get_option('gmt_offset');
[284] Fix | Delete
if ( get_option('timezone_string') || !empty($current_offset) ) {
[285] Fix | Delete
?><span id="local-time"><?php printf( __( 'Local time is <code>%1$s</code>', 'wp-super-cache' ), date_i18n( $timezone_format ) ); ?></span><?php
[286] Fix | Delete
}
[287] Fix | Delete
$next_gc = wp_next_scheduled( 'wp_cache_gc' );
[288] Fix | Delete
if ( $next_gc )
[289] Fix | Delete
echo "<p>" . sprintf( __( 'Next scheduled garbage collection will be at <strong>%s UTC</strong>', 'wp-super-cache' ), date_i18n( $timezone_format, $next_gc, 'gmt' ) ) . "</p>";
[290] Fix | Delete
[291] Fix | Delete
[292] Fix | Delete
if ( $wp_cache_preload_on )
[293] Fix | Delete
echo "<p>" . __( 'Warning! <strong>PRELOAD MODE</strong> activated. Supercache files will not be deleted regardless of age.', 'wp-super-cache' ) . "</p>";
[294] Fix | Delete
[295] Fix | Delete
echo "<script type='text/javascript'>";
[296] Fix | Delete
echo "jQuery(function () {
[297] Fix | Delete
jQuery('#cache_interval_time').on('click',function () {
[298] Fix | Delete
jQuery('#schedule_interval').attr('checked', true);
[299] Fix | Delete
});
[300] Fix | Delete
jQuery('#cache_scheduled_time').on('click',function () {
[301] Fix | Delete
jQuery('#schedule_time').attr('checked', true);
[302] Fix | Delete
});
[303] Fix | Delete
jQuery('#cache_scheduled_select').on('click',function () {
[304] Fix | Delete
jQuery('#schedule_time').attr('checked', true);
[305] Fix | Delete
});
[306] Fix | Delete
});";
[307] Fix | Delete
echo "</script>";
[308] Fix | Delete
echo '<form name="wp_edit_max_time" action="' . esc_url_raw( add_query_arg( 'tab', 'settings', $admin_url ) . '#expirytime' ) . '" method="post">';
[309] Fix | Delete
echo '<input name="action" value="expirytime" type="hidden" />';
[310] Fix | Delete
echo '<table class="form-table">';
[311] Fix | Delete
echo '<tr><td><label for="wp_max_time"><strong>' . __( 'Cache Timeout', 'wp-super-cache' ) . '</strong></label></td>';
[312] Fix | Delete
echo "<td><input type='text' id='wp_max_time' size=6 name='wp_max_time' value='" . esc_attr( $cache_max_time ) . "' /> " . __( "seconds", 'wp-super-cache' ) . "</td></tr>\n";
[313] Fix | Delete
echo "<tr><td></td><td>" . __( 'How long should cached pages remain fresh? Set to 0 to disable garbage collection. A good starting point is 3600 seconds.', 'wp-super-cache' ) . "</td></tr>\n";
[314] Fix | Delete
echo '<tr><td valign="top"><strong>' . esc_html__( 'Scheduler', 'wp-super-cache' ) . '</strong></td><td><table cellpadding=0 cellspacing=0><tr><td valign="top"><input type="radio" id="schedule_interval" name="cache_schedule_type" value="interval" ' . checked( 'interval', $cache_schedule_type, false ) . ' /></td><td valign="top"><label for="schedule_interval">' . esc_html__( 'Timer:', 'wp-super-cache' ) . '</label></td>';
[315] Fix | Delete
echo "<td><input type='text' id='cache_interval_time' size=6 name='cache_time_interval' value='" . esc_attr( $cache_time_interval ) . "' /> " . esc_html__( 'seconds', 'wp-super-cache' ) . '<br />' . esc_html__( 'How often to check for stale cached files.', 'wp-super-cache' ) . '</td></tr>';
[316] Fix | Delete
echo '<tr><td valign="top"><input type="radio" id="schedule_time" name="cache_schedule_type" value="time" ' . checked( 'time', $cache_schedule_type, false ) . ' /></td><td valign="top"><label for="schedule_time">' . __( 'Clock:', 'wp-super-cache' ) . '</label></td>';
[317] Fix | Delete
echo "<td><input type=\"text\" size=5 id='cache_scheduled_time' name='cache_scheduled_time' value=\"" . esc_attr( $cache_scheduled_time ) . "\" /> " . __( "HH:MM", 'wp-super-cache' ) . "<br />" . __( 'Check for stale cached files at this time <strong>(UTC)</strong> or starting at this time every <em>interval</em> below.', 'wp-super-cache' ) . "</td></tr>";
[318] Fix | Delete
$schedules = wp_get_schedules();
[319] Fix | Delete
echo "<tr><td><br /></td><td><label for='cache_scheduled_select'>" . __( 'Interval:', 'wp-super-cache' ) . "</label></td><td><select id='cache_scheduled_select' name='cache_schedule_interval' size=1>";
[320] Fix | Delete
foreach( $schedules as $desc => $details ) {
[321] Fix | Delete
echo "<option value='$desc' " . selected( $desc, $cache_schedule_interval, false ) . " /> {$details[ 'display' ]}</option>";
[322] Fix | Delete
}
[323] Fix | Delete
echo "</select></td></tr>";
[324] Fix | Delete
echo '</table></td></tr>';
[325] Fix | Delete
echo '<tr><td><label for="cache_gc_email_me"><strong>' . __( 'Notification Emails', 'wp-super-cache' ) . '</strong></label></td>';
[326] Fix | Delete
echo "<td><input type='checkbox' id='cache_gc_email_me' name='cache_gc_email_me' " . checked( $cache_gc_email_me, 1, false ) . " /> " . __( 'Email me when the garbage collection runs.', 'wp-super-cache' ) . "</td></tr>\n";
[327] Fix | Delete
echo "</table>\n";
[328] Fix | Delete
echo "<h5>" . __( 'Garbage Collection', 'wp-super-cache' ) . "</h5>";
[329] Fix | Delete
echo "<ol><li>" . __( '<em>Garbage collection</em> is the simple act of throwing out your garbage. For this plugin that would be old or <em>stale</em> cached files that may be out of date. New cached files are described as <em>fresh</em>.', 'wp-super-cache' ) . "</li>\n";
[330] Fix | Delete
echo "<li>" . __( 'Cached files are fresh for a limited length of time. You can set that time in the <em>Cache Timeout</em> text box on this page.', 'wp-super-cache' ) . "</li>\n";
[331] Fix | Delete
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";
[332] Fix | Delete
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";
[333] Fix | Delete
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";
[334] Fix | Delete
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";
[335] Fix | Delete
echo "</ol>";
[336] Fix | Delete
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";
[337] Fix | Delete
echo "<ol>";
[338] Fix | Delete
echo "<li>" . __( 'Sites that want to serve lots of newly generated data should set the <em>Cache Timeout</em> to 60 and use the <em>Timer</em> scheduler set to 90 seconds.', 'wp-super-cache' ) . "</li>\n";
[339] Fix | Delete
echo "<li>" . __( 'Sites with widgets and rss feeds in their sidebar should probably use a timeout of 3600 seconds and set the timer to 600 seconds. Stale files will be caught within 10 minutes of going stale.', 'wp-super-cache' ) . "</li>\n";
[340] Fix | Delete
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";
[341] Fix | Delete
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";
[342] Fix | Delete
echo "</ol>";
[343] Fix | Delete
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.', 'wp-super-cache' ) . "</p>";
[344] Fix | Delete
echo "<p>" . __( 'Set the expiry time to 0 seconds to disable garbage collection.', 'wp-super-cache' ) . "</p>";
[345] Fix | Delete
echo '<div class="submit"><input class="button-primary" type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Change Expiration', 'wp-super-cache' ) . '" /></div>';
[346] Fix | Delete
wp_nonce_field('wp-cache');
[347] Fix | Delete
echo "</form>\n";
[348] Fix | Delete
?>
[349] Fix | Delete
</fieldset>
[350] Fix | Delete
</div>
[351] Fix | Delete
[352] Fix | Delete
<?php
[353] Fix | Delete
// Accepted Filenames
[354] Fix | Delete
echo '<div class="wpsc-card">';
[355] Fix | Delete
echo '<a name="files"></a><fieldset class="options"><h4>' . __( 'Accepted Filenames &amp; Rejected URIs', 'wp-super-cache' ) . '</h4>';
[356] Fix | Delete
echo '<a name="rejectpages"></a>';
[357] Fix | Delete
echo '<p>' . __( 'Do not cache the following page types. See the <a href="https://codex.wordpress.org/Conditional_Tags">Conditional Tags</a> documentation for a complete discussion on each type.', 'wp-super-cache' ) . '</p>';
[358] Fix | Delete
echo '<form name="wp_edit_rejected_pages" action="' . esc_url_raw( add_query_arg( 'tab', 'settings', $admin_url ) . '#rejectpages' ) . '" method="post">';
[359] Fix | Delete
echo '<input type="hidden" name="wp_edit_rejected_pages" value="1" />';
[360] Fix | Delete
echo '<label><input type="checkbox" value="1" name="wp_cache_pages[single]" ' . checked( 1, $wp_cache_pages[ 'single' ], false ) . ' /> ' . __( 'Single Posts', 'wp-super-cache' ) . ' (is_single)</label><br />';
[361] Fix | Delete
echo '<label><input type="checkbox" value="1" name="wp_cache_pages[pages]" ' . checked( 1, $wp_cache_pages[ 'pages' ], false ) . ' /> ' . __( 'Pages', 'wp-super-cache' ) . ' (is_page)</label><br />';
[362] Fix | Delete
echo '<label><input type="checkbox" value="1" name="wp_cache_pages[frontpage]" ' . checked( 1, $wp_cache_pages[ 'frontpage' ], false ) . ' /> ' . __( 'Front Page', 'wp-super-cache' ) . ' (is_front_page)</label><br />';
[363] Fix | Delete
echo '&nbsp;&nbsp;<label><input type="checkbox" value="1" name="wp_cache_pages[home]" ' . checked( 1, $wp_cache_pages[ 'home' ], false ) . ' /> ' . __( 'Home', 'wp-super-cache' ) . ' (is_home)</label><br />';
[364] Fix | Delete
echo '<label><input type="checkbox" value="1" name="wp_cache_pages[archives]" ' . checked( 1, $wp_cache_pages[ 'archives' ], false ) . ' /> ' . __( 'Archives', 'wp-super-cache' ) . ' (is_archive)</label><br />';
[365] Fix | Delete
echo '&nbsp;&nbsp;<label><input type="checkbox" value="1" name="wp_cache_pages[tag]" ' . checked( 1, $wp_cache_pages[ 'tag' ], false ) . ' /> ' . __( 'Tags', 'wp-super-cache' ) . ' (is_tag)</label><br />';
[366] Fix | Delete
echo '&nbsp;&nbsp;<label><input type="checkbox" value="1" name="wp_cache_pages[category]" ' . checked( 1, $wp_cache_pages[ 'category' ], false ) . ' /> ' . __( 'Category', 'wp-super-cache' ) . ' (is_category)</label><br />';
[367] Fix | Delete
echo '<label><input type="checkbox" value="1" name="wp_cache_pages[feed]" ' . checked( 1, $wp_cache_pages[ 'feed' ], false ) . ' /> ' . __( 'Feeds', 'wp-super-cache' ) . ' (is_feed)</label><br />';
[368] Fix | Delete
echo '<label><input type="checkbox" value="1" name="wp_cache_pages[search]" ' . checked( 1, $wp_cache_pages[ 'search' ], false ) . ' /> ' . __( 'Search Pages', 'wp-super-cache' ) . ' (is_search)</label><br />';
[369] Fix | Delete
echo '<label><input type="checkbox" value="1" name="wp_cache_pages[author]" ' . checked( 1, $wp_cache_pages[ 'author' ], false ) . ' /> ' . __( 'Author Pages', 'wp-super-cache' ) . ' (is_author)</label><br />';
[370] Fix | Delete
[371] Fix | Delete
echo '<div class="submit"><input class="button-primary" type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Save Settings', 'wp-super-cache' ) . '" /></div>';
[372] Fix | Delete
wp_nonce_field('wp-cache');
[373] Fix | Delete
echo "</form>\n";
[374] Fix | Delete
echo '</div>';
[375] Fix | Delete
[376] Fix | Delete
// Rejected URL strings
[377] Fix | Delete
echo '<div class="wpsc-card">';
[378] Fix | Delete
echo '<a name="rejecturi"></a><fieldset class="options"><h4>' . __( 'Rejected URL Strings', 'wp-super-cache' ) . '</h4>';
[379] Fix | Delete
echo '<form name="wp_edit_rejected" action="' . esc_url_raw( add_query_arg( 'tab', 'settings', $admin_url ) . '#rejecturi' ) . '" method="post">';
[380] Fix | Delete
echo "<p>" . __( 'Add here strings (not a filename) that forces a page not to be cached. For example, if your URLs include year and you dont want to cache last year posts, it&#8217;s enough to specify the year, i.e. &#8217;/2004/&#8217;. WP-Cache will search if that string is part of the URI and if so, it will not cache that page.', 'wp-super-cache' ) . "</p>\n";
[381] Fix | Delete
echo '<textarea name="wp_rejected_uri" cols="40" rows="4" style="width: 50%; font-size: 12px;" class="code">';
[382] Fix | Delete
foreach( $cache_rejected_uri as $file ) {
[383] Fix | Delete
echo esc_html( $file ) . "\n";
[384] Fix | Delete
}
[385] Fix | Delete
echo '</textarea> ';
[386] Fix | Delete
echo '<div class="submit"><input class="button-primary" type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Save Strings', 'wp-super-cache' ) . '" /></div>';
[387] Fix | Delete
wp_nonce_field( 'wp-cache' );
[388] Fix | Delete
echo "</form>\n";
[389] Fix | Delete
echo '</div>';
[390] Fix | Delete
[391] Fix | Delete
// Rejected Cookies
[392] Fix | Delete
echo '<div class="wpsc-card">';
[393] Fix | Delete
echo '<a name="rejectcookies"></a><fieldset class="options"><h4>' . __( 'Rejected Cookies', 'wp-super-cache' ) . '</h4>';
[394] Fix | Delete
echo '<form name="wp_edit_rejected_cookies" action="' . esc_url_raw( add_query_arg( 'tab', 'settings', $admin_url ) . '#rejectcookies' ) . '" method="post">';
[395] Fix | Delete
echo "<p>" . __( 'Do not cache pages when these cookies are set. Add the cookie names here, one per line. Matches on fragments, so "test" will match "WordPress_test_cookie". (Simple caching only)', 'wp-super-cache' ) . "</p>\n";
[396] Fix | Delete
echo '<textarea name="wp_rejected_cookies" cols="40" rows="4" style="width: 50%; font-size: 12px;" class="code">';
[397] Fix | Delete
foreach ( (array) $wpsc_rejected_cookies as $file) {
[398] Fix | Delete
echo esc_html( $file ) . "\n";
[399] Fix | Delete
}
[400] Fix | Delete
echo '</textarea> ';
[401] Fix | Delete
echo '<div class="submit"><input class="button-primary" type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Save', 'wp-super-cache' ) . '" /></div>';
[402] Fix | Delete
wp_nonce_field('wp-cache');
[403] Fix | Delete
echo "</form>\n";
[404] Fix | Delete
echo '</div>';
[405] Fix | Delete
[406] Fix | Delete
// Always Cache Filenames
[407] Fix | Delete
echo '<div class="wpsc-card">';
[408] Fix | Delete
echo '<a name="cancache"></a><fieldset class="options"><h4>' . __( 'Always Cache Filenames', 'wp-super-cache' ) . '</h4>';
[409] Fix | Delete
echo '<div style="clear:both"></div><form name="wp_edit_accepted" action="' . esc_url_raw( add_query_arg( 'tab', 'settings', $admin_url ) . '#cancache' ) . '" method="post">';
[410] Fix | Delete
echo "<p>" . __( 'Add here those filenames that can be cached, even if they match one of the rejected substring specified above.', 'wp-super-cache' ) . "</p>\n";
[411] Fix | Delete
echo '<textarea name="wp_accepted_files" cols="40" rows="8" style="width: 50%; font-size: 12px;" class="code">';
[412] Fix | Delete
foreach ($cache_acceptable_files as $file) {
[413] Fix | Delete
echo esc_html($file) . "\n";
[414] Fix | Delete
}
[415] Fix | Delete
echo '</textarea> ';
[416] Fix | Delete
echo '<div class="submit"><input class="button-primary" type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Save Files', 'wp-super-cache' ) . '" /></div>';
[417] Fix | Delete
wp_nonce_field('wp-cache');
[418] Fix | Delete
echo "</form>\n";
[419] Fix | Delete
echo '</div>';
[420] Fix | Delete
[421] Fix | Delete
echo '</fieldset>';
[422] Fix | Delete
echo '</div>';
[423] Fix | Delete
[424] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function