PluginProbe ʕ •ᴥ•ʔ
GDPR Cookie Compliance – Cookie Banner, Cookie Consent, Cookie Notice for CCPA, EU Cookie Law / 4.10.6
GDPR Cookie Compliance – Cookie Banner, Cookie Consent, Cookie Notice for CCPA, EU Cookie Law v4.10.6
5.0.14 5.0.13 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.2.0 3.2.1 4.0.0 4.0.1 4.0.2 4.0.3 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.10.0 4.10.1 4.10.2 4.10.3 4.10.4 4.10.5 4.10.6 4.11.0 4.11.1 4.11.2 4.12.0 4.12.1 4.12.2 4.12.3 4.12.4 4.12.5 4.12.6 4.12.7 4.12.8 4.13.0 4.13.1 4.13.2 4.13.3 4.13.4 4.14.0 4.15.0 4.15.1 4.15.10 4.15.2 4.15.3 4.15.4 4.15.5 4.15.6 4.15.7 4.15.8 4.15.9 4.16.1 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7 4.3.8 4.3.9 4.4.0 4.4.1 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.5.0 4.5.1 4.5.10 4.5.11 4.5.12 4.5.13 4.5.2 4.5.3 4.5.4 4.5.5 4.5.6 4.5.7 4.5.8 4.5.9 4.6.0 4.6.1 4.6.2 4.6.3 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.7.5 4.7.6 4.7.7 4.8.0 4.8.1 4.8.10 4.8.11 4.8.12 4.8.13 4.8.2 4.8.3 4.8.4 4.8.5 4.8.6 4.8.7 4.8.8 4.8.9 4.9.1 4.9.2 4.9.3 4.9.4 4.9.5 4.9.6 4.9.7 5.0.0 5.0.1 5.0.10 5.0.11 5.0.12 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.0.9 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2
gdpr-cookie-compliance / class-moove-gdpr-content.php
gdpr-cookie-compliance Last commit date
controllers 3 years ago dist 3 years ago gdpr-modules 3 years ago languages 3 years ago views 3 years ago class-gdpr-modules-view.php 3 years ago class-gdpr-modules.php 3 years ago class-gdpr-view.php 3 years ago class-moove-gdpr-actions.php 3 years ago class-moove-gdpr-content.php 3 years ago class-moove-gdpr-options.php 3 years ago gdpr-functions.php 3 years ago moove-gdpr.php 3 years ago readme.txt 3 years ago
class-moove-gdpr-content.php
571 lines
1 <?php
2 /**
3 * Moove_GDPR_Content File Doc Comment
4 *
5 * @category Moove_GDPR_Content
6 * @package gdpr-cookie-compliance
7 * @author Moove Agency
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 Moove Agency
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 * Returns the GDPR activation key
43 * @param string $option_key Option key.
44 *
45 */
46 public function gdpr_get_activation_key( $option_key ) {
47 $value = get_option( $option_key );
48 if ( is_multisite() && ! $value ) :
49 $_value = function_exists( 'get_site_option' ) ? get_site_option( $option_key ) : false;
50 if ( $_value ) :
51 $main_blog_id = get_main_site_id();
52 if ( $main_blog_id ) :
53 switch_to_blog( $main_blog_id );
54 update_option(
55 $option_key,
56 $_value
57 );
58 restore_current_blog();
59 delete_site_option( $option_key );
60 $value = $_value;
61 endif;
62 endif;
63 endif;
64 return $value;
65 }
66
67 /**
68 * JavaScript localize extension
69 */
70 public static function moove_gdpr_get_localize_scripts() {
71 $loc_data = array();
72 $gdpr_loc_data = apply_filters( 'gdpr_extend_loc_data', $loc_data );
73 return $gdpr_loc_data;
74 }
75
76 /**
77 * Strict Necessary Tab Content
78 *
79 * @return string Filtered Content
80 */
81 public function moove_gdpr_get_strict_necessary_content() {
82 $_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>';
83 return $_content;
84 }
85
86 /**
87 * Strict Necessary Warning Message
88 *
89 * @return string Filtered Content
90 */
91 public function moove_gdpr_get_strict_necessary_warning() {
92 $_content = '';
93 $options_name = $this->moove_gdpr_get_option_name();
94 $gdpr_options = get_option( $options_name );
95 $wpml_lang_options = $this->moove_gdpr_get_wpml_lang();
96
97 if ( ! isset( $gdpr_options[ 'moove_gdpr_strictly_necessary_cookies_warning' . $wpml_lang_options ] ) ) :
98 $_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' );
99 endif;
100 return $_content;
101 }
102
103 /**
104 * Advanced Cookies Tab Content
105 *
106 * @return string Filtered Content
107 */
108 public function moove_gdpr_get_advanced_cookies_content() {
109 $_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>';
110 return $_content;
111 }
112
113 /**
114 * Third Party Cookies Tab Content
115 *
116 * @return string Filtered Content
117 */
118 public function moove_gdpr_get_third_party_content() {
119 $_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' );
120 $_content .= '<p>' . __( 'Keeping this cookie enabled helps us to improve our website.', 'gdpr-cookie-compliance' ) . '</p>';
121 return $_content;
122 }
123
124 /**
125 * Cookie Policy Tab Content
126 *
127 * @return string Filtered Content
128 */
129 public function moove_gdpr_get_cookie_policy_content() {
130 $privacy_policy_page = get_option( 'wp_page_for_privacy_policy' );
131 $privacy_policy_link = $privacy_policy_page ? esc_url( get_permalink( $privacy_policy_page ) ) : false;
132 $privacy_policy_link = $privacy_policy_link ? $privacy_policy_link : '#';
133
134 $_content = '<p>' . sprintf( __( 'More information about our [privacy_link]Cookie Policy[/privacy_link]', 'gdpr-cookie-compliance' ), $privacy_policy_link ) . '</p>';
135 $_content = str_replace( '[privacy_link]', '<a href="' . $privacy_policy_link . '" target="_blank">', $_content );
136 $_content = str_replace( '[/privacy_link]', '</a>', $_content );
137
138 return $_content;
139 }
140
141 /**
142 * Cookie Policy Tab Content
143 *
144 * @return string Filtered Content
145 */
146 public function moove_gdpr_ifb_content() {
147 $_content = '<h2>' . __( 'This content is blocked', 'gdpr-cookie-compliance' );
148 $_content .= '<p>' . __( 'Please enable the cookies to view this content', 'gdpr-cookie-compliance' );
149 $_content .= '<br><br>';
150 $_content .= '[accept]' . esc_html__( 'Accept', 'gdpr-cookie-compliance' ) . '[/accept] ';
151 $_content .= '[setting]' . esc_html__( 'Adjust your settings', 'gdpr-cookie-compliance' ) . '[/setting] ';
152 return $_content;
153 }
154
155
156
157 /**
158 * Get option name
159 */
160 public function moove_gdpr_get_option_name() {
161 return 'moove_gdpr_plugin_settings';
162 }
163
164 /**
165 * Get option name
166 */
167 public function moove_gdpr_get_key_name() {
168 return 'moove_gdpr_plugin_key';
169 }
170
171 /**
172 * Get strict secondary notice
173 */
174 public function moove_gdpr_get_secondary_notice() {
175 $_content = '';
176 $options_name = $this->moove_gdpr_get_option_name();
177 $gdpr_options = get_option( $options_name );
178 $wpml_lang_options = $this->moove_gdpr_get_wpml_lang();
179 if ( ! isset( $gdpr_options[ 'moove_gdpr_modal_strictly_secondary_notice' . $wpml_lang_options ] ) ) :
180 $_content = __( 'Please enable Strictly Necessary Cookies first so that we can save your preferences!', 'gdpr-cookie-compliance' );
181 endif;
182 return $_content;
183 }
184
185 /**
186 * Get WMPL language code
187 */
188 public function moove_gdpr_get_wpml_lang( $type = 'code' ) {
189 if ( function_exists( 'trp_get_languages' ) && isset( $_GET['gdpr-lang'] ) && is_admin() ) :
190 $lang_code = sanitize_text_field( wp_unslash( $_GET['gdpr-lang'] ) );
191 if ( $type === 'code' ) :
192 return $lang_code;
193 else :
194 $trp_languages = trp_get_languages();
195 return isset( $trp_languages[$lang_code] ) ? $trp_languages[$lang_code] : '';
196 endif;
197 elseif ( class_exists( 'Falang' ) && isset( $_GET['gdpr-lang'] ) && is_admin() ) :
198 $lang_code = sanitize_text_field( wp_unslash( $_GET['gdpr-lang'] ) );
199 if ( $type === 'code' ) :
200 return $lang_code;
201 else :
202 $falang_languages = Falang()->get_model()->get_languages_list();
203 $lang_name = $lang_code;
204 foreach ( $falang_languages as $language ) :
205 $_code = isset( $language->locale ) ? $language->locale : ( isset( $language->slug ) ? $language->slug : '' );
206 $lang_name = $_code === $lang_code && isset( $language->name ) ? $language->name : $lang_name;
207 endforeach;
208 return $lang_name;
209 endif;
210 else :
211 if ( function_exists( 'trp_get_languages' ) ) :
212 $trp_languages = trp_get_languages();
213 global $TRP_LANGUAGE;
214 return $type === 'code' ? $TRP_LANGUAGE : $trp_languages[ $TRP_LANGUAGE ];
215 elseif ( class_exists( 'Falang' ) ) :
216 $current_language = Falang()->get_current_language();
217 if ( $type === 'code' ) :
218 $lang = isset( $current_language->locale ) ? $current_language->locale : ( isset( $current_language->slug ) ? $current_language->slug : '' );
219 else :
220 $lang = isset( $current_language->name ) ? $current_language->name : '';
221 endif;
222 return $lang;
223 elseif ( defined( 'ICL_LANGUAGE_CODE' ) ) :
224 $language_code = ICL_LANGUAGE_CODE;
225 if ( ICL_LANGUAGE_CODE === 'all' ) :
226 if ( function_exists( 'pll_default_language' ) ) :
227 $language_code = pll_default_language();
228 elseif ( class_exists( 'SitePress' ) ) :
229 global $sitepress;
230 $language_code = $sitepress->get_default_language();
231 endif;
232 endif;
233 return '_' . $language_code;
234 elseif ( isset( $GLOBALS['q_config']['language'] ) ) :
235 return $GLOBALS['q_config']['language'];
236 elseif ( function_exists( 'wpm_get_user_language' ) ) :
237 return wpm_get_user_language();
238 endif;
239 endif;
240 return '';
241 }
242
243 /**
244 * Licence token
245 */
246 public function get_license_token() {
247 $license_token = trailingslashit( site_url() );
248 return $license_token;
249 }
250
251 /**
252 * PHP Cookie Checker, available from version 1.3.0
253 */
254 public function gdpr_get_php_cookies() {
255 $cookies_accepted = array(
256 'strict' => false,
257 'thirdparty' => false,
258 'advanced' => false,
259 );
260 if ( isset( $_COOKIE['moove_gdpr_popup'] ) ) :
261 $cookies = sanitize_text_field( wp_unslash( $_COOKIE['moove_gdpr_popup'] ) );
262 $cookies_decoded = json_decode( wp_unslash( $cookies ), true );
263 if ( $cookies_decoded && is_array( $cookies_decoded ) && ! empty( $cookies_decoded ) ) :
264 $cookies_accepted = array(
265 'strict' => isset( $cookies_decoded['strict'] ) && intval( $cookies_decoded['strict'] ) === 1 ? true : false,
266 'thirdparty' => isset( $cookies_decoded['thirdparty'] ) && intval( $cookies_decoded['thirdparty'] ) === 1 ? true : false,
267 'advanced' => isset( $cookies_decoded['advanced'] ) && intval( $cookies_decoded['advanced'] ) === 1 ? true : false,
268 );
269 endif;
270 else :
271 $options_name = $this->moove_gdpr_get_option_name();
272 $gdpr_options = get_option( $options_name );
273 $wpml_lang_options = $this->moove_gdpr_get_wpml_lang();
274
275 $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;
276 $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;
277 $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;
278
279 if ( 1 === $strictly_functionality ) :
280 if ( 1 === $thirdparty_default || 1 === $advanced_default ) :
281 $strict_default = 1;
282 else :
283 $strict_default = 0;
284 endif;
285 else :
286 $strict_default = 1;
287 endif;
288
289 $cookies_accepted = array(
290 'strict' => $strict_default,
291 'thirdparty' => $thirdparty_default,
292 'advanced' => $advanced_default,
293 );
294
295 endif;
296 return $cookies_accepted;
297 }
298
299 /**
300 * GDPR Licence action button
301 *
302 * @param array $response Response.
303 * @param string $gdpr_key GDPR Key.
304 */
305 public static function gdpr_licence_action_button( $response, $gdpr_key ) {
306 $type = isset( $response['type'] ) ? $response['type'] : false;
307 if ( 'expired' === $type || 'activated' === $type || 'max_activation_reached' === $type ) :
308 if ( 'activated' !== $type ) :
309 ?>
310 <button type="submit" name="gdpr_activate_license" class="button button-primary button-inverse">
311 <?php esc_html_e( 'Activate', 'gdpr-cookie-compliance' ); ?>
312 </button>
313 <?php
314 endif;
315 elseif ( 'invalid' === $type ) :
316 ?>
317 <button type="submit" name="gdpr_activate_license" class="button button-primary button-inverse">
318 <?php esc_html_e( 'Activate', 'gdpr-cookie-compliance' ); ?>
319 </button>
320 <?php
321 else :
322 ?>
323 <button type="submit" name="gdpr_activate_license" class="button button-primary button-inverse">
324 <?php esc_html_e( 'Activate', 'gdpr-cookie-compliance' ); ?>
325 </button>
326 <br /><br />
327 <hr />
328 <h4 style="margin-bottom: 0;"><?php esc_html_e( 'Buy licence', 'gdpr-cookie-compliance' ); ?></h4>
329 <p>
330 <?php
331 $store_link = __( 'You can buy licences from our [store_link]online store[/store_link].', 'gdpr-cookie-compliance' );
332 $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 );
333 $store_link = str_replace( '[/store_link]', '</a>', $store_link );
334 apply_filters( 'gdpr_cc_keephtml', $store_link, true );
335 ?>
336 </p>
337 <p>
338 <a href="https://www.mooveagency.com/wordpress-plugins/gdpr-cookie-compliance/" target="_blank" class="button button-primary">Buy Now</a>
339 </p>
340 <br />
341 <hr />
342 <?php
343 endif;
344 }
345
346 /**
347 * Licence input key
348 *
349 * @param array $response Response.
350 * @param string $gdpr_key GDPR Key.
351 */
352 public static function gdpr_licence_input_field( $response, $gdpr_key ) {
353 $type = isset( $response['type'] ) ? $response['type'] : false;
354 if ( 'expired' === $type ) :
355 // LICENSE EXPIRED.
356 ?>
357 <tr>
358 <th scope="row" style="padding: 0 0 10px 0;">
359 <hr />
360 <h4 style="margin-bottom: 0;"><?php esc_html_e( 'Renew your licence', 'gdpr-cookie-compliance' ); ?></h4>
361 <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>
362 <a href="<?php echo esc_attr( MOOVE_SHOP_URL ); ?>?renew=<?php echo esc_attr( $response['key'] ); ?>" target="_blank" class="button button-primary">Renew Licence</a>
363 <br /><br />
364 <hr />
365
366 <h4 style="margin-bottom: 0;"><?php esc_html_e( 'Enter new licence key', 'gdpr-cookie-compliance' ); ?></h4>
367 </th>
368 </tr>
369 <tr>
370 <td style="padding: 0;">
371 <input name="moove_gdpr_license_key" required min="35" type="text" id="moove_gdpr_license_key" value="" class="regular-text">
372 </td>
373 </tr>
374 <?php
375 elseif ( 'activated' === $type || 'max_activation_reached' === $type ) :
376 // LICENSE ACTIVATED.
377 ?>
378 <tr>
379 <th scope="row" style="padding: 0 0 10px 0;">
380 <hr />
381 <h4 style="margin-bottom: 0;"><?php esc_html_e( 'Buy more licences', 'gdpr-cookie-compliance' ); ?></h4>
382 <p>
383 <?php
384 $store_link = __( 'You can buy more licences from our [store_link]online store[/store_link].', 'gdpr-cookie-compliance' );
385 $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 );
386 $store_link = str_replace( '[/store_link]', '</a>', $store_link );
387 apply_filters( 'gdpr_cc_keephtml', $store_link, true );
388 ?>
389 </p>
390 <p>
391 <a href="https://www.mooveagency.com/wordpress-plugins/gdpr-cookie-compliance/" target="_blank" class="button button-primary">
392 Buy Now
393 </a>
394 </p>
395 <br />
396 <hr />
397 </th>
398 </tr>
399 <?php
400 if ( 'max_activation_reached' === $type ) : ?>
401 <tr>
402 <th scope="row" style="padding: 0 0 10px 0;">
403 <label><?php esc_html_e( 'Enter a new licence key:', 'gdpr-cookie-compliance' ); ?></label>
404 </th>
405 </tr>
406 <tr>
407 <td style="padding: 0;">
408 <input name="moove_gdpr_license_key" required min="35" type="text" id="moove_gdpr_license_key" value="" class="regular-text">
409 </td>
410 </tr>
411 <?php
412 endif;
413 elseif ( 'invalid' === $type ) :
414 ?>
415 <tr>
416 <th scope="row" style="padding: 0 0 10px 0;">
417 <hr />
418 <h4 style="margin-bottom: 0;"><?php esc_html_e( 'Buy licence', 'gdpr-cookie-compliance' ); ?></h4>
419 <p>
420 <?php
421 $store_link = __( 'You can buy licences from our [store_link]online store[/store_link].', 'gdpr-cookie-compliance' );
422 $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 );
423 $store_link = str_replace( '[/store_link]', '</a>', $store_link );
424 apply_filters( 'gdpr_cc_keephtml', $store_link, true );
425 ?>
426 </p>
427 <p>
428 <a href="https://www.mooveagency.com/wordpress-plugins/gdpr-cookie-compliance/" target="_blank" class="button button-primary">Buy Now</a>
429 </p>
430 <br />
431 <hr />
432 </th>
433 </tr>
434 <tr>
435 <th scope="row" style="padding: 0 0 10px 0;">
436 <label><?php esc_html_e( 'Enter your licence key:', 'gdpr-cookie-compliance' ); ?></label>
437 </th>
438 </tr>
439 <tr>
440 <td style="padding: 0;">
441 <input name="moove_gdpr_license_key" required min="35" type="text" id="moove_gdpr_license_key" value="" class="regular-text">
442 </td>
443 </tr>
444 <?php
445 else :
446 ?>
447 <tr>
448 <th scope="row" style="padding: 0 0 10px 0;">
449 <label><?php esc_html_e( 'Enter licence key:', 'gdpr-cookie-compliance' ); ?></label>
450 </th>
451 </tr>
452 <tr>
453 <td style="padding: 0;">
454 <input name="moove_gdpr_license_key" required min="35" type="text" id="moove_gdpr_license_key" value="" class="regular-text">
455 </td>
456 </tr>
457 <?php
458 endif;
459 }
460
461 /**
462 * GDPR Alert Box
463 *
464 * @param string $type Type.
465 * @param array $response Response.
466 * @param string $gdpr_key GDPR Key.
467 */
468 public static function gdpr_get_alertbox( $type, $response, $gdpr_key ) {
469 if ( 'error' === $type ) :
470 $messages = isset( $response['message'] ) && is_array( $response['message'] ) ? implode( '</p><p>', $response['message'] ) : '';
471 if ( $response['type'] === 'inactive' || $response['type'] === 'max_activation_reached' || $response['type'] === 'suspended' ) :
472 $gdpr_default_content = new Moove_GDPR_Content();
473 $option_key = $gdpr_default_content->moove_gdpr_get_key_name();
474 $gdpr_key = $gdpr_default_content->gdpr_get_activation_key( $option_key );
475
476 update_option(
477 $option_key,
478 array(
479 'key' => $response['key'],
480 'deactivation' => strtotime( 'now' ),
481 )
482 );
483 $gdpr_key = $gdpr_default_content->gdpr_get_activation_key( $option_key );
484 endif;
485 ?>
486 <div class="gdpr-admin-alert gdpr-admin-alert-error">
487 <div class="gdpr-alert-content">
488 <div class="gdpr-licence-key-wrap">
489 <p>License key:
490 <strong><?php echo esc_attr( apply_filters( 'gdpr_licence_key_visibility', isset( $response['key'] ) ? $response['key'] : ( isset( $gdpr_key['key'] ) ? $gdpr_key['key'] : $gdpr_key ) ) ); ?></strong>
491 </p>
492 </div>
493 <!-- .gdpr-licence-key-wrap -->
494 <p><?php apply_filters( 'gdpr_cc_keephtml', $messages, true ); ?></p>
495 </div>
496 <span class="dashicons dashicons-dismiss"></span>
497 </div>
498 <!-- .gdpr-admin-alert gdpr-admin-alert-success -->
499 <?php
500 else :
501 $messages = isset( $response['message'] ) && is_array( $response['message'] ) ? implode( '</p><p>', $response['message'] ) : '';
502 ?>
503 <div class="gdpr-admin-alert gdpr-admin-alert-success">
504 <div class="gdpr-alert-content">
505 <div class="gdpr-licence-key-wrap">
506 <p>License key:
507 <strong><?php echo esc_attr( apply_filters( 'gdpr_licence_key_visibility', isset( $response['key'] ) ? $response['key'] : ( isset( $gdpr_key['key'] ) ? $gdpr_key['key'] : $gdpr_key ) ) ); ?></strong>
508 </p>
509 </div>
510 <!-- .gdpr-licence-key-wrap -->
511 <p><?php apply_filters( 'gdpr_cc_keephtml', $messages, true ); ?></p>
512 </div>
513 <span class="dashicons dashicons-yes-alt"></span>
514 </div>
515 <!-- .gdpr-admin-alert gdpr-admin-alert-success -->
516 <?php
517 endif;
518 do_action( 'gdpr_plugin_updater_notice' );
519 }
520
521 /**
522 * GDPR Update Alert
523 *
524 * @return void
525 */
526 public static function gdpr_premium_update_alert() {
527
528 $plugins = get_site_transient( 'update_plugins' );
529 $lm = new Moove_GDPR_License_Manager();
530 $plugin_slug = $lm->get_add_on_plugin_slug();
531
532 if ( isset( $plugins->response[ $plugin_slug ] ) && is_plugin_active( $plugin_slug ) ) :
533 $version = $plugins->response[ $plugin_slug ]->new_version;
534
535 $current_user = wp_get_current_user();
536 $user_id = isset( $current_user->ID ) ? $current_user->ID : 0;
537 $dismiss = get_option( 'gdpr_hide_update_notice_' . $user_id );
538
539 if ( isset( $plugins->response[ $plugin_slug ]->package ) && ! $plugins->response[ $plugin_slug ]->package ) :
540 $gdpr_default_content = new Moove_GDPR_Content();
541 $option_key = $gdpr_default_content->moove_gdpr_get_key_name();
542 $gdpr_key = $gdpr_default_content->gdpr_get_activation_key( $option_key );
543 $license_key = isset( $gdpr_key['key'] ) ? sanitize_text_field( $gdpr_key['key'] ) : false;
544 $renew_link = MOOVE_SHOP_URL . '?renew=' . $license_key;
545 $license_manager = admin_url( 'admin.php' ) . '?page=moove-gdpr&amp;tab=licence';
546 $purchase_link = 'https://www.mooveagency.com/wordpress-plugins/gdpr-cookie-compliance/';
547 $notice_text = '';
548 if ( $license_key && isset( $gdpr_key['activation'] ) ) :
549 // Expired.
550 $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>.';
551 elseif ( $license_key && isset( $gdpr_key['deactivation'] ) ) :
552 // Deactivated.
553 $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>.';
554 elseif ( ! $license_key ) :
555 // No license key installed.
556 $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>.';
557 endif;
558 ?>
559 <div class="gdpr-cookie-alert gdpr-cookie-update-alert" style="display: inline-block;">
560 <h4>
561 <?php esc_html_e( 'There is a new version of GDPR Cookie Compliance - Premium Add-On.', 'gdpr-cookie-compliance' ); ?></h4>
562 <p><?php apply_filters( 'gdpr_cc_keephtml', $notice_text, true ); ?></p>
563 </div>
564 <!-- .gdpr-cookie-alert -->
565 <?php
566 endif;
567 endif;
568 }
569 }
570 new Moove_GDPR_Content();
571