Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/lib/Cookiebot_Activated.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ private function set_to_mode_auto_when_no_cookiebot_id_is_set() {
private function set_banner_enabled_by_default() {
$enabled = get_option( 'cookiebot-banner-enabled', 'default' );
$cbid = Cookiebot_WP::get_cbid();

// Set to enabled if it's a fresh install (default)
if ( $enabled === 'default' ) {
$enabled = '1';
update_option( 'cookiebot-banner-enabled', $enabled );
}

// If banner is disabled but CBID is configured, it was disabled by hosting or plugin update. Re-enable it.
if ( $enabled === '0' && ! empty( $cbid ) ) {
update_option( 'cookiebot-banner-enabled', '1' );
Expand Down
4 changes: 2 additions & 2 deletions src/lib/script_loader_tag/Script_Loader_Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function ( $tag ) use ( $handle ) {
public function cookiebot_add_consent_attribute_to_script_tag( $attributes ) {
// First, check if this script requires consent (registered via add_tag)
$handle = $this->extract_handle_from_attributes( $attributes );

if ( $handle && array_key_exists( $handle, $this->tags ) && ! empty( $this->tags[ $handle ] ) ) {
$attributes['type'] = 'text/plain';
$attributes['data-cookieconsent'] = implode( ',', $this->tags[ $handle ] );
Expand Down Expand Up @@ -141,7 +141,7 @@ public function cookiebot_add_consent_attribute_to_inline_script_tag( $attribute

// Check if inline script belongs to a consent-required parent script
$base_handle = $this->extract_base_id_from_inline_id( $attributes['id'] );

if ( $base_handle && array_key_exists( $base_handle, $this->tags ) && ! empty( $this->tags[ $base_handle ] ) ) {
$attributes['type'] = 'text/plain';
$attributes['data-cookieconsent'] = implode( ',', $this->tags[ $base_handle ] );
Expand Down