: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Class CTF_GDPR_Integrations
* Adds GDPR related workarounds for third-party plugins:
* https://wordpress.org/plugins/cookie-law-info/
if ( ! defined( 'ABSPATH' ) ) {
class CTF_GDPR_Integrations {
* Undoing of Cookie Notice's Twitter Feed related code
public static function init() {
add_filter( 'wt_cli_third_party_scripts', array( 'TwitterFeed\CTF_GDPR_Integrations', 'undo_script_blocking' ), 11 );
add_filter( 'cmplz_known_script_tags', array( 'TwitterFeed\CTF_GDPR_Integrations', 'undo_script_blocking' ), 11 );
* Prevents changes made to how JavaScript file is added to
public static function undo_script_blocking( $return ) {
$settings = ctf_get_database_settings();
if ( ! self::doing_gdpr( $settings ) ) {
} unset( $return['twitter-feed'] );
remove_filter( 'wt_cli_third_party_scripts', 'wt_cli_twitter_feed_script' );
remove_filter( 'cmplz_known_script_tags', 'cmplz_twitter_feed_script' );
* Whether or not consent plugins that Twitter Feed
* is compatible with are active.
public static function gdpr_plugins_active() {
if ( class_exists( 'Cookie_Notice' ) ) {
return 'Cookie Notice by dFactory';
if ( function_exists( 'run_cookie_law_info' ) ) {
return 'GDPR Cookie Consent by WebToffee';
if ( class_exists( 'Cookiebot_WP' ) ) {
return 'Cookiebot by Cybot A/S';
if ( class_exists( 'COMPLIANZ' ) ) {
return 'Complianz by Really Simple Plugins';
if ( function_exists( 'BorlabsCookieHelper' ) ) {
return 'Borlabs Cookie by Borlabs';
* GDPR features can be added automatically, forced enabled,
public static function doing_gdpr( $settings ) {
$gdpr = isset( $settings['gdpr'] ) ? $settings['gdpr'] : 'auto';
return ( self::gdpr_plugins_active() !== false );
* No tests needed in free version
public static function gdpr_tests_successful( $retest = false ) {
* No tests needed in free version
public static function gdpr_tests_error_message() {
public static function statuses() {
$statuses_option = get_option( 'ctf_statuses', array() );
$return = isset( $statuses_option['gdpr'] ) ? $statuses_option['gdpr'] : array();