The GDPR Framework By Data443 - Version 2.0.1

Version Description

(3/16/2022) =

  • FRAM-320 Fix WooCommerce integration initialization call timing to be earlier
  • FRAM-323 Provide a settable message for the case where the email is not found
  • FRAM-325 Fix the problem of sending data to non-registered visitors
Download this release

Release Info

Developer data443
Plugin Icon 128x128 The GDPR Framework By Data443
Version 2.0.1
Comparing to
See all releases

Code changes from version 2.0.0 to 2.0.1

.gitignore DELETED
@@ -1 +0,0 @@
1
- .vscode/sftp.json
 
bootstrap.php CHANGED
@@ -17,14 +17,16 @@ function gdpr($name)
17
  return $gdpr->AdminError;
18
  } elseif ($name === 'options') {
19
  return $gdpr->Options;
 
 
 
 
 
 
20
  }
21
  die("Unknown name in gdpr: " . $name);
22
  }
23
 
24
- global $gdpr;
25
- $gdpr = new \Codelight\GDPR\Singleton();
26
- $gdpr->init(__FILE__);
27
-
28
  add_action('init', function() {
29
 
30
  if (!is_admin()) {
@@ -38,4 +40,8 @@ include_once(dirname(__FILE__).'/src/Updater/Updater.php');
38
 
39
  add_action('plugins_loaded', function () use($gdpr_error) {
40
  new \Codelight\GDPR\Updater\Updater();
 
 
 
 
41
  }, 0);
17
  return $gdpr->AdminError;
18
  } elseif ($name === 'options') {
19
  return $gdpr->Options;
20
+ } elseif ($name === 'consent') {
21
+ return $gdpr->Consent;
22
+ } elseif ($name === 'data-subject') {
23
+ return $gdpr->DataSubject;
24
+ } elseif ($name === 'controller') {
25
+ return $gdpr->Controller;
26
  }
27
  die("Unknown name in gdpr: " . $name);
28
  }
29
 
 
 
 
 
30
  add_action('init', function() {
31
 
32
  if (!is_admin()) {
40
 
41
  add_action('plugins_loaded', function () use($gdpr_error) {
42
  new \Codelight\GDPR\Updater\Updater();
43
+
44
+ global $gdpr;
45
+ $gdpr = new \Codelight\GDPR\Singleton();
46
+ $gdpr->init(__FILE__);
47
  }, 0);
gdpr-framework.php CHANGED
@@ -7,7 +7,7 @@
7
  * Author: Data443
8
  * Requires at least: 4.7
9
  * Requires PHP: 5.6
10
- * Version: 2.0.0
11
  * Author URI: https://www.data443.com/
12
  * Text Domain: gdpr-framework
13
  * Domain Path: /languages
@@ -20,7 +20,22 @@ if (!defined('WPINC'))
20
  die;
21
  }
22
 
23
- define('GDPR_FRAMEWORK_VERSION', '2.0.0');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
  add_shortcode( 'gdpr_privacy_safe', 'render_privacy_safe' ); // preserve backward compatibility
26
  add_shortcode( 'data443_privacy_safe', 'render_privacy_safe' );
7
  * Author: Data443
8
  * Requires at least: 4.7
9
  * Requires PHP: 5.6
10
+ * Version: 2.0.1
11
  * Author URI: https://www.data443.com/
12
  * Text Domain: gdpr-framework
13
  * Domain Path: /languages
20
  die;
21
  }
22
 
23
+ if (defined('GDPR_FRAMEWORK_PRO_VERSION')) {
24
+ function GDPR_admin_notices() {
25
+ ?>
26
+ <div style="clear:both"></div>
27
+ <div class="error iwp" style="padding:10px;">
28
+ The PREMIUM GDPR plugin is already installed. Please deactivate this plugin to continue using the FREE version.
29
+ </div>
30
+ <div style="clear:both"></div>
31
+ <?php }
32
+ add_action('admin_notices', 'GDPR_admin_notices');
33
+ return;
34
+ }
35
+
36
+ define('GDPR_FRAMEWORK_VERSION', '2.0.1');
37
+
38
+ define('GDPR_DEFAULT_UNKNOWN_USER_MESSAGE', 'Message received.');
39
 
40
  add_shortcode( 'gdpr_privacy_safe', 'render_privacy_safe' ); // preserve backward compatibility
41
  add_shortcode( 'data443_privacy_safe', 'render_privacy_safe' );
readme.txt CHANGED
@@ -79,6 +79,7 @@ Steps to add consent with contact form 7 are as follow:
79
  3. Then go to the contact form 7 click on Acceptance button a pop-up will get open.
80
  4. Add the name of that acceptance same as that of slug i.e "contact_acceptance".
81
  5. Insert the tag then save the form then it will be embedded with contact form 7.
 
82
 
83
  Compatibility Guide:
84
 
@@ -117,6 +118,12 @@ We are also planning to add other important privacy-related features missing fro
117
 
118
  == Change log ==
119
 
 
 
 
 
 
 
120
  = 2.0.0 (2/15/2022) =
121
 
122
  * Fram-306 Streamline the code to address malware warning from 3rd party code
79
  3. Then go to the contact form 7 click on Acceptance button a pop-up will get open.
80
  4. Add the name of that acceptance same as that of slug i.e "contact_acceptance".
81
  5. Insert the tag then save the form then it will be embedded with contact form 7.
82
+ example tag: [acceptance contact_acceptance] I consent to email contact. [/acceptance]
83
 
84
  Compatibility Guide:
85
 
118
 
119
  == Change log ==
120
 
121
+ = 2.0.1 (3/16/2022) =
122
+
123
+ * FRAM-320 Fix WooCommerce integration initialization call timing to be earlier
124
+ * FRAM-323 Provide a settable message for the case where the email is not found
125
+ * FRAM-325 Fix the problem of sending data to non-registered visitors
126
+
127
  = 2.0.0 (2/15/2022) =
128
 
129
  * Fram-306 Streamline the code to address malware warning from 3rd party code
src/Admin/AdminTabGeneral.php CHANGED
@@ -27,6 +27,7 @@ class AdminTabGeneral extends AdminTab
27
  $this->registerSetting('gdpr_email_from');
28
  $this->registerSetting('gdpr_export_action');
29
  $this->registerSetting('gdpr_export_action_email');
 
30
 
31
  $this->registerSetting('gdpr_delete_action');
32
  $this->registerSetting('gdpr_delete_action_reassign');
@@ -177,6 +178,13 @@ class AdminTabGeneral extends AdminTab
177
  ['class' => 'js-gdpr-export-action-email hidden']
178
  );
179
 
 
 
 
 
 
 
 
180
  /**
181
  * Delete data
182
  */
@@ -488,6 +496,17 @@ class AdminTabGeneral extends AdminTab
488
  echo gdpr('view')->render('admin/general/export-action', compact('exportAction'));
489
  echo gdpr('view')->render('admin/general/description-export-action');
490
  }
 
 
 
 
 
 
 
 
 
 
 
