Analytics
1 week ago
Elementor
1 week ago
Providers
1 week ago
SBR_GDPR.php
1 week ago
SBRelay.php
1 week ago
SBR_GDPR.php
102 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Namespace SmashBalloon\Reviews\Common\Integrations |
| 5 | */ |
| 6 | |
| 7 | namespace SmashBalloon\Reviews\Common\Integrations; |
| 8 | |
| 9 | /** |
| 10 | * Class to check if the GDPR is enabled |
| 11 | * Hide+Show images/avatars depending on the GDPR settings |
| 12 | */ |
| 13 | class SBR_GDPR |
| 14 | { |
| 15 | public static function doing_gdpr() |
| 16 | { |
| 17 | $settings = get_option('sbr_settings', []); |
| 18 | if (!is_array($settings)) { |
| 19 | $settings = []; |
| 20 | } |
| 21 | |
| 22 | $gdpr = !empty($settings['gdpr']) ? $settings['gdpr'] : 'auto'; |
| 23 | |
| 24 | if ($gdpr === 'auto') { |
| 25 | return self::gdpr_plugins_active() !== false; |
| 26 | } |
| 27 | |
| 28 | return $gdpr === 'yes' ? true : false; |
| 29 | } |
| 30 | |
| 31 | /** |
| 32 | * Check if a GDPR plugin is active |
| 33 | * |
| 34 | * @return string|false |
| 35 | */ |
| 36 | public static function gdpr_plugins_active() |
| 37 | { |
| 38 | // WPConsent by the WPConsent team |
| 39 | if (function_exists('WPConsent')) { |
| 40 | return 'WPConsent by the WPConsent team'; |
| 41 | } |
| 42 | |
| 43 | // Real Cookie Banner by devowl.io |
| 44 | if (defined('RCB_ROOT_SLUG')) { |
| 45 | return 'Real Cookie Banner by devowl.io'; |
| 46 | } |
| 47 | |
| 48 | // GDPR Cookie Compliance by Moove Agency |
| 49 | if (function_exists('gdpr_cookie_is_accepted')) { |
| 50 | return 'GDPR Cookie Compliance by Moove Agency'; |
| 51 | } |
| 52 | |
| 53 | // Cookie Notice by dFactory |
| 54 | if (class_exists('Cookie_Notice')) { |
| 55 | return 'Cookie Notice by dFactory'; |
| 56 | } |
| 57 | |
| 58 | // GDPR Cookie Consent by WebToffee |
| 59 | if ( |
| 60 | function_exists('run_cookie_law_info') |
| 61 | || class_exists('Cookie_Law_Info') |
| 62 | ) { |
| 63 | return 'GDPR Cookie Consent by WebToffee'; |
| 64 | } |
| 65 | |
| 66 | // CookieYes | GDPR Cookie Consent by CookieYes |
| 67 | if (defined('CKY_APP_ASSETS_URL')) { |
| 68 | return 'CookieYes | GDPR Cookie Consent by CookieYes'; |
| 69 | } |
| 70 | |
| 71 | // Cookiebot by Cybot A/S |
| 72 | if (class_exists('Cookiebot_WP')) { |
| 73 | return 'Cookiebot by Cybot A/S'; |
| 74 | } |
| 75 | |
| 76 | // Complianz by Really Simple Plugins |
| 77 | if (class_exists('COMPLIANZ')) { |
| 78 | return 'Complianz by Really Simple Plugins'; |
| 79 | } |
| 80 | |
| 81 | // Borlabs Cookie by Borlabs |
| 82 | if ( |
| 83 | function_exists('BorlabsCookieHelper') |
| 84 | || (defined('BORLABS_COOKIE_VERSION') |
| 85 | && version_compare(BORLABS_COOKIE_VERSION, '3.0', '>=')) |
| 86 | ) { |
| 87 | return 'Borlabs Cookie by Borlabs'; |
| 88 | } |
| 89 | |
| 90 | // SBR Feed Builder |
| 91 | if ( |
| 92 | is_admin() |
| 93 | && !empty($_GET['page']) |
| 94 | && $_GET['page'] === 'sbr' |
| 95 | ) { |
| 96 | return false; |
| 97 | } |
| 98 | |
| 99 | return false; |
| 100 | } |
| 101 | } |
| 102 |