GDPR - Version 2.0.9

Version Description

  • Fix a syntax error introduced after cleaning code with PHPCS.
  • Fix functions that were not checking if registered consents were empty before running.
Download this release

Release Info

Developer fclaussen
Plugin Icon 128x128 GDPR
Version 2.0.9
Comparing to
See all releases

Code changes from version 2.0.8 to 2.0.9

README.txt CHANGED
@@ -5,7 +5,7 @@ Tags: gdpr, compliance, privacy, law, general data protection regulation
5
  Requires at least: 4.7
6
  Requires PHP: 5.6
7
  Tested up to: 4.9
8
- Stable tag: 2.0.8
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -206,6 +206,10 @@ Activating this plugin does not guarantee that an organisation is successfully m
206
 
207
  == Changelog ==
208
 
 
 
 
 
209
  = 2.0.8 =
210
  * Adding a setting to hide plugin generated markup from bots such as Googlebot.
211
  * Fix cookie category dismiss button not showing up after adding a new category. A save was required before the button would appear.
5
  Requires at least: 4.7
6
  Requires PHP: 5.6
7
  Tested up to: 4.9
8
+ Stable tag: 2.0.9
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
206
 
207
  == Changelog ==
208
 
209
+ = 2.0.9 =
210
+ * Fix a syntax error introduced after cleaning code with PHPCS.
211
+ * Fix functions that were not checking if registered consents were empty before running.
212
+
213
  = 2.0.8 =
214
  * Adding a setting to hide plugin generated markup from bots such as Googlebot.
215
  * Fix cookie category dismiss button not showing up after adding a new category. A save was required before the button would appear.
admin/class-gdpr-telemetry.php CHANGED
@@ -413,16 +413,18 @@ class GDPR_Telemetry {
413
 
414
  /* Search for plugin */
415
  if ( self::_localize_plugin( $path ) ) {
 
416
  return array(
417
  'type' => 'Plugin',
418
- 'name' => self::_localize_plugin( $path )['Name'],
419
  );
420
 
421
  /* Search for theme */
422
  } elseif ( self::_localize_theme( $path ) ) {
 
423
  return array(
424
  'type' => 'Theme',
425
- 'name' => self::_localize_theme( $path )->get( 'Name' ),
426
  );
427
  }
428
 
413
 
414
  /* Search for plugin */
415
  if ( self::_localize_plugin( $path ) ) {
416
+ $data = self::_localize_plugin( $path );
417
  return array(
418
  'type' => 'Plugin',
419
+ 'name' => $data['Name'],
420
  );
421
 
422
  /* Search for theme */
423
  } elseif ( self::_localize_theme( $path ) ) {
424
+ $data = self::_localize_theme( $path );
425
  return array(
426
  'type' => 'Theme',
427
+ 'name' => $data->get( 'Name' ),
428
  );
429
  }
430
 
gdpr.php CHANGED
@@ -16,7 +16,7 @@
16
  * Plugin Name: GDPR
17
  * Plugin URI: https://trewknowledge.com
18
  * Description: This plugin is meant to assist a Controller, Data Processor, and Data Protection Officer (DPO) with efforts to meet the obligations and rights enacted under the GDPR.
19
- * Version: 2.0.8
20
  * Author: Trew Knowledge
21
  * Author URI: https://trewknowledge.com
22
  * License: GPL-2.0+
@@ -35,7 +35,7 @@ if ( ! defined( 'WPINC' ) ) {
35
  * Start at version 1.0.0 and use SemVer - https://semver.org
36
  * Rename this for your plugin and update it as you release new versions.
37
  */
38
- define( 'GDPR_VERSION', '2.0.8' );
39
 
40
  /**
41
  * The code that runs during plugin activation.
16
  * Plugin Name: GDPR
17
  * Plugin URI: https://trewknowledge.com
18
  * Description: This plugin is meant to assist a Controller, Data Processor, and Data Protection Officer (DPO) with efforts to meet the obligations and rights enacted under the GDPR.
19
+ * Version: 2.0.9
20
  * Author: Trew Knowledge
21
  * Author URI: https://trewknowledge.com
22
  * License: GPL-2.0+
35
  * Start at version 1.0.0 and use SemVer - https://semver.org
36
  * Rename this for your plugin and update it as you release new versions.
37
  */
38
+ define( 'GDPR_VERSION', '2.0.9' );
39
 
40
  /**
41
  * The code that runs during plugin activation.
includes/class-gdpr.php CHANGED
@@ -322,6 +322,9 @@ class GDPR {
322
  */
323
  public static function get_consent_checkboxes( $consent_key = false ) {
324
  $consent_types = get_option( 'gdpr_consent_types', array() );
 
 
 
325
  $sent_extras = ( isset( $_POST['user_consents'] ) ) ? sanitize_text_field( wp_unslash( $_POST['user_consents'] ) ) : array(); // WPCS: Input var ok, CSRF ok.
326
  $allowed_html = array(
327
  'a' => array(
@@ -589,6 +592,9 @@ class GDPR {
589
  */
590
  public static function save_consent( $user_id, $consent ) {
591
  $registered_consent = get_option( 'gdpr_consent_types', array() );
 
 
 
592
  $consent_ids = array_keys( $registered_consent );
593
  $user = get_user_by( 'ID', $user_id );
594
  $consent = sanitize_text_field( wp_unslash( $consent ) );
322
  */
323
  public static function get_consent_checkboxes( $consent_key = false ) {
324
  $consent_types = get_option( 'gdpr_consent_types', array() );
325
+ if ( empty( $consent_types ) ) {
326
+ return;
327
+ }
328
  $sent_extras = ( isset( $_POST['user_consents'] ) ) ? sanitize_text_field( wp_unslash( $_POST['user_consents'] ) ) : array(); // WPCS: Input var ok, CSRF ok.
329
  $allowed_html = array(
330
  'a' => array(
592
  */
593
  public static function save_consent( $user_id, $consent ) {
594
  $registered_consent = get_option( 'gdpr_consent_types', array() );
595
+ if ( empty( $registered_consent ) ) {
596
+ return false;
597
+ }
598
  $consent_ids = array_keys( $registered_consent );
599
  $user = get_user_by( 'ID', $user_id );
600
  $consent = sanitize_text_field( wp_unslash( $consent ) );