PluginProbe ʕ •ᴥ•ʔ
Custom Twitter Feeds – A Tweets Widget or X Feed Widget / 2.8.0
Custom Twitter Feeds – A Tweets Widget or X Feed Widget v2.8.0
2.8.0 2.7.0 2.6.1 2.6.0 1.0 1.0.1 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.2 1.2.1 1.2.10 1.2.11 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3 1.4 1.4.1 1.5 1.5.1 1.6 1.6.1 1.7 1.8 1.8.1 1.8.2 1.8.3 1.8.4 2.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.1 2.1.1 2.1.2 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.5.4 2.5.5 trunk
custom-twitter-feeds / inc / CTF_GDPR_Integrations.php
custom-twitter-feeds / inc Last commit date
Admin 4 weeks ago Builder 4 weeks ago Integrations 4 weeks ago SmashTwitter 4 weeks ago UsageTracking 4 weeks ago V2 4 weeks ago blocks 4 weeks ago CTF_Display_Elements.php 4 weeks ago CTF_Feed.php 4 weeks ago CTF_Feed_Locator.php 4 weeks ago CTF_GDPR_Integrations.php 4 weeks ago CTF_Parse.php 4 weeks ago CTF_Settings.php 4 weeks ago CtfAdmin.php 4 weeks ago CtfCache.php 4 weeks ago CtfFeed.php 4 weeks ago CtfOauthConnect.php 4 weeks ago SB_Twitter_Cron_Updater.php 4 weeks ago admin-hooks.php 4 weeks ago ctf-functions.php 4 weeks ago notices.php 4 weeks ago widget.php 4 weeks ago
CTF_GDPR_Integrations.php
144 lines
1 <?php
2 /**
3 * Class CTF_GDPR_Integrations
4 *
5 * Adds GDPR related workarounds for third-party plugins:
6 * https://wordpress.org/plugins/cookie-law-info/
7 *
8 * @since 1.7/1.12
9 */
10 namespace TwitterFeed;
11
12 if ( ! defined( 'ABSPATH' ) ) {
13 die( '-1' );
14 }
15
16 class CTF_GDPR_Integrations {
17
18 /**
19 * Undoing of Cookie Notice's Twitter Feed related code
20 * needs to be done late.
21 *
22 * @since 1.7/1.12
23 */
24 public static function init() {
25 add_filter( 'wt_cli_third_party_scripts', array( 'TwitterFeed\CTF_GDPR_Integrations', 'undo_script_blocking' ), 11 );
26 add_filter( 'cmplz_known_script_tags', array( 'TwitterFeed\CTF_GDPR_Integrations', 'undo_script_blocking' ), 11 );
27 }
28
29 /**
30 * Prevents changes made to how JavaScript file is added to
31 * pages.
32 *
33 * @param array $return
34 *
35 * @return array
36 *
37 * @since 1.7/1.12
38 */
39 public static function undo_script_blocking( $return ) {
40 $settings = ctf_get_database_settings();
41 if ( ! self::doing_gdpr( $settings ) ) {
42 return $return;
43 } unset( $return['twitter-feed'] );
44
45 remove_filter( 'wt_cli_third_party_scripts', 'wt_cli_twitter_feed_script' );
46 remove_filter( 'cmplz_known_script_tags', 'cmplz_twitter_feed_script' );
47
48 return $return;
49 }
50
51 /**
52 * Whether or not consent plugins that Twitter Feed
53 * is compatible with are active.
54 *
55 * @return bool|string
56 *
57 * @since 1.7/1.12
58 */
59 public static function gdpr_plugins_active() {
60 if ( function_exists( 'WPConsent' ) ) {
61 return 'WPConsent by the WPConsent team';
62 }
63 if ( defined( 'RCB_ROOT_SLUG' ) ) {
64 return 'Real Cookie Banner by devowl.io';
65 }
66 if ( function_exists( 'gdpr_cookie_is_accepted' ) ) {
67 return 'GDPR Cookie Compliance by Moove Agency';
68 }
69 if ( class_exists( 'Cookie_Notice' ) ) {
70 return 'Cookie Notice by dFactory';
71 }
72 if ( function_exists( 'run_cookie_law_info' ) ) {
73 return 'GDPR Cookie Consent by WebToffee';
74 }
75 if ( class_exists( 'Cookiebot_WP' ) ) {
76 return 'Cookiebot by Cybot A/S';
77 }
78 if ( class_exists( 'COMPLIANZ' ) ) {
79 return 'Complianz by Really Simple Plugins';
80 }
81 if (function_exists('BorlabsCookieHelper') || ( defined('BORLABS_COOKIE_VERSION') && version_compare(BORLABS_COOKIE_VERSION, '3.0', '>=') )) {
82 return 'Borlabs Cookie by Borlabs';
83 }
84 if ( is_admin() && ! empty( $_GET['page'] ) && $_GET['page'] === 'ctf-feed-builder' ) {
85 return false;
86 }
87
88 return false;
89 }
90
91 /**
92 * GDPR features can be added automatically, forced enabled,
93 * or forced disabled.
94 *
95 * @param $settings
96 *
97 * @return bool
98 *
99 * @since 1.7/1.12
100 */
101 public static function doing_gdpr( $settings ) {
102 $gdpr = isset( $settings['gdpr'] ) ? $settings['gdpr'] : 'auto';
103 if ( $gdpr === 'no' ) {
104 return false;
105 }
106 if ( $gdpr === 'yes' ) {
107 return true;
108 }
109 return ( self::gdpr_plugins_active() !== false );
110 }
111
112 /**
113 * No tests needed in free version
114 *
115 * @param bool $retest
116 *
117 * @return bool
118 *
119 * @since 1.7/1.12
120 */
121 public static function gdpr_tests_successful( $retest = false ) {
122 return true;
123 }
124
125 /**
126 * No tests needed in free version
127 *
128 * @return array
129 *
130 * @since 1.7/1.12
131 */
132 public static function gdpr_tests_error_message() {
133 return array();
134 }
135
136 public static function statuses() {
137 $statuses_option = get_option( 'ctf_statuses', array() );
138
139 $return = isset( $statuses_option['gdpr'] ) ? $statuses_option['gdpr'] : array();
140 return $return;
141 }
142
143 }
144