Changeset 3209495
- Timestamp:
- 12/17/2024 09:15:28 PM (16 months ago)
- Location:
- cookie-notice-consent
- Files:
-
- 7 edited
- 19 copied
-
tags/1.6.3 (copied) (copied from cookie-notice-consent/trunk)
-
tags/1.6.3/cookie-notice-consent.php (copied) (copied from cookie-notice-consent/trunk/cookie-notice-consent.php) (2 diffs)
-
tags/1.6.3/css/admin.css (copied) (copied from cookie-notice-consent/trunk/css/admin.css)
-
tags/1.6.3/css/front-theme-labs.min.css (copied) (copied from cookie-notice-consent/trunk/css/front-theme-labs.min.css)
-
tags/1.6.3/css/front-theme-lowkey.min.css (copied) (copied from cookie-notice-consent/trunk/css/front-theme-lowkey.min.css)
-
tags/1.6.3/css/front-theme-sidecar.min.css (copied) (copied from cookie-notice-consent/trunk/css/front-theme-sidecar.min.css)
-
tags/1.6.3/css/front.css (copied) (copied from cookie-notice-consent/trunk/css/front.css)
-
tags/1.6.3/css/front.min.css (copied) (copied from cookie-notice-consent/trunk/css/front.min.css)
-
tags/1.6.3/includes/class-cnc-admin.php (copied) (copied from cookie-notice-consent/trunk/includes/class-cnc-admin.php) (1 diff)
-
tags/1.6.3/includes/class-cnc-embeds.php (copied) (copied from cookie-notice-consent/trunk/includes/class-cnc-embeds.php) (1 diff)
-
tags/1.6.3/includes/class-cnc-front.php (copied) (copied from cookie-notice-consent/trunk/includes/class-cnc-front.php) (4 diffs)
-
tags/1.6.3/includes/class-cnc-helper.php (copied) (copied from cookie-notice-consent/trunk/includes/class-cnc-helper.php)
-
tags/1.6.3/includes/class-cnc-logger.php (copied) (copied from cookie-notice-consent/trunk/includes/class-cnc-logger.php) (2 diffs)
-
tags/1.6.3/includes/class-cnc-settings.php (copied) (copied from cookie-notice-consent/trunk/includes/class-cnc-settings.php) (4 diffs)
-
tags/1.6.3/includes/class-cnc-shortcodes.php (copied) (copied from cookie-notice-consent/trunk/includes/class-cnc-shortcodes.php)
-
tags/1.6.3/js/front.js (copied) (copied from cookie-notice-consent/trunk/js/front.js)
-
tags/1.6.3/js/front.min.js (copied) (copied from cookie-notice-consent/trunk/js/front.min.js)
-
tags/1.6.3/readme.txt (copied) (copied from cookie-notice-consent/trunk/readme.txt) (2 diffs)
-
tags/1.6.3/wpml-config.xml (copied) (copied from cookie-notice-consent/trunk/wpml-config.xml)
-
trunk/cookie-notice-consent.php (modified) (2 diffs)
-
trunk/includes/class-cnc-admin.php (modified) (1 diff)
-
trunk/includes/class-cnc-embeds.php (modified) (1 diff)
-
trunk/includes/class-cnc-front.php (modified) (4 diffs)
-
trunk/includes/class-cnc-logger.php (modified) (2 diffs)
-
trunk/includes/class-cnc-settings.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cookie-notice-consent/tags/1.6.3/cookie-notice-consent.php
r3062530 r3209495 4 4 * Plugin Name: Cookie Notice & Consent 5 5 * Description: Display a cookie notice, collect consent for different categories and output scripts if consent is given. 6 * Version: 1.6. 26 * Version: 1.6.3 7 7 * Author: Christoph Rado 8 8 * Author URI: https://christophrado.de/ 9 * Tested up to: 6. 59 * Tested up to: 6.7 10 10 */ 11 11 … … 26 26 * Current plugin version 27 27 */ 28 private $version = '1.6. 2';28 private $version = '1.6.3'; 29 29 30 30 /** -
cookie-notice-consent/tags/1.6.3/includes/class-cnc-admin.php
r3062530 r3209495 15 15 public function __construct( $instance ) { 16 16 $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 ); 19 18 } 20 19 -
cookie-notice-consent/tags/1.6.3/includes/class-cnc-embeds.php
r3062530 r3209495 15 15 public function __construct( $instance ) { 16 16 $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 ); 19 18 } 20 19 -
cookie-notice-consent/tags/1.6.3/includes/class-cnc-front.php
r3062530 r3209495 15 15 public function __construct( $instance ) { 16 16 $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 ); 19 18 } 20 19 … … 28 27 add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_cookie_notice_consent_styles' ) ); 29 28 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(); 50 31 } 51 32 … … 135 116 'ajax_url' => admin_url( 'admin-ajax.php' ), 136 117 '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'] : '', 139 120 ) ); 140 121 } … … 169 150 return $classes; 170 151 $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';173 152 return $classes; 174 153 } -
cookie-notice-consent/tags/1.6.3/includes/class-cnc-logger.php
r3062530 r3209495 15 15 public function __construct( $instance ) { 16 16 $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 ); 19 18 } 20 19 … … 33 32 public function add_actions() { 34 33 // Register consent log CPT 35 add_action( 'init', array( $this, 'register_cpt' ), 51 );34 add_action( 'init', array( $this, 'register_cpt' ), 151 ); 36 35 // Add admin actions 37 36 add_action( 'admin_init', array( $this, 'manage_admin_views' ) ); -
cookie-notice-consent/tags/1.6.3/includes/class-cnc-settings.php
r3062530 r3209495 19 19 20 20 $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() { 21 34 $this->option_groups = $this->cnc->helper->get_option_groups(); 22 35 $this->defaults = $this->get_default_options(); 23 36 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 admin28 add_action( 'admin_init', array( $this, 'init_settings' ) );29 30 }31 32 /**33 * Load the database options34 */35 public function load_options() {36 37 foreach( $this->option_groups as $slug => $title ) { 37 38 $this->options[$slug] = get_option( "cookie_notice_consent_$slug" ); … … 52 53 'revoke_consent_button_label' => __( 'Revoke consent', 'cookie-notice-consent' ), 53 54 'block_embeds' => '0', 54 'respect_dnt' => '0',55 'respect_gpc' => '0'56 55 ), 57 56 'design_settings' => array( … … 208 207 'cookie_notice_consent_general_settings_group', 209 208 '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'233 209 ); 234 210 … … 456 432 } 457 433 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 480 434 public function cb_settings_section_general_embeds_settings() { 481 435 echo '<p>' . __( 'Manage settings for automatic oEmbed blocking.', 'cookie-notice-consent' ) . '</p>'; -
cookie-notice-consent/tags/1.6.3/readme.txt
r3062530 r3209495 4 4 Tags: cookie, consent, compliance, gdpr, dsgvo 5 5 Requires at least: 5.0 6 Tested up to: 6. 57 Stable tag: 1.6. 26 Tested up to: 6.7 7 Stable tag: 1.6.3 8 8 Requires PHP: 5.6 9 9 License: GPLv3 … … 76 76 77 77 == 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 78 83 79 84 = 1.6.2 = -
cookie-notice-consent/trunk/cookie-notice-consent.php
r3062530 r3209495 4 4 * Plugin Name: Cookie Notice & Consent 5 5 * Description: Display a cookie notice, collect consent for different categories and output scripts if consent is given. 6 * Version: 1.6. 26 * Version: 1.6.3 7 7 * Author: Christoph Rado 8 8 * Author URI: https://christophrado.de/ 9 * Tested up to: 6. 59 * Tested up to: 6.7 10 10 */ 11 11 … … 26 26 * Current plugin version 27 27 */ 28 private $version = '1.6. 2';28 private $version = '1.6.3'; 29 29 30 30 /** -
cookie-notice-consent/trunk/includes/class-cnc-admin.php
r3062530 r3209495 15 15 public function __construct( $instance ) { 16 16 $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 ); 19 18 } 20 19 -
cookie-notice-consent/trunk/includes/class-cnc-embeds.php
r3062530 r3209495 15 15 public function __construct( $instance ) { 16 16 $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 ); 19 18 } 20 19 -
cookie-notice-consent/trunk/includes/class-cnc-front.php
r3062530 r3209495 15 15 public function __construct( $instance ) { 16 16 $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 ); 19 18 } 20 19 … … 28 27 add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_cookie_notice_consent_styles' ) ); 29 28 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(); 50 31 } 51 32 … … 135 116 'ajax_url' => admin_url( 'admin-ajax.php' ), 136 117 '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'] : '', 139 120 ) ); 140 121 } … … 169 150 return $classes; 170 151 $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';173 152 return $classes; 174 153 } -
cookie-notice-consent/trunk/includes/class-cnc-logger.php
r3062530 r3209495 15 15 public function __construct( $instance ) { 16 16 $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 ); 19 18 } 20 19 … … 33 32 public function add_actions() { 34 33 // Register consent log CPT 35 add_action( 'init', array( $this, 'register_cpt' ), 51 );34 add_action( 'init', array( $this, 'register_cpt' ), 151 ); 36 35 // Add admin actions 37 36 add_action( 'admin_init', array( $this, 'manage_admin_views' ) ); -
cookie-notice-consent/trunk/includes/class-cnc-settings.php
r3062530 r3209495 19 19 20 20 $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() { 21 34 $this->option_groups = $this->cnc->helper->get_option_groups(); 22 35 $this->defaults = $this->get_default_options(); 23 36 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 admin28 add_action( 'admin_init', array( $this, 'init_settings' ) );29 30 }31 32 /**33 * Load the database options34 */35 public function load_options() {36 37 foreach( $this->option_groups as $slug => $title ) { 37 38 $this->options[$slug] = get_option( "cookie_notice_consent_$slug" ); … … 52 53 'revoke_consent_button_label' => __( 'Revoke consent', 'cookie-notice-consent' ), 53 54 'block_embeds' => '0', 54 'respect_dnt' => '0',55 'respect_gpc' => '0'56 55 ), 57 56 'design_settings' => array( … … 208 207 'cookie_notice_consent_general_settings_group', 209 208 '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'233 209 ); 234 210 … … 456 432 } 457 433 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 480 434 public function cb_settings_section_general_embeds_settings() { 481 435 echo '<p>' . __( 'Manage settings for automatic oEmbed blocking.', 'cookie-notice-consent' ) . '</p>'; -
cookie-notice-consent/trunk/readme.txt
r3062530 r3209495 4 4 Tags: cookie, consent, compliance, gdpr, dsgvo 5 5 Requires at least: 5.0 6 Tested up to: 6. 57 Stable tag: 1.6. 26 Tested up to: 6.7 7 Stable tag: 1.6.3 8 8 Requires PHP: 5.6 9 9 License: GPLv3 … … 76 76 77 77 == 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 78 83 79 84 = 1.6.2 =
Note: See TracChangeset
for help on using the changeset viewer.