491
  public function renderPopupThemeSelector()
492
  {
493
  global $gdpr;
27
  $this->registerSetting('gdpr_email_from');
28
  $this->registerSetting('gdpr_export_action');
29
  $this->registerSetting('gdpr_export_action_email');
30
+ $this->registerSetting('gdpr_unknown_user_message');
31
 
32
  $this->registerSetting('gdpr_delete_action');
33
  $this->registerSetting('gdpr_delete_action_reassign');
178
  ['class' => 'js-gdpr-export-action-email hidden']
179
  );
180
 
181
+ $this->registerSettingField(
182
+ 'gdpr_unknown_user_message',
183
+ _x('Unknown Data Subject Message', '(Admin)', 'gdpr-framework'),
184
+ [$this, 'renderUnknownUserField'],
185
+ 'gdpr_section_export'
186
+ );
187
+
188
  /**
189
  * Delete data
190
  */
496
  echo gdpr('view')->render('admin/general/export-action', compact('exportAction'));
497
  echo gdpr('view')->render('admin/general/description-export-action');
498
  }
499
+
500
+ public function renderUnknownUserField()
501
+ {
502
+ $content = gdpr('options')->get('unknown_user_message', GDPR_DEFAULT_UNKNOWN_USER_MESSAGE);
503
+ if (empty(trim($content))) {
504
+ $content = GDPR_DEFAULT_UNKNOWN_USER_MESSAGE;
505
+ gdpr('options')->set('unknown_user_message', $content);
506
+ }
507
+ echo gdpr('view')->render('admin/general/unknown-user-message', compact('content'));
508
+ }
509
+
510
  public function renderPopupThemeSelector()
511
  {
512
  global $gdpr;
src/Components/PrivacyToolsPage/PrivacyToolsPage.php CHANGED
@@ -14,6 +14,7 @@ class PrivacyToolsPage
14
  , $gdpr->DataExporter
15
  , $gdpr->UserConsentModel
16
  );
 
