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

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-conte.../plugins/wp-super...
File: wp-cache.php
// mobile_groups = array( 'apple' => array( 'ipod', 'iphone' ), 'nokia' => array( 'nokia5800', 'symbianos' ) );
[1000] Fix | Delete
[1001] Fix | Delete
$wp_cache_mobile_browsers = implode( ', ', $wp_cache_mobile_browsers );
[1002] Fix | Delete
$wp_cache_mobile_prefixes = implode( ', ', $wp_cache_mobile_prefixes );
[1003] Fix | Delete
[1004] Fix | Delete
if ( false == apply_filters( 'wp_super_cache_error_checking', true ) )
[1005] Fix | Delete
return false;
[1006] Fix | Delete
[1007] Fix | Delete
if ( function_exists( 'get_supercache_dir' ) )
[1008] Fix | Delete
$supercachedir = get_supercache_dir();
[1009] Fix | Delete
if( get_option( 'gzipcompression' ) == 1 )
[1010] Fix | Delete
update_option( 'gzipcompression', 0 );
[1011] Fix | Delete
if( !isset( $cache_rebuild_files ) )
[1012] Fix | Delete
$cache_rebuild_files = 0;
[1013] Fix | Delete
[1014] Fix | Delete
$valid_nonce = isset($_REQUEST['_wpnonce']) ? wp_verify_nonce($_REQUEST['_wpnonce'], 'wp-cache') : false;
[1015] Fix | Delete
/* http://www.netlobo.com/div_hiding.html */
[1016] Fix | Delete
?>
[1017] Fix | Delete
<script type='text/javascript'>
[1018] Fix | Delete
<!--
[1019] Fix | Delete
function toggleLayer( whichLayer ) {
[1020] Fix | Delete
var elem, vis;
[1021] Fix | Delete
if( document.getElementById ) // this is the way the standards work
[1022] Fix | Delete
elem = document.getElementById( whichLayer );
[1023] Fix | Delete
else if( document.all ) // this is the way old msie versions work
[1024] Fix | Delete
elem = document.all[whichLayer];
[1025] Fix | Delete
else if( document.layers ) // this is the way nn4 works
[1026] Fix | Delete
elem = document.layers[whichLayer];
[1027] Fix | Delete
vis = elem.style;
[1028] Fix | Delete
// if the style.display value is blank we try to figure it out here
[1029] Fix | Delete
if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
[1030] Fix | Delete
vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
[1031] Fix | Delete
vis.display = (vis.display==''||vis.display=='block')?'none':'block';
[1032] Fix | Delete
}
[1033] Fix | Delete
// -->
[1034] Fix | Delete
//Clicking header opens fieldset options
[1035] Fix | Delete
jQuery(document).ready(function(){
[1036] Fix | Delete
jQuery("fieldset h4").css("cursor","pointer").on("click",function(){
[1037] Fix | Delete
jQuery(this).parent("fieldset").find("p,form,ul,blockquote").toggle("slow");
[1038] Fix | Delete
});
[1039] Fix | Delete
});
[1040] Fix | Delete
</script>
[1041] Fix | Delete
[1042] Fix | Delete
<style type='text/css'>
[1043] Fix | Delete
#nav h3 {
[1044] Fix | Delete
border-bottom: 1px solid #ccc;
[1045] Fix | Delete
padding-bottom: 0;
[1046] Fix | Delete
height: 1.5em;
[1047] Fix | Delete
}
[1048] Fix | Delete
table.wpsc-settings-table {
[1049] Fix | Delete
clear: both;
[1050] Fix | Delete
}
[1051] Fix | Delete
</style>
[1052] Fix | Delete
<div id="wpsc-dashboard">
[1053] Fix | Delete
<?php
[1054] Fix | Delete
wpsc_render_header();
[1055] Fix | Delete
[1056] Fix | Delete
echo '<div class="wpsc-body">';
[1057] Fix | Delete
echo '<a name="top"></a>';
[1058] Fix | Delete
[1059] Fix | Delete
// Set a default.
[1060] Fix | Delete
if ( false === $cache_enabled && ! isset( $wp_cache_mod_rewrite ) ) {
[1061] Fix | Delete
$wp_cache_mod_rewrite = 0;
[1062] Fix | Delete
} elseif ( ! isset( $wp_cache_mod_rewrite ) && $cache_enabled && $super_cache_enabled ) {
[1063] Fix | Delete
$wp_cache_mod_rewrite = 1;
[1064] Fix | Delete
}
[1065] Fix | Delete
[1066] Fix | Delete
$admin_url = admin_url( 'options-general.php?page=wpsupercache' );
[1067] Fix | Delete
$curr_tab = ! empty( $_GET['tab'] ) ? sanitize_text_field( stripslashes( $_GET['tab'] ) ) : ''; // WPCS: sanitization ok.
[1068] Fix | Delete
if ( empty( $curr_tab ) ) {
[1069] Fix | Delete
$curr_tab = 'easy';
[1070] Fix | Delete
if ( $wp_cache_mod_rewrite ) {
[1071] Fix | Delete
$curr_tab = 'settings';
[1072] Fix | Delete
echo '<div class="notice notice-info is-dismissible"><p>' . __( 'Notice: <em>Expert mode caching enabled</em>. Showing Advanced Settings Page by default.', 'wp-super-cache' ) . '</p></div>';
[1073] Fix | Delete
}
[1074] Fix | Delete
}
[1075] Fix | Delete
[1076] Fix | Delete
if ( 'preload' === $curr_tab ) {
[1077] Fix | Delete
if ( true == $super_cache_enabled && ! defined( 'DISABLESUPERCACHEPRELOADING' ) ) {
[1078] Fix | Delete
global $wp_cache_preload_interval, $wp_cache_preload_on, $wp_cache_preload_taxonomies, $wp_cache_preload_email_me, $wp_cache_preload_email_volume, $wp_cache_preload_posts, $wpdb;
[1079] Fix | Delete
wpsc_preload_settings();
[1080] Fix | Delete
$currently_preloading = false;
[1081] Fix | Delete
[1082] Fix | Delete
echo '<div id="wpsc-preload-status"></div>';
[1083] Fix | Delete
}
[1084] Fix | Delete
}
[1085] Fix | Delete
[1086] Fix | Delete
wpsc_admin_tabs( $curr_tab );
[1087] Fix | Delete
echo '<div class="wpsc-body-content wrap">';
[1088] Fix | Delete
[1089] Fix | Delete
if ( isset( $wp_super_cache_front_page_check ) && $wp_super_cache_front_page_check == 1 && ! wp_next_scheduled( 'wp_cache_check_site_hook' ) ) {
[1090] Fix | Delete
wp_schedule_single_event( time() + 360, 'wp_cache_check_site_hook' );
[1091] Fix | Delete
wp_cache_debug( 'scheduled wp_cache_check_site_hook for 360 seconds time.', 2 );
[1092] Fix | Delete
}
[1093] Fix | Delete
[1094] Fix | Delete
if ( isset( $_REQUEST['wp_restore_config'] ) && $valid_nonce ) {
[1095] Fix | Delete
unlink( $wp_cache_config_file );
[1096] Fix | Delete
echo '<strong>' . esc_html__( 'Configuration file changed, some values might be wrong. Load the page again from the "Settings" menu to reset them.', 'wp-super-cache' ) . '</strong>';
[1097] Fix | Delete
}
[1098] Fix | Delete
[1099] Fix | Delete
if ( substr( get_option( 'permalink_structure' ), -1 ) == '/' ) {
[1100] Fix | Delete
wp_cache_replace_line( '^ *\$wp_cache_slash_check', "\$wp_cache_slash_check = 1;", $wp_cache_config_file );
[1101] Fix | Delete
} else {
[1102] Fix | Delete
wp_cache_replace_line( '^ *\$wp_cache_slash_check', "\$wp_cache_slash_check = 0;", $wp_cache_config_file );
[1103] Fix | Delete
}
[1104] Fix | Delete
$home_path = parse_url( site_url() );
[1105] Fix | Delete
$home_path = trailingslashit( array_key_exists( 'path', $home_path ) ? $home_path['path'] : '' );
[1106] Fix | Delete
if ( ! isset( $wp_cache_home_path ) ) {
[1107] Fix | Delete
$wp_cache_home_path = '/';
[1108] Fix | Delete
wp_cache_setting( 'wp_cache_home_path', '/' );
[1109] Fix | Delete
}
[1110] Fix | Delete
if ( "$home_path" != "$wp_cache_home_path" ) {
[1111] Fix | Delete
wp_cache_setting( 'wp_cache_home_path', $home_path );
[1112] Fix | Delete
}
[1113] Fix | Delete
[1114] Fix | Delete
if ( $wp_cache_mobile_enabled == 1 ) {
[1115] Fix | Delete
update_cached_mobile_ua_list( $wp_cache_mobile_browsers, $wp_cache_mobile_prefixes, $mobile_groups );
[1116] Fix | Delete
}
[1117] Fix | Delete
[1118] Fix | Delete
?>
[1119] Fix | Delete
<style>
[1120] Fix | Delete
.wpsc-boost-banner {
[1121] Fix | Delete
margin: 2px 1.25rem 1.25rem 0;
[1122] Fix | Delete
box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.03), 0px 1px 2px rgba(0, 0, 0, 0.03);
[1123] Fix | Delete
border: 1px solid #d5d5d5;
[1124] Fix | Delete
position: relative;
[1125] Fix | Delete
}
[1126] Fix | Delete
[1127] Fix | Delete
.wpsc-boost-banner-inner {
[1128] Fix | Delete
display: flex;
[1129] Fix | Delete
grid-template-columns: minmax(auto, 750px) 500px;
[1130] Fix | Delete
justify-content: space-between;
[1131] Fix | Delete
min-height: 300px;
[1132] Fix | Delete
background: #fff;
[1133] Fix | Delete
overflow: hidden;
[1134] Fix | Delete
}
[1135] Fix | Delete
[1136] Fix | Delete
.wpsc-boost-banner-content {
[1137] Fix | Delete
display: inline-flex;
[1138] Fix | Delete
flex-direction: column;
[1139] Fix | Delete
padding: 2.5rem;
[1140] Fix | Delete
text-align: left;
[1141] Fix | Delete
}
[1142] Fix | Delete
[1143] Fix | Delete
.wpsc-boost-banner-image-container {
[1144] Fix | Delete
position: relative;
[1145] Fix | Delete
background-image: url( <?php echo esc_url( plugin_dir_url( __FILE__ ) . '/assets/jetpack-colors.svg' ); ?> );
[1146] Fix | Delete
background-size: cover;
[1147] Fix | Delete
min-width: 40%;
[1148] Fix | Delete
max-width: 40%;
[1149] Fix | Delete
overflow: hidden;
[1150] Fix | Delete
text-align: right;
[1151] Fix | Delete
}
[1152] Fix | Delete
[1153] Fix | Delete
.wpsc-boost-banner-image-container img {
[1154] Fix | Delete
position: relative;
[1155] Fix | Delete
top: 50%;
[1156] Fix | Delete
transform: translateY(-50%);
[1157] Fix | Delete
}
[1158] Fix | Delete
[1159] Fix | Delete
.wpsc-boost-banner h3 {
[1160] Fix | Delete
font-size: 24px;
[1161] Fix | Delete
line-height: 32px;
[1162] Fix | Delete
}
[1163] Fix | Delete
[1164] Fix | Delete
.wpsc-boost-banner p {
[1165] Fix | Delete
font-size: 14px;
[1166] Fix | Delete
line-height: 24px;
[1167] Fix | Delete
margin: 0 0 1.9rem;
[1168] Fix | Delete
}
[1169] Fix | Delete
[1170] Fix | Delete
.wpsc-boost-banner .wpsc-boost-dismiss {
[1171] Fix | Delete
position: absolute;
[1172] Fix | Delete
top: 10px;
[1173] Fix | Delete
right: 10px;
[1174] Fix | Delete
color: black;
[1175] Fix | Delete
cursor:pointer;
[1176] Fix | Delete
}
[1177] Fix | Delete
[1178] Fix | Delete
.wpsc-boost-banner .button-primary {
[1179] Fix | Delete
background: black;
[1180] Fix | Delete
border-color: black;
[1181] Fix | Delete
color: #fff;
[1182] Fix | Delete
width: fit-content;
[1183] Fix | Delete
padding: 0.4rem 1rem;
[1184] Fix | Delete
font-size: 16px;
[1185] Fix | Delete
line-height: 23px;
[1186] Fix | Delete
}
[1187] Fix | Delete
[1188] Fix | Delete
.wpsc-boost-banner .button-primary:hover {
[1189] Fix | Delete
background-color: #333;
[1190] Fix | Delete
}
[1191] Fix | Delete
[1192] Fix | Delete
.wpsc-boost-banner .button-primary:visited {
[1193] Fix | Delete
background-color: black;
[1194] Fix | Delete
border-color: black;
[1195] Fix | Delete
}
[1196] Fix | Delete
</style>
[1197] Fix | Delete
[1198] Fix | Delete
<table class="wpsc-settings-table"><td valign="top">
[1199] Fix | Delete
[1200] Fix | Delete
<?php
[1201] Fix | Delete
wpsc_jetpack_boost_install_banner();
[1202] Fix | Delete
[1203] Fix | Delete
switch ( $curr_tab ) {
[1204] Fix | Delete
case 'cdn':
[1205] Fix | Delete
scossdl_off_options();
[1206] Fix | Delete
break;
[1207] Fix | Delete
case 'tester':
[1208] Fix | Delete
case 'contents':
[1209] Fix | Delete
echo '<a name="test"></a>';
[1210] Fix | Delete
wp_cache_files();
[1211] Fix | Delete
break;
[1212] Fix | Delete
case 'preload':
[1213] Fix | Delete
wpsc_render_partial(
[1214] Fix | Delete
'preload',
[1215] Fix | Delete
compact(
[1216] Fix | Delete
'cache_enabled',
[1217] Fix | Delete
'super_cache_enabled',
[1218] Fix | Delete
'admin_url',
[1219] Fix | Delete
'wp_cache_preload_interval',
[1220] Fix | Delete
'wp_cache_preload_on',
[1221] Fix | Delete
'wp_cache_preload_taxonomies',
[1222] Fix | Delete
'wp_cache_preload_email_me',
[1223] Fix | Delete
'wp_cache_preload_email_volume',
[1224] Fix | Delete
'currently_preloading',
[1225] Fix | Delete
'wp_cache_preload_posts'
[1226] Fix | Delete
)
[1227] Fix | Delete
);
[1228] Fix | Delete
[1229] Fix | Delete
break;
[1230] Fix | Delete
case 'plugins':
[1231] Fix | Delete
wpsc_plugins_tab();
[1232] Fix | Delete
break;
[1233] Fix | Delete
case 'debug':
[1234] Fix | Delete
global $wp_super_cache_debug, $wp_cache_debug_log, $wp_cache_debug_ip, $wp_cache_debug_ip;
[1235] Fix | Delete
global $wp_super_cache_front_page_text, $wp_super_cache_front_page_notification;
[1236] Fix | Delete
global $wp_super_cache_advanced_debug, $wp_cache_debug_username, $wp_super_cache_front_page_clear;
[1237] Fix | Delete
wpsc_render_partial(
[1238] Fix | Delete
'debug',
[1239] Fix | Delete
compact( 'wp_super_cache_debug', 'wp_cache_debug_log', 'wp_cache_debug_ip', 'cache_path', 'valid_nonce', 'wp_cache_config_file', 'wp_super_cache_comments', 'wp_super_cache_front_page_check', 'wp_super_cache_front_page_clear', 'wp_super_cache_front_page_text', 'wp_super_cache_front_page_notification', 'wp_super_cache_advanced_debug', 'wp_cache_debug_username', 'wp_cache_home_path' )
[1240] Fix | Delete
);
[1241] Fix | Delete
break;
[1242] Fix | Delete
case 'settings':
[1243] Fix | Delete
global $cache_acceptable_files, $wpsc_rejected_cookies, $cache_rejected_uri, $wp_cache_pages;
[1244] Fix | Delete
global $cache_max_time, $wp_cache_config_file, $valid_nonce, $super_cache_enabled, $cache_schedule_type, $cache_scheduled_time, $cache_schedule_interval, $cache_time_interval, $cache_gc_email_me, $wp_cache_preload_on;
[1245] Fix | Delete
[1246] Fix | Delete
wp_cache_update_rejected_pages();
[1247] Fix | Delete
wp_cache_update_rejected_cookies();
[1248] Fix | Delete
wp_cache_update_rejected_strings();
[1249] Fix | Delete
wp_cache_update_accepted_strings();
[1250] Fix | Delete
wp_cache_time_update();
[1251] Fix | Delete
[1252] Fix | Delete
wpsc_render_partial(
[1253] Fix | Delete
'advanced',
[1254] Fix | Delete
compact(
[1255] Fix | Delete
'wp_cache_front_page_checks',
[1256] Fix | Delete
'admin_url',
[1257] Fix | Delete
'cache_enabled',
[1258] Fix | Delete
'super_cache_enabled',
[1259] Fix | Delete
'wp_cache_mod_rewrite',
[1260] Fix | Delete
'is_nginx',
[1261] Fix | Delete
'wp_cache_not_logged_in',
[1262] Fix | Delete
'wp_cache_no_cache_for_get',
[1263] Fix | Delete
'cache_compression',
[1264] Fix | Delete
'cache_rebuild_files',
[1265] Fix | Delete
'wpsc_save_headers',
[1266] Fix | Delete
'wp_supercache_304',
[1267] Fix | Delete
'wp_cache_make_known_anon',
[1268] Fix | Delete
'wp_cache_mfunc_enabled',
[1269] Fix | Delete
'wp_cache_mobile_enabled',
[1270] Fix | Delete
'wp_cache_mobile_browsers',
[1271] Fix | Delete
'wp_cache_disable_utf8',
[1272] Fix | Delete
'wp_cache_clear_on_post_edit',
[1273] Fix | Delete
'wp_cache_front_page_checks',
[1274] Fix | Delete
'wp_cache_refresh_single_only',
[1275] Fix | Delete
'wp_supercache_cache_list',
[1276] Fix | Delete
'wp_cache_mutex_disabled',
[1277] Fix | Delete
'wp_super_cache_late_init',
[1278] Fix | Delete
'cache_page_secret',
[1279] Fix | Delete
'cache_path',
[1280] Fix | Delete
'cache_acceptable_files',
[1281] Fix | Delete
'wpsc_rejected_cookies',
[1282] Fix | Delete
'cache_rejected_uri',
[1283] Fix | Delete
'wp_cache_pages',
[1284] Fix | Delete
'cache_max_time',
[1285] Fix | Delete
'valid_nonce',
[1286] Fix | Delete
'super_cache_enabled',
[1287] Fix | Delete
'cache_schedule_type',
[1288] Fix | Delete
'cache_scheduled_time',
[1289] Fix | Delete
'cache_schedule_interval',
[1290] Fix | Delete
'cache_time_interval',
[1291] Fix | Delete
'cache_gc_email_me',
[1292] Fix | Delete
'wp_cache_mobile_prefixes',
[1293] Fix | Delete
'wp_cache_preload_on'
[1294] Fix | Delete
)
[1295] Fix | Delete
);
[1296] Fix | Delete
[1297] Fix | Delete
wpsc_edit_tracking_parameters();
[1298] Fix | Delete
wpsc_edit_rejected_ua();
[1299] Fix | Delete
wpsc_lockdown();
[1300] Fix | Delete
wpsc_restore_settings();
[1301] Fix | Delete
[1302] Fix | Delete
break;
[1303] Fix | Delete
case 'easy':
[1304] Fix | Delete
default:
[1305] Fix | Delete
wpsc_render_partial(
[1306] Fix | Delete
'easy',
[1307] Fix | Delete
array(
[1308] Fix | Delete
'admin_url' => $admin_url,
[1309] Fix | Delete
'cache_enabled' => $cache_enabled,
[1310] Fix | Delete
'is_nginx' => $is_nginx,
[1311] Fix | Delete
'wp_cache_mod_rewrite' => $wp_cache_mod_rewrite,
[1312] Fix | Delete
'valid_nonce' => $valid_nonce,
[1313] Fix | Delete
'cache_path' => $cache_path,
[1314] Fix | Delete
'wp_super_cache_comments' => $wp_super_cache_comments,
[1315] Fix | Delete
)
[1316] Fix | Delete
);
[1317] Fix | Delete
break;
[1318] Fix | Delete
}
[1319] Fix | Delete
?>
[1320] Fix | Delete
[1321] Fix | Delete
</fieldset>
[1322] Fix | Delete
</td><td valign='top' style='width: 300px'>
[1323] Fix | Delete
<!-- TODO: Hide #wpsc-callout from all pages except the Easy tab -->
[1324] Fix | Delete
<div class="wpsc-card" id="wpsc-callout">
[1325] Fix | Delete
<?php if ( ! empty( $wpsc_promo_links ) && is_array( $wpsc_promo_links ) ) : ?>
[1326] Fix | Delete
<h4><?php esc_html_e( 'Other Site Tools', 'wp-super-cache' ); ?></h4>
[1327] Fix | Delete
<ul style="list-style: square; margin-left: 2em;">
[1328] Fix | Delete
<li><a href="<?php echo esc_url( $wpsc_promo_links['boost'] ); ?>"><?php esc_html_e( 'Boost your page speed scores', 'wp-super-cache' ); ?></a></li>
[1329] Fix | Delete
<li><a href="<?php echo esc_url( $wpsc_promo_links['photon'] ); ?>"><?php esc_html_e( 'Speed up images and photos (free)', 'wp-super-cache' ); ?></a></li>
[1330] Fix | Delete
<li><a href="<?php echo esc_url( $wpsc_promo_links['videopress'] ); ?>"><?php esc_html_e( 'Fast video hosting (paid)', 'wp-super-cache' ); ?></a></li>
[1331] Fix | Delete
<li><a href="<?php echo esc_url( $wpsc_promo_links['crowdsignal'] ); ?>"><?php esc_html_e( 'Add Surveys and Polls to your site', 'wp-super-cache' ); ?></a></li>
[1332] Fix | Delete
</ul>
[1333] Fix | Delete
<?php endif; ?>
[1334] Fix | Delete
<h4><?php _e( 'Need Help?', 'wp-super-cache' ); ?></h4>
[1335] Fix | Delete
<ol>
[1336] Fix | Delete
<li><?php printf( __( 'Use the <a href="%1$s">Debug tab</a> for diagnostics.', 'wp-super-cache' ), admin_url( 'options-general.php?page=wpsupercache&tab=debug' ) ); ?></li>
[1337] Fix | Delete
<li>
[1338] Fix | Delete
<?php
[1339] Fix | Delete
echo wp_kses_post(
[1340] Fix | Delete
sprintf(
[1341] Fix | Delete
/* translators: %s is the URL for the documentation. */
[1342] Fix | Delete
__( 'Check out the <a href="%s">plugin documentation</a>.', 'wp-super-cache' ),
[1343] Fix | Delete
'https://jetpack.com/support/wp-super-cache/'
[1344] Fix | Delete
)
[1345] Fix | Delete
);
[1346] Fix | Delete
?>
[1347] Fix | Delete
</li>
[1348] Fix | Delete
<li>
[1349] Fix | Delete
<?php
[1350] Fix | Delete
echo wp_kses_post(
[1351] Fix | Delete
sprintf(
[1352] Fix | Delete
/* translators: %1$s is the URL for the support forum. */
[1353] Fix | Delete
__( 'Visit the <a href="%1$s">support forum</a>.', 'wp-super-cache' ),
[1354] Fix | Delete
'https://wordpress.org/support/plugin/wp-super-cache/'
[1355] Fix | Delete
)
[1356] Fix | Delete
);
[1357] Fix | Delete
?>
[1358] Fix | Delete
</li>
[1359] Fix | Delete
<li><?php printf( __( 'Try out the <a href="%1$s">development version</a> for the latest fixes (<a href="%2$s">changelog</a>).', 'wp-super-cache' ), 'https://odd.blog/y/2o', 'https://plugins.trac.wordpress.org/log/wp-super-cache/' ); ?></li>
[1360] Fix | Delete
</ol>
[1361] Fix | Delete
<h4><?php esc_html_e( 'Rate This Plugin', 'wp-super-cache' ); ?></h4>
[1362] Fix | Delete
<p><?php printf( __( 'Please <a href="%s">rate us</a> and give feedback.', 'wp-super-cache' ), 'https://wordpress.org/support/plugin/wp-super-cache/reviews?rate=5#new-post' ); ?></p>
[1363] Fix | Delete
[1364] Fix | Delete
<?php
[1365] Fix | Delete
if ( isset( $wp_supercache_cache_list ) && $wp_supercache_cache_list ) {
[1366] Fix | Delete
$start_date = get_option( 'wpsupercache_start' );
[1367] Fix | Delete
if ( ! $start_date ) {
[1368] Fix | Delete
$start_date = time();
[1369] Fix | Delete
}
[1370] Fix | Delete
?>
[1371] Fix | Delete
<p><?php printf( __( 'Cached pages since %1$s : <strong>%2$s</strong>', 'wp-super-cache' ), date( 'M j, Y', $start_date ), number_format( get_option( 'wpsupercache_count' ) ) ); ?></p>
[1372] Fix | Delete
<p><?php _e( 'Newest Cached Pages:', 'wp-super-cache' ); ?><ol>
[1373] Fix | Delete
<?php
[1374] Fix | Delete
foreach ( array_reverse( (array) get_option( 'supercache_last_cached' ) ) as $url ) {
[1375] Fix | Delete
$since = time() - strtotime( $url['date'] );
[1376] Fix | Delete
echo "<li><a title='" . sprintf( esc_html__( 'Cached %s seconds ago', 'wp-super-cache' ), (int) $since ) . "' href='" . site_url( $url['url'] ) . "'>" . substr( $url['url'], 0, 20 ) . "</a></li>\n";
[1377] Fix | Delete
}
[1378] Fix | Delete
?>
[1379] Fix | Delete
</ol>
[1380] Fix | Delete
<small><?php esc_html_e( '(may not always be accurate on busy sites)', 'wp-super-cache' ); ?></small>
[1381] Fix | Delete
</p><?php
[1382] Fix | Delete
} elseif ( false == get_option( 'wpsupercache_start' ) ) {
[1383] Fix | Delete
update_option( 'wpsupercache_start', time() );
[1384] Fix | Delete
update_option( 'wpsupercache_count', 0 );
[1385] Fix | Delete
}
[1386] Fix | Delete
?>
[1387] Fix | Delete
</div>
[1388] Fix | Delete
</td></table>
[1389] Fix | Delete
</div>
[1390] Fix | Delete
</div>
[1391] Fix | Delete
<?php wpsc_render_footer(); ?>
[1392] Fix | Delete
</div>
[1393] Fix | Delete
<?php
[1394] Fix | Delete
}
[1395] Fix | Delete
[1396] Fix | Delete
function wpsc_plugins_tab() {
[1397] Fix | Delete
echo '<div class="wpsc-card">';
[1398] Fix | Delete
echo '<p>' . esc_html__( 'Cache plugins are PHP scripts you\'ll find in a dedicated folder inside the WP Super Cache folder (wp-super-cache/plugins/). They load at the same time as WP Super Cache, and before regular WordPress plugins.', 'wp-super-cache' ) . '</p>';
[1399] Fix | Delete
echo '<p>' . esc_html__( 'Keep in mind that cache plugins are for advanced users only. To create and manage them, you\'ll need extensive knowledge of both PHP and WordPress actions.', 'wp-super-cache' ) . '</p>';
[1400] Fix | Delete
echo '<p>' . sprintf( __( '<strong>Warning</strong>! Due to the way WordPress upgrades plugins, the ones you upload to the WP Super Cache folder (wp-super-cache/plugins/) will be deleted when you upgrade WP Super Cache. To avoid this loss, load your cache plugins from a different location. When you set <strong>$wp_cache_plugins_dir</strong> to the new location in wp-config.php, WP Super Cache will look there instead. <br />You can find additional details in the <a href="%s">developer documentation</a>.', 'wp-super-cache' ), 'https://odd.blog/wp-super-cache-developers/' ) . '</p>';
[1401] Fix | Delete
echo '</div>';
[1402] Fix | Delete
echo '<div class="wpsc-card">';
[1403] Fix | Delete
ob_start();
[1404] Fix | Delete
if ( defined( 'WP_CACHE' ) ) {
[1405] Fix | Delete
if ( function_exists( 'do_cacheaction' ) ) {
[1406] Fix | Delete
do_cacheaction( 'cache_admin_page' );
[1407] Fix | Delete
}
[1408] Fix | Delete
}
[1409] Fix | Delete
$out = ob_get_contents();
[1410] Fix | Delete
ob_end_clean();
[1411] Fix | Delete
[1412] Fix | Delete
if ( SUBMITDISABLED == ' ' && $out != '' ) {
[1413] Fix | Delete
echo '<h4>' . esc_html__( 'Available Plugins', 'wp-super-cache' ) . '</h4>';
[1414] Fix | Delete
echo '<ol>';
[1415] Fix | Delete
echo $out;
[1416] Fix | Delete
echo '</ol>';
[1417] Fix | Delete
}
[1418] Fix | Delete
echo '</div>';
[1419] Fix | Delete
}
[1420] Fix | Delete
[1421] Fix | Delete
function wpsc_admin_tabs( $current = '' ) {
[1422] Fix | Delete
global $cache_enabled, $super_cache_enabled, $wp_cache_mod_rewrite;
[1423] Fix | Delete
[1424] Fix | Delete
if ( '' === $current ) {
[1425] Fix | Delete
$current = ! empty( $_GET['tab'] ) ? stripslashes( $_GET['tab'] ) : ''; // WPCS: CSRF ok, sanitization ok.
[1426] Fix | Delete
}
[1427] Fix | Delete
[1428] Fix | Delete
$admin_url = admin_url( 'options-general.php?page=wpsupercache' );
[1429] Fix | Delete
$admin_tabs = array(
[1430] Fix | Delete
'easy' => __( 'Easy', 'wp-super-cache' ),
[1431] Fix | Delete
'settings' => __( 'Advanced', 'wp-super-cache' ),
[1432] Fix | Delete
'cdn' => __( 'CDN', 'wp-super-cache' ),
[1433] Fix | Delete
'contents' => __( 'Contents', 'wp-super-cache' ),
[1434] Fix | Delete
'preload' => __( 'Preload', 'wp-super-cache' ),
[1435] Fix | Delete
'plugins' => __( 'Plugins', 'wp-super-cache' ),
[1436] Fix | Delete
'debug' => __( 'Debug', 'wp-super-cache' ),
[1437] Fix | Delete
);
[1438] Fix | Delete
[1439] Fix | Delete
echo '<div class="wpsc-nav-container"><ul class="wpsc-nav">';
[1440] Fix | Delete
[1441] Fix | Delete
foreach ( $admin_tabs as $tab => $name ) {
[1442] Fix | Delete
printf(
[1443] Fix | Delete
'<li class="%s"><a href="%s">%s</a></li>',
[1444] Fix | Delete
esc_attr( $tab === $current ? 'wpsc-nav-tab wpsc-nav-tab-selected' : 'wpsc-nav-tab' ),
[1445] Fix | Delete
esc_url_raw( add_query_arg( 'tab', $tab, $admin_url ) ),
[1446] Fix | Delete
esc_html( $name )
[1447] Fix | Delete
);
[1448] Fix | Delete
}
[1449] Fix | Delete
[1450] Fix | Delete
echo '</ul></div>';
[1451] Fix | Delete
}
[1452] Fix | Delete
[1453] Fix | Delete
function wpsc_restore_settings() {
[1454] Fix | Delete
$admin_url = admin_url( 'options-general.php?page=wpsupercache' );
[1455] Fix | Delete
wpsc_render_partial(
[1456] Fix | Delete
'restore',
[1457] Fix | Delete
compact( 'admin_url' )
[1458] Fix | Delete
);
[1459] Fix | Delete
}
[1460] Fix | Delete
[1461] Fix | Delete
function comment_form_lockdown_message() {
[1462] Fix | Delete
?><p><?php _e( "Comment moderation is enabled. Your comment may take some time to appear.", 'wp-super-cache' ); ?></p><?php
[1463] Fix | Delete
}
[1464] Fix | Delete
if( defined( 'WPLOCKDOWN' ) && constant( 'WPLOCKDOWN' ) )
[1465] Fix | Delete
add_action( 'comment_form', 'comment_form_lockdown_message' );
[1466] Fix | Delete
[1467] Fix | Delete
function wp_update_lock_down() {
[1468] Fix | Delete
global $cache_path, $wp_cache_config_file, $valid_nonce;
[1469] Fix | Delete
[1470] Fix | Delete
if ( isset( $_POST[ 'wp_lock_down' ] ) && $valid_nonce ) {
[1471] Fix | Delete
$wp_lock_down = $_POST[ 'wp_lock_down' ] == '1' ? '1' : '0';
[1472] Fix | Delete
wp_cache_replace_line( '^.*WPLOCKDOWN', "if ( ! defined( 'WPLOCKDOWN' ) ) define( 'WPLOCKDOWN', '$wp_lock_down' );", $wp_cache_config_file );
[1473] Fix | Delete
if ( false == defined( 'WPLOCKDOWN' ) )
[1474] Fix | Delete
define( 'WPLOCKDOWN', $wp_lock_down );
[1475] Fix | Delete
if ( $wp_lock_down == '0' && function_exists( 'prune_super_cache' ) )
[1476] Fix | Delete
prune_super_cache( $cache_path, true ); // clear the cache after lockdown
[1477] Fix | Delete
return $wp_lock_down;
[1478] Fix | Delete
}
[1479] Fix | Delete
if ( defined( 'WPLOCKDOWN' ) )
[1480] Fix | Delete
return constant( 'WPLOCKDOWN' );
[1481] Fix | Delete
else
[1482] Fix | Delete
return 0;
[1483] Fix | Delete
}
[1484] Fix | Delete
[1485] Fix | Delete
function wpsc_update_direct_pages() {
[1486] Fix | Delete
global $cached_direct_pages, $valid_nonce, $cache_path, $wp_cache_config_file;
[1487] Fix | Delete
[1488] Fix | Delete
if ( false == isset( $cached_direct_pages ) )
[1489] Fix | Delete
$cached_direct_pages = array();
[1490] Fix | Delete
$out = '';
[1491] Fix | Delete
if ( $valid_nonce && array_key_exists('direct_pages', $_POST) && is_array( $_POST[ 'direct_pages' ] ) && !empty( $_POST[ 'direct_pages' ] ) ) {
[1492] Fix | Delete
$expiredfiles = array_diff( $cached_direct_pages, $_POST[ 'direct_pages' ] );
[1493] Fix | Delete
unset( $cached_direct_pages );
[1494] Fix | Delete
foreach( $_POST[ 'direct_pages' ] as $page ) {
[1495] Fix | Delete
$page = str_replace( '..', '', preg_replace( '/[ <>\'\"\r\n\t\(\)\$\[\];#]/', '', $page ) );
[1496] Fix | Delete
if ( $page != '' ) {
[1497] Fix | Delete
$cached_direct_pages[] = $page;
[1498] Fix | Delete
$out .= "'$page', ";
[1499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function