GDPR Cookie Compliance - Version 3.2.0

Version Description

  • Improved code quality
  • Security & Sanitize functions extended
  • Added reset settings button
  • Bugfixes
Download this release

Release Info

Developer MooveAgency
Plugin Icon 128x128 GDPR Cookie Compliance
Version 3.2.0
Comparing to
See all releases

Code changes from version 3.1.1 to 3.2.0

Files changed (60) hide show
  1. moove-modules-view.php → class-gdpr-modules-view.php +8 -6
  2. class-gdpr-modules.php +392 -0
  3. moove-view.php → class-gdpr-view.php +6 -4
  4. moove-actions.php → class-moove-gdpr-actions.php +78 -49
  5. class-moove-gdpr-content.php +498 -0
  6. moove-options.php → class-moove-gdpr-options.php +12 -8
  7. controllers/class-moove-gdpr-controller.php +471 -0
  8. controllers/class-moove-gdpr-license-manager.php +228 -0
  9. controllers/class-moove-gdpr-updater.php +287 -0
  10. controllers/moove-controller.php +0 -424
  11. controllers/moove-license-manager.php +0 -189
  12. controllers/moove-plugin-updater.php +0 -227
  13. dist/scripts/admin.js +1 -1
  14. dist/scripts/main.js +2 -2
  15. dist/styles/admin.css +1 -1
  16. gdpr-functions.php +400 -0
  17. gdpr-modules/branding-styles.php +10 -10
  18. gdpr-modules/modal/company-logo.php +1 -1
  19. gdpr-modules/modal/modal-base-onepage.php +1 -1
  20. gdpr-modules/modal/modal-base-tabs.php +1 -1
  21. gdpr-modules/modal/tab-footer-buttons.php +2 -2
  22. gdpr-modules/modal/tab-navigation.php +5 -5
  23. moove-content.php +0 -442
  24. moove-controller.php +0 -9
  25. moove-functions.php +0 -381
  26. moove-gdpr.php +75 -33
  27. moove-modules.php +0 -378
  28. readme.txt +7 -1
  29. views/moove/admin/settings/accept-on-scroll.php +10 -2
  30. views/moove/admin/settings/advanced-cookies.php +253 -0
  31. views/moove/admin/settings/advanced_cookies.php +0 -254
  32. views/moove/admin/settings/banner-settings.php +198 -0
  33. views/moove/admin/settings/banner_settings.php +0 -193
  34. views/moove/admin/settings/branding.php +180 -175
  35. views/moove/admin/settings/cookie-banner-manager.php +10 -2
  36. views/moove/admin/settings/cookie-policy.php +114 -0
  37. views/moove/admin/settings/cookie_policy.php +0 -107
  38. views/moove/admin/settings/export-import.php +10 -2
  39. views/moove/admin/settings/floating-button.php +143 -0
  40. views/moove/admin/settings/floating_button.php +0 -129
  41. views/moove/admin/settings/full-screen-mode.php +10 -2
  42. views/moove/admin/settings/general-settings.php +169 -0
  43. views/moove/admin/settings/general_settings.php +0 -136
  44. views/moove/admin/settings/geo-location.php +10 -1
  45. views/moove/admin/settings/help.php +183 -229
  46. views/moove/admin/settings/iframe-blocker.php +9 -1
  47. views/moove/admin/settings/licence.php +126 -118
  48. views/moove/admin/settings/multisite-settings.php +11 -2
  49. views/moove/admin/settings/plugin-boxes.php +121 -0
  50. views/moove/admin/settings/plugin_boxes.php +0 -118
  51. views/moove/admin/settings/privacy-overview.php +91 -0
  52. views/moove/admin/settings/privacy_overview.php +0 -83
  53. views/moove/admin/settings/settings-page.php +160 -0
  54. views/moove/admin/settings/settings_page.php +0 -159
  55. views/moove/admin/settings/stats.php +11 -1
  56. views/moove/admin/settings/strictly-necessary-cookies.php +168 -0
  57. views/moove/admin/settings/strictly_necessary_cookies.php +0 -155
  58. views/moove/admin/settings/third-party-cookies.php +280 -0
  59. views/moove/admin/settings/third_party_cookies.php +0 -256
  60. views/moove/admin/settings/video-tutorial.php +13 -3
moove-modules-view.php → class-gdpr-modules-view.php RENAMED
@@ -1,6 +1,4 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly
3
-
4
  /**
5
  * GDPR_Modules_View File Doc Comment
6
  *
@@ -9,6 +7,10 @@ if ( ! defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly
9
  * @author Gaspar Nemes
10
  */
11
 
 
 
 
 
12
  /**
13
  * GDPR_Modules_View Class Doc Comment
14
  *
@@ -22,13 +24,13 @@ class GDPR_Modules_View {
22
  *
23
  * Parameters:
24
  *
25
- * @param string $view // the view to load, dot used as directory separator, no file extension given.
26
- * @param mixed $data // The data to display in the view (could be anything, even an object).
27
  */