17
  new PrivacyToolsPageShortcode($controller, $gdpr->Consent);
18
  }
19
  }
14
  , $gdpr->DataExporter
15
  , $gdpr->UserConsentModel
16
  );
17
+ $gdpr->Controller = $controller;
18
  new PrivacyToolsPageShortcode($controller, $gdpr->Consent);
19
  }
20
  }
src/Components/PrivacyToolsPage/PrivacyToolsPageController.php CHANGED
@@ -111,9 +111,9 @@ class PrivacyToolsPageController {
111
  exit;
112
  }
113
 
114
- /**
115
- * If the given email address exists as a data subject, send an authentication email to that address
116
- */
117
  public function sendIdentificationEmail() {
118
  // Additional safety check
119
  if ( ! is_email( $_REQUEST['email'] ) ) {
@@ -122,15 +122,15 @@ class PrivacyToolsPageController {
122
  $requested_email = sanitize_email( $_REQUEST['email'] );
123
  }
124
 
125
- $user = get_user_by( 'email', $requested_email );
126
- if (empty($user)) {
127
- $this->redirect( array( 'gdpr_notice' => 'unregistered_user' ) );
128
- }
129
-
130
  if ( $this->dataSubjectIdentificator->isDataSubject( $requested_email ) ) {
131
  $this->dataSubjectIdentificator->sendIdentificationEmail( $requested_email );
132
  } else {
133
- $this->dataSubjectIdentificator->sendNoDataFoundEmail( $requested_email );
 
 
 
 
 
134
  }
135
 
136
  $this->redirect( array( 'gdpr_notice' => 'email_sent' ) );
111
  exit;
112
  }
113
 
114
+ /**
115
+ * If the given email address exists as a data subject, send an authentication email to that address
116
+ */
117
  public function sendIdentificationEmail() {
118
  // Additional safety check
119
  if ( ! is_email( $_REQUEST['email'] ) ) {
122
  $requested_email = sanitize_email( $_REQUEST['email'] );
123
  }
124
 
 
 
 
 
 
125
  if ( $this->dataSubjectIdentificator->isDataSubject( $requested_email ) ) {
126
  $this->dataSubjectIdentificator->sendIdentificationEmail( $requested_email );
127
  } else {
128
+ $user = get_user_by( 'email', $requested_email );
129
+ if (empty($user)) {
130
+ $this->redirect( array( 'gdpr_notice' => 'unregistered_user' ) );
131
+ } else {
132
+ $this->dataSubjectIdentificator->sendNoDataFoundEmail( $requested_email );
133
+ }
134
  }
135
 
136
  $this->redirect( array( 'gdpr_notice' => 'email_sent' ) );
src/Singleton.php CHANGED
@@ -29,6 +29,7 @@ class Singleton {
29
  var $DataExporter;
30
  var $UserConsentModel;
31
  var $DataManager;
 
32
 
33
  function init($path) {
34
  $this->PluginUrl = plugin_dir_url($path);
29
  var $DataExporter;
30
  var $UserConsentModel;
31
  var $DataManager;
32
+ var $Controller;
33
 
34
  function init($path) {
35
  $this->PluginUrl = plugin_dir_url($path);
views/admin/general/unknown-user-message.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+
2
+ <input type="text" name="gdpr_unknown_user_message" value="<?php if($content!=""){?>
3
+ <?= esc_html_x($content, 'gdpr-framework');?>
4
+ <?php } ?>" />
5
+ <p class="description">
6
+ <?= esc_html_x('This message is displayed if the email entered on the privacy tools page is not found.', '(Admin)', 'gdpr-framework'); ?>
7
+ </p>
views/privacy-tools/notices.php CHANGED
@@ -25,7 +25,7 @@
25
  <?php endif; ?>
26
 
27
  <?php if ('unregistered_user' === sanitize_key($_REQUEST['gdpr_notice'])): ?>
28
- <?= __('The email you entered is not associated with any user on this site.', 'gdpr-framework'); ?>
29
  <?php endif; ?>
30
  </mark>
31
  </div>
25
  <?php endif; ?>
26
 
27
  <?php if ('unregistered_user' === sanitize_key($_REQUEST['gdpr_notice'])): ?>
28
+ <?= __(sanitize_text_field(gdpr('options')->get('unknown_user_message', GDPR_DEFAULT_UNKNOWN_USER_MESSAGE)), 'gdpr-framework'); ?>
29
  <?php endif; ?>
30
  </mark>
31
  </div>