The GDPR Framework By Data443 - Version 1.0.9

Version Description

  • Add support for Contact Form 7 Flamingo
  • Remove nested the_content filter in the consent area editor to avoid potential conflicts with various plugins (Thanks Gary McPherson!)
  • Fix some missing translation strings (Thanks trueqap!)
  • Additional minor tweaks
  • Update Italian translation (Thanks Rienzi Comunica!)
Download this release

Release Info

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

Code changes from version 1.0.8 to 1.0.9

gdpr-framework.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: The GDPR Framework
5
  * Plugin URI: https://codelight.eu/wordpress-gdpr-framework/
6
  * Description: Tools to help make your website GDPR-compliant. Fully documented, extendable and developer-friendly.
7
- * Version: 1.0.8
8
  * Author: Codelight
9
  * Author URI: https://codelight.eu/
10
  * Text Domain: gdpr-framework
@@ -15,7 +15,7 @@ if (!defined('WPINC')) {
15
  die;
16
  }
17
 
18
- define('GDPR_FRAMEWORK_VERSION', '1.0.8');
19
 
20
  /**
21
  * Helper function for prettying up errors
4
  * Plugin Name: The GDPR Framework
5
  * Plugin URI: https://codelight.eu/wordpress-gdpr-framework/
6
  * Description: Tools to help make your website GDPR-compliant. Fully documented, extendable and developer-friendly.
7
+ * Version: 1.0.9
8
  * Author: Codelight
9
  * Author URI: https://codelight.eu/
10
  * Text Domain: gdpr-framework
15
  die;
16
  }
17
 
18
+ define('GDPR_FRAMEWORK_VERSION', '1.0.9');
19
 
20
  /**
21
  * Helper function for prettying up errors
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: gdpr
5
  Requires at least: 4.7
6
  Tested up to: 4.9.5
7
  Requires PHP: 5.6.33
8
- Stable tag: 1.0.8
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
11
 
@@ -41,18 +41,22 @@ For developers: [Developer Docs](https://codelight.eu/wordpress-gdpr-framework/d
41
  ☑ Fully documented;
42
  ☑ Developer-friendly. Everything can be extended, every feature and template can be overridden.
43
 
 
 
 
 
 
44
  GDPR is here to stay and we are just getting started. There's lots more to come!
45
 
46
  ### Plugin support:
47
  The GDPR Framework currently works with the following plugins
48
- ☑ Contact Form 7
49
  ☑ Gravity Forms - [Download the GDPR add-on](https://wordpress.org/plugins/gdpr-for-gravity-forms/)
50
  ☑ Formidable Forms - [Download the GDPR add-on](https://wordpress.org/plugins/gdpr-for-formidable-forms/)
51
  ☑ WPML
52
 
53
  Coming soon:
54
  ☐ Ninja Forms
55
- ☐ Contact Form 7 Flamingo
56
 
57
  Still free and open-source.
58
 
@@ -89,6 +93,13 @@ This is a very important aspect of GDPR which we will definitely find a solution
89
 
90
  == Changelog ==
91
 
 
 
 
 
 
 
 
92
  = 1.0.8 =
93
  * Disable Privacy Tools page if not set via admin (fixes infinite redirect issue)
94
  * Add additional admin notification if Privacy Tools page is not set
5
  Requires at least: 4.7
6
  Tested up to: 4.9.5
7
  Requires PHP: 5.6.33
8
+ Stable tag: 1.0.9
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
11
 
41
  ☑ Fully documented;
42
  ☑ Developer-friendly. Everything can be extended, every feature and template can be overridden.
43
 
44
+ ### Coming up next
45
+ ☐ Cookie solution
46
+ ☐ Integration with WP & WooCommerce core tools
47
+ ☐ Overhaul & improvements on the consent tracking mechanism, re-consent, etc.
48
+
49
  GDPR is here to stay and we are just getting started. There's lots more to come!
50
 
51
  ### Plugin support:
52
  The GDPR Framework currently works with the following plugins
53
+ ☑ Contact Form 7 & Contact Form Flamingo
54
  ☑ Gravity Forms - [Download the GDPR add-on](https://wordpress.org/plugins/gdpr-for-gravity-forms/)
55
  ☑ Formidable Forms - [Download the GDPR add-on](https://wordpress.org/plugins/gdpr-for-formidable-forms/)
56
  ☑ WPML
57
 
58
  Coming soon:
59
  ☐ Ninja Forms
 
60
 
61
  Still free and open-source.
62
 
93
 
94
  == Changelog ==
95
 
96
+ = 1.0.9 =
97
+ * Add support for Contact Form 7 Flamingo
98
+ * Remove nested the_content filter in the consent area editor to avoid potential conflicts with various plugins (Thanks Gary McPherson!)
99
+ * Fix some missing translation strings (Thanks trueqap!)
100
+ * Additional minor tweaks
101
+ * Update Italian translation (Thanks Rienzi Comunica!)
102
+
103
  = 1.0.8 =
104
  * Disable Privacy Tools page if not set via admin (fixes infinite redirect issue)
105
  * Add additional admin notification if Privacy Tools page is not set
src/Components/PrivacyPolicy/AdminTabPrivacyPolicy.php CHANGED
@@ -270,11 +270,13 @@ class AdminTabPrivacyPolicy extends AdminTab
270
  */
