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: domain-mapping.php
<?php
[0] Fix | Delete
[1] Fix | Delete
function domain_mapping_gc_cache( $function, $directory ) {
[2] Fix | Delete
global $cache_path;
[3] Fix | Delete
[4] Fix | Delete
if ( ! function_exists( 'domain_mapping_warning' ) ) {
[5] Fix | Delete
return;
[6] Fix | Delete
}
[7] Fix | Delete
[8] Fix | Delete
$siteurl = domain_mapping_siteurl( false );
[9] Fix | Delete
if ( ! $siteurl ) {
[10] Fix | Delete
return;
[11] Fix | Delete
}
[12] Fix | Delete
[13] Fix | Delete
$sitedir = trailingslashit( preg_replace( '`^(https?:)?//`', '', $siteurl ) );
[14] Fix | Delete
[15] Fix | Delete
if ( 'homepage' === $directory ) {
[16] Fix | Delete
$directory = '';
[17] Fix | Delete
}
[18] Fix | Delete
[19] Fix | Delete
switch ( $function ) {
[20] Fix | Delete
case 'rebuild':
[21] Fix | Delete
wpsc_rebuild_files( $cache_path . 'supercache/' . $sitedir . $directory );
[22] Fix | Delete
break;
[23] Fix | Delete
case 'prune':
[24] Fix | Delete
wpsc_delete_files( $cache_path . 'supercache/' . $sitedir . $directory );
[25] Fix | Delete
break;
[26] Fix | Delete
}
[27] Fix | Delete
}
[28] Fix | Delete
[29] Fix | Delete
function domain_mapping_supercachedir( $dir ) {
[30] Fix | Delete
global $cache_path;
[31] Fix | Delete
[32] Fix | Delete
if ( ! function_exists( 'domain_mapping_warning' ) ) {
[33] Fix | Delete
return $dir;
[34] Fix | Delete
}
[35] Fix | Delete
[36] Fix | Delete
$siteurl = domain_mapping_siteurl( false );
[37] Fix | Delete
if ( ! $siteurl ) {
[38] Fix | Delete
return $dir;
[39] Fix | Delete
}
[40] Fix | Delete
[41] Fix | Delete
$sitedir = trailingslashit( preg_replace( '`^(https?:)?//`', '', $siteurl ) );
[42] Fix | Delete
[43] Fix | Delete
return trailingslashit( $cache_path . 'supercache/' . $sitedir );
[44] Fix | Delete
}
[45] Fix | Delete
[46] Fix | Delete
function domain_mapping_actions() {
[47] Fix | Delete
global $cache_domain_mapping;
[48] Fix | Delete
[49] Fix | Delete
$cache_domain_mapping = (int) $cache_domain_mapping;
[50] Fix | Delete
if ( 1 !== $cache_domain_mapping ) {
[51] Fix | Delete
return;
[52] Fix | Delete
}
[53] Fix | Delete
[54] Fix | Delete
add_filter( 'wp_super_cache_supercachedir', 'domain_mapping_supercachedir' );
[55] Fix | Delete
add_action( 'gc_cache', 'domain_mapping_gc_cache', 10, 2 );
[56] Fix | Delete
}
[57] Fix | Delete
add_cacheaction( 'add_cacheaction', 'domain_mapping_actions' );
[58] Fix | Delete
[59] Fix | Delete
function wp_supercache_domain_mapping_admin() {
[60] Fix | Delete
global $cache_domain_mapping, $wp_cache_config_file, $valid_nonce;
[61] Fix | Delete
[62] Fix | Delete
$requested_state = isset( $_POST['cache_domain_mapping'] ) ? (int) $_POST['cache_domain_mapping'] : null;
[63] Fix | Delete
$cache_domain_mapping = (int) $cache_domain_mapping;
[64] Fix | Delete
[65] Fix | Delete
$changed = false;
[66] Fix | Delete
if ( null !== $requested_state && $valid_nonce ) {
[67] Fix | Delete
$cache_domain_mapping = $requested_state;
[68] Fix | Delete
[69] Fix | Delete
wp_cache_replace_line( '^\s*\$cache_domain_mapping\s*=', '$cache_domain_mapping = ' . intval( $cache_domain_mapping ) . ';', $wp_cache_config_file );
[70] Fix | Delete
$changed = true;
[71] Fix | Delete
}
[72] Fix | Delete
[73] Fix | Delete
$id = 'domain_mapping-section';
[74] Fix | Delete
?>
[75] Fix | Delete
<fieldset id="<?php echo esc_attr( $id ); ?>" class="options">
[76] Fix | Delete
[77] Fix | Delete
<h4><?php esc_html_e( 'Domain Mapping', 'wp-super-cache' ); ?></h4>
[78] Fix | Delete
[79] Fix | Delete
<form name="wp_manager" action="" method="post">
[80] Fix | Delete
<label><input type="radio" name="cache_domain_mapping" value="1" <?php checked( $cache_domain_mapping ); ?>/> <?php esc_html_e( 'Enabled', 'wp-super-cache' ); ?></label>
[81] Fix | Delete
<label><input type="radio" name="cache_domain_mapping" value="0" <?php checked( ! $cache_domain_mapping ); ?>/> <?php esc_html_e( 'Disabled', 'wp-super-cache' ); ?></label>
[82] Fix | Delete
<?php
[83] Fix | Delete
echo '<p>' . __( 'Provides support for <a href="https://wordpress.org/plugins/wordpress-mu-domain-mapping/">Domain Mapping</a> plugin to map multiple domains to a blog.', 'wp-super-cache' ) . '</p>';
[84] Fix | Delete
[85] Fix | Delete
if ( $changed ) {
[86] Fix | Delete
echo '<p><strong>' . sprintf(
[87] Fix | Delete
esc_html__( 'Domain Mapping support is now %s', 'wp-super-cache' ),
[88] Fix | Delete
esc_html( $cache_domain_mapping ? __( 'enabled', 'wp-super-cache' ) : __( 'disabled', 'wp-super-cache' ) )
[89] Fix | Delete
) . '</strong></p>';
[90] Fix | Delete
}
[91] Fix | Delete
[92] Fix | Delete
echo '<div class="submit"><input class="button-primary" ' . SUBMITDISABLED . ' type="submit" value="' . esc_html__( 'Update', 'wp-super-cache' ) . '" /></div>';
[93] Fix | Delete
wp_nonce_field( 'wp-cache' );
[94] Fix | Delete
?>
[95] Fix | Delete
</form>
[96] Fix | Delete
[97] Fix | Delete
</fieldset>
[98] Fix | Delete
<?php
[99] Fix | Delete
}
[100] Fix | Delete
add_cacheaction( 'cache_admin_page', 'wp_supercache_domain_mapping_admin' );
[101] Fix | Delete
[102] Fix | Delete
function wp_supercache_domain_mapping_notice() {
[103] Fix | Delete
global $cache_enabled;
[104] Fix | Delete
[105] Fix | Delete
if ( $cache_enabled ) {
[106] Fix | Delete
echo '<div class="error"><p><strong>' . esc_html__( 'Domain Mapping plugin detected! Please go to the Supercache plugins page and enable the domain mapping helper plugin.', 'wp-super-cache' ) . '</strong></p></div>';
[107] Fix | Delete
}
[108] Fix | Delete
}
[109] Fix | Delete
function wp_supercache_domain_mapping_exists() {
[110] Fix | Delete
global $cache_domain_mapping;
[111] Fix | Delete
[112] Fix | Delete
$cache_domain_mapping = (int) $cache_domain_mapping;
[113] Fix | Delete
if ( 1 === $cache_domain_mapping ) {
[114] Fix | Delete
return;
[115] Fix | Delete
}
[116] Fix | Delete
[117] Fix | Delete
if ( is_admin() && function_exists( 'domain_mapping_warning' ) ) {
[118] Fix | Delete
add_action( 'admin_notices', 'wp_supercache_domain_mapping_notice' );
[119] Fix | Delete
}
[120] Fix | Delete
}
[121] Fix | Delete
[122] Fix | Delete
if ( isset( $_GET['page'] ) && 'wpsupercache' === $_GET['page'] ) {
[123] Fix | Delete
add_cacheaction( 'add_cacheaction', 'wp_supercache_domain_mapping_exists' );
[124] Fix | Delete
}
[125] Fix | Delete
[126] Fix | Delete
function wpsc_domain_mapping_list( $list ) {
[127] Fix | Delete
$list['domain_mapping'] = array(
[128] Fix | Delete
'key' => 'domain_mapping',
[129] Fix | Delete
'url' => 'https://wordpress.org/plugins/wordpress-mu-domain-mapping/',
[130] Fix | Delete
'title' => esc_html__( 'Domain Mapping', 'wp-super-cache' ),
[131] Fix | Delete
'desc' => esc_html__( 'Provides support for Domain Mapping plugin to map multiple domains to a blog.', 'wp-super-cache' ),
[132] Fix | Delete
);
[133] Fix | Delete
return $list;
[134] Fix | Delete
}
[135] Fix | Delete
add_cacheaction( 'wpsc_filter_list', 'wpsc_domain_mapping_list' );
[136] Fix | Delete
[137] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function