Plugin Directory

Changeset 3209495


Ignore:
Timestamp:
12/17/2024 09:15:28 PM (16 months ago)
Author:
christophrado
Message:

1.6.3 release

Location:
cookie-notice-consent
Files:
7 edited
19 copied

Legend:

Unmodified
Added
Removed
  • cookie-notice-consent/tags/1.6.3/cookie-notice-consent.php

    r3062530 r3209495  
    44 * Plugin Name:     Cookie Notice & Consent
    55 * Description:     Display a cookie notice, collect consent for different categories and output scripts if consent is given.
    6  * Version:         1.6.2
     6 * Version:         1.6.3
    77 * Author:          Christoph Rado
    88 * Author URI:      https://christophrado.de/
    9  * Tested up to:    6.5
     9 * Tested up to:    6.7
    1010 */
    1111
     
    2626     * Current plugin version
    2727     */
    28     private $version = '1.6.2';
     28    private $version = '1.6.3';
    2929   
    3030    /**
  • cookie-notice-consent/tags/1.6.3/includes/class-cnc-admin.php

    r3062530 r3209495  
    1515    public function __construct( $instance ) {
    1616        $this->cnc = $instance;
    17         // Add actions in init, since settings need to be loaded earlier
    18         add_action( 'init', array( $this, 'init_consent_actions' ) );
     17        add_action( 'init', array( $this, 'init_consent_actions' ), 150 );
    1918    }
    2019   
  • cookie-notice-consent/tags/1.6.3/includes/class-cnc-embeds.php

    r3062530 r3209495  
    1515    public function __construct( $instance ) {
    1616        $this->cnc = $instance;
    17         // Add actions in init, since settings need to be loaded earlier
    18         add_action( 'init', array( $this, 'init_embed_block' ) );
     17        add_action( 'init', array( $this, 'init_embed_block' ), 150 );
    1918    }
    2019   
  • cookie-notice-consent/tags/1.6.3/includes/class-cnc-front.php

    r3062530 r3209495  
    1515    public function __construct( $instance ) {
    1616        $this->cnc = $instance;
    17         // Add actions in init, since settings need to be loaded earlier
    18         add_action( 'init', array( $this, 'init_front' ) );
     17        add_action( 'init', array( $this, 'init_front' ), 150 );
    1918    }
    2019   
     
    2827        add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_cookie_notice_consent_styles' ) );
    2928        add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_cookie_notice_consent_scripts' ) );
    30         // Only print notice and category code if no privacy signal was sent
    31         if( ! $this->privacy_signal_detected() ) {
    32             add_action( 'wp_footer', array( $this, 'print_cookie_notice' ), 1000 );
    33             $this->maybe_print_category_code();
    34         }
    35     }
    36    
    37     /**
    38      * Check if client sent a privacy default and CNC should respect it
    39      */
    40     public function privacy_signal_detected() {
    41         // Do Not Track
    42         if( $this->cnc->settings->get_option( 'general_settings', 'respect_dnt' ) ) {
    43             return ( isset( $_SERVER['HTTP_DNT'] ) && $_SERVER['HTTP_DNT'] === '1' );
    44         }
    45         // Global Privacy Control
    46         if( $this->cnc->settings->get_option( 'general_settings', 'respect_dnt' ) ) {
    47             return ( isset( $_SERVER['HTTP_SEC_GPC'] ) && $_SERVER['HTTP_SEC_GPC'] === '1' );
    48         }
    49         return false;
     29        add_action( 'wp_footer', array( $this, 'print_cookie_notice' ), 1000 );
     30        $this->maybe_print_category_code();
    5031    }
    5132   
     
    135116                'ajax_url'          => admin_url( 'admin-ajax.php' ),
    136117                'ajax_nonce'        => wp_create_nonce( 'cookie_notice_consent' ),
    137                 'remote_addr'       => filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP ),
    138                 'http_user_agent'   => $_SERVER['HTTP_USER_AGENT'],
     118                'remote_addr'       => isset( $_SERVER['REMOTE_ADDR'] ) ? filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP ) : '',
     119                'http_user_agent'   => isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '',
    139120            ) );
    140121        }
     
    169150            return $classes;
    170151        $classes[] = $this->cnc->helper->is_cookie_consent_set() ? 'cookie-consent-set' : 'cookie-consent-not-set';
    171         if( $this->privacy_signal_detected() )
    172             $classes[] = 'privacy-signal';
    173152        return $classes;
    174153    }
  • cookie-notice-consent/tags/1.6.3/includes/class-cnc-logger.php

    r3062530 r3209495  
    1515    public function __construct( $instance ) {
    1616        $this->cnc = $instance;
    17         // Add actions in init, since settings need to be loaded earlier
    18         add_action( 'init', array( $this, 'init_logger' ), 50 );
     17        add_action( 'init', array( $this, 'init_logger' ), 150 );
    1918    }
    2019   
     
    3332    public function add_actions() {
    3433        // Register consent log CPT
    35         add_action( 'init', array( $this, 'register_cpt' ), 51 );
     34        add_action( 'init', array( $this, 'register_cpt' ), 151 );
    3635        // Add admin actions
    3736        add_action( 'admin_init', array( $this, 'manage_admin_views' ) );
  • cookie-notice-consent/tags/1.6.3/includes/class-cnc-settings.php

    r3062530 r3209495  
    1919       
    2020        $this->cnc = $instance;
     21       
     22        // Load options late to allow for get_option filtering by other plugins (WPML / Polylang)
     23        add_action( 'init', array( $this, 'load_options' ), 75 );
     24       
     25        // Initialize settings in admin
     26        add_action( 'admin_init', array( $this, 'init_settings' ) );
     27       
     28    }
     29   
     30    /**
     31     * Load the database options
     32     */
     33    public function load_options() {
    2134        $this->option_groups = $this->cnc->helper->get_option_groups();
    2235        $this->defaults = $this->get_default_options();
    2336       
    24         // Load options late to allow for get_option filtering by other plugins (WPML / Polylang)
    25         add_action( 'plugins_loaded', array( $this, 'load_options' ), 15 );
    26        
    27         // Initialize settings in admin
    28         add_action( 'admin_init', array( $this, 'init_settings' ) );
    29        
    30     }
    31    
    32     /**
    33      * Load the database options
    34      */
    35     public function load_options() {
    3637        foreach( $this->option_groups as $slug => $title ) {
    3738            $this->options[$slug] = get_option( "cookie_notice_consent_$slug" );
     
    5253                'revoke_consent_button_label' => __( 'Revoke consent', 'cookie-notice-consent' ),
    5354                'block_embeds' => '0',
    54                 'respect_dnt' => '0',
    55                 'respect_gpc' => '0'
    5655            ),
    5756            'design_settings' => array(
     
    208207            'cookie_notice_consent_general_settings_group',
    209208            'section_general_notice'
    210         );
    211        
    212         add_settings_section(
    213             'section_general_privacy',
    214             __( 'Privacy Settings', 'cookie-notice-consent' ),
    215             array( $this, 'cb_settings_section_general_privacy_settings' ),
    216             'cookie_notice_consent_general_settings_group'
    217         );
    218        
    219         add_settings_field(
    220             'respect_dnt',
    221             __( 'Respect DNT', 'cookie-notice-consent' ),
    222             array( $this, 'cb_setting_respect_dnt' ),
    223             'cookie_notice_consent_general_settings_group',
    224             'section_general_privacy'
    225         );
    226        
    227         add_settings_field(
    228             'respect_gpc',
    229             __( 'Respect GPC', 'cookie-notice-consent' ),
    230             array( $this, 'cb_setting_respect_gpc' ),
    231             'cookie_notice_consent_general_settings_group',
    232             'section_general_privacy'
    233209        );
    234210       
     
    456432    }
    457433   
    458     public function cb_settings_section_general_privacy_settings() {
    459         echo '<p>' . __( 'Manage general privacy settings.', 'cookie-notice-consent' ) . '</p>';
    460     }
    461    
    462     public function cb_setting_respect_dnt() {
    463         $this->render_settings_field_checkbox(
    464             'general_settings',
    465             'respect_dnt',
    466             __( 'Respect the Do Not Track (DNT) signal that the visitor might send', 'cookie-notice-consent' ),
    467             __( 'If the client sends the corresponding request, the consent banner will not be output at all.', 'cookie-notice-consent' )
    468         );
    469     }
    470    
    471     public function cb_setting_respect_gpc() {
    472         $this->render_settings_field_checkbox(
    473             'general_settings',
    474             'respect_gpc',
    475             __( 'Respect the Global Privacy Control (GPC) signal that the visitor might send', 'cookie-notice-consent' ),
    476             __( 'If the client sends the corresponding request, the consent banner will not be output at all.', 'cookie-notice-consent' )
    477         );
    478     }
    479    
    480434    public function cb_settings_section_general_embeds_settings() {
    481435        echo '<p>' . __( 'Manage settings for automatic oEmbed blocking.', 'cookie-notice-consent' ) . '</p>';
  • cookie-notice-consent/tags/1.6.3/readme.txt

    r3062530 r3209495  
    44Tags: cookie, consent, compliance, gdpr, dsgvo
    55Requires at least: 5.0
    6 Tested up to: 6.5
    7 Stable tag: 1.6.2
     6Tested up to: 6.7
     7Stable tag: 1.6.3
    88Requires PHP: 5.6
    99License: GPLv3
     
    7676
    7777== Changelog ==
     78
     79= 1.6.3 =
     80* Fixed: Translation loading (_load_textdomain_just_in_time error)
     81* Removed: Privacy Signal logic, since browser support is now pretty much dead
     82* Tested up to 6.7
    7883
    7984= 1.6.2 =
  • cookie-notice-consent/trunk/cookie-notice-consent.php

    r3062530 r3209495  
    44 * Plugin Name:     Cookie Notice & Consent
    55 * Description:     Display a cookie notice, collect consent for different categories and output scripts if consent is given.
    6  * Version:         1.6.2
     6 * Version:         1.6.3
    77 * Author:          Christoph Rado
    88 * Author URI:      https://christophrado.de/
    9  * Tested up to:    6.5
     9 * Tested up to:    6.7
    1010 */
    1111
     
    2626     * Current plugin version
    2727     */
    28     private $version = '1.6.2';
     28    private $version = '1.6.3';
    2929   
    3030    /**
  • cookie-notice-consent/trunk/includes/class-cnc-admin.php

    r3062530 r3209495  
    1515    public function __construct( $instance ) {
    1616        $this->cnc = $instance;
    17         // Add actions in init, since settings need to be loaded earlier
    18         add_action( 'init', array( $this, 'init_consent_actions' ) );
     17        add_action( 'init', array( $this, 'init_consent_actions' ), 150 );
    1918    }
    2019   
  • cookie-notice-consent/trunk/includes/class-cnc-embeds.php

    r3062530 r3209495  
    1515    public function __construct( $instance ) {
    1616        $this->cnc = $instance;
    17         // Add actions in init, since settings need to be loaded earlier
    18         add_action( 'init', array( $this, 'init_embed_block' ) );
     17        add_action( 'init', array( $this, 'init_embed_block' ), 150 );
    1918    }
    2019   
  • cookie-notice-consent/trunk/includes/class-cnc-front.php

    r3062530 r3209495  
    1515    public function __construct( $instance ) {
    1616        $this->cnc = $instance;
    17         // Add actions in init, since settings need to be loaded earlier
    18         add_action( 'init', array( $this, 'init_front' ) );
     17        add_action( 'init', array( $this, 'init_front' ), 150 );
    1918    }
    2019   
     
    2827        add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_cookie_notice_consent_styles' ) );
    2928        add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_cookie_notice_consent_scripts' ) );
    30         // Only print notice and category code if no privacy signal was sent
    31         if( ! $this->privacy_signal_detected() ) {
    32             add_action( 'wp_footer', array( $this, 'print_cookie_notice' ), 1000 );
    33             $this->maybe_print_category_code();
    34         }
    35     }
    36    
    37     /**
    38      * Check if client sent a privacy default and CNC should respect it
    39      */
    40     public function privacy_signal_detected() {
    41         // Do Not Track
    42         if( $this->cnc->settings->get_option( 'general_settings', 'respect_dnt' ) ) {
    43             return ( isset( $_SERVER['HTTP_DNT'] ) && $_SERVER['HTTP_DNT'] === '1' );
    44         }
    45         // Global Privacy Control
    46         if( $this->cnc->settings->get_option( 'general_settings', 'respect_dnt' ) ) {
    47             return ( isset( $_SERVER['HTTP_SEC_GPC'] ) && $_SERVER['HTTP_SEC_GPC'] === '1' );
    48         }
    49         return false;
     29        add_action( 'wp_footer', array( $this, 'print_cookie_notice' ), 1000 );
     30        $this->maybe_print_category_code();
    5031    }
    5132   
     
    135116                'ajax_url'          => admin_url( 'admin-ajax.php' ),
    136117                'ajax_nonce'        => wp_create_nonce( 'cookie_notice_consent' ),
    137                 'remote_addr'       => filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP ),
    138                 'http_user_agent'   => $_SERVER['HTTP_USER_AGENT'],
     118                'remote_addr'       => isset( $_SERVER['REMOTE_ADDR'] ) ? filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP ) : '',
     119                'http_user_agent'   => isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '',
    139120            ) );
    140121        }
     
    169150            return $classes;
    170151        $classes[] = $this->cnc->helper->is_cookie_consent_set() ? 'cookie-consent-set' : 'cookie-consent-not-set';
    171         if( $this->privacy_signal_detected() )
    172             $classes[] = 'privacy-signal';
    173152        return $classes;
    174153    }
  • cookie-notice-consent/trunk/includes/class-cnc-logger.php

    r3062530 r3209495  
    1515    public function __construct( $instance ) {
    1616        $this->cnc = $instance;
    17         // Add actions in init, since settings need to be loaded earlier
    18         add_action( 'init', array( $this, 'init_logger' ), 50 );
     17        add_action( 'init', array( $this, 'init_logger' ), 150 );
    1918    }
    2019   
     
    3332    public function add_actions() {
    3433        // Register consent log CPT
    35         add_action( 'init', array( $this, 'register_cpt' ), 51 );
     34        add_action( 'init', array( $this, 'register_cpt' ), 151 );
    3635        // Add admin actions
    3736        add_action( 'admin_init', array( $this, 'manage_admin_views' ) );
  • cookie-notice-consent/trunk/includes/class-cnc-settings.php

    r3062530 r3209495  
    1919       
    2020        $this->cnc = $instance;
     21       
     22        // Load options late to allow for get_option filtering by other plugins (WPML / Polylang)
     23        add_action( 'init', array( $this, 'load_options' ), 75 );
     24       
     25        // Initialize settings in admin
     26        add_action( 'admin_init', array( $this, 'init_settings' ) );
     27       
     28    }
     29   
     30    /**
     31     * Load the database options
     32     */
     33    public function load_options() {
    2134        $this->option_groups = $this->cnc->helper->get_option_groups();
    2235        $this->defaults = $this->get_default_options();
    2336       
    24         // Load options late to allow for get_option filtering by other plugins (WPML / Polylang)
    25         add_action( 'plugins_loaded', array( $this, 'load_options' ), 15 );
    26        
    27         // Initialize settings in admin
    28         add_action( 'admin_init', array( $this, 'init_settings' ) );
    29        
    30     }
    31    
    32     /**
    33      * Load the database options
    34      */
    35     public function load_options() {
    3637        foreach( $this->option_groups as $slug => $title ) {
    3738            $this->options[$slug] = get_option( "cookie_notice_consent_$slug" );
     
    5253                'revoke_consent_button_label' => __( 'Revoke consent', 'cookie-notice-consent' ),
    5354                'block_embeds' => '0',
    54                 'respect_dnt' => '0',
    55                 'respect_gpc' => '0'
    5655            ),
    5756            'design_settings' => array(
     
    208207            'cookie_notice_consent_general_settings_group',
    209208            'section_general_notice'
    210         );
    211        
    212         add_settings_section(
    213             'section_general_privacy',
    214             __( 'Privacy Settings', 'cookie-notice-consent' ),
    215             array( $this, 'cb_settings_section_general_privacy_settings' ),
    216             'cookie_notice_consent_general_settings_group'
    217         );
    218        
    219         add_settings_field(
    220             'respect_dnt',
    221             __( 'Respect DNT', 'cookie-notice-consent' ),
    222             array( $this, 'cb_setting_respect_dnt' ),
    223             'cookie_notice_consent_general_settings_group',
    224             'section_general_privacy'
    225         );
    226        
    227         add_settings_field(
    228             'respect_gpc',
    229             __( 'Respect GPC', 'cookie-notice-consent' ),
    230             array( $this, 'cb_setting_respect_gpc' ),
    231             'cookie_notice_consent_general_settings_group',
    232             'section_general_privacy'
    233209        );
    234210       
     
    456432    }
    457433   
    458     public function cb_settings_section_general_privacy_settings() {
    459         echo '<p>' . __( 'Manage general privacy settings.', 'cookie-notice-consent' ) . '</p>';
    460     }
    461    
    462     public function cb_setting_respect_dnt() {
    463         $this->render_settings_field_checkbox(
    464             'general_settings',
    465             'respect_dnt',
    466             __( 'Respect the Do Not Track (DNT) signal that the visitor might send', 'cookie-notice-consent' ),
    467             __( 'If the client sends the corresponding request, the consent banner will not be output at all.', 'cookie-notice-consent' )
    468         );
    469     }
    470    
    471     public function cb_setting_respect_gpc() {
    472         $this->render_settings_field_checkbox(
    473             'general_settings',
    474             'respect_gpc',
    475             __( 'Respect the Global Privacy Control (GPC) signal that the visitor might send', 'cookie-notice-consent' ),
    476             __( 'If the client sends the corresponding request, the consent banner will not be output at all.', 'cookie-notice-consent' )
    477         );
    478     }
    479    
    480434    public function cb_settings_section_general_embeds_settings() {
    481435        echo '<p>' . __( 'Manage settings for automatic oEmbed blocking.', 'cookie-notice-consent' ) . '</p>';
  • cookie-notice-consent/trunk/readme.txt

    r3062530 r3209495  
    44Tags: cookie, consent, compliance, gdpr, dsgvo
    55Requires at least: 5.0
    6 Tested up to: 6.5
    7 Stable tag: 1.6.2
     6Tested up to: 6.7
     7Stable tag: 1.6.3
    88Requires PHP: 5.6
    99License: GPLv3
     
    7676
    7777== Changelog ==
     78
     79= 1.6.3 =
     80* Fixed: Translation loading (_load_textdomain_just_in_time error)
     81* Removed: Privacy Signal logic, since browser support is now pretty much dead
     82* Tested up to 6.7
    7883
    7984= 1.6.2 =
Note: See TracChangeset for help on using the changeset viewer.