271
  public function renderDpaJS()
272
  {
273
- echo "<a href='https://codelight.eu/wordpress-gdpr-framework/knowledge-base/do-i-need-to-appoint-an-eu-based-representative/' target='_blank'>";
274
- echo 'See the <a href="http://ec.europa.eu/justice/data-protection/article-29/structure/data-protection-authorities/index_en.htm" target="_blank">list of contacts here</a>';
275
- echo "</a>";
276
-
277
-
 
 
278
 
279
  $dpaData = json_encode(gdpr('helpers')->getDataProtectionAuthorities());
280
  echo gdpr('view')->render('admin/privacy-policy/dpa', compact('dpaData'));
270
  */
271
  public function renderDpaJS()
272
  {
273
+ //echo "<a href='https://codelight.eu/wordpress-gdpr-framework/knowledge-base/do-i-need-to-appoint-an-eu-based-representative/' target='_blank'>";
274
+ echo sprintf(
275
+ _x('See the %slist of contacts here%s.', '(Admin)', 'gdpr-framework'),
276
+ '<a href="http://ec.europa.eu/justice/data-protection/article-29/structure/data-protection-authorities/index_en.htm" target="_blank">',
277
+ '</a>'
278
+ );
279
+ //echo "</a>";
280
 
281
  $dpaData = json_encode(gdpr('helpers')->getDataProtectionAuthorities());
282
  echo gdpr('view')->render('admin/privacy-policy/dpa', compact('dpaData'));
src/Components/PrivacyToolsPage/PrivacyToolsPageController.php CHANGED
@@ -164,7 +164,7 @@ class PrivacyToolsPageController
164
  ]);
165
  }
166
 
167
- $consentInfo = apply_filters('the_content', gdpr('options')->get('consent_info'));
168
 
169
  echo gdpr('view')->render(
170
  "privacy-tools/form-consent",
164
  ]);
165
  }
166
 
167
+ $consentInfo = wpautop(gdpr('options')->get('consent_info'));
168
 
169
  echo gdpr('view')->render(
170
  "privacy-tools/form-consent",
src/Components/WordpressUser/Controllers/DashboardDataPageController.php CHANGED
@@ -91,7 +91,7 @@ class DashboardDataPageController
91
  ]);
92
  }
93
 
94
- $consentInfo = apply_filters('the_content', gdpr('options')->get('consent_info'));
95
 
96
  echo gdpr('view')->render(
97
  "modules/wordpress-user/dashboard/data-page/form-consent",
91
  ]);
92
  }
93
 
94
+ $consentInfo = wpautop(gdpr('options')->get('consent_info'));
95
 
