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: jetpack.php
<?php
[0] Fix | Delete
[1] Fix | Delete
if ( ! class_exists( 'Automattic\Jetpack\Device_Detection' ) ) {
[2] Fix | Delete
// Manually load Device_Detection before autoload is initialized.
[3] Fix | Delete
if ( defined( 'WPCACHEHOME' ) ) {
[4] Fix | Delete
if ( file_exists( WPCACHEHOME . '/vendor/automattic/jetpack-device-detection/src/class-device-detection.php' ) ) {
[5] Fix | Delete
require_once WPCACHEHOME . '/vendor/automattic/jetpack-device-detection/src/class-device-detection.php';
[6] Fix | Delete
}
[7] Fix | Delete
}
[8] Fix | Delete
}
[9] Fix | Delete
[10] Fix | Delete
function wp_super_cache_jetpack_admin() {
[11] Fix | Delete
global $cache_jetpack, $wp_cache_config_file, $valid_nonce;
[12] Fix | Delete
[13] Fix | Delete
$cache_jetpack = '' === $cache_jetpack ? '0' : $cache_jetpack;
[14] Fix | Delete
[15] Fix | Delete
if ( isset( $_POST['cache_jetpack'] ) && $valid_nonce ) {
[16] Fix | Delete
if ( $cache_jetpack === (int) $_POST['cache_jetpack'] ) {
[17] Fix | Delete
$changed = false;
[18] Fix | Delete
} else {
[19] Fix | Delete
$changed = true;
[20] Fix | Delete
}
[21] Fix | Delete
$cache_jetpack = (int) $_POST['cache_jetpack'];
[22] Fix | Delete
wp_cache_replace_line( '^ *\$cache_jetpack', "\$cache_jetpack = '$cache_jetpack';", $wp_cache_config_file );
[23] Fix | Delete
if ( $changed && $cache_jetpack ) {
[24] Fix | Delete
wp_cache_replace_line( '^ *\$wp_cache_mobile_enabled', '$wp_cache_mobile_enabled = 1;', $wp_cache_config_file );
[25] Fix | Delete
wp_cache_replace_line( '^ *\$wp_cache_mod_rewrite', '$wp_cache_mod_rewrite = 0;', $wp_cache_config_file );
[26] Fix | Delete
wp_cache_replace_line( '^ *\$super_cache_enabled', '$super_cache_enabled = 1;', $wp_cache_config_file );
[27] Fix | Delete
}
[28] Fix | Delete
}
[29] Fix | Delete
$id = 'jetpack-section';
[30] Fix | Delete
?>
[31] Fix | Delete
<fieldset id="<?php echo $id; ?>" class="options">
[32] Fix | Delete
<h4><?php _e( 'Jetpack Mobile Theme', 'wp-super-cache' ); ?></h4>
[33] Fix | Delete
<?php
[34] Fix | Delete
if ( false === file_exists( dirname( WPCACHEHOME ) . '/jetpack/class.jetpack-user-agent.php' ) ) {
[35] Fix | Delete
echo '<strong>' . sprintf( __( 'Jetpack not found in %s. Install it and enable the mobile theme and this helper plugin to cache visits by mobile visitors.', 'wp-super-cache' ), dirname( WPCACHEHOME ) ) . '</strong>';
[36] Fix | Delete
} else {
[37] Fix | Delete
?>
[38] Fix | Delete
<form name="wp_manager" action="" method="post">
[39] Fix | Delete
<label><input type="radio" name="cache_jetpack" value="1" <?php if ( $cache_jetpack ) { echo 'checked="checked" '; } ?>/> <?php _e( 'Enabled', 'wp-super-cache' ); ?></label>
[40] Fix | Delete
<label><input type="radio" name="cache_jetpack" value="0" <?php if ( ! $cache_jetpack ) { echo 'checked="checked" '; } ?>/> <?php _e( 'Disabled', 'wp-super-cache' ); ?></label>
[41] Fix | Delete
<?php
[42] Fix | Delete
echo '<p>' . __( 'Provides support for the <a href="https://wordpress.org/plugins/jetpack/">Jetpack</a> mobile theme and plugin. PHP caching mode and mobile support will be enabled too.', 'wp-super-cache' ) . '</p>';
[43] Fix | Delete
if ( isset( $changed ) && $changed ) {
[44] Fix | Delete
if ( $cache_jetpack ) {
[45] Fix | Delete
$status = __( 'enabled', 'wp-super-cache' );
[46] Fix | Delete
} else {
[47] Fix | Delete
$status = __( 'disabled', 'wp-super-cache' );
[48] Fix | Delete
}
[49] Fix | Delete
echo '<p><strong>' . sprintf( __( 'Jetpack Mobile Theme support is now %s', 'wp-super-cache' ), $status ) . '</strong></p>';
[50] Fix | Delete
}
[51] Fix | Delete
echo '<div class="submit"><input class="button-primary" ' . SUBMITDISABLED . 'type="submit" value="' . __( 'Update', 'wp-super-cache' ) . '" /></div>';
[52] Fix | Delete
wp_nonce_field( 'wp-cache' );
[53] Fix | Delete
?>
[54] Fix | Delete
</form>
[55] Fix | Delete
<?php } ?>
[56] Fix | Delete
</fieldset>
[57] Fix | Delete
<?php
[58] Fix | Delete
}
[59] Fix | Delete
add_cacheaction( 'cache_admin_page', 'wp_super_cache_jetpack_admin' );
[60] Fix | Delete
[61] Fix | Delete
function wp_super_cache_jetpack_cookie_check( $cache_key ) {
[62] Fix | Delete
if ( isset ( $_COOKIE['akm_mobile'] ) ) {
[63] Fix | Delete
if ( $_COOKIE['akm_mobile'] == 'true' ) {
[64] Fix | Delete
return 'mobile';
[65] Fix | Delete
} elseif ( $_COOKIE['akm_mobile'] == 'false' ) {
[66] Fix | Delete
return 'normal';
[67] Fix | Delete
}
[68] Fix | Delete
}
[69] Fix | Delete
[70] Fix | Delete
if ( ! class_exists( 'Automattic\Jetpack\Device_Detection' ) ) {
[71] Fix | Delete
return 'normal';
[72] Fix | Delete
}
[73] Fix | Delete
[74] Fix | Delete
if ( \Automattic\Jetpack\Device_Detection::is_phone() ) {
[75] Fix | Delete
return 'mobile';
[76] Fix | Delete
} else {
[77] Fix | Delete
return 'normal';
[78] Fix | Delete
}
[79] Fix | Delete
}
[80] Fix | Delete
[81] Fix | Delete
if ( isset( $cache_jetpack ) && '1' === $cache_jetpack ) {
[82] Fix | Delete
add_cacheaction( 'wp_cache_check_mobile', 'wp_super_cache_jetpack_cookie_check' );
[83] Fix | Delete
}
[84] Fix | Delete
[85] Fix | Delete
function wpsc_cache_jetpack_list( $list ) {
[86] Fix | Delete
$list['jetpack'] = array(
[87] Fix | Delete
'key' => 'jetpack',
[88] Fix | Delete
'url' => 'https://wordpress.org/plugins/jetpack/',
[89] Fix | Delete
'title' => __( 'Jetpack Mobile Theme', 'wp-super-cache' ),
[90] Fix | Delete
'desc' => __( 'Provides support for the Jetpack mobile theme and plugin. PHP caching mode and mobile support will be enabled too.', 'wp-super-cache' ),
[91] Fix | Delete
);
[92] Fix | Delete
return $list;
[93] Fix | Delete
}
[94] Fix | Delete
add_cacheaction( 'wpsc_filter_list', 'wpsc_cache_jetpack_list' );
[95] Fix | Delete
[96] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function