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/clone/wp-conte.../plugins/advanced.../modules/adblock-.../public
File: public.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/**
[2] Fix | Delete
* Class Advanced_Ads_Adblock_Finder
[3] Fix | Delete
*/
[4] Fix | Delete
class Advanced_Ads_Adblock_Finder {
[5] Fix | Delete
[6] Fix | Delete
/**
[7] Fix | Delete
* Advanced_Ads_Adblock_Finder constructor.
[8] Fix | Delete
*/
[9] Fix | Delete
public function __construct() {
[10] Fix | Delete
add_action( 'wp_footer', [ $this, 'print_adblock_check_js' ], 9 );
[11] Fix | Delete
}
[12] Fix | Delete
[13] Fix | Delete
/**
[14] Fix | Delete
* Print the appropriate script into wp_footer.
[15] Fix | Delete
*
[16] Fix | Delete
* Don't print anything on AMP pages.
[17] Fix | Delete
* Print minimal script if Advanced Ads Pro module "Ads for ad blockers" is active.
[18] Fix | Delete
*/
[19] Fix | Delete
public function print_adblock_check_js() {
[20] Fix | Delete
if ( advads_is_amp() ) {
[21] Fix | Delete
return;
[22] Fix | Delete
}
[23] Fix | Delete
[24] Fix | Delete
$options = Advanced_Ads::get_instance()->options();
[25] Fix | Delete
$minified = ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG;
[26] Fix | Delete
[27] Fix | Delete
// if ad blocker counter is active.
[28] Fix | Delete
if ( ! empty( $options['ga-UID'] ) ) {
[29] Fix | Delete
printf(
[30] Fix | Delete
'<script>(function(){var advanced_ads_ga_UID="%s",advanced_ads_ga_anonymIP=!!%d;%s})();</script>',
[31] Fix | Delete
esc_attr( $options['ga-UID'] ),
[32] Fix | Delete
esc_attr( ! defined( 'ADVANCED_ADS_DISABLE_ANALYTICS_ANONYMIZE_IP' ) || ! ADVANCED_ADS_DISABLE_ANALYTICS_ANONYMIZE_IP ),
[33] Fix | Delete
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped,WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -- escaping could break the script and we're getting the contents of a local file
[34] Fix | Delete
$minified
[35] Fix | Delete
? file_get_contents( __DIR__ . '/ga-adblock-counter.min.js' )
[36] Fix | Delete
: file_get_contents( __DIR__ . '/adblocker-enabled.js' ) . file_get_contents( __DIR__ . '/ga-adblock-counter.js' )
[37] Fix | Delete
// phpcs:enable
[38] Fix | Delete
);
[39] Fix | Delete
} elseif ( defined( 'AAP_SLUG' ) && ! empty( get_option( 'advanced-ads-pro' )['ads-for-adblockers']['enabled'] ) ) {
[40] Fix | Delete
// if Advanced Ads Pro module "Ads for ad blockers" is active but no tracking.
[41] Fix | Delete
printf(
[42] Fix | Delete
'<script>%s</script>',
[43] Fix | Delete
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped,WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -- escaping could break the script and we're getting the contents of a local file
[44] Fix | Delete
file_get_contents( __DIR__ . '/adblocker-enabled' . ( $minified ? '.min' : '' ) . '.js' )
[45] Fix | Delete
);
[46] Fix | Delete
}
[47] Fix | Delete
}
[48] Fix | Delete
}
[49] Fix | Delete
[50] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function