96
  echo gdpr('view')->render(
97
  "modules/wordpress-user/dashboard/data-page/form-consent",
src/Modules/ContactForm7/Flamingo.php ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ namespace Codelight\GDPR\Modules\ContactForm7;
5
+
6
+
7
+ class Flamingo
8
+ {
9
+ public function __construct()
10
+ {
11
+ add_filter('wpcf7_editor_panels', [$this, 'addCF7Tab']);
12
+ add_action('wpcf7_save_contact_form', [$this, 'saveCF7Tab'], 10, 3);
13
+
14
+ add_filter('gdpr/data-subject/data', [$this, 'getExportData'], 20, 2);
15
+ add_action('gdpr/data-subject/delete', [$this, 'deleteEntries']);
16
+ add_action('gdpr/data-subject/anonymize', [$this, 'deleteEntries']);
17
+ }
18
+
19
+ public function addCF7Tab($tabs)
20
+ {
21
+ $tabs['privacy-panel'] = [
22
+ 'title' => __('Privacy', 'gdpr-framework'),
23
+ 'callback' => [$this, 'renderPrivacyTab'],
24
+ ];
25
+
26
+ return $tabs;
27
+ }
28
+
29
+ public function renderPrivacyTab(\WPCF7_ContactForm $form)
30
+ {
31
+ $enabled = get_post_meta($form->id(), 'gdpr_cf7_enabled', true) ? get_post_meta($form->id(), 'gdpr_cf7_enabled', true) : '';
32
+ $emailField = get_post_meta($form->id(), 'gdpr_cf7_email_field', true) ? get_post_meta($form->id(), 'gdpr_cf7_email_field', true) : '';
33
+
34
+ echo gdpr('view')->render(
35
+ 'modules/contact-form-7/form-privacy-tab',
36
+ compact('enabled', 'emailField')
37
+ );
38
+ }
39
+
40
+ public function saveCF7Tab(\WPCF7_ContactForm $contactForm, $args, $context)
41
+ {
42
+ if (isset($_POST['gdpr_cf7_enabled']) && isset($_POST['post_ID']) && $_POST['post_ID']) {
43
+ update_post_meta($_POST['post_ID'], 'gdpr_cf7_enabled', $_POST['gdpr_cf7_enabled']);
44
+ }
45
+
46
+ if (isset($_POST['gdpr_cf7_email_field']) && !empty($_POST['gdpr_cf7_email_field']) && isset($_POST['post_ID']) && $_POST['post_ID']) {
47
+ update_post_meta($_POST['post_ID'], 'gdpr_cf7_email_field', $_POST['gdpr_cf7_email_field']);
48
+ }
49
+ }
50
+
51
+ public function getExportData(array $data, $email)
52
+ {
53
+ $entries = $this->getEntriesByEmail($email);
54
+
55
+ if (!count($entries)) {
56
+ return $data;
57
+ }
58
+
59
+ foreach ($entries as $i => $message) {
60
+ $title = __('Form submissions: ', 'gdpr') . ucfirst($message->channel);
61
+
62
+ if (count($message->fields)) {
63
+ foreach ($message->fields as $key => $value) {
64
+ $data[$title][$i][$key] = $value;
65
+ }
66
+ }
67
+
68
+ if (count($message->consent)) {
69
+ foreach ($message->consent as $key => $value) {
70
+ $data[$title][$i][$key] = $value;
71
+ }
72
+ }
73
+
74
+ $data[$title][$i]['date'] = $message->date;
75
+ $data[$title][$i]['ip'] = $message->meta['remote_ip'];
76
+ $data[$title][$i]['user_agent'] = $message->meta['user_agent'];
77
+ $data[$title][$i]['url'] = $message->meta['post_url'];
78
+ }
79
+
80
+ return $data;
81
+ }
82
+
83
+ public function getEntriesByEmail($email)
84
+ {
85
+ $forms = $this->getValidForms();
86
+
87
+ if (!count($forms)) {
88
+ return [];
89
+ }
90
+
91
+ $entries = [];
92
+
93
+ foreach ($forms as $form) {
94
+ /* @var $form \WPCF7_ContactForm */
95
+ $messages = \Flamingo_Inbound_Message::find([
96
+ 'channel' => get_post_field( 'post_name', $form->id()),
97
+ ]);
98
+
99
+ if (!count($messages)) {
100
+ continue;
101
+ }
102
+
103
+ $emailField = get_post_meta($form->id(), 'gdpr_cf7_email_field', true);
104
+
105
+ if (!$emailField) {
106
+ continue;
107
+ }
108
+
109
+ foreach ($messages as $message) {
110
+ if ($email === $message->fields[$emailField]) {
111
+ $entries[] = $message;
112
+ }
113
+ }
114
+ }
115
+
116
+ return $entries;
117
+ }
118
+
119
+ public function getValidForms()
120
+ {
121
+ return \WPCF7_ContactForm::find([
122
+ 'meta_query' => [
123
+ [
124
+ 'key' => 'gdpr_cf7_enabled',
125
+ 'value' => '1',
126
+ ],
127
+ ],
128
+ ]);
129
+ }
130
+
131
+ public function deleteEntries($email)
132
+ {
133
+ $entries = $this->getEntriesByEmail($email);
134
+
135
+ if (count($entries)) {
136
+ foreach ($entries as $i => $message) {
137
+ if ($message->id) {
138
+ $message->delete();
139
+ }
140
+ }
141
+ }
142
+
143
+ $contacts = \Flamingo_Contact::search_by_email($email);
144
+ if (count($contacts)) {
145
+ foreach ($contacts as $i => $contactId) {
146
+ (new \Flamingo_Contact($contactId))->delete();
147
+ }
148
+ }
149
+
150
+ }
151
+ }
src/Setup.php CHANGED
@@ -15,6 +15,7 @@ use Codelight\GDPR\DataSubject\DataSubjectManager;
15
  use Codelight\GDPR\Modules\ContactForm7\ContactForm7;
16
  use Codelight\GDPR\Components\Themes\Themes;
17
  use Codelight\GDPR\Components\WordpressUser\WordpressUser;
 
18
  use Codelight\GDPR\Modules\WPML\WPML;
19
  use Codelight\GDPR\Options\Options;
20
 
@@ -90,5 +91,6 @@ class Setup
90
  // Integrations
91
  gdpr()->make(Themes::class);
92
  gdpr()->make(ContactForm7::class);
 
93
  }
