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.../plugins
File: badbehaviour.php
<?php
[0] Fix | Delete
[1] Fix | Delete
function wp_supercache_badbehaviour( $file ) {
[2] Fix | Delete
global $cache_badbehaviour;
[3] Fix | Delete
[4] Fix | Delete
if ( 1 !== $cache_badbehaviour ) {
[5] Fix | Delete
return $file;
[6] Fix | Delete
}
[7] Fix | Delete
wp_supercache_badbehaviour_include();
[8] Fix | Delete
return $file;
[9] Fix | Delete
}
[10] Fix | Delete
add_cacheaction( 'wp_cache_served_cache_file', 'wp_supercache_badbehaviour' );
[11] Fix | Delete
[12] Fix | Delete
function wp_supercache_badbehaviour_include() {
[13] Fix | Delete
$bbfile = get_bb_file_loc();
[14] Fix | Delete
if ( ! $bbfile ) {
[15] Fix | Delete
require_once $bbfile;
[16] Fix | Delete
}
[17] Fix | Delete
}
[18] Fix | Delete
[19] Fix | Delete
function get_bb_file_loc() {
[20] Fix | Delete
global $cache_badbehaviour_file;
[21] Fix | Delete
if ( $cache_badbehaviour_file ) {
[22] Fix | Delete
return $cache_badbehaviour_file;
[23] Fix | Delete
}
[24] Fix | Delete
[25] Fix | Delete
if ( file_exists( WP_CONTENT_DIR . '/plugins/bad-behavior/bad-behavior-generic.php' ) ) {
[26] Fix | Delete
$bbfile = WP_CONTENT_DIR . '/plugins/bad-behavior/bad-behavior-generic.php';
[27] Fix | Delete
} elseif ( file_exists( WP_CONTENT_DIR . '/plugins/Bad-Behavior/bad-behavior-generic.php' ) ) {
[28] Fix | Delete
$bbfile = WP_CONTENT_DIR . '/plugins/Bad-Behavior/bad-behavior-generic.php';
[29] Fix | Delete
} else {
[30] Fix | Delete
$bbfile = false;
[31] Fix | Delete
}
[32] Fix | Delete
return $bbfile;
[33] Fix | Delete
}
[34] Fix | Delete
[35] Fix | Delete
function wp_supercache_badbehaviour_admin() {
[36] Fix | Delete
global $cache_badbehaviour, $wp_cache_config_file, $valid_nonce;
[37] Fix | Delete
[38] Fix | Delete
$cache_badbehaviour = '' === $cache_badbehaviour ? 0 : $cache_badbehaviour;
[39] Fix | Delete
if ( 'no' === $cache_badbehaviour ) {
[40] Fix | Delete
$cache_badbehaviour = 0;
[41] Fix | Delete
}
[42] Fix | Delete
[43] Fix | Delete
$err = false;
[44] Fix | Delete
[45] Fix | Delete
if ( isset( $_POST['cache_badbehaviour'] ) && $valid_nonce ) {
[46] Fix | Delete
$bbfile = get_bb_file_loc();
[47] Fix | Delete
if ( ! $bbfile ) {
[48] Fix | Delete
$_POST['cache_badbehaviour'] = 0;
[49] Fix | Delete
$err = __( 'Bad Behaviour not found. Please check your install.', 'wp-super-cache' );
[50] Fix | Delete
}
[51] Fix | Delete
if ( $cache_badbehaviour === (int) $_POST['cache_badbehaviour'] ) {
[52] Fix | Delete
$changed = false;
[53] Fix | Delete
} else {
[54] Fix | Delete
$changed = true;
[55] Fix | Delete
}
[56] Fix | Delete
$cache_badbehaviour = (int) $_POST['cache_badbehaviour'];
[57] Fix | Delete
wp_cache_replace_line( '^ *\$cache_compression', "\$cache_compression = 0;", $wp_cache_config_file );
[58] Fix | Delete
wp_cache_replace_line( '^ *\$cache_badbehaviour', "\$cache_badbehaviour = $cache_badbehaviour;", $wp_cache_config_file );
[59] Fix | Delete
wp_cache_replace_line( '^ *\$cache_badbehaviour_file', "\$cache_badbehaviour_file = '$bbfile';", $wp_cache_config_file );
[60] Fix | Delete
$changed = true;
[61] Fix | Delete
}
[62] Fix | Delete
$id = 'badbehavior-section';
[63] Fix | Delete
?>
[64] Fix | Delete
<fieldset id="<?php echo $id; ?>" class="options">
[65] Fix | Delete
<h4><?php _e( 'Bad Behavior', 'wp-super-cache' ); ?></h4>
[66] Fix | Delete
<form name="wp_manager" action="" method="post">
[67] Fix | Delete
<label><input type="radio" name="cache_badbehaviour" value="1" <?php if ( $cache_badbehaviour ) { echo 'checked="checked" '; } ?>/> <?php _e( 'Enabled', 'wp-super-cache' ); ?></label>
[68] Fix | Delete
<label><input type="radio" name="cache_badbehaviour" value="0" <?php if ( ! $cache_badbehaviour ) { echo 'checked="checked" '; } ?>/> <?php _e( 'Disabled', 'wp-super-cache' ); ?></label>
[69] Fix | Delete
<p><?php _e( '', 'wp-super-cache' ); ?></p><?php
[70] Fix | Delete
echo '<p>' . sprintf( __( '(Only WPCache caching supported, disabled compression and requires <a href="http://www.bad-behavior.ioerror.us/">Bad Behavior</a> in "%s/plugins/bad-behavior/") ', 'wp-super-cache' ), WP_CONTENT_DIR ) . '</p>';
[71] Fix | Delete
if ( isset( $changed ) && $changed ) {
[72] Fix | Delete
if ( $cache_badbehaviour ) {
[73] Fix | Delete
$status = __( 'enabled', 'wp-super-cache' );
[74] Fix | Delete
} else {
[75] Fix | Delete
$status = __( 'disable', 'wp-super-cache' );
[76] Fix | Delete
}
[77] Fix | Delete
echo '<p><strong>' . sprintf( __( 'Bad Behavior support is now %s', 'wp-super-cache' ), $status ) . '</strong></p>';
[78] Fix | Delete
}
[79] Fix | Delete
echo '<div class="submit"><input class="button-primary" ' . SUBMITDISABLED . 'type="submit" value="' . __( 'Update', 'wp-super-cache' ) . '" /></div>';
[80] Fix | Delete
wp_nonce_field( 'wp-cache' );
[81] Fix | Delete
?>
[82] Fix | Delete
</form>
[83] Fix | Delete
</fieldset>
[84] Fix | Delete
<?php
[85] Fix | Delete
if ( $err ) {
[86] Fix | Delete
echo '<p><strong>' . __( 'Warning!', 'wp-super-cache' ) . "</strong> $err</p>";
[87] Fix | Delete
}
[88] Fix | Delete
}
[89] Fix | Delete
add_cacheaction( 'cache_admin_page', 'wp_supercache_badbehaviour_admin' );
[90] Fix | Delete
[91] Fix | Delete
function wpsc_badbehaviour_list( $list ) {
[92] Fix | Delete
$list['badbehaviour'] = array(
[93] Fix | Delete
'key' => 'badbehaviour',
[94] Fix | Delete
'url' => 'http://www.bad-behavior.ioerror.us/',
[95] Fix | Delete
'title' => __( 'Bad Behavior', 'wp-super-cache' ),
[96] Fix | Delete
'desc' => sprintf( __( 'Support for Bad Behavior. (Only WPCache caching supported, disabled compression and requires Bad Behavior in "%s/plugins/bad-behavior/") ', 'wp-super-cache' ), WP_CONTENT_DIR ),
[97] Fix | Delete
);
[98] Fix | Delete
return $list;
[99] Fix | Delete
}
[100] Fix | Delete
add_cacheaction( 'wpsc_filter_list', 'wpsc_badbehaviour_list' );
[101] Fix | Delete
[102] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function