28
  public static function load( $view, $content ) {
29
  $view_file_origin = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'gdpr-modules';
30
- $view_name = str_replace( '.' , DIRECTORY_SEPARATOR , $view ) . '.php';
31
- $locate_template = locate_template( 'gdpr-modules' . DIRECTORY_SEPARATOR . $view_name );
32
  $view_file_origin = $locate_template ? $locate_template : $view_file_origin . DIRECTORY_SEPARATOR . $view_name;
33
  if ( file_exists( $view_file_origin ) ) :
34
  ob_start();
1
  <?php
 
 
2
  /**
3
  * GDPR_Modules_View File Doc Comment
4
  *
7
  * @author Gaspar Nemes
8
  */
9
 
10
+ if ( ! defined( 'ABSPATH' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
  /**
15
  * GDPR_Modules_View Class Doc Comment
16
  *
24
  *
25
  * Parameters:
26
  *
27
+ * @param string $view // the view to load, dot used as directory separator, no file extension given.
28
+ * @param mixed $content // The data to display in the view (could be anything, even an object).
29
  */
30
  public static function load( $view, $content ) {
31
  $view_file_origin = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'gdpr-modules';
32
+ $view_name = str_replace( '.', DIRECTORY_SEPARATOR, $view ) . '.php';
33
+ $locate_template = locate_template( 'gdpr-modules' . DIRECTORY_SEPARATOR . $view_name );
34
  $view_file_origin = $locate_template ? $locate_template : $view_file_origin . DIRECTORY_SEPARATOR . $view_name;
35
  if ( file_exists( $view_file_origin ) ) :
36
  ob_start();
class-gdpr-modules.php ADDED
@@ -0,0 +1,392 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * GDPR_Modules File Doc Comment
4
+ *
5
+ * @category GDPR_Modules
6
+ * @package gdpr-cookie-compliance
7
+ * @author Gaspar Nemes
8
+ */
9
+
10
+ if ( ! defined( 'ABSPATH' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
+ /**
15
+ * GDPR_Modules Class Doc Comment
16
+ *
17
+ * @category Class
18
+ * @package Moove_Modules
19
+ * @author Gaspar Nemes
20
+ */
21
+ class GDPR_Modules {
22
+ /**
23
+ * GDPR Options.
24
+ *
25
+ * @var array $gdpr_options GDPR Options.
26
+ */
27
+ protected $gdpr_options;
28
+
29
+ /**
30
+ * Language code.
31
+ *
32
+ * @var string $wmpl_lang Language code.
33
+ */
34
+ protected $wpml_lang;
35
+
36
+ /**
37
+ * Construct function
38
+ */
39
+ public function __construct() {
40
+ $gdpr_default_content = new Moove_GDPR_Content();
41
+ $option_name = $gdpr_default_content->moove_gdpr_get_option_name();
42
+ $modal_options = get_option( $option_name );
43
+ $wpml_lang = $gdpr_default_content->moove_gdpr_get_wpml_lang();
44
+ $this->gdpr_options = $modal_options;
45
+ $this->wpml_lang = $wpml_lang;
46
+ }
47
+
48
+ /**
49
+ * GDPR Module - Floating Button view & content
50
+ */
51
+ public function get_floating_button() {
52
+ $view_controller = new GDPR_Modules_View();
53
+ $modal_options = $this->gdpr_options;
54
+ $wpml_lang = $this->wpml_lang;
55
+ $floating_button_visibility = 'display: block;';
56
+ $floating_button_class = '';
57
+ $infobar_hidden = isset( $modal_options['moove_gdpr_infobar_visibility'] ) && 'hidden' === $modal_options['moove_gdpr_infobar_visibility'] ? true : false;
58
+ if ( $infobar_hidden ) :
59
+ $floating_button_class = 'button-visible';
60
+ endif;
61
+ $floating_button_position = isset( $modal_options['moove_gdpr_floating_button_position'] ) ? $modal_options['moove_gdpr_floating_button_position'] : '';
62
+ $data = new stdClass();
63
+ $data->options = $modal_options;
64
+ $data->wpml_lang = $wpml_lang;
65
+ $data->is_enabled = ( isset( $modal_options['moove_gdpr_floating_button_enable'] ) && 1 === intval( $modal_options['moove_gdpr_floating_button_enable'] ) ) ? true : false;
66
+ $data->styles = $floating_button_visibility . $floating_button_position;
67
+ $data->class = $floating_button_class;
68
+ if ( $floating_button_position ) :
69
+ $data->class = $floating_button_class .= ' gdpr-floating-button-custom-position';
70
+ endif;
71
+ $data->label = ( isset( $modal_options[ 'moove_gdpr_floating_button_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_floating_button_label' . $wpml_lang ] ) ? $modal_options[ 'moove_gdpr_floating_button_label' . $wpml_lang ] : __( 'Change cookie settings', 'gdpr-cookie-compliance' );
72
+ return $view_controller->load( 'infobar.floating-button', $data );
73
+ }
74
+
75
+ /**
76
+ * GDPR Module - Base structure
77
+ */
78
+ public function get_modal_base() {
79
+ $view_controller = new GDPR_Modules_View();
80
+ $modal_options = $this->gdpr_options;
81
+ $wpml_lang = $this->wpml_lang;
82
+ $layout = isset( $modal_options['moove_gdpr_plugin_layout'] ) ? $modal_options['moove_gdpr_plugin_layout'] : 'v1';
83
+ $tab_title = isset( $modal_options[ 'moove_gdpr_privacy_overview_tab_title' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_privacy_overview_tab_title' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_privacy_overview_tab_title' . $wpml_lang ] : __( 'Privacy Overview', 'gdpr-cookie-compliance' );
84
+ $data = new stdClass();
85
+ $data->logo_position = isset( $modal_options['moove_gdpr_logo_position'] ) ? $modal_options['moove_gdpr_logo_position'] : 'left';
86
+ $data->theme = 'moove_gdpr_modal_theme_' . $layout;
87
+ $modal_theme = 'moove_gdpr_modal_theme_' . $layout;
88
+ $data->modal_title = 'v1' === $layout ? false : $tab_title;
89
+ $view_type = 'v1' === $layout ? 'tabs' : 'onepage';
90
+ return $view_controller->load( 'modal.modal-base-' . $view_type, $data );
91
+ }
92
+
93
+ /**
94
+ * GDPR Module - Infobar structure
95
+ */
96
+ public function get_infobar_base() {
97
+ $view_controller = new GDPR_Modules_View();
98
+ $modal_options = $this->gdpr_options;
99
+ $wpml_lang = $this->wpml_lang;
100
+ $data = new stdClass();
101
+ $infobar_classes = array(
102
+ 'moove-gdpr-info-bar-hidden',
103
+ 'moove-gdpr-align-center',
104
+ );
105
+ $modal_scheme = isset( $modal_options['moove_gdpr_colour_scheme'] ) ? ( ( 1 === intval( $modal_options['moove_gdpr_colour_scheme'] ) || 2 === intval( $modal_options['moove_gdpr_colour_scheme'] ) ) ? intval( $modal_options['moove_gdpr_colour_scheme'] ) : 1 ) : 1;
106
+
107
+ $scheme_class = 2 === $modal_scheme ? 'moove-gdpr-light-scheme' : 'moove-gdpr-dark-scheme';
108
+ $infobar_position = isset( $modal_options['moove_gdpr_infobar_position'] ) ? $modal_options['moove_gdpr_infobar_position'] : 'bottom';
109
+ $infobar_classes[] = $scheme_class;
110
+ $infobar_classes[] = 'gdpr_infobar_postion_' . $infobar_position;
111
+ $infobar_classes = apply_filters( 'gdpr_info_bar_class_extension', $infobar_classes );
112
+ $infobar_hidden = isset( $modal_options['moove_gdpr_infobar_visibility'] ) && 'hidden' === $modal_options['moove_gdpr_infobar_visibility'] ? true : false;
113
+ $data->show = $infobar_hidden ? false : true;
114
+ $data->class = implode( ' ', $infobar_classes );
115
+ $infobar_content = apply_filters( 'gdpr_info_bar_popup_content', $view_controller->load( 'infobar.infobar-base', $data ) );
116
+ return $infobar_content;
117
+
118
+ }
119
+
120
+ /**
121
+ * GDPR Module - Infobar Main Content
122
+ */
123
+ public function get_infobar_content() {
124
+ $view_controller = new GDPR_Modules_View();
125
+ $modal_options = $this->gdpr_options;
126
+ $wpml_lang = $this->wpml_lang;
127
+ $_content = '<p>' . __( 'This website uses cookies to provide you with the best browsing experience.', 'gdpr-cookie-compliance' ) . '</p>' .
128
+ '<p>' . __( 'Find out more or adjust your [setting]settings[/setting].', 'gdpr-cookie-compliance' ) . '</p>';
129
+ $content = isset( $modal_options[ 'moove_gdpr_info_bar_content' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_info_bar_content' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_info_bar_content' . $wpml_lang ] : $_content;
130
+ $content = str_replace( '[setting]', '<span data-href="#moove_gdpr_cookie_modal" class="change-settings-button">', $content );
131
+ $content = str_replace( '[/setting]', '</span>', $content );
132
+ $content = apply_filters( 'gdpr_info_bar_notice_content', $content );
133
+ $data = new stdClass();
134
+ $data->text_content = $content;
135
+ return $view_controller->load( 'infobar.infobar-content', $data );
136
+ }
137
+
138
+ /**
139
+ * GDPR Module - Infobar button & extensions
140
+ */
141
+ public function get_infobar_buttons() {
142
+ $view_controller = new GDPR_Modules_View();
143
+ $modal_options = $this->gdpr_options;
144
+ $wpml_lang = $this->wpml_lang;
145
+ $data = new stdClass();
146
+ $data->button_label = isset( $modal_options[ 'moove_gdpr_infobar_accept_button_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_infobar_accept_button_label' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_infobar_accept_button_label' . $wpml_lang ] : __( 'Accept', 'gdpr-cookie-compliance' );
147
+ return $view_controller->load( 'infobar.infobar-buttons', $data );
148
+
149
+ }
150
+
151
+ /**
152
+ * GDPR Module - Company Logo
153
+ */
154
+ public function get_company_logo() {
155
+ $view_controller = new GDPR_Modules_View();
156
+ $modal_options = $this->gdpr_options;
157
+ $wpml_lang = $this->wpml_lang;
158
+ $data = new stdClass();
159
+ $data->options = $modal_options;
160
+ $data->wpml_lang = $wpml_lang;
161
+ $data->logo_url = isset( $modal_options['moove_gdpr_company_logo'] ) && $modal_options['moove_gdpr_company_logo'] ? $modal_options['moove_gdpr_company_logo'] : plugin_dir_url( __FILE__ ) . 'dist/images/gdpr-logo.png';
162
+ $data->logo_url = str_replace( plugin_dir_url( __FILE__ ) . 'dist/images/moove-logo.png', plugin_dir_url( __FILE__ ) . 'dist/images/gdpr-logo.png', $data->logo_url );
163
+ $data->logo_alt = gdpr_get_logo_alt( $data->logo_url );
164
+ return $view_controller->load( 'modal.company-logo', $data );
165
+ }
166
+
167
+ /**
168
+ * GDPR Module - Branding Options
169
+ */
170
+ public function get_gdpr_branding() {
171
+ $view_controller = new GDPR_Modules_View();
172
+ $moove_actions_cnt = new Moove_GDPR_Actions();
173
+ $modal_options = $this->gdpr_options;
174
+ $wpml_lang = $this->wpml_lang;
175
+ $data = new stdClass();
176
+ $data->options = $modal_options;
177
+ $data->wpml_lang = $wpml_lang;
178
+ $data->text = $moove_actions_cnt->moove_gdpr_footer_branding_content();
179
+ $data->is_enabled = isset( $modal_options['moove_gdpr_modal_powered_by_disable'] ) && 1 === intval( $modal_options['moove_gdpr_modal_powered_by_disable'] ) ? false : true;
180
+ return $view_controller->load( 'modal.gdpr-branding', $data );
181
+ }
182
+
183
+ /**
184
+ * GDPR Module - Privacy Overview Content
185
+ */
186
+ public function get_section_overview() {
187
+ $view_controller = new GDPR_Modules_View();
188
+ $modal_options = $this->gdpr_options;
189
+ $wpml_lang = $this->wpml_lang;
190
+ $gdpr_default_content = new Moove_GDPR_Content();
191
+ $layout = isset( $modal_options['moove_gdpr_plugin_layout'] ) ? $modal_options['moove_gdpr_plugin_layout'] : 'v1';
192
+ $tab_title = isset( $modal_options[ 'moove_gdpr_privacy_overview_tab_title' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_privacy_overview_tab_title' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_privacy_overview_tab_title' . $wpml_lang ] : __( 'Privacy Overview', 'gdpr-cookie-compliance' );
193
+ $tab_content = isset( $modal_options[ 'moove_gdpr_privacy_overview_tab_content' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_privacy_overview_tab_content' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_privacy_overview_tab_content' . $wpml_lang ] : $gdpr_default_content->moove_gdpr_get_privacy_overview_content();
194
+ $data = new stdClass();
195
+ $data->options = $modal_options;
196
+ $data->wpml_lang = $wpml_lang;
197
+ $data->tab_title = 'v1' === $layout ? $tab_title : false;
198
+ $data->tab_content = wpautop( $tab_content );
199
+ $data->visibility = 'v1' === $layout ? 'style="display:none"' : '';
200
+
201
+ return $view_controller->load( 'modal.content-sections.overview', $data );
202
+
203
+ }
204
+
205
+ /**
206
+ * GPDR Module - Strictly Necessary Cookies
207
+ */
208
+ public function get_section_strictly() {
209
+ $view_controller = new GDPR_Modules_View();
210
+ $modal_options = $this->gdpr_options;
211
+ $wpml_lang = $this->wpml_lang;
212
+ $gdpr_default_content = new Moove_GDPR_Content();
213
+ $layout = isset( $modal_options['moove_gdpr_plugin_layout'] ) ? $modal_options['moove_gdpr_plugin_layout'] : 'v1';
214
+ $tab_title = isset( $modal_options[ 'moove_gdpr_strictly_necessary_cookies_tab_title' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_strictly_necessary_cookies_tab_title' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_strictly_necessary_cookies_tab_title' . $wpml_lang ] : __( 'Strictly Necessary Cookies', 'gdpr-cookie-compliance' );
215
+ $tab_content = isset( $modal_options[ 'moove_gdpr_strict_necessary_cookies_tab_content' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_strict_necessary_cookies_tab_content' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_strict_necessary_cookies_tab_content' . $wpml_lang ] : $gdpr_default_content->moove_gdpr_get_strict_necessary_content();
216
+ $strictly = isset( $modal_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) && intval( $modal_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) ? intval( $modal_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) : 1;
217
+ $warning_msg = isset( $modal_options[ 'moove_gdpr_strictly_necessary_cookies_warning' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_strictly_necessary_cookies_warning' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_strictly_necessary_cookies_warning' . $wpml_lang ] : $gdpr_default_content->moove_gdpr_get_strict_necessary_warning();
218
+ $data = new stdClass();
219
+ $data->options = $modal_options;
220
+ $data->wpml_lang = $wpml_lang;
221
+ $data->tab_title = $tab_title;
222
+ $data->tab_content = wpautop( $tab_content );
223
+ $data->show = 3 !== $strictly;
224
+ $data->is_checked = 1 !== $strictly ? 'disabled checked="checked" ' : '';
225
+ $data->text_enable = isset( $modal_options[ 'moove_gdpr_modal_enabled_checkbox_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_modal_enabled_checkbox_label' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_modal_enabled_checkbox_label' . $wpml_lang ] : __( 'Enabled', 'gdpr-cookie-compliance' );
226
+ $data->text_disable = isset( $modal_options[ 'moove_gdpr_modal_disabled_checkbox_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_modal_disabled_checkbox_label' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_modal_disabled_checkbox_label' . $wpml_lang ] : __( 'Disabled', 'gdpr-cookie-compliance' );
227
+ $data->warning_message_top = 'v2' === $layout ? wpautop( $warning_msg ) : false;
228
+ $data->warning_message_bottom = 'v1' === $layout ? wpautop( $warning_msg ) : false;
229
+ $data->checkbox_state = 1 !== $strictly ? 'gdpr-checkbox-disabled checkbox-selected' : '';
230
+ $data->visibility = 'v1' === $layout ? 'style="display:none"' : '';
231
+ return $view_controller->load( 'modal.content-sections.strictly', $data );
232
+ }
233
+
234
+ /**
235
+ * GDPR Module - Advanced Cookies
236
+ */
237
+ public function get_section_advanced() {
238
+ $view_controller = new GDPR_Modules_View();
239
+ $modal_options = $this->gdpr_options;
240
+ $wpml_lang = $this->wpml_lang;
241
+ $gdpr_default_content = new Moove_GDPR_Content();
242
+
243
+ $layout = isset( $modal_options['moove_gdpr_plugin_layout'] ) ? $modal_options['moove_gdpr_plugin_layout'] : 'v1';
244
+ $tab_title = isset( $modal_options[ 'moove_gdpr_advanced_cookies_tab_title' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_advanced_cookies_tab_title' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_advanced_cookies_tab_title' . $wpml_lang ] : __( 'Additional Cookies', 'gdpr-cookie-compliance' );
245
+ $tab_content = isset( $modal_options[ 'moove_gdpr_advanced_cookies_tab_content' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_advanced_cookies_tab_content' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_advanced_cookies_tab_content' . $wpml_lang ] : $gdpr_default_content->moove_gdpr_get_advanced_cookies_content();
246
+ $strictly = isset( $modal_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) && intval( $modal_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) ? intval( $modal_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) : 1;
247
+ $data = new stdClass();
248
+ $data->options = $modal_options;
249
+ $data->wpml_lang = $wpml_lang;
250
+ $data->tab_title = $tab_title;
251
+ $data->tab_content = wpautop( $tab_content );
252
+ $data->show = isset( $modal_options['moove_gdpr_advanced_cookies_enable'] ) && 1 === intval( $modal_options['moove_gdpr_advanced_cookies_enable'] ) ? true : false;
253
+ $data->is_checked = 1 !== $strictly ? '' : 'disabled';
254
+ $data->fieldset = 1 !== $strictly ? 'fl-strenabled' : 'fl-disabled';
255
+ $data->text_enable = isset( $modal_options[ 'moove_gdpr_modal_enabled_checkbox_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_modal_enabled_checkbox_label' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_modal_enabled_checkbox_label' . $wpml_lang ] : __( 'Enabled', 'gdpr-cookie-compliance' );
256
+ $data->text_disable = isset( $modal_options[ 'moove_gdpr_modal_disabled_checkbox_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_modal_disabled_checkbox_label' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_modal_disabled_checkbox_label' . $wpml_lang ] : __( 'Disabled', 'gdpr-cookie-compliance' );
257
+ $data->warning_message = isset( $modal_options[ 'moove_gdpr_modal_strictly_secondary_notice' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_modal_strictly_secondary_notice' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_modal_strictly_secondary_notice' . $wpml_lang ] : $gdpr_default_content->moove_gdpr_get_secondary_notice();
258
+ $data->warning_message = wpautop( $data->warning_message );
259
+ $data->visibility = 'v1' === $layout ? 'style="display:none"' : '';
260
+ return $view_controller->load( 'modal.content-sections.advanced', $data );
261
+ }
262
+
263
+ /**
264
+ * GDPR Module - Third Party Cookies
265
+ */
266
+ public function get_section_third_party() {
267
+ $view_controller = new GDPR_Modules_View();
268
+ $modal_options = $this->gdpr_options;
269
+ $wpml_lang = $this->wpml_lang;
270
+ $gdpr_default_content = new Moove_GDPR_Content();
271
+ $layout = isset( $modal_options['moove_gdpr_plugin_layout'] ) ? $modal_options['moove_gdpr_plugin_layout'] : 'v1';
272
+ $tab_title = isset( $modal_options[ 'moove_gdpr_performance_cookies_tab_title' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_performance_cookies_tab_title' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_performance_cookies_tab_title' . $wpml_lang ] : __( '3rd Party Cookies', 'gdpr-cookie-compliance' );
273
+ $tab_content = isset( $modal_options[ 'moove_gdpr_performance_cookies_tab_content' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_performance_cookies_tab_content' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_performance_cookies_tab_content' . $wpml_lang ] : $gdpr_default_content->moove_gdpr_get_third_party_content();
274
+ $strictly = isset( $modal_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) && intval( $modal_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) ? intval( $modal_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) : 1;
275
+ $data = new stdClass();
276
+ $data->options = $modal_options;
277
+ $data->wpml_lang = $wpml_lang;
278
+ $data->tab_title = $tab_title;
279
+ $data->tab_content = wpautop( $tab_content );
280
+ $data->show = isset( $modal_options['moove_gdpr_third_party_cookies_enable'] ) && 1 === intval( $modal_options['moove_gdpr_third_party_cookies_enable'] ) ? true : false;
281
+ $data->is_checked = 1 !== $strictly ? '' : 'disabled';
282
+ $data->fieldset = 1 !== $strictly ? 'fl-strenabled' : 'fl-disabled';
283
+ $data->text_enable = isset( $modal_options[ 'moove_gdpr_modal_enabled_checkbox_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_modal_enabled_checkbox_label' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_modal_enabled_checkbox_label' . $wpml_lang ] : __( 'Enabled', 'gdpr-cookie-compliance' );
284
+ $data->text_disable = isset( $modal_options[ 'moove_gdpr_modal_disabled_checkbox_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_modal_disabled_checkbox_label' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_modal_disabled_checkbox_label' . $wpml_lang ] : __( 'Disabled', 'gdpr-cookie-compliance' );
285
+ $data->warning_message = isset( $modal_options[ 'moove_gdpr_modal_strictly_secondary_notice' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_modal_strictly_secondary_notice' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_modal_strictly_secondary_notice' . $wpml_lang ] : $gdpr_default_content->moove_gdpr_get_secondary_notice();
286
+ $data->warning_message = wpautop( $data->warning_message );
287
+ $data->visibility = 'v1' === $layout ? 'style="display:none"' : '';
288
+ return $view_controller->load( 'modal.content-sections.third_party', $data );
289
+ }
290
+
291
+ /**
292
+ * GDPR Module - Custom CSS for branding
293
+ */
294
+ public function get_branding_styles() {
295
+ $view_controller = new GDPR_Modules_View();
296
+ $modal_options = $this->gdpr_options;
297
+ $wpml_lang = $this->wpml_lang;
298
+ $font_family = false;
299
+ if ( isset( $modal_options['moove_gdpr_plugin_font_type'] ) ) :
300
+ if ( '1' === $modal_options['moove_gdpr_plugin_font_type'] ) :
301
+ $font_family = "'Nunito', sans-serif";
302
+ elseif ( '2' === $modal_options['moove_gdpr_plugin_font_type'] ) :
303
+ $font_family = 'inherit';
304
+ else :
305
+ $font_family = isset( $modal_options['moove_gdpr_plugin_font_family'] ) && $modal_options['moove_gdpr_plugin_font_family'] ? $modal_options['moove_gdpr_plugin_font_family'] : "'Nunito', sans-serif";
306
+ endif;
307
+ endif;
308
+ $font_family = $font_family ? $font_family : ( isset( $modal_options['moove_gdpr_plugin_font_family'] ) && $modal_options['moove_gdpr_plugin_font_family'] ? $modal_options['moove_gdpr_plugin_font_family'] : "'Nunito', sans-serif" );
309
+ $data = new stdClass();
310
+ $data->primary_colour = isset( $modal_options['moove_gdpr_brand_colour'] ) && $modal_options['moove_gdpr_brand_colour'] ? $modal_options['moove_gdpr_brand_colour'] : '#0C4DA2';
311
+ $data->secondary_colour = isset( $modal_options['moove_gdpr_brand_secondary_colour'] ) && $modal_options['moove_gdpr_brand_secondary_colour'] ? $modal_options['moove_gdpr_brand_secondary_colour'] : '#000000';
312
+ $data->button_bg = isset( $modal_options['moove_gdpr_floating_button_background_colour'] ) && $modal_options['moove_gdpr_floating_button_background_colour'] ? $modal_options['moove_gdpr_floating_button_background_colour'] : '#373737';
313
+ $data->button_hover_bg = isset( $modal_options['moove_gdpr_floating_button_hover_background_colour'] ) && $modal_options['moove_gdpr_floating_button_hover_background_colour'] ? $modal_options['moove_gdpr_floating_button_hover_background_colour'] : '#000000';
314
+ $data->button_font = isset( $modal_options['moove_gdpr_floating_button_font_colour'] ) && $modal_options['moove_gdpr_floating_button_font_colour'] ? $modal_options['moove_gdpr_floating_button_font_colour'] : '#ffffff';
315
+ $data->font_family = $font_family;
316
+ return $view_controller->load( 'branding-styles', $data );
317
+
318
+ }
319
+
320
+ /**
321
+ * GDPR Module - Cookie Policy Page
322
+ */
323
+ public function get_section_cookiepolicy() {
324
+ $view_controller = new GDPR_Modules_View();
325
+ $modal_options = $this->gdpr_options;
326
+ $wpml_lang = $this->wpml_lang;
327
+ $gdpr_default_content = new Moove_GDPR_Content();
328
+ $layout = isset( $modal_options['moove_gdpr_plugin_layout'] ) ? $modal_options['moove_gdpr_plugin_layout'] : 'v1';
329
+ $tab_title = isset( $modal_options[ 'moove_gdpr_cookie_policy_tab_nav_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_cookie_policy_tab_nav_label' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_cookie_policy_tab_nav_label' . $wpml_lang ] : __( '3rd Party Cookies', 'gdpr-cookie-compliance' );
330
+ $tab_content = isset( $modal_options[ 'moove_gdpr_cookies_policy_tab_content' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_cookies_policy_tab_content' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_cookies_policy_tab_content' . $wpml_lang ] : $gdpr_default_content->moove_gdpr_get_cookie_policy_content();
331
+ $data = new stdClass();
332
+ $data->options = $modal_options;
333
+ $data->wpml_lang = $wpml_lang;
334
+ $data->tab_title = $tab_title;
335
+ $data->tab_content = wpautop( $tab_content );
336
+ $data->show = isset( $modal_options['moove_gdpr_cookie_policy_enable'] ) && 1 === intval( $modal_options['moove_gdpr_cookie_policy_enable'] ) ? true : false;
337
+ $data->visibility = 'v1' === $layout ? 'style="display:none"' : '';
338
+ return $view_controller->load( 'modal.content-sections.cookiepolicy', $data );
339
+ }
340
+
341
+ /**
342
+ * GDPR Module - Footer Button inside the Modal
343
+ */
344
+ public function get_tab_footer_buttons() {
345
+ $view_controller = new GDPR_Modules_View();
346
+ $modal_options = $this->gdpr_options;
347
+ $wpml_lang = $this->wpml_lang;
348
+ $data = new stdClass();
349
+ $data->allow_label = isset( $modal_options[ 'moove_gdpr_modal_allow_button_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_modal_allow_button_label' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_modal_allow_button_label' . $wpml_lang ] : __( 'Enable All', 'gdpr-cookie-compliance' );
350
+ $data->settings_label = isset( $modal_options[ 'moove_gdpr_modal_save_button_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_modal_save_button_label' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_modal_save_button_label' . $wpml_lang ] : __( 'Save Settings', 'gdpr-cookie-compliance' );
351
+
352
+ return $view_controller->load( 'modal.tab-footer-buttons', $data );
353
+ }
354
+
355
+ /**
356
+ * GDPR Module - Navigation inside the modal
357
+ */
358
+ public function get_tab_navigation() {
359
+ $view_controller = new GDPR_Modules_View();
360
+ $modal_options = $this->gdpr_options;
361
+ $wpml_lang = $this->wpml_lang;
362
+ $strictly = isset( $modal_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) && intval( $modal_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) ? intval( $modal_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) : 1;
363
+ $data = new stdClass();
364
+ $data->overview = new stdClass();
365
+ $data->strictly = new stdClass();
366
+ $data->advanced = new stdClass();
367
+ $data->third_party = new stdClass();
368
+ $data->cookiepolicy = new stdClass();
369
+
370
+ // OVERVIEW.
371
+ $data->overview->nav_label = isset( $modal_options[ 'moove_gdpr_privacy_overview_tab_title' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_privacy_overview_tab_title' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_privacy_overview_tab_title' . $wpml_lang ] : __( 'Privacy Overview', 'gdpr-cookie-compliance' );
372
+
373
+ // STRICTLY.
374
+ $data->strictly->show = 3 !== $strictly;
375
+ $data->strictly->nav_label = isset( $modal_options[ 'moove_gdpr_strictly_necessary_cookies_tab_title' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_strictly_necessary_cookies_tab_title' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_strictly_necessary_cookies_tab_title' . $wpml_lang ] : __( 'Strictly Necessary Cookies', 'gdpr-cookie-compliance' );
376
+
377
+ // THIRD PARTY.
378
+ $data->third_party->show = isset( $modal_options['moove_gdpr_third_party_cookies_enable'] ) && 1 === intval( $modal_options['moove_gdpr_third_party_cookies_enable'] ) ? true : false;
379
+ $data->third_party->nav_label = isset( $modal_options[ 'moove_gdpr_performance_cookies_tab_title' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_performance_cookies_tab_title' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_performance_cookies_tab_title' . $wpml_lang ] : __( '3rd Party Cookies', 'gdpr-cookie-compliance' );
380
+
381
+ // ADVANCED.
382
+ $data->advanced->show = isset( $modal_options['moove_gdpr_advanced_cookies_enable'] ) && 1 === intval( $modal_options['moove_gdpr_advanced_cookies_enable'] ) ? true : false;
383
+ $data->advanced->nav_label = isset( $modal_options[ 'moove_gdpr_advanced_cookies_tab_title' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_advanced_cookies_tab_title' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_advanced_cookies_tab_title' . $wpml_lang ] : __( 'Additional Cookies', 'gdpr-cookie-compliance' );
384
+
385
+ // COOKIEPOLICY.
386
+ $data->cookiepolicy->show = isset( $modal_options['moove_gdpr_cookie_policy_enable'] ) && 1 === intval( $modal_options['moove_gdpr_cookie_policy_enable'] ) ? true : false;
387
+ $data->cookiepolicy->nav_label = isset( $modal_options[ 'moove_gdpr_cookie_policy_tab_nav_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_cookie_policy_tab_nav_label' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_cookie_policy_tab_nav_label' . $wpml_lang ] : __( 'Cookie Policy', 'gdpr-cookie-compliance' );
388
+
389
+ return $view_controller->load( 'modal.tab-navigation', $data );
390
+ }
391
+
392
+ }
moove-view.php → class-gdpr-view.php RENAMED
@@ -1,6 +1,4 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly
3
-
4
  /**
5
  * GDPR_View File Doc Comment
6
  *
@@ -9,6 +7,10 @@ if ( ! defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly
9
  * @author Gaspar Nemes
10
  */
11
 
 
 
 
 
12
  /**
13
  * GDPR_View Class Doc Comment
14
  *
@@ -23,11 +25,11 @@ class GDPR_View {
23
  * Parameters:
24
  *
25
  * @param string $view // the view to load, dot used as directory separator, no file extension given.
26
- * @param mixed $data // The data to display in the view (could be anything, even an object).
27
  */
28
  public static function load( $view, $content ) {
29
  $view_file_origin = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'views';
30
- $view_name = str_replace( '.' , DIRECTORY_SEPARATOR , $view ) . '.php';
31
  if ( file_exists( $view_file_origin . DIRECTORY_SEPARATOR . $view_name ) ) :
32
  ob_start();
33
  include $view_file_origin . DIRECTORY_SEPARATOR . $view_name;
1
  <?php
 
 
2
  /**
3
  * GDPR_View File Doc Comment
4
  *
7
  * @author Gaspar Nemes
8
  */
9
 
10
+ if ( ! defined( 'ABSPATH' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
  /**
15
  * GDPR_View Class Doc Comment
16
  *
25
  * Parameters:
26
  *
27
  * @param string $view // the view to load, dot used as directory separator, no file extension given.
28
+ * @param mixed $content // The data to display in the view (could be anything, even an object).
29
  */
30
  public static function load( $view, $content ) {
31
  $view_file_origin = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'views';
32
+ $view_name = str_replace( '.', DIRECTORY_SEPARATOR, $view ) . '.php';
33
  if ( file_exists( $view_file_origin . DIRECTORY_SEPARATOR . $view_name ) ) :
34
  ob_start();
35
  include $view_file_origin . DIRECTORY_SEPARATOR . $view_name;
moove-actions.php → class-moove-gdpr-actions.php RENAMED
@@ -1,8 +1,4 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) :
3
- exit;
4
- endif; // Exit if accessed directly.
5
-
6
  /**
7
  * Moove_GDPR_Actions File Doc Comment
8
  *
@@ -11,6 +7,10 @@ endif; // Exit if accessed directly.
11
  * @author Gaspar Nemes
12
  */
13
 
 
 
 
 
14
  /**
15
  * Moove_GDPR_Actions Class Doc Comment
16
  *
@@ -19,46 +19,51 @@ endif; // Exit if accessed directly.
19
  * @author Gaspar Nemes
20
  */
21
  class Moove_GDPR_Actions {
 
22
  /**
23
  * Global variable used in localization
24
  *
25
- * @var array
26
  */
27
- var $gdpr_loc_data;
28
  /**
29
  * Construct
30
  */
31
- function __construct() {
32
  $this->moove_register_scripts();
33
  $this->moove_register_ajax_actions();
34
  add_action( 'gdpr_cookie_filter_settings', array( &$this, 'gdpr_remove_cached_scripts' ) );
35
  add_action( 'gdpr_settings_tab_nav_extensions', array( &$this, 'gdpr_settings_tab_nav_extensions' ), 10, 1 );
36
  add_action( 'gdpr_check_extensions', array( &$this, 'gdpr_check_extensions' ), 10, 2 );
37
  add_action( 'gdpr_premium_section_ads', array( &$this, 'gdpr_premium_section_ads' ) );
38
-
39
  add_action( 'gdpr_tab_cbm_ph', array( &$this, 'gdpr_premium_section_ads' ) );
40
  add_action( 'gdpr_tab_cbm_ps', array( &$this, 'gdpr_premium_section_ads' ) );
41
  add_action( 'gdpr_get_alertbox', array( 'Moove_GDPR_Content', 'gdpr_get_alertbox' ), 10, 3 );
42
  add_action( 'gdpr_licence_input_field', array( 'Moove_GDPR_Content', 'gdpr_licence_input_field' ), 10, 2 );
43
  add_action( 'gdpr_licence_action_button', array( 'Moove_GDPR_Content', 'gdpr_licence_action_button' ), 10, 2 );
44
  add_action( 'gdpr_premium_update_alert', array( 'Moove_GDPR_Content', 'gdpr_premium_update_alert' ) );
45
-
46
  add_action( 'gdpr_cdn_url', array( &$this, 'gdpr_cdn_base_url' ), 10, 1 );
47
  add_action( 'gdpr_info_bar_button_extensions', array( &$this, 'gdpr_info_add_reject_button_extensions' ) );
48
  add_action( 'gdpr_support_sidebar_class', array( &$this, 'gdpr_support_sidebar_class' ), 10, 1 );
49
-
50
  $gdpr_default_content = new Moove_GDPR_Content();
51
  $option_key = $gdpr_default_content->moove_gdpr_get_key_name();
52
  $gdpr_key = function_exists( 'get_site_option' ) ? get_site_option( $option_key ) : get_option( $option_key );
53
  if ( $gdpr_key && ! isset( $gdpr_key['deactivation'] ) ) :
54
  do_action( 'gdpr_plugin_loaded' );
55
  endif;
 
 
 
 
 
56
  }
57
 
58
  /**
59
  * Extra class for admin sidebar widgets
 
 
 
60
  */
61
-
62
  public function gdpr_support_sidebar_class( $class ) {
63
  if ( class_exists( 'Moove_GDPR_Addon_View' ) ) :
64
  $class = 'm-plugin-box-highlighted';
@@ -66,6 +71,20 @@ class Moove_GDPR_Actions {
66
  return $class;
67
  }
68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  /**
70
  * Reject button extension, will be listed next to the Accept button if it's enabled in the CMS
71
  */
@@ -76,14 +95,16 @@ class Moove_GDPR_Actions {
76
  $wpml_lang = $gdpr_default_content->moove_gdpr_get_wpml_lang();
77
  if ( isset( $modal_options['moove_gdpr_reject_button_enable'] ) && intval( $modal_options['moove_gdpr_reject_button_enable'] ) === 1 ) :
78
  $button_label = isset( $modal_options[ 'moove_gdpr_infobar_reject_button_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_infobar_reject_button_label' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_infobar_reject_button_label' . $wpml_lang ] : __( 'Reject', 'gdpr-cookie-compliance-addon' );
79
- ?>
80
- <button class="mgbutton moove-gdpr-infobar-reject-btn"><?php echo $button_label; ?></button>
81
- <?php
82
  endif;
83
- }
84
 
85
  /**
86
  * CDN base URL for lity lightbox
 
 
87
  */
88
  public function gdpr_cdn_base_url( $plugin_url ) {
89
  $gdpr_default_content = new Moove_GDPR_Content();
@@ -105,20 +126,22 @@ class Moove_GDPR_Actions {
105
  public function gdpr_premium_section_ads() {
106
 
107
  if ( class_exists( 'Moove_GDPR_Addon_View' ) ) :
108
- $add_on_view = new Moove_GDPR_Addon_View();
109
- $slug = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : false;
110
- $view_content = $slug ? $add_on_view->load( 'moove.admin.settings.' . $slug, array() ) : false;
 
 
 
 
111
 
112
- if ( ! $view_content && $slug && $slug !== 'help' ) :
113
  ?>
114
  <div class="gdpr-locked-section">
115
  <span>
116
  <i class="dashicons dashicons-lock"></i>
117
  <h4>This feature is not supported in this version of the Premium Add-on.</h4>
118
-
119
- <p><strong><a href="<?php echo admin_url( 'admin.php' ); ?>?page=moove-gdpr&amp;tab=licence" class="gdpr_admin_link">Activate your licence</a> to download the latest version of the Premium Add-on.</strong></p>
120
-
121
- <p class="gdpr_license_info">Don’t have a valid licence key yet? <br><a href="<?php echo MOOVE_SHOP_URL; ?>/my-account" target="_blank" class="gdpr_admin_link">Login to your account</a> to generate the key or <a href="https://www.mooveagency.com/wordpress-plugins/gdpr-cookie-compliance/" class="gdpr_admin_link" target="_blank">buy a new licence here</a>.</p>
122
  <br />
123
 
124
  <a href="https://www.mooveagency.com/wordpress-plugins/gdpr-cookie-compliance/" target="_blank" class="plugin-buy-now-btn">Buy Now</a>
@@ -140,9 +163,9 @@ class Moove_GDPR_Actions {
140
  $gdpr_key = function_exists( 'get_site_option' ) ? get_site_option( $option_key ) : get_option( $option_key );
141
  ?>
142
  <?php if ( isset( $gdpr_key['deactivation'] ) || $gdpr_key['activation'] ) : ?>
143
- <p><strong><a href="<?php echo admin_url( 'admin.php' ); ?>?page=moove-gdpr&amp;tab=licence" class="gdpr_admin_link">Activate your licence</a> or <a href="https://www.mooveagency.com/wordpress-plugins/gdpr-cookie-compliance/" class="gdpr_admin_link" target="_blank">buy a new licence here</a></strong></p>
144
  <?php else : ?>
145
- <p><strong>Do you have a licence key? <br />Insert your license key to the "<a href="<?php echo admin_url( 'admin.php' ); ?>?page=moove-gdpr&amp;tab=licence" class="gdpr_admin_link">Licence Manager</a>" and activate it.</strong></p>
146
 
147
  <?php endif; ?>
148
  <br />
@@ -154,20 +177,23 @@ class Moove_GDPR_Actions {
154
  <!-- .gdpr-locked-section -->
155
  <?php
156
  endif;
157
- }
158
 
159
  /**
160
  * Checking for Premium Add-on installed and activated
 
 
 
161
  */
162
  public function gdpr_check_extensions( $content, $slug ) {
163
  $return = $content;
164
  if ( class_exists( 'Moove_GDPR_Addon_View' ) ) :
165
- $add_on_view = new Moove_GDPR_Addon_View();
166
- if ( method_exists( $add_on_view, 'check' ) ) :
167
- $view_content = $add_on_view->check( 'moove.admin.settings.' . $slug ) ;
168
- if ( $view_content ) :
169
- $return = '';
170
- endif;
171
  else :
172
  $return = '';
173
  endif;
@@ -210,11 +236,11 @@ class Moove_GDPR_Actions {
210
  $force_reload = $force_reload ? 'true' : 'false';
211
  $geo_location_enabled = isset( $modal_options['moove_gdpr_geolocation_eu'] ) && intval( $modal_options['moove_gdpr_geolocation_eu'] ) === 1 ? 'true' : 'false';
212
 
213
- // By using this filter, you can force the plugin to load the lity lightbox using PHP instead of JavaScript.
214
- $load_lity = apply_filters('gdpr_enqueue_lity_nojs', true);
215
- $load_lity = $load_lity ? 'true' : 'false';
216
 
217
- $loc_data = array(
218
  'ajaxurl' => admin_url( 'admin-ajax.php' ),
219
  'post_id' => get_the_ID(),
220
  'plugin_dir' => apply_filters( 'gdpr_cdn_url', plugins_url( basename( dirname( __FILE__ ) ) ) ),
@@ -224,13 +250,13 @@ class Moove_GDPR_Actions {
224
  'third_party' => isset( $modal_options['moove_gdpr_third_party_cookies_enable_first_visit'] ) && intval( $modal_options['moove_gdpr_third_party_cookies_enable_first_visit'] ) ? intval( $modal_options['moove_gdpr_third_party_cookies_enable_first_visit'] ) : 0,
225
  'advanced' => isset( $modal_options['moove_gdpr_advanced_cookies_enable_first_visit'] ) && intval( $modal_options['moove_gdpr_advanced_cookies_enable_first_visit'] ) ? intval( $modal_options['moove_gdpr_advanced_cookies_enable_first_visit'] ) : 0,
226
  ),
227
- 'geo_location' => $geo_location_enabled,
228
  'force_reload' => $force_reload,
229
  'is_single' => is_single(),
230
  'current_user' => get_current_user_id(),
231
- 'load_lity' => $load_lity ,
232
  );
233
- $this->gdpr_loc_data = apply_filters( 'gdpr_extend_loc_data', $loc_data );
234
  wp_localize_script( $ascript, 'moove_frontend_gdpr_scripts', $this->gdpr_loc_data );
235
 
236
  }
@@ -256,12 +282,12 @@ class Moove_GDPR_Actions {
256
  $wpml_lang = $gdpr_default_content->moove_gdpr_get_wpml_lang();
257
  $css_file = 'gdpr-main.css';
258
  if ( isset( $modal_options['moove_gdpr_plugin_font_type'] ) ) :
259
- if ( $modal_options['moove_gdpr_plugin_font_type'] === '1' ) :
260
  $css_file = 'gdpr-main.css';
261
- elseif ( $modal_options['moove_gdpr_plugin_font_type'] === '2' ) :
262
  $css_file = 'gdpr-main-nf.css';
263
  else :
264
- $css_file = isset( $modal_options['moove_gdpr_plugin_font_family'] ) && $modal_options['moove_gdpr_plugin_font_family'] && strpos( strtolower( $modal_options['moove_gdpr_plugin_font_family'] ), 'nunito' ) === false ? 'gdpr-main-nf.css' : 'gdpr-main.css';
265
  endif;
266
  endif;
267
  wp_enqueue_style( 'moove_gdpr_frontend', plugins_url( basename( dirname( __FILE__ ) ) ) . '/dist/styles/' . $css_file, '', MOOVE_GDPR_VERSION );
@@ -295,6 +321,7 @@ class Moove_GDPR_Actions {
295
 
296
  add_action( 'wp_ajax_moove_hide_update_notice', array( 'Moove_GDPR_Updater', 'moove_hide_update_notice' ) );
297
 
 
298
  }
299
 
300
  /**
@@ -309,14 +336,15 @@ class Moove_GDPR_Actions {
309
  ob_start();
310
  ?>
311
 
312
- <a href="https://wordpress.org/plugins/gdpr-cookie-compliance" target="_blank" rel="noopener" class='moove-gdpr-branding'><?php echo $powered_label; ?> GDPR <?php _e( 'plugin', 'gdpr-cookie-compliance' ); ?></a>
313
  <?php
314
  return ob_get_clean();
315
  }
316
 
317
  /**
318
- * GDPR Cookie Compliance - Admin Tabs
319
- * Routing & views
 
320
  */
321
  public function gdpr_settings_tab_nav_extensions( $active_tab ) {
322
  $tab_data = array(
@@ -356,15 +384,16 @@ class Moove_GDPR_Actions {
356
  foreach ( $tab_data as $tab ) :
357
  ob_start();
358
  ?>
359
- <a href="?page=moove-gdpr&amp;tab=<?php echo $tab['slug']; ?>" class="gdpr-cc-addon nav-tab gdpr-cc-disabled <?php echo $active_tab == $tab['slug'] ? 'nav-tab-active' : ''; ?>">
360
- <?php echo $tab['name']; ?>
361
  </a>
362
  <?php
363
  $content = ob_get_clean();
364
- echo apply_filters( 'gdpr_check_extensions', $content, $tab['slug'] );
 
365
  endforeach;
366
  }
367
 
368
  }
369
- $moove_gdpr_actions_provider = new Moove_GDPR_Actions();
370
 
1
  <?php
 
 
 
 
2
  /**
3
  * Moove_GDPR_Actions File Doc Comment
4
  *
7
  * @author Gaspar Nemes
8
  */
9
 
10
+ if ( ! defined( 'ABSPATH' ) ) :
11
+ exit;
12
+ endif; // Exit if accessed directly.
13
+
14
  /**
15
  * Moove_GDPR_Actions Class Doc Comment
16
  *
19
  * @author Gaspar Nemes
20
  */
21
  class Moove_GDPR_Actions {
22
+
23
  /**
24
  * Global variable used in localization
25
  *
26
+ * @var $gdpr_loc_data Localization variable
27
  */
28
+ public $gdpr_loc_data;
29
  /**
30
  * Construct
31
  */
32
+ public function __construct() {
33
  $this->moove_register_scripts();
34
  $this->moove_register_ajax_actions();
35
  add_action( 'gdpr_cookie_filter_settings', array( &$this, 'gdpr_remove_cached_scripts' ) );
36
  add_action( 'gdpr_settings_tab_nav_extensions', array( &$this, 'gdpr_settings_tab_nav_extensions' ), 10, 1 );
37
  add_action( 'gdpr_check_extensions', array( &$this, 'gdpr_check_extensions' ), 10, 2 );
38
  add_action( 'gdpr_premium_section_ads', array( &$this, 'gdpr_premium_section_ads' ) );
 
39
  add_action( 'gdpr_tab_cbm_ph', array( &$this, 'gdpr_premium_section_ads' ) );
40
  add_action( 'gdpr_tab_cbm_ps', array( &$this, 'gdpr_premium_section_ads' ) );
41
  add_action( 'gdpr_get_alertbox', array( 'Moove_GDPR_Content', 'gdpr_get_alertbox' ), 10, 3 );
42
  add_action( 'gdpr_licence_input_field', array( 'Moove_GDPR_Content', 'gdpr_licence_input_field' ), 10, 2 );
43
  add_action( 'gdpr_licence_action_button', array( 'Moove_GDPR_Content', 'gdpr_licence_action_button' ), 10, 2 );
44
  add_action( 'gdpr_premium_update_alert', array( 'Moove_GDPR_Content', 'gdpr_premium_update_alert' ) );
 
45
  add_action( 'gdpr_cdn_url', array( &$this, 'gdpr_cdn_base_url' ), 10, 1 );
46
  add_action( 'gdpr_info_bar_button_extensions', array( &$this, 'gdpr_info_add_reject_button_extensions' ) );
47
  add_action( 'gdpr_support_sidebar_class', array( &$this, 'gdpr_support_sidebar_class' ), 10, 1 );
 
48
  $gdpr_default_content = new Moove_GDPR_Content();
49
  $option_key = $gdpr_default_content->moove_gdpr_get_key_name();
50
  $gdpr_key = function_exists( 'get_site_option' ) ? get_site_option( $option_key ) : get_option( $option_key );
51
  if ( $gdpr_key && ! isset( $gdpr_key['deactivation'] ) ) :
52
  do_action( 'gdpr_plugin_loaded' );
53
  endif;
54
+ add_action( 'gdpr_cc_keephtml', array( &$this, 'gdpr_cc_keephtml' ), 10, 2 );
55
+
56
+ add_action( 'wp_footer', array( 'Moove_GDPR_Controller', 'moove_gdpr_cookie_popup_modal' ), 99 );
57
+ add_action( 'admin_init', array( 'Moove_GDPR_Controller', 'moove_gdpr_add_editor_styles' ) );
58
+ add_action( 'wp_footer', array( 'Moove_GDPR_Controller', 'moove_gdpr_cookie_popup_info' ) );
59
  }
60
 
61
  /**
62
  * Extra class for admin sidebar widgets
63
+ *
64
+ * @param string $class Class name.
65
+ * @return string $class
66
  */
 
67
  public function gdpr_support_sidebar_class( $class ) {
68
  if ( class_exists( 'Moove_GDPR_Addon_View' ) ) :
69
  $class = 'm-plugin-box-highlighted';
71
  return $class;
72
  }
73
 
74
+ /**
75
+ * Sanitize filter allowing html tags and styles with attributes
76
+ *
77
+ * @param string $content Content.
78
+ * @param boolean $echo Option echo the value or return.
79
+ */
80
+ public function gdpr_cc_keephtml( $content, $echo = false ) {
81
+ if ( $echo ) :
82
+ echo $content;
83
+ else :
84
+ return $content;
85
+ endif;
86
+ }
87
+
88
  /**
89
  * Reject button extension, will be listed next to the Accept button if it's enabled in the CMS
90
  */
95
  $wpml_lang = $gdpr_default_content->moove_gdpr_get_wpml_lang();
96
  if ( isset( $modal_options['moove_gdpr_reject_button_enable'] ) && intval( $modal_options['moove_gdpr_reject_button_enable'] ) === 1 ) :
97
  $button_label = isset( $modal_options[ 'moove_gdpr_infobar_reject_button_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_infobar_reject_button_label' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_infobar_reject_button_label' . $wpml_lang ] : __( 'Reject', 'gdpr-cookie-compliance-addon' );
98
+ ?>
99
+ <button class="mgbutton moove-gdpr-infobar-reject-btn"><?php echo esc_attr( $button_label ); ?></button>
100
+ <?php
101
  endif;
102
+ }
103
 
104
  /**
105
  * CDN base URL for lity lightbox
106
+ *
107
+ * @param string $plugin_url Plugin URL.
108
  */
109
  public function gdpr_cdn_base_url( $plugin_url ) {
110
  $gdpr_default_content = new Moove_GDPR_Content();
126
  public function gdpr_premium_section_ads() {
127
 
128
  if ( class_exists( 'Moove_GDPR_Addon_View' ) ) :
129
+ wp_verify_nonce( 'gdpr_nonce', 'gdpr_cookie_compliance_nonce' );
130
+ $slug = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : false;
131
+ $licence_manager = new Moove_GDPR_License_Manager();
132
+ $add_on_slug = $licence_manager->get_add_on_plugin_slug();
133
+ $view_path = $add_on_slug ? WP_PLUGIN_DIR . '/' . plugin_dir_path( $add_on_slug ) . '/views/moove/admin/settings/' . $slug .'.php' : false;
134
+
135
+ $view_content = $slug && $view_path ? file_exists( $view_path ) : false;
136
 
137
+ if ( ! $view_content && $slug && 'help' !== $slug ) :
138
  ?>
139
  <div class="gdpr-locked-section">
140
  <span>
141
  <i class="dashicons dashicons-lock"></i>
142
  <h4>This feature is not supported in this version of the Premium Add-on.</h4>
143
+ <p><strong><a href="<?php echo esc_url( admin_url( 'admin.php' ) ); ?>?page=moove-gdpr&amp;tab=licence" class="gdpr_admin_link">Activate your licence</a> to download the latest version of the Premium Add-on.</strong></p>
144
+ <p class="gdpr_license_info">Don’t have a valid licence key yet? <br><a href="<?php echo esc_url( MOOVE_SHOP_URL ); ?>/my-account" target="_blank" class="gdpr_admin_link">Login to your account</a> to generate the key or <a href="https://www.mooveagency.com/wordpress-plugins/gdpr-cookie-compliance/" class="gdpr_admin_link" target="_blank">buy a new licence here</a>.</p>
 
 
145
  <br />
146
 
147
  <a href="https://www.mooveagency.com/wordpress-plugins/gdpr-cookie-compliance/" target="_blank" class="plugin-buy-now-btn">Buy Now</a>
163
  $gdpr_key = function_exists( 'get_site_option' ) ? get_site_option( $option_key ) : get_option( $option_key );
164
  ?>
165
  <?php if ( isset( $gdpr_key['deactivation'] ) || $gdpr_key['activation'] ) : ?>
166
+ <p><strong><a href="<?php echo esc_url( admin_url( 'admin.php' ) ); ?>?page=moove-gdpr&amp;tab=licence" class="gdpr_admin_link">Activate your licence</a> or <a href="https://www.mooveagency.com/wordpress-plugins/gdpr-cookie-compliance/" class="gdpr_admin_link" target="_blank">buy a new licence here</a></strong></p>
167
  <?php else : ?>
168
+ <p><strong>Do you have a licence key? <br />Insert your license key to the "<a href="<?php echo esc_url( admin_url( 'admin.php' ) ); ?>?page=moove-gdpr&amp;tab=licence" class="gdpr_admin_link">Licence Manager</a>" and activate it.</strong></p>
169
 
170
  <?php endif; ?>
171
  <br />
177
  <!-- .gdpr-locked-section -->
178
  <?php
179
  endif;
180
+ }
181
 
182
  /**
183
  * Checking for Premium Add-on installed and activated
184
+ *
185
+ * @param string $content Content.
186
+ * @param string $slug Slug.
187
  */
188
  public function gdpr_check_extensions( $content, $slug ) {
189
  $return = $content;
190
  if ( class_exists( 'Moove_GDPR_Addon_View' ) ) :
191
+ $licence_manager = new Moove_GDPR_License_Manager();
192
+ $add_on_slug = $licence_manager->get_add_on_plugin_slug();
193
+ $view_path = $add_on_slug ? WP_PLUGIN_DIR . '/' . plugin_dir_path( $add_on_slug ) . '/views/moove/admin/settings/' . $slug .'.php' : false;
194
+ $view_content = $slug && $view_path ? file_exists( $view_path ) : false;
195
+ if ( ! $view_content ) :
196
+ $return = $return;
197
  else :
198
  $return = '';
199
  endif;
236
  $force_reload = $force_reload ? 'true' : 'false';
237
  $geo_location_enabled = isset( $modal_options['moove_gdpr_geolocation_eu'] ) && intval( $modal_options['moove_gdpr_geolocation_eu'] ) === 1 ? 'true' : 'false';
238
 
239
+ // By using this filter, you can force the plugin to load the lity lightbox using PHP instead of JavaScript.
240
+ $load_lity = apply_filters( 'gdpr_enqueue_lity_nojs', true );
241
+ $load_lity = $load_lity ? 'true' : 'false';
242
 
243
+ $loc_data = array(
244
  'ajaxurl' => admin_url( 'admin-ajax.php' ),
245
  'post_id' => get_the_ID(),
246
  'plugin_dir' => apply_filters( 'gdpr_cdn_url', plugins_url( basename( dirname( __FILE__ ) ) ) ),
250
  'third_party' => isset( $modal_options['moove_gdpr_third_party_cookies_enable_first_visit'] ) && intval( $modal_options['moove_gdpr_third_party_cookies_enable_first_visit'] ) ? intval( $modal_options['moove_gdpr_third_party_cookies_enable_first_visit'] ) : 0,
251
  'advanced' => isset( $modal_options['moove_gdpr_advanced_cookies_enable_first_visit'] ) && intval( $modal_options['moove_gdpr_advanced_cookies_enable_first_visit'] ) ? intval( $modal_options['moove_gdpr_advanced_cookies_enable_first_visit'] ) : 0,
252
  ),
253
+ 'geo_location' => $geo_location_enabled,
254
  'force_reload' => $force_reload,
255
  'is_single' => is_single(),
256
  'current_user' => get_current_user_id(),
257
+ 'load_lity' => $load_lity,
258
  );
259
+ $this->gdpr_loc_data = apply_filters( 'gdpr_extend_loc_data', $loc_data );
260
  wp_localize_script( $ascript, 'moove_frontend_gdpr_scripts', $this->gdpr_loc_data );
261
 
262
  }
282
  $wpml_lang = $gdpr_default_content->moove_gdpr_get_wpml_lang();
283
  $css_file = 'gdpr-main.css';
284
  if ( isset( $modal_options['moove_gdpr_plugin_font_type'] ) ) :
285
+ if ( '1' === $modal_options['moove_gdpr_plugin_font_type'] ) :
286
  $css_file = 'gdpr-main.css';
287
+ elseif ( '2' === $modal_options['moove_gdpr_plugin_font_type'] ) :
288
  $css_file = 'gdpr-main-nf.css';
289
  else :
290
+ $css_file = isset( $modal_options['moove_gdpr_plugin_font_family'] ) && $modal_options['moove_gdpr_plugin_font_family'] && false === strpos( strtolower( $modal_options['moove_gdpr_plugin_font_family'] ), 'nunito' ) ? 'gdpr-main-nf.css' : 'gdpr-main.css';
291
  endif;
292
  endif;
293
  wp_enqueue_style( 'moove_gdpr_frontend', plugins_url( basename( dirname( __FILE__ ) ) ) . '/dist/styles/' . $css_file, '', MOOVE_GDPR_VERSION );
321
 
322
  add_action( 'wp_ajax_moove_hide_update_notice', array( 'Moove_GDPR_Updater', 'moove_hide_update_notice' ) );
323
 
324
+ add_action( 'wp_ajax_gdpr_cookie_compliance_reset_settings', array( 'Moove_GDPR_Controller', 'gdpr_cookie_compliance_reset_settings' ) );
325
  }
326
 
327
  /**
336
  ob_start();
337
  ?>
338
 
339
+ <a href="https://wordpress.org/plugins/gdpr-cookie-compliance" target="_blank" rel="noopener" class='moove-gdpr-branding'><?php echo esc_attr( $powered_label ); ?> GDPR <?php esc_attr_e( 'plugin', 'gdpr-cookie-compliance' ); ?></a>
340
  <?php
341
  return ob_get_clean();
342
  }
343
 
344
  /**
345
+ * GDPR Cookie Compliance - Admin Tabs - Routing & views
346
+ *
347
+ * @param string $active_tab Active tab.
348
  */
349
  public function gdpr_settings_tab_nav_extensions( $active_tab ) {
350
  $tab_data = array(
384
  foreach ( $tab_data as $tab ) :
385
  ob_start();
386
  ?>
387
+ <a href="?page=moove-gdpr&amp;tab=<?php echo esc_attr( $tab['slug'] ); ?>" class="gdpr-cc-addon nav-tab gdpr-cc-disabled <?php echo $active_tab === $tab['slug'] ? 'nav-tab-active' : ''; ?>">
388
+ <?php echo esc_attr( $tab['name'] ); ?>
389
  </a>
390
  <?php
391
  $content = ob_get_clean();
392
+ $content = apply_filters( 'gdpr_check_extensions', $content, $tab['slug'] );
393
+ apply_filters( 'gdpr_cc_keephtml', $content, true );
394
  endforeach;
395
  }
396
 
397
  }
398
+ new Moove_GDPR_Actions();
399
 
class-moove-gdpr-content.php ADDED
@@ -0,0 +1,498 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Moove_GDPR_Content File Doc Comment
4
+ *
5
+ * @category Moove_GDPR_Content
6
+ * @package gdpr-cookie-compliance
7
+ * @author Gaspar Nemes
8
+ */
9
+
10
+ if ( ! defined( 'ABSPATH' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
+
15
+ /**
16
+ * Moove_GDPR_Content Class Doc Comment
17
+ *
18
+ * @category Class
19
+ * @package Moove_Controller
20
+ * @author Gaspar Nemes
21
+ */
22
+ class Moove_GDPR_Content {
23
+
24
+ /**
25
+ * Construct
26
+ */
27
+ public function __construct() {
28
+
29
+ }
30
+
31
+ /**
32
+ * Privacy Overview Tab Content
33
+ *
34
+ * @return string Filtered Content
35
+ */
36
+ public function moove_gdpr_get_privacy_overview_content() {
37
+ $_content = '<p>' . __( 'This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.', 'gdpr-cookie-compliance' ) . '</p>';
38
+ return $_content;
39
+ }
40
+
41
+ /**
42
+ * JavaScript localize extension
43
+ */
44
+ public static function moove_gdpr_get_localize_scripts() {
45
+ $loc_data = array();
46
+ $gdpr_loc_data = apply_filters( 'gdpr_extend_loc_data', $loc_data );
47
+ return $gdpr_loc_data;
48
+ }
49
+
50
+ /**
51
+ * Strict Necessary Tab Content
52
+ *
53
+ * @return string Filtered Content
54
+ */
55
+ public function moove_gdpr_get_strict_necessary_content() {
56
+ $_content = '<p>' . __( 'Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.', 'gdpr-cookie-compliance' ) . '</p>';
57
+ return $_content;
58
+ }
59
+
60
+ /**
61
+ * Strict Necessary Warning Message
62
+ *
63
+ * @return string Filtered Content
64
+ */
65
+ public function moove_gdpr_get_strict_necessary_warning() {
66
+ $_content = '';
67
+ $options_name = $this->moove_gdpr_get_option_name();
68
+ $gdpr_options = get_option( $options_name );
69
+ $wpml_lang_options = $this->moove_gdpr_get_wpml_lang();
70
+
71
+ if ( ! isset( $gdpr_options[ 'moove_gdpr_strictly_necessary_cookies_warning' . $wpml_lang_options ] ) ) :
72
+ $_content = __( 'If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.', 'gdpr-cookie-compliance' );
73
+ endif;
74
+ return $_content;
75
+ }
76
+
77
+ /**
78
+ * Advanced Cookies Tab Content
79
+ *
80
+ * @return string Filtered Content
81
+ */
82
+ public function moove_gdpr_get_advanced_cookies_content() {
83
+ $_content = '<p>' . __( 'This website uses the following additional cookies:</p><p>(List the cookies that you are using on the website here.)', 'gdpr-cookie-compliance' ) . '</p>';
84
+ return $_content;
85
+ }
86
+
87
+ /**
88
+ * Third Party Cookies Tab Content
89
+ *
90
+ * @return string Filtered Content
91
+ */
92
+ public function moove_gdpr_get_third_party_content() {
93
+ $_content = '<p>' . __( 'This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.', 'gdpr-cookie-compliance' );
94
+ $_content .= '<p>' . __( 'Keeping this cookie enabled helps us to improve our website.', 'gdpr-cookie-compliance' ) . '</p>';
95
+ return $_content;
96
+ }
97
+
98
+ /**
99
+ * Cookie Policy Tab Content
100
+ *
101
+ * @return string Filtered Content
102
+ */
103
+ public function moove_gdpr_get_cookie_policy_content() {
104
+ $privacy_policy_page = get_option( 'wp_page_for_privacy_policy' );
105
+ $privacy_policy_link = $privacy_policy_page ? esc_url( get_permalink( $privacy_policy_page ) ) : false;
106
+ $privacy_policy_link = $privacy_policy_link ? $privacy_policy_link : '#';
107
+
108
+ $_content = '<p>' . sprintf( __( 'More information about our [privacy_link]Cookie Policy[/privacy_link]', 'gdpr-cookie-compliance' ), $privacy_policy_link ) . '</p>';
109
+ $_content = str_replace( '[privacy_link]', '<a href="' . $privacy_policy_link . '" target="_blank">', $_content );
110
+ $_content = str_replace( '[/privacy_link]', '</a>', $_content );
111
+
112
+ return $_content;
113
+ }
114
+
115
+ /**
116
+ * Cookie Policy Tab Content
117
+ *
118
+ * @return string Filtered Content
119
+ */
120
+ public function moove_gdpr_ifb_content() {
121
+ $_content = '<h2>' . __( 'Sorry,<br /> the content is blocked!', 'gdpr-cookie-compliance' );
122
+ $_content .= '<p>' . __( 'To unlock, please enable the cookies!', 'gdpr-cookie-compliance' );
123
+ $_content .= '<br><br>';
124
+ $_content .= __( '[accept]Accept[/accept] [setting]Adjust your settings[/setting]', 'gdpr-cookie-compliance' );
125
+ return $_content;
126
+ }
127
+
128
+
129
+
130
+ /**
131
+ * Get option name
132
+ */
133
+ public function moove_gdpr_get_option_name() {
134
+ return 'moove_gdpr_plugin_settings';
135
+ }
136
+
137
+ /**
138
+ * Get option name
139
+ */
140
+ public function moove_gdpr_get_key_name() {
141
+ return 'moove_gdpr_plugin_key';
142
+ }
143
+
144
+ /**
145
+ * Get strict secondary notice
146
+ */
147
+ public function moove_gdpr_get_secondary_notice() {
148
+ $_content = '';
149
+ $options_name = $this->moove_gdpr_get_option_name();
150
+ $gdpr_options = get_option( $options_name );
151
+ $wpml_lang_options = $this->moove_gdpr_get_wpml_lang();
152
+ if ( ! isset( $gdpr_options[ 'moove_gdpr_modal_strictly_secondary_notice' . $wpml_lang_options ] ) ) :
153
+ $_content = __( 'Please enable Strictly Necessary Cookies first so that we can save your preferences!', 'gdpr-cookie-compliance' );
154
+ endif;
155
+ return $_content;
156
+ }
157
+
158
+ /**
159
+ * Get WMPL language code
160
+ */
161
+ public function moove_gdpr_get_wpml_lang() {
162
+ if ( defined( 'ICL_LANGUAGE_CODE' ) ) {
163
+ $language_code = ICL_LANGUAGE_CODE;
164
+ if ( ICL_LANGUAGE_CODE === 'all' ) :
165
+ if ( function_exists( 'pll_default_language' ) ) :
166
+ $language_code = pll_default_language();
167
+ elseif ( class_exists( 'SitePress' ) ) :
168
+ global $sitepress;
169
+ $language_code = $sitepress->get_default_language();
170
+ endif;
171
+ endif;
172
+ return '_' . $language_code;
173
+ } elseif ( isset( $GLOBALS['q_config']['language'] ) ) {
174
+ return $GLOBALS['q_config']['language'];
175
+ } elseif ( function_exists( 'wpm_get_user_language' ) ) {
176
+ return wpm_get_user_language();
177
+ }
178
+ return '';
179
+ }
180
+
181
+ /**
182
+ * Licence token
183
+ */
184
+ public function get_license_token() {
185
+ $license_token = function_exists( 'network_site_url' ) ? network_site_url( '/' ) : home_url( '/' );
186
+ return $license_token;
187
+ }
188
+
189
+ /**
190
+ * PHP Cookie Checker, available from version 1.3.0
191
+ */
192
+ public function gdpr_get_php_cookies() {
193
+ $cookies_accepted = array(
194
+ 'strict' => false,
195
+ 'thirdparty' => false,
196
+ 'advanced' => false,
197
+ );
198
+ if ( isset( $_COOKIE['moove_gdpr_popup'] ) ) :
199
+ $cookies = sanitize_text_field( wp_unslash( $_COOKIE['moove_gdpr_popup'] ) );
200
+ $cookies_decoded = json_decode( wp_unslash( $cookies ), true );
201
+ if ( $cookies_decoded && is_array( $cookies_decoded ) && ! empty( $cookies_decoded ) ) :
202
+ $cookies_accepted = array(
203
+ 'strict' => isset( $cookies_decoded['strict'] ) && intval( $cookies_decoded['strict'] ) === 1 ? true : false,
204
+ 'thirdparty' => isset( $cookies_decoded['thirdparty'] ) && intval( $cookies_decoded['thirdparty'] ) === 1 ? true : false,
205
+ 'advanced' => isset( $cookies_decoded['advanced'] ) && intval( $cookies_decoded['advanced'] ) === 1 ? true : false,
206
+ );
207
+ endif;
208
+ else :
209
+ $options_name = $this->moove_gdpr_get_option_name();
210
+ $gdpr_options = get_option( $options_name );
211
+ $wpml_lang_options = $this->moove_gdpr_get_wpml_lang();
212
+
213
+ $strictly_functionality = isset( $gdpr_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) && intval( $gdpr_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) ? intval( $gdpr_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) : 1;
214
+ $thirdparty_default = isset( $gdpr_options['moove_gdpr_third_party_cookies_enable_first_visit'] ) && intval( $gdpr_options['moove_gdpr_third_party_cookies_enable_first_visit'] ) ? intval( $gdpr_options['moove_gdpr_third_party_cookies_enable_first_visit'] ) : 0;
215
+ $advanced_default = isset( $gdpr_options['moove_gdpr_advanced_cookies_enable_first_visit'] ) && intval( $gdpr_options['moove_gdpr_advanced_cookies_enable_first_visit'] ) ? intval( $gdpr_options['moove_gdpr_advanced_cookies_enable_first_visit'] ) : 0;
216
+
217
+ if ( 1 === $strictly_functionality ) :
218
+ if ( 1 === $thirdparty_default || 1 === $advanced_default ) :
219
+ $strict_default = 1;
220
+ else :
221
+ $strict_default = 0;
222
+ endif;
223
+ else :
224
+ $strict_default = 1;
225
+ endif;
226
+
227
+ $cookies_accepted = array(
228
+ 'strict' => $strict_default,
229
+ 'thirdparty' => $thirdparty_default,
230
+ 'advanced' => $advanced_default,
231
+ );
232
+
233
+ endif;
234
+ return $cookies_accepted;
235
+ }
236
+
237
+ /**
238
+ * GDPR Licence action button
239
+ *
240
+ * @param array $response Response.
241
+ * @param string $gdpr_key GDPR Key.
242
+ */
243
+ public static function gdpr_licence_action_button( $response, $gdpr_key ) {
244
+ $type = isset( $response['type'] ) ? $response['type'] : false;
245
+ if ( 'expired' === $type || 'activated' === $type || 'max_activation_reached' === $type ) :
246
+ ?>
247
+ <button type="submit" name="gdpr_activate_license" class="button button-primary button-inverse">
248
+ <?php esc_html_e( 'Activate', 'gdpr-cookie-compliance' ); ?>
249
+ </button>
250
+ <?php
251
+ elseif ( 'invalid' === $type ) :
252
+ ?>
253
+ <button type="submit" name="gdpr_activate_license" class="button button-primary button-inverse">
254
+ <?php esc_html_e( 'Activate', 'gdpr-cookie-compliance' ); ?>
255
+ </button>
256
+ <?php
257
+ else :
258
+ ?>
259
+ <button type="submit" name="gdpr_activate_license" class="button button-primary button-inverse">
260
+ <?php esc_html_e( 'Activate', 'gdpr-cookie-compliance' ); ?>
261
+ </button>
262
+ <br /><br />
263
+ <hr />
264
+ <h4 style="margin-bottom: 0;"><?php esc_html_e( 'Buy licence', 'gdpr-cookie-compliance' ); ?></h4>
265
+ <p>
266
+ <?php
267
+ $store_link = __( 'You can buy licences from our [store_link]online store[/store_link].', 'gdpr-cookie-compliance' );
268
+ $store_link = str_replace( '[store_link]', '<a href="https://www.mooveagency.com/wordpress-plugins/gdpr-cookie-compliance/" target="_blank" class="gdpr_admin_link">', $store_link );
269
+ $store_link = str_replace( '[/store_link]', '</a>', $store_link );
270
+ apply_filters( 'gdpr_cc_keephtml', $store_link, true );
271
+ ?>
272
+ </p>
273
+ <p>
274
+ <a href="https://www.mooveagency.com/wordpress-plugins/gdpr-cookie-compliance/" target="_blank" class="button button-primary">Buy Now</a>
275
+ </p>
276
+ <br />
277
+ <hr />
278
+ <?php
279
+ endif;
280
+ }
281
+
282
+ /**
283
+ * Licence input key
284
+ *
285
+ * @param array $response Response.
286
+ * @param string $gdpr_key GDPR Key.
287
+ */
288
+ public static function gdpr_licence_input_field( $response, $gdpr_key ) {
289
+ $type = isset( $response['type'] ) ? $response['type'] : false;
290
+ if ( 'expired' === $type ) :
291
+ // LICENSE EXPIRED.
292
+ ?>
293
+ <tr>
294
+ <th scope="row" style="padding: 0 0 10px 0;">
295
+ <hr />
296
+ <h4 style="margin-bottom: 0;"><?php esc_html_e( 'Renew your licence', 'gdpr-cookie-compliance' ); ?></h4>
297
+ <p><?php esc_html_e( 'Your licence has expired. You will not receive the latest updates and features unless you renew your licence.', 'gdpr-cookie-compliance' ); ?></p>
298
+ <a href="<?php echo esc_attr( MOOVE_SHOP_URL ); ?>?renew=<?php echo esc_attr( $response['key'] ); ?>" class="button button-primary">Renew Licence</a>
299
+ <br /><br />
300
+ <hr />
301
+
302
+ <h4 style="margin-bottom: 0;"><?php esc_html_e( 'Enter new licence key', 'gdpr-cookie-compliance' ); ?></h4>
303
+ </th>
304
+ </tr>
305
+ <tr>
306
+ <td style="padding: 0;">
307
+ <input name="moove_gdpr_license_key" required min="35" type="text" id="moove_gdpr_license_key" value="" class="regular-text">
308
+ </td>
309
+ </tr>
310
+ <?php
311
+ elseif ( 'activated' === $type || 'max_activation_reached' === $type ) :
312
+ // LICENSE ACTIVATED.
313
+ ?>
314
+ <tr>
315
+ <th scope="row" style="padding: 0 0 10px 0;">
316
+ <hr />
317
+ <h4 style="margin-bottom: 0;"><?php esc_html_e( 'Buy more licences', 'gdpr-cookie-compliance' ); ?></h4>
318
+ <p>
319
+ <?php
320
+ $store_link = __( 'You can buy more licences from our [store_link]online store[/store_link].', 'gdpr-cookie-compliance' );
321
+ $store_link = str_replace( '[store_link]', '<a href="https://www.mooveagency.com/wordpress-plugins/gdpr-cookie-compliance/" target="_blank" class="gdpr_admin_link">', $store_link );
322
+ $store_link = str_replace( '[/store_link]', '</a>', $store_link );
323
+ apply_filters( 'gdpr_cc_keephtml', $store_link, true );
324
+ ?>
325
+ </p>
326
+ <p>
327
+ <a href="https://www.mooveagency.com/wordpress-plugins/gdpr-cookie-compliance/" target="_blank" class="button button-primary">
328
+ Buy Now
329
+ </a>
330
+ </p>
331
+ <br />
332
+ <hr />
333
+ <h4 style="margin-bottom: 0;"><?php esc_html_e( 'Enter new licence key', 'gdpr-cookie-compliance' ); ?></h4>
334
+ </th>
335
+ </tr>
336
+ <tr>
337
+ <td style="padding: 0;">
338
+ <input name="moove_gdpr_license_key" required min="35" type="text" id="moove_gdpr_license_key" value="" class="regular-text">
339
+ </td>
340
+ </tr>
341
+ <?php
342
+ elseif ( 'invalid' === $type ) :
343
+ ?>
344
+ <tr>
345
+ <th scope="row" style="padding: 0 0 10px 0;">
346
+ <hr />
347
+ <h4 style="margin-bottom: 0;"><?php esc_html_e( 'Buy licence', 'gdpr-cookie-compliance' ); ?></h4>
348
+ <p>
349
+ <?php
350
+ $store_link = __( 'You can buy licences from our [store_link]online store[/store_link].', 'gdpr-cookie-compliance' );
351
+ $store_link = str_replace( '[store_link]', '<a href="https://www.mooveagency.com/wordpress-plugins/gdpr-cookie-compliance/" target="_blank" class="gdpr_admin_link">', $store_link );
352
+ $store_link = str_replace( '[/store_link]', '</a>', $store_link );
353
+ apply_filters( 'gdpr_cc_keephtml', $store_link, true );
354
+ ?>
355
+ </p>
356
+ <p>
357
+ <a href="https://www.mooveagency.com/wordpress-plugins/gdpr-cookie-compliance/" target="_blank" class="button button-primary">Buy Now</a>
358
+ </p>
359
+ <br />
360
+ <hr />
361
+ </th>
362
+ </tr>
363
+ <tr>
364
+ <th scope="row" style="padding: 0 0 10px 0;">
365
+ <label><?php esc_html_e( 'Enter your licence key:', 'gdpr-cookie-compliance' ); ?></label>
366
+ </th>
367
+ </tr>
368
+ <tr>
369
+ <td style="padding: 0;">
370
+ <input name="moove_gdpr_license_key" required min="35" type="text" id="moove_gdpr_license_key" value="" class="regular-text">
371
+ </td>
372
+ </tr>
373
+ <?php
374
+ else :
375
+ ?>
376
+ <tr>
377
+ <th scope="row" style="padding: 0 0 10px 0;">
378
+ <label><?php esc_html_e( 'Enter licence key:', 'gdpr-cookie-compliance' ); ?></label>
379
+ </th>
380
+ </tr>
381
+ <tr>
382
+ <td style="padding: 0;">
383
+ <input name="moove_gdpr_license_key" required min="35" type="text" id="moove_gdpr_license_key" value="" class="regular-text">
384
+ </td>
385
+ </tr>
386
+ <?php
387
+ endif;
388
+ }
389
+
390
+ /**
391
+ * GDPR Alert Box
392
+ *
393
+ * @param string $type Type.
394
+ * @param array $response Response.
395
+ * @param string $gdpr_key GDPR Key.
396
+ */
397
+ public static function gdpr_get_alertbox( $type, $response, $gdpr_key ) {
398
+ if ( 'error' === $type ) :
399
+ $messages = isset( $response['message'] ) && is_array( $response['message'] ) ? implode( '</p><p>', $response['message'] ) : '';
400
+ if ( $response['type'] === 'inactive' ) :
401
+ $gdpr_default_content = new Moove_GDPR_Content();
402
+ $option_key = $gdpr_default_content->moove_gdpr_get_key_name();
403
+ $gdpr_key = function_exists( 'get_site_option' ) ? get_site_option( $option_key ) : get_option( $option_key );
404
+ if ( function_exists( 'update_site_option' ) ) :
405
+ update_site_option(
406
+ $option_key,
407
+ array(
408
+ 'key' => $response['key'],
409
+ 'deactivation' => strtotime( 'now' ),
410
+ )
411
+ );
412
+ else :
413
+ update_option(
414
+ $option_key,
415
+ array(
416
+ 'key' => $response['key'],
417
+ 'deactivation' => strtotime( 'now' ),
418
+ )
419
+ );
420
+ endif;
421
+ $gdpr_key = function_exists( 'get_site_option' ) ? get_site_option( $option_key ) : get_option( $option_key );
422
+ endif;
423
+ ?>
424
+ <div class="gdpr-admin-alert gdpr-admin-alert-error">
425
+ <div class="gdpr-alert-content">
426
+ <p>License key: <strong><?php echo esc_attr( isset( $response['key'] ) ? $response['key'] : $gdpr_key['key'] ); ?></strong></p>
427
+ <p><?php apply_filters( 'gdpr_cc_keephtml', $messages, true ); ?></p>
428
+ </div>
429
+ <span class="dashicons dashicons-dismiss"></span>
430
+ </div>
431
+ <!-- .gdpr-admin-alert gdpr-admin-alert-success -->
432
+ <?php
433
+ else :
434
+ $messages = isset( $response['message'] ) && is_array( $response['message'] ) ? implode( '</p><p>', $response['message'] ) : '';
435
+ ?>
436
+ <div class="gdpr-admin-alert gdpr-admin-alert-success">
437
+ <div class="gdpr-alert-content">
438
+ <p>License key: <strong><?php echo esc_attr( isset( $response['key'] ) ? $response['key'] : $gdpr_key['key'] ); ?></strong></p>
439
+ <p><?php apply_filters( 'gdpr_cc_keephtml', $messages, true ); ?></p>
440
+ </div>
441
+ <span class="dashicons dashicons-yes-alt"></span>
442
+ </div>
443
+ <!-- .gdpr-admin-alert gdpr-admin-alert-success -->
444
+ <?php
445
+ endif;
446
+ do_action( 'gdpr_plugin_updater_notice' );
447
+ }
448
+
449
+ /**
450
+ * GDPR Update Alert
451
+ *
452
+ * @return void
453
+ */
454
+ public static function gdpr_premium_update_alert() {
455
+
456
+ $plugins = get_site_transient( 'update_plugins' );
457
+ $lm = new Moove_GDPR_License_Manager();
458
+ $plugin_slug = $lm->get_add_on_plugin_slug();
459
+
460
+ if ( isset( $plugins->response[ $plugin_slug ] ) && is_plugin_active( $plugin_slug ) ) :
461
+ $version = $plugins->response[ $plugin_slug ]->new_version;
462
+
463
+ $current_user = wp_get_current_user();
464
+ $user_id = isset( $current_user->ID ) ? $current_user->ID : 0;
465
+ $dismiss = get_option( 'gdpr_hide_update_notice_' . $user_id );
466
+
467
+ if ( isset( $plugins->response[ $plugin_slug ]->package ) && ! $plugins->response[ $plugin_slug ]->package ) :
468
+ $gdpr_default_content = new Moove_GDPR_Content();
469
+ $option_key = $gdpr_default_content->moove_gdpr_get_key_name();
470
+ $gdpr_key = function_exists( 'get_site_option' ) ? get_site_option( $option_key ) : get_option( $option_key );
471
+ $license_key = isset( $gdpr_key['key'] ) ? sanitize_text_field( $gdpr_key['key'] ) : false;
472
+ $renew_link = MOOVE_SHOP_URL . '?renew=' . $license_key;
473
+ $license_manager = admin_url( 'admin.php' ) . '?page=moove-gdpr&amp;tab=licence';
474
+ $purchase_link = 'https://www.mooveagency.com/wordpress-plugins/gdpr-cookie-compliance/';
475
+ $notice_text = '';
476
+ if ( $license_key && isset( $gdpr_key['activation'] ) ) :
477
+ // Expired.
478
+ $notice_text = 'Update is not available until you <a href="' . $renew_link . '" target="_blank">renew your licence</a>. You can also update your licence key in the <a href="' . $license_manager . '">Licence Manager</a>.';
479
+ elseif ( $license_key && isset( $gdpr_key['deactivation'] ) ) :
480
+ // Deactivated.
481
+ $notice_text = 'Update is not available until you <a href="' . $purchase_link . '" target="_blank">purchase a licence</a>. You can also update your licence key in the <a href="' . $license_manager . '">Licence Manager</a>.';
482
+ elseif ( ! $license_key ) :
483
+ // No license key installed.
484
+ $notice_text = 'Update is not available until you <a href="' . $purchase_link . '" target="_blank">purchase a licence</a>. You can also update your licence key in the <a href="' . $license_manager . '">Licence Manager</a>.';
485
+ endif;
486
+ ?>
487
+ <div class="gdpr-cookie-alert gdpr-cookie-update-alert" style="display: inline-block;">
488
+ <h4>
489
+ <?php esc_html_e( 'There is a new version of GDPR Cookie Compliance - Premium Add-On.', 'gdpr-cookie-compliance' ); ?></h4>
490
+ <p><?php apply_filters( 'gdpr_cc_keephtml', $notice_text, true ); ?></p>
491
+ </div>
492
+ <!-- .gdpr-cookie-alert -->
493
+ <?php
494
+ endif;
495
+ endif;
496
+ }
497
+ }
498
+ new Moove_GDPR_Content();
moove-options.php → class-moove-gdpr-options.php RENAMED
@@ -1,6 +1,4 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly
3
-
4
  /**
5
  * Moove_GDPR_Options File Doc Comment
6
  *
@@ -9,6 +7,10 @@ if ( ! defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly
9
  * @author Gaspar Nemes
10
  */
11
 
 
 
 
 
12
  /**
13
  * Moove_GDPR_Options Class Doc Comment
14
  *
@@ -23,10 +25,11 @@ class Moove_GDPR_Options {
23
  * @var array
24
  */
25
  private $options;
 
26
  /**
27
  * Construct
28
  */
29
- function __construct() {
30
  add_action( 'admin_menu', array( &$this, 'moove_gdpr_admin_menu' ) );
31
  }
32
 
@@ -39,10 +42,10 @@ class Moove_GDPR_Options {
39
  $gdpr_settings_page = add_menu_page(
40
  'GDPR Cookie', // Page_title.
41
  'GDPR Cookie Compliance', // Menu_title.
42
- 'manage_options', // Capability.
43
  'moove-gdpr', // Menu_slug.
44
  array( &$this, 'moove_gdpr_settings_page' ), // Function.
45
- 'dashicons-shield',
46
  90 // Position.
47
  );
48
  add_action( 'load-' . $gdpr_settings_page, array( 'Moove_GDPR_Actions', 'moove_gdpr_admin_scripts' ) );
@@ -53,10 +56,11 @@ class Moove_GDPR_Options {
53
  * @return void
54
  */
55
  public function moove_gdpr_settings_page() {
56
- $data = array();
57
  $view_cnt = new GDPR_View();
58
- echo $view_cnt->load( 'moove.admin.settings.settings_page', $data );
 
59
  }
60
 
61
  }
62
- $moove_gdpr_options = new Moove_GDPR_Options();
1
  <?php
 
 
2
  /**
3
  * Moove_GDPR_Options File Doc Comment
4
  *
7
  * @author Gaspar Nemes
8
  */
9
 
10
+ if ( ! defined( 'ABSPATH' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
  /**
15
  * Moove_GDPR_Options Class Doc Comment
16
  *
25
  * @var array
26
  */
27
  private $options;
28
+
29
  /**
30
  * Construct
31
  */
32
+ public function __construct() {
33
  add_action( 'admin_menu', array( &$this, 'moove_gdpr_admin_menu' ) );
34
  }
35
 
42
  $gdpr_settings_page = add_menu_page(
43
  'GDPR Cookie', // Page_title.
44
  'GDPR Cookie Compliance', // Menu_title.
45
+ apply_filters( 'gdpr_options_page_cap', 'manage_options' ), // Capability.
46
  'moove-gdpr', // Menu_slug.
47
  array( &$this, 'moove_gdpr_settings_page' ), // Function.
48
+ 'dashicons-shield', // Icon.
49
  90 // Position.
50
  );
51
  add_action( 'load-' . $gdpr_settings_page, array( 'Moove_GDPR_Actions', 'moove_gdpr_admin_scripts' ) );
56
  * @return void
57
  */
58
  public function moove_gdpr_settings_page() {
59
+ $data = array();
60
  $view_cnt = new GDPR_View();
61
+ $content = $view_cnt->load( 'moove.admin.settings.settings-page', $data );
62
+ apply_filters( 'gdpr_cc_keephtml', $content, true );
63
  }
64
 
65
  }
66
+ new Moove_GDPR_Options();
controllers/class-moove-gdpr-controller.php ADDED
@@ -0,0 +1,471 @@