94
  }
15
  use Codelight\GDPR\Modules\ContactForm7\ContactForm7;
16
  use Codelight\GDPR\Components\Themes\Themes;
17
  use Codelight\GDPR\Components\WordpressUser\WordpressUser;
18
+ use Codelight\GDPR\Modules\ContactForm7\Flamingo;
19
  use Codelight\GDPR\Modules\WPML\WPML;
20
  use Codelight\GDPR\Options\Options;
21
 
91
  // Integrations
92
  gdpr()->make(Themes::class);
93
  gdpr()->make(ContactForm7::class);
94
+ gdpr()->make(Flamingo::class);
95
  }
96
  }
views/admin/consent.php CHANGED
@@ -75,7 +75,7 @@
75
 
76
  </table>
77
  <div class="gdpr-consent-add-button">
78
- <input data-repeater-create class="button button-primary" type="button" value="Add consent type"/>
79
  </div>
80
  <input type="hidden" name="gdpr_nonce" value="<?= $nonce; ?>" />
81
  <input type="hidden" name="gdpr_action" value="update_consent_data" />
75
 
76
  </table>
77
  <div class="gdpr-consent-add-button">
78
+ <input data-repeater-create class="button button-primary" type="button" value="<?= _x('Add consent type', '(Admin)', 'gdpr-framework'); ?>"/>
79
  </div>
80
  <input type="hidden" name="gdpr_nonce" value="<?= $nonce; ?>" />
81
  <input type="hidden" name="gdpr_action" value="update_consent_data" />
views/admin/notices/help.php CHANGED
@@ -1,3 +1,7 @@
1
  <p>
2
- Need help? Take a look at our <a href="<?= gdpr('helpers')->docs('wordpress-site-owners-guide-to-gdpr/'); ?>" target="_blank">documentation</a>.
 
 
 
 
3
  </p>
1
  <p>
2
+ <?= sprintf(
3
+ _x('Need help? Take a look at our %sdocumentation%s.', '(Admin)', 'gdpr-framework'),
4
+ '<a href="' . gdpr('helpers')->docs('wordpress-site-owners-guide-to-gdpr/') . '" target="_blank">',
5
+ '</a>'
6
+ ); ?>
7
  </p>
views/admin/privacy-policy/has-dpo.php CHANGED
@@ -8,5 +8,5 @@
8
  value="yes"
9
  <?= checked($hasDPO, 'yes'); ?>
10
  >
11
- I have appointed a Data Protection Officer (DPO)
12
  </label>
8
  value="yes"
9
  <?= checked($hasDPO, 'yes'); ?>
10
  >
11
+ <?= _x('I have appointed a Data Protection Officer (DPO)', '(Admin)', 'gdpr-framework'); ?>
12
  </label>
views/modules/contact-form-7/form-privacy-tab.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h2><?php echo esc_html(__('Privacy', 'gdpr-framework')); ?></h2>
2
+ <fieldset>
3
+ <legend>
4
+ <?php //_ex('Privacy configuration', '(Admin)', 'gdpr-framework'); ?>
5
+ </legend>
6
+
7
+ <p class="description">
8
+ <label for="gdpr_cf7_enabled">
9
+ <input type="checkbox" id="gdpr_cf7_enabled" name="gdpr_cf7_enabled" value="1" <?= checked($enabled, true); ?>>
10
+ <?php _ex("Include the entries of this form when downloading or deleting a data subject's data.", '(Admin)', 'gdpr-framework'); ?>
11
+ </label>
12
+ </p>
13
+
14
+ <br>
15
+
16
+ <p class="description">
17
+ <label for="gdpr_cf7_email_field">
18
+ <?php _ex("Enter the mail-tag of the sender's email field (for example, your-email).", '(Admin)', 'gdpr-framework'); ?>
19
+ <br>
20
+ <input
21
+ type="text"
22
+ id="gdpr_cf7_email_field"
23
+ name="gdpr_cf7_email_field"
24
+ class="large-text"
25
+ size="70"
26
+ value="<?php echo $emailField ? $emailField : 'your-email'; ?>"
27
+ placeholder="your-email"
28
+ >
29
+ </label>
30
+ </p>
31
+ </fieldset>