title */ public function get_sections(): array { return [ 'gdpr' => [ 'title' => __( 'GDPR/DSGVO', 'adpresso' ), 'description' => '', 'controlled_by' => 'enable_module_' . $this->get_id(), 'initially_open' => true, ], // 'cookies' => [ // 'title' => __( 'Cookie Handling', 'adpresso' ), // 'description' => '', // 'controlled_by' => '', // 'initially_open' => true, // ], ]; } /** * Define the options for this settings tab. * * @return array */ protected function define_options(): array { $show_premium_upsells = true; if ( adpresso_fs()->is_premium() ) { $show_premium_upsells = false; } $options = [ 'enable_module_' . $this->get_id() => [ 'type' => 'toggle', 'label' => __( 'Enable privacy', 'adpresso' ), 'description' => __( 'Show ads only to users who give their permission to cookies and ads.', 'adpresso' ), 'default' => 0, 'section' => 'gdpr', ], // 'no_cookies' => [ // 'section' => 'cookies', // 'label' => __( 'Prevent cookies at all', 'adpresso' ), // 'description' => __( 'AdPresso won´t set any cookies. This will impact the functionality of the plugin', 'adpresso' ), // 'type' => 'toggle', // 'default' => '0', // ], // 'show_cookie_notices' => [ // 'section' => 'cookies', // 'label' => __( 'Mark cookie or privacy relevant features in AdPresso.', 'adpresso' ), // 'description' => __( 'Features in AdPresso will be marked as privacy relevant and inform you in which whey they affect privacy.', 'adpresso' ), // 'type' => 'toggle', // 'default' => '0', // ], // 'update_profile_button' => [ // 'section' => 'cookies', // 'label' => __( 'Update visitor profile', 'adpresso' ), // 'text' => __( 'Update visitor profile', 'adpresso' ), // 'type' => 'button', // ], // 'update_profile_login' => [ // 'section' => 'cookies', // 'label' => __( 'Update visitor profile when user logs in or out', 'adpresso' ), // 'type' => 'toggle', // 'default' => '0', // ], ]; $options['privacy_consent_method'] = [ 'type' => 'select', 'label' => __( 'Consent method', 'adpresso' ), 'description' => __( 'Chose a method to define consent', 'adpresso' ), 'options' => [ 'automatic' => __( 'Automatic detection (TCF, Plugin mode, cookie)', 'adpresso' ), 'tcf' => __( 'IAB Transparency and Consent Framework (TCF)', 'adpresso' ), 'plugin_mode' => __( 'Borlabs, Complianz, Real Cookie Banner, etc.', 'adpresso' ), 'custom_cookie' => __( 'Cookie', 'adpresso' ), ], 'default' => 'automatic', 'section' => 'gdpr', ]; $options['tcf_personalized_purpose'] = [ 'type' => 'toggle', 'label' => __( 'Allow Non-Personalized Ads (NPA) Fallback', 'adpresso' ), 'description' => __( 'If the user rejects personalized advertising but accepts basic cookies, allow AdPresso to load a non-personalized version of the ad (e.g., Google AdSense NPA) instead of blocking it completely.', 'adpresso' ), 'default' => 1, 'section' => 'gdpr', 'depends_on' => [ [ 'field_id' => 'enable_module_' . $this->get_id(), 'operator' => 'is', 'value' => '1' ], [ 'field_id' => 'privacy_consent_method', 'operator' => 'is_one_of', 'value' => [ 'tcf', 'automatic' ] ], ], 'disable' => $show_premium_upsells, ]; $options['cookie_name'] = [ 'type' => 'text', 'label' => __( 'Cookie name', 'adpresso' ), 'description' => __( 'Name of the cookie to check for consent.', 'adpresso' ), 'default' => 'cookie_consent', 'section' => 'gdpr', 'depends_on' => [ [ 'field_id' => 'enable_module_' . $this->get_id(), 'operator' => 'is', 'value' => '1' ], [ 'field_id' => 'privacy_consent_method', 'operator' => 'is_one_of', 'value' => [ 'custom_cookie' ] ], ], ]; $options['cookie_value'] = [ 'type' => 'text', 'label' => __( 'Cookie value', 'adpresso' ), 'description' => __( 'Value of the cookie to check for consent.', 'adpresso' ), 'default' => 'accepted', 'section' => 'gdpr', 'depends_on' => [ [ 'field_id' => 'enable_module_' . $this->get_id(), 'operator' => 'is', 'value' => '1' ], [ 'field_id' => 'privacy_consent_method', 'operator' => 'is_one_of', 'value' => [ 'custom_cookie' ] ], ], ]; return $options; } }