Version Description
- Fixed PHP notices
Download this release
Release Info
Developer | MooveAgency |
Plugin | GDPR Cookie Compliance |
Version | 2.0.2 |
Comparing to | |
See all releases |
Code changes from version 2.0.1 to 2.0.2
- controllers/moove-controller.php +20 -2
- moove-actions.php +19 -0
- moove-content.php +3 -1
- moove-functions.php +114 -116
- moove-gdpr.php +8 -3
- moove-modules.php +55 -49
- readme.txt +2 -0
controllers/moove-controller.php
CHANGED
@@ -34,7 +34,11 @@ class Moove_GDPR_Controller {
|
|
34 |
add_editor_style( moove_gdpr_get_plugin_directory_url() . 'dist/styles/custom-editor-style.css' );
|
35 |
}
|
36 |
|
37 |
-
|
|
|
|
|
|
|
|
|
38 |
function get_gdpr_plugin_details( $plugin_slug = '' ) {
|
39 |
$plugin_return = false;
|
40 |
$wp_repo_plugins = '';
|
@@ -243,7 +247,18 @@ class Moove_GDPR_Controller {
|
|
243 |
$option_name = $gdpr_default_content->moove_gdpr_get_option_name();
|
244 |
$modal_options = get_option( $option_name );
|
245 |
|
246 |
-
$cache_array = array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
|
248 |
// THIRD PARTY - SCRIPT CACHE
|
249 |
ob_start();
|
@@ -332,6 +347,9 @@ class Moove_GDPR_Controller {
|
|
332 |
die();
|
333 |
}
|
334 |
|
|
|
|
|
|
|
335 |
public static function moove_gdpr_remove_php_cookies() {
|
336 |
$urlparts = parse_url( site_url('/') );
|
337 |
$domain = preg_replace('/www\./i', '', $urlparts['host']);
|
34 |
add_editor_style( moove_gdpr_get_plugin_directory_url() . 'dist/styles/custom-editor-style.css' );
|
35 |
}
|
36 |
|
37 |
+
/**
|
38 |
+
* Reading plugin statistics from WordPress.org
|
39 |
+
* - star rating
|
40 |
+
* - downloads & active installations
|
41 |
+
*/
|
42 |
function get_gdpr_plugin_details( $plugin_slug = '' ) {
|
43 |
$plugin_return = false;
|
44 |
$wp_repo_plugins = '';
|
247 |
$option_name = $gdpr_default_content->moove_gdpr_get_option_name();
|
248 |
$modal_options = get_option( $option_name );
|
249 |
|
250 |
+
$cache_array = array(
|
251 |
+
'thirdparty' => array(
|
252 |
+
'header' => '',
|
253 |
+
'body' => '',
|
254 |
+
'footer' => ''
|
255 |
+
),
|
256 |
+
'advanced' => array(
|
257 |
+
'header' => '',
|
258 |
+
'body' => '',
|
259 |
+
'footer' => ''
|
260 |
+
)
|
261 |
+
);
|
262 |
|
263 |
// THIRD PARTY - SCRIPT CACHE
|
264 |
ob_start();
|
347 |
die();
|
348 |
}
|
349 |
|
350 |
+
/**
|
351 |
+
* Removing all the cookies including www and non-www domains
|
352 |
+
*/
|
353 |
public static function moove_gdpr_remove_php_cookies() {
|
354 |
$urlparts = parse_url( site_url('/') );
|
355 |
$domain = preg_replace('/www\./i', '', $urlparts['host']);
|
moove-actions.php
CHANGED
@@ -41,6 +41,9 @@ class Moove_GDPR_Actions {
|
|
41 |
add_action( 'gdpr_info_bar_button_extensions', array( &$this, 'gdpr_info_add_reject_button_extensions' ) );
|
42 |
}
|
43 |
|
|
|
|
|
|
|
44 |
public function gdpr_info_add_reject_button_extensions() {
|
45 |
$gdpr_default_content = new Moove_GDPR_Content();
|
46 |
$option_name = $gdpr_default_content->moove_gdpr_get_option_name();
|
@@ -54,6 +57,9 @@ class Moove_GDPR_Actions {
|
|
54 |
endif;
|
55 |
}
|
56 |
|
|
|
|
|
|
|
57 |
public function gdpr_cdn_base_url( $plugin_url ) {
|
58 |
$gdpr_default_content = new Moove_GDPR_Content();
|
59 |
$option_name = $gdpr_default_content->moove_gdpr_get_option_name();
|
@@ -68,6 +74,9 @@ class Moove_GDPR_Actions {
|
|
68 |
|
69 |
}
|
70 |
|
|
|
|
|
|
|
71 |
public function gdpr_premium_section_ads() {
|
72 |
if ( ! class_exists('Moove_GDPR_Addon_Controller') ) :
|
73 |
?>
|
@@ -84,10 +93,16 @@ class Moove_GDPR_Actions {
|
|
84 |
endif;
|
85 |
}
|
86 |
|
|
|
|
|
|
|
87 |
public function gdpr_check_extensions( $content ) {
|
88 |
return class_exists('Moove_GDPR_Addon_Controller') ? '' : $content;
|
89 |
}
|
90 |
|
|
|
|
|
|
|
91 |
public function gdpr_remove_cached_scripts() {
|
92 |
$transient_key = 'gdpr_cookie_cache';
|
93 |
delete_transient( $transient_key );
|
@@ -203,6 +218,10 @@ class Moove_GDPR_Actions {
|
|
203 |
return ob_get_clean();
|
204 |
}
|
205 |
|
|
|
|
|
|
|
|
|
206 |
public function gdpr_settings_tab_nav_extensions( $active_tab ) {
|
207 |
ob_start();
|
208 |
?>
|
41 |
add_action( 'gdpr_info_bar_button_extensions', array( &$this, 'gdpr_info_add_reject_button_extensions' ) );
|
42 |
}
|
43 |
|
44 |
+
/**
|
45 |
+
* Reject button extension, will be listed next to the Accept button if it's enabled in the CMS
|
46 |
+
*/
|
47 |
public function gdpr_info_add_reject_button_extensions() {
|
48 |
$gdpr_default_content = new Moove_GDPR_Content();
|
49 |
$option_name = $gdpr_default_content->moove_gdpr_get_option_name();
|
57 |
endif;
|
58 |
}
|
59 |
|
60 |
+
/**
|
61 |
+
* CDN base URL for lity lightbox
|
62 |
+
*/
|
63 |
public function gdpr_cdn_base_url( $plugin_url ) {
|
64 |
$gdpr_default_content = new Moove_GDPR_Content();
|
65 |
$option_name = $gdpr_default_content->moove_gdpr_get_option_name();
|
74 |
|
75 |
}
|
76 |
|
77 |
+
/**
|
78 |
+
* Lock screen of premium tabs, visible in the free version
|
79 |
+
*/
|
80 |
public function gdpr_premium_section_ads() {
|
81 |
if ( ! class_exists('Moove_GDPR_Addon_Controller') ) :
|
82 |
?>
|
93 |
endif;
|
94 |
}
|
95 |
|
96 |
+
/**
|
97 |
+
* Checking for Premium Add-on installed and activated
|
98 |
+
*/
|
99 |
public function gdpr_check_extensions( $content ) {
|
100 |
return class_exists('Moove_GDPR_Addon_Controller') ? '' : $content;
|
101 |
}
|
102 |
|
103 |
+
/**
|
104 |
+
* Clearing AJAX transient cache
|
105 |
+
*/
|
106 |
public function gdpr_remove_cached_scripts() {
|
107 |
$transient_key = 'gdpr_cookie_cache';
|
108 |
delete_transient( $transient_key );
|
218 |
return ob_get_clean();
|
219 |
}
|
220 |
|
221 |
+
/**
|
222 |
+
* GDPR Cookie Compliance - Admin Tabs
|
223 |
+
* Routing & views
|
224 |
+
*/
|
225 |
public function gdpr_settings_tab_nav_extensions( $active_tab ) {
|
226 |
ob_start();
|
227 |
?>
|
moove-content.php
CHANGED
@@ -146,7 +146,9 @@ class Moove_GDPR_Content {
|
|
146 |
return '';
|
147 |
}
|
148 |
|
149 |
-
|
|
|
|
|
150 |
public function gdpr_get_php_cookies() {
|
151 |
$cookies_accepted = array(
|
152 |
'strict' => false,
|
146 |
return '';
|
147 |
}
|
148 |
|
149 |
+
/**
|
150 |
+
* PHP Cookie Checker, available from version 1.3.0
|
151 |
+
*/
|
152 |
public function gdpr_get_php_cookies() {
|
153 |
$cookies_accepted = array(
|
154 |
'strict' => false,
|
moove-functions.php
CHANGED
@@ -8,26 +8,36 @@ if ( ! defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly
|
|
8 |
* @package gdpr-cookie-compliance
|
9 |
* @author Gaspar Nemes
|
10 |
*/
|
|
|
|
|
|
|
|
|
11 |
function moove_gdpr_get_plugin_directory_url() {
|
12 |
return plugin_dir_url( __FILE__ );
|
13 |
}
|
14 |
|
|
|
|
|
|
|
15 |
add_filter( 'plugin_action_links', 'moove_gdpr_plugin_settings_link', 10, 2 );
|
16 |
-
|
17 |
function moove_gdpr_plugin_settings_link( $links, $file ) {
|
18 |
if ( plugin_basename( dirname( __FILE__ ) . '/moove-gdpr.php' ) === $file ) {
|
19 |
/*
|
20 |
-
|
21 |
-
|
22 |
$in = '<a href="?page=moove-gdpr">' . __( 'Settings','gdpr-cookie-compliance' ) . '</a>';
|
23 |
array_unshift( $links, $in );
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
|
|
|
|
|
|
|
|
31 |
}
|
32 |
return $links;
|
33 |
}
|
@@ -40,54 +50,40 @@ function moove_gdpr_plugin_settings_link( $links, $file ) {
|
|
40 |
* @return int Attachment ID on success, 0 on failure
|
41 |
*/
|
42 |
function gdpr_get_attachment_id( $url ) {
|
43 |
-
|
44 |
$attachment_id = 0;
|
45 |
-
|
46 |
$dir = wp_upload_dir();
|
47 |
-
|
48 |
if ( false !== strpos( $url, $dir['baseurl'] . '/' ) ) { // Is URL in uploads directory?
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
'
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
break;
|
80 |
-
}
|
81 |
-
endif;
|
82 |
-
|
83 |
-
endwhile;
|
84 |
-
wp_reset_query();
|
85 |
-
wp_reset_postdata();
|
86 |
-
|
87 |
-
}
|
88 |
-
|
89 |
}
|
90 |
-
|
91 |
return $attachment_id;
|
92 |
}
|
93 |
|
@@ -115,59 +111,61 @@ function gdpr_get_logo_alt( $image_url ) {
|
|
115 |
|
116 |
}
|
117 |
|
|
|
|
|
|
|
118 |
function gdpr_get_module( $module = '' ) {
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
return false;
|
171 |
}
|
172 |
|
173 |
/**
|
@@ -175,15 +173,15 @@ function gdpr_get_module( $module = '' ) {
|
|
175 |
*/
|
176 |
|
177 |
if ( ! function_exists( 'gdpr_cookie_is_accepted' ) ) :
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
endif;
|
8 |
* @package gdpr-cookie-compliance
|
9 |
* @author Gaspar Nemes
|
10 |
*/
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Relative path of the GDPR cookie plugin
|
14 |
+
*/
|
15 |
function moove_gdpr_get_plugin_directory_url() {
|
16 |
return plugin_dir_url( __FILE__ );
|
17 |
}
|
18 |
|
19 |
+
/**
|
20 |
+
* Extension to display support, premium and settings links in the plugin listing page
|
21 |
+
*/
|
22 |
add_filter( 'plugin_action_links', 'moove_gdpr_plugin_settings_link', 10, 2 );
|
|
|
23 |
function moove_gdpr_plugin_settings_link( $links, $file ) {
|
24 |
if ( plugin_basename( dirname( __FILE__ ) . '/moove-gdpr.php' ) === $file ) {
|
25 |
/*
|
26 |
+
* Insert the Settings page link at the beginning
|
27 |
+
*/
|
28 |
$in = '<a href="?page=moove-gdpr">' . __( 'Settings','gdpr-cookie-compliance' ) . '</a>';
|
29 |
array_unshift( $links, $in );
|
30 |
|
31 |
+
/*
|
32 |
+
* Insert the Support page link at the end
|
33 |
+
*/
|
34 |
+
$in = '<a href="https://wordpress.org/support/plugin/gdpr-cookie-compliance/" target="_blank">' . __( 'Support','gdpr-cookie-compliance' ) . '</a>';
|
35 |
+
array_push( $links, $in );
|
36 |
+
/*
|
37 |
+
* Insert the Premium Upgrade link at the end
|
38 |
+
*/
|
39 |
+
$in = '<a href="https://www.mooveagency.com/wordpress-plugins/gdpr-cookie-compliance/" target="_blank">' . __( 'Premium Upgrade','gdpr-cookie-compliance' ) . '</a>';
|
40 |
+
array_push( $links, $in );
|
41 |
}
|
42 |
return $links;
|
43 |
}
|
50 |
* @return int Attachment ID on success, 0 on failure
|
51 |
*/
|
52 |
function gdpr_get_attachment_id( $url ) {
|
|
|
53 |
$attachment_id = 0;
|
|
|
54 |
$dir = wp_upload_dir();
|
|
|
55 |
if ( false !== strpos( $url, $dir['baseurl'] . '/' ) ) { // Is URL in uploads directory?
|
56 |
+
$file = basename( $url );
|
57 |
+
$query_args = array(
|
58 |
+
'post_type' => 'attachment',
|
59 |
+
'post_status' => 'inherit',
|
60 |
+
'fields' => 'ids',
|
61 |
+
'meta_query' => array(
|
62 |
+
array(
|
63 |
+
'value' => $file,
|
64 |
+
'compare' => 'LIKE',
|
65 |
+
'key' => '_wp_attachment_metadata',
|
66 |
+
),
|
67 |
+
)
|
68 |
+
);
|
69 |
+
$query = new WP_Query( $query_args );
|
70 |
+
if ( $query->have_posts() ) {
|
71 |
+
while ( $query->have_posts() ) : $query->the_post();
|
72 |
+
$post_id = get_the_ID();
|
73 |
+
$meta = wp_get_attachment_metadata( $post_id );
|
74 |
+
if ( $meta && isset( $meta['file'] ) && isset( $meta['sizes'] ) ) :
|
75 |
+
$original_file = basename( $meta['file'] );
|
76 |
+
$cropped_image_files = wp_list_pluck( $meta['sizes'], 'file' );
|
77 |
+
if ( $original_file === $file || in_array( $file, $cropped_image_files ) ) {
|
78 |
+
$attachment_id = $post_id;
|
79 |
+
break;
|
80 |
+
}
|
81 |
+
endif;
|
82 |
+
endwhile;
|
83 |
+
wp_reset_query();
|
84 |
+
wp_reset_postdata();
|
85 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
}
|
|
|
87 |
return $attachment_id;
|
88 |
}
|
89 |
|
111 |
|
112 |
}
|
113 |
|
114 |
+
/**
|
115 |
+
* GDPR Module manager, introduced in version 1.1.5
|
116 |
+
*/
|
117 |
function gdpr_get_module( $module = '' ) {
|
118 |
+
if ( $module ) :
|
119 |
+
$module_controller = new GDPR_Modules();
|
120 |
+
switch ( $module ) :
|
121 |
+
case 'floating-button':
|
122 |
+
return apply_filters( 'gdpr_floating_button_module', $module_controller->get_floating_button() );
|
123 |
+
break;
|
124 |
+
case 'infobar-base':
|
125 |
+
return apply_filters( 'gdpr_infobar_base_module', $module_controller->get_infobar_base() );
|
126 |
+
break;
|
127 |
+
case 'infobar-content':
|
128 |
+
return apply_filters( 'gdpr_infobar_content_module', $module_controller->get_infobar_content() );
|
129 |
+
break;
|
130 |
+
case 'infobar-buttons':
|
131 |
+
return apply_filters( 'gdpr_infobar_buttons_module', $module_controller->get_infobar_buttons() );
|
132 |
+
break;
|
133 |
+
case 'company-logo':
|
134 |
+
return apply_filters( 'gdpr_company_logo_module', $module_controller->get_company_logo() );
|
135 |
+
break;
|
136 |
+
case 'gdpr-branding':
|
137 |
+
return apply_filters( 'gdpr_branding_module', $module_controller->get_gdpr_branding() );
|
138 |
+
break;
|
139 |
+
case 'modal-base' :
|
140 |
+
return apply_filters( 'gdpr_modal_base_module', $module_controller->get_modal_base() );
|
141 |
+
break;
|
142 |
+
case 'tab-navigation' :
|
143 |
+
return apply_filters( 'gdpr_tab_navigation_module', $module_controller->get_tab_navigation() );
|
144 |
+
break;
|
145 |
+
case 'modal-footer-buttons' :
|
146 |
+
return apply_filters( 'gdpr_modal_footer_buttons_module', $module_controller->get_tab_footer_buttons() );
|
147 |
+
break;
|
148 |
+
case 'section-overview' :
|
149 |
+
return apply_filters( 'gdpr_section_overview_module', $module_controller->get_section_overview() );
|
150 |
+
break;
|
151 |
+
case 'section-strictly' :
|
152 |
+
return apply_filters( 'gdpr_section_strictly_module', $module_controller->get_section_strictly() );
|
153 |
+
break;
|
154 |
+
case 'section-advanced' :
|
155 |
+
return apply_filters( 'gdpr_section_advanced_module', $module_controller->get_section_advanced() );
|
156 |
+
break;
|
157 |
+
case 'section-third_party' :
|
158 |
+
return apply_filters( 'gdpr_section_third_party_module', $module_controller->get_section_third_party() );
|
159 |
+
break;
|
160 |
+
case 'section-cookiepolicy' :
|
161 |
+
return apply_filters( 'gdpr_section_cookiepolicy_module', $module_controller->get_section_cookiepolicy() );
|
162 |
+
break;
|
163 |
+
case 'branding-styles' :
|
164 |
+
return apply_filters( 'gdpr_branding_styles_module', $module_controller->get_branding_styles() );
|
165 |
+
break;
|
166 |
+
endswitch;
|
167 |
+
endif;
|
168 |
+
return false;
|
|
|
169 |
}
|
170 |
|
171 |
/**
|
173 |
*/
|
174 |
|
175 |
if ( ! function_exists( 'gdpr_cookie_is_accepted' ) ) :
|
176 |
+
function gdpr_cookie_is_accepted( $type = '' ) {
|
177 |
+
$response = false;
|
178 |
+
$type = sanitize_text_field( $type );
|
179 |
+
$accepted_types = array( 'strict', 'thirdparty', 'advanced' );
|
180 |
+
if ( $type && in_array( $type, $accepted_types ) ) :
|
181 |
+
$gdpr_content = new Moove_GDPR_Content();
|
182 |
+
$php_cookies = $gdpr_content->gdpr_get_php_cookies();
|
183 |
+
$response = $php_cookies && isset( $php_cookies[ $type ] ) && $php_cookies[ $type ] ? true : false;
|
184 |
+
endif;
|
185 |
+
return $response;
|
186 |
+
}
|
187 |
endif;
|
moove-gdpr.php
CHANGED
@@ -6,7 +6,7 @@ if ( ! defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly
|
|
6 |
* Plugin Name: GDPR Cookie Compliance
|
7 |
* Plugin URI: https://wordpress.org/plugins/gdpr-cookie-compliance/
|
8 |
* Description: GDPR is an EU wide legislation that specifies how user data should be handled. This plugin has settings that can assist you with GDPR cookie compliance requirements.
|
9 |
-
* Version: 2.0.
|
10 |
* Author: Moove Agency
|
11 |
* Domain Path: /languages
|
12 |
* Author URI: https://www.mooveagency.com
|
@@ -14,7 +14,7 @@ if ( ! defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly
|
|
14 |
* Text Domain: gdpr-cookie-compliance
|
15 |
*/
|
16 |
|
17 |
-
define( 'MOOVE_GDPR_VERSION', '2.0.
|
18 |
|
19 |
register_activation_hook( __FILE__ , 'moove_gdpr_activate' );
|
20 |
register_deactivation_hook( __FILE__ , 'moove_gdpr_deactivate' );
|
@@ -34,13 +34,18 @@ function moove_gdpr_deactivate() {
|
|
34 |
// update_option( $option_name, array() );
|
35 |
}
|
36 |
|
|
|
|
|
|
|
37 |
add_action( 'plugins_loaded', 'moove_gdpr_load_textdomain' );
|
38 |
|
39 |
function moove_gdpr_load_textdomain() {
|
40 |
load_plugin_textdomain( 'gdpr-cookie-compliance', false, basename( dirname( __FILE__ ) ) . '/languages' );
|
41 |
}
|
42 |
|
43 |
-
|
|
|
|
|
44 |
add_action('plugins_loaded', 'gdpr_cookie_compliance_load_libs');
|
45 |
|
46 |
function gdpr_cookie_compliance_load_libs() {
|
6 |
* Plugin Name: GDPR Cookie Compliance
|
7 |
* Plugin URI: https://wordpress.org/plugins/gdpr-cookie-compliance/
|
8 |
* Description: GDPR is an EU wide legislation that specifies how user data should be handled. This plugin has settings that can assist you with GDPR cookie compliance requirements.
|
9 |
+
* Version: 2.0.2
|
10 |
* Author: Moove Agency
|
11 |
* Domain Path: /languages
|
12 |
* Author URI: https://www.mooveagency.com
|
14 |
* Text Domain: gdpr-cookie-compliance
|
15 |
*/
|
16 |
|
17 |
+
define( 'MOOVE_GDPR_VERSION', '2.0.2' );
|
18 |
|
19 |
register_activation_hook( __FILE__ , 'moove_gdpr_activate' );
|
20 |
register_deactivation_hook( __FILE__ , 'moove_gdpr_deactivate' );
|
34 |
// update_option( $option_name, array() );
|
35 |
}
|
36 |
|
37 |
+
/**
|
38 |
+
* Loading Text Domain - for translations & localizations
|
39 |
+
*/
|
40 |
add_action( 'plugins_loaded', 'moove_gdpr_load_textdomain' );
|
41 |
|
42 |
function moove_gdpr_load_textdomain() {
|
43 |
load_plugin_textdomain( 'gdpr-cookie-compliance', false, basename( dirname( __FILE__ ) ) . '/languages' );
|
44 |
}
|
45 |
|
46 |
+
/**
|
47 |
+
* Loading Core files after all the plugins are loaded!
|
48 |
+
*/
|
49 |
add_action('plugins_loaded', 'gdpr_cookie_compliance_load_libs');
|
50 |
|
51 |
function gdpr_cookie_compliance_load_libs() {
|
moove-modules.php
CHANGED
@@ -17,8 +17,10 @@ if ( ! defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly
|
|
17 |
* @author Gaspar Nemes
|
18 |
*/
|
19 |
class GDPR_Modules {
|
|
|
20 |
protected $gdpr_options;
|
21 |
protected $wpml_lang;
|
|
|
22 |
/**
|
23 |
* Construct function
|
24 |
*/
|
@@ -31,11 +33,13 @@ class GDPR_Modules {
|
|
31 |
$this->wpml_lang = $wpml_lang;
|
32 |
}
|
33 |
|
|
|
|
|
|
|
34 |
public function get_floating_button() {
|
35 |
$view_controller = new GDPR_Modules_View();
|
36 |
$modal_options = $this->gdpr_options;
|
37 |
$wpml_lang = $this->wpml_lang;
|
38 |
-
|
39 |
$floating_button_visibility = 'display: block;';
|
40 |
$floating_button_class = '';
|
41 |
$infobar_hidden = isset( $modal_options['moove_gdpr_infobar_visibility'] ) && $modal_options['moove_gdpr_infobar_visibility'] === 'hidden' ? true : false;
|
@@ -46,73 +50,66 @@ class GDPR_Modules {
|
|
46 |
$data = new stdClass();
|
47 |
$data->options = $modal_options;
|
48 |
$data->wpml_lang = $wpml_lang;
|
49 |
-
$data->is_enabled = ( isset( $modal_options['moove_gdpr_floating_button_enable'] ) && intval( $modal_options['moove_gdpr_floating_button_enable'] ) === 1 ) ? true : false;
|
50 |
$data->styles = $floating_button_visibility . $floating_button_position;
|
51 |
$data->class = $floating_button_class;
|
52 |
if ( $floating_button_position ) :
|
53 |
$data->class = $floating_button_class .= ' gdpr-floating-button-custom-position';
|
54 |
endif;
|
55 |
$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');
|
56 |
-
|
57 |
return $view_controller->load( 'infobar.floating-button', $data );
|
58 |
}
|
59 |
|
|
|
|
|
|
|
60 |
public function get_modal_base() {
|
61 |
$view_controller = new GDPR_Modules_View();
|
62 |
$modal_options = $this->gdpr_options;
|
63 |
$wpml_lang = $this->wpml_lang;
|
64 |
$layout = isset( $modal_options['moove_gdpr_plugin_layout'] ) ? $modal_options['moove_gdpr_plugin_layout'] : 'v1';
|
65 |
-
|
66 |
$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');
|
67 |
-
|
68 |
-
|
69 |
$data = new stdClass();
|
70 |
$data->logo_position = isset( $modal_options['moove_gdpr_logo_position'] ) ? $modal_options['moove_gdpr_logo_position'] : 'left';
|
71 |
$data->theme = $modal_theme = 'moove_gdpr_modal_theme_' . $layout;
|
72 |
$data->modal_title = $layout === 'v1' ? false : $tab_title;
|
73 |
-
|
74 |
$view_type = $layout === 'v1' ? 'tabs' : 'onepage';
|
75 |
return $view_controller->load( 'modal.modal-base-' . $view_type, $data );
|
76 |
}
|
77 |
|
|
|
|
|
|
|
78 |
public function get_infobar_base() {
|
79 |
$view_controller = new GDPR_Modules_View();
|
80 |
$modal_options = $this->gdpr_options;
|
81 |
$wpml_lang = $this->wpml_lang;
|
82 |
$data = new stdClass();
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
$infobar_classes = array(
|
87 |
'moove-gdpr-info-bar-hidden',
|
88 |
'moove-gdpr-align-center',
|
89 |
);
|
90 |
$modal_scheme = isset( $modal_options['moove_gdpr_colour_scheme'] ) ? ( ( intval( $modal_options['moove_gdpr_colour_scheme'] ) === 1 || intval( $modal_options['moove_gdpr_colour_scheme'] ) === 2 ) ? intval( $modal_options['moove_gdpr_colour_scheme'] ) : 1 ) : 1;
|
91 |
-
|
92 |
$scheme_class = $modal_scheme === 2 ? 'moove-gdpr-light-scheme' : 'moove-gdpr-dark-scheme';
|
93 |
-
|
94 |
-
|
95 |
$infobar_position = isset( $modal_options['moove_gdpr_infobar_position'] ) ? $modal_options['moove_gdpr_infobar_position'] : 'bottom';
|
96 |
$infobar_classes[] = $scheme_class;
|
97 |
$infobar_classes[] = 'gdpr_infobar_postion_' . $infobar_position;
|
98 |
$infobar_classes = apply_filters( 'gdpr_info_bar_class_extension', $infobar_classes );
|
99 |
$infobar_hidden = isset( $modal_options['moove_gdpr_infobar_visibility'] ) && $modal_options['moove_gdpr_infobar_visibility'] === 'hidden' ? true : false;
|
100 |
-
|
101 |
$data->show = $infobar_hidden ? false : true;
|
102 |
-
$data->class = implode( ' ', $infobar_classes );
|
103 |
-
|
104 |
-
|
105 |
$infobar_content = apply_filters( 'gdpr_info_bar_popup_content', $view_controller->load( 'infobar.infobar-base', $data ) );
|
106 |
-
|
107 |
return $infobar_content;
|
108 |
|
109 |
}
|
110 |
|
|
|
|
|
|
|
111 |
public function get_infobar_content() {
|
112 |
$view_controller = new GDPR_Modules_View();
|
113 |
$modal_options = $this->gdpr_options;
|
114 |
-
$wpml_lang = $this->wpml_lang;
|
115 |
-
|
116 |
$_content = '<p>'.__('This website uses cookies to provide you with the best browsing experience.','gdpr-cookie-compliance').'</p>'.
|
117 |
'<p>'.__('Find out more or adjust your [setting]settings[/setting].','gdpr-cookie-compliance').'</p>';
|
118 |
$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;
|
@@ -124,17 +121,22 @@ class GDPR_Modules {
|
|
124 |
return $view_controller->load( 'infobar.infobar-content', $data );
|
125 |
}
|
126 |
|
|
|
|
|
|
|
127 |
public function get_infobar_buttons() {
|
128 |
$view_controller = new GDPR_Modules_View();
|
129 |
$modal_options = $this->gdpr_options;
|
130 |
$wpml_lang = $this->wpml_lang;
|
131 |
-
|
132 |
$data = new stdClass();
|
133 |
$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');
|
134 |
return $view_controller->load( 'infobar.infobar-buttons', $data );
|
135 |
|
136 |
}
|
137 |
|
|
|
|
|
|
|
138 |
public function get_company_logo() {
|
139 |
$view_controller = new GDPR_Modules_View();
|
140 |
$modal_options = $this->gdpr_options;
|
@@ -148,6 +150,9 @@ class GDPR_Modules {
|
|
148 |
return $view_controller->load( 'modal.company-logo', $data );
|
149 |
}
|
150 |
|
|
|
|
|
|
|
151 |
public function get_gdpr_branding() {
|
152 |
$view_controller = new GDPR_Modules_View();
|
153 |
$moove_actions_cnt = new Moove_GDPR_Actions();
|
@@ -157,22 +162,21 @@ class GDPR_Modules {
|
|
157 |
$data->options = $modal_options;
|
158 |
$data->wpml_lang = $wpml_lang;
|
159 |
$data->text = $moove_actions_cnt->moove_gdpr_footer_branding_content();
|
160 |
-
|
161 |
-
$data->is_enabled = isset( $modal_options['moove_gdpr_modal_powered_by_disable'] ) && intval( $modal_options['moove_gdpr_modal_powered_by_disable'] === 1 ) ? false : true;
|
162 |
-
|
163 |
return $view_controller->load( 'modal.gdpr-branding', $data );
|
164 |
}
|
165 |
|
|
|
|
|
|
|
166 |
public function get_section_overview() {
|
167 |
$view_controller = new GDPR_Modules_View();
|
168 |
$modal_options = $this->gdpr_options;
|
169 |
$wpml_lang = $this->wpml_lang;
|
170 |
$gdpr_default_content = new Moove_GDPR_Content();
|
171 |
-
|
172 |
$layout = isset( $modal_options['moove_gdpr_plugin_layout'] ) ? $modal_options['moove_gdpr_plugin_layout'] : 'v1';
|
173 |
$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');
|
174 |
$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();
|
175 |
-
|
176 |
$data = new stdClass();
|
177 |
$data->options = $modal_options;
|
178 |
$data->wpml_lang = $wpml_lang;
|
@@ -183,20 +187,20 @@ class GDPR_Modules {
|
|
183 |
return $view_controller->load( 'modal.content-sections.overview', $data );
|
184 |
|
185 |
}
|
186 |
-
|
|
|
|
|
|
|
187 |
public function get_section_strictly() {
|
188 |
$view_controller = new GDPR_Modules_View();
|
189 |
$modal_options = $this->gdpr_options;
|
190 |
$wpml_lang = $this->wpml_lang;
|
191 |
$gdpr_default_content = new Moove_GDPR_Content();
|
192 |
-
|
193 |
$layout = isset( $modal_options['moove_gdpr_plugin_layout'] ) ? $modal_options['moove_gdpr_plugin_layout'] : 'v1';
|
194 |
$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');
|
195 |
$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();
|
196 |
-
|
197 |
$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;
|
198 |
$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();
|
199 |
-
|
200 |
$data = new stdClass();
|
201 |
$data->options = $modal_options;
|
202 |
$data->wpml_lang = $wpml_lang;
|
@@ -210,10 +214,12 @@ class GDPR_Modules {
|
|
210 |
$data->warning_message_bottom = $layout === 'v1' ? wpautop( $warning_msg ) : false;
|
211 |
$data->checkbox_state = $strictly !== 1 ? 'gdpr-checkbox-disabled checkbox-selected' : '';
|
212 |
$data->visibility = $layout === 'v1' ? 'style="display:none"' : '';
|
213 |
-
|
214 |
return $view_controller->load( 'modal.content-sections.strictly', $data );
|
215 |
}
|
216 |
-
|
|
|
|
|
|
|
217 |
public function get_section_advanced() {
|
218 |
$view_controller = new GDPR_Modules_View();
|
219 |
$modal_options = $this->gdpr_options;
|
@@ -224,7 +230,6 @@ class GDPR_Modules {
|
|
224 |
$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'.$wpml_lang,'gdpr-cookie-compliance');
|
225 |
$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();
|
226 |
$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;
|
227 |
-
|
228 |
$data = new stdClass();
|
229 |
$data->options = $modal_options;
|
230 |
$data->wpml_lang = $wpml_lang;
|
@@ -238,21 +243,21 @@ class GDPR_Modules {
|
|
238 |
$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();
|
239 |
$data->warning_message = wpautop( $data->warning_message );
|
240 |
$data->visibility = $layout === 'v1' ? 'style="display:none"' : '';
|
241 |
-
|
242 |
return $view_controller->load( 'modal.content-sections.advanced', $data );
|
243 |
}
|
244 |
-
|
|
|
|
|
|
|
245 |
public function get_section_third_party() {
|
246 |
$view_controller = new GDPR_Modules_View();
|
247 |
$modal_options = $this->gdpr_options;
|
248 |
$wpml_lang = $this->wpml_lang;
|
249 |
$gdpr_default_content = new Moove_GDPR_Content();
|
250 |
-
|
251 |
$layout = isset( $modal_options['moove_gdpr_plugin_layout'] ) ? $modal_options['moove_gdpr_plugin_layout'] : 'v1';
|
252 |
$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');
|
253 |
$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();
|
254 |
$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;
|
255 |
-
|
256 |
$data = new stdClass();
|
257 |
$data->options = $modal_options;
|
258 |
$data->wpml_lang = $wpml_lang;
|
@@ -266,10 +271,12 @@ class GDPR_Modules {
|
|
266 |
$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();
|
267 |
$data->warning_message = wpautop( $data->warning_message );
|
268 |
$data->visibility = $layout === 'v1' ? 'style="display:none"' : '';
|
269 |
-
|
270 |
return $view_controller->load( 'modal.content-sections.third_party', $data );
|
271 |
}
|
272 |
|
|
|
|
|
|
|
273 |
public function get_branding_styles() {
|
274 |
$view_controller = new GDPR_Modules_View();
|
275 |
$modal_options = $this->gdpr_options;
|
@@ -284,9 +291,7 @@ class GDPR_Modules {
|
|
284 |
$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";
|
285 |
endif;
|
286 |
endif;
|
287 |
-
|
288 |
$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" );
|
289 |
-
|
290 |
$data = new stdClass();
|
291 |
$data->primary_colour = isset( $modal_options['moove_gdpr_brand_colour'] ) && $modal_options['moove_gdpr_brand_colour'] ? $modal_options['moove_gdpr_brand_colour'] : '#0C4DA2';
|
292 |
$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';
|
@@ -294,21 +299,21 @@ class GDPR_Modules {
|
|
294 |
$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';
|
295 |
$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';
|
296 |
$data->font_family = $font_family;
|
297 |
-
|
298 |
return $view_controller->load( 'branding-styles', $data );
|
299 |
|
300 |
}
|
301 |
-
|
|
|
|
|
|
|
302 |
public function get_section_cookiepolicy() {
|
303 |
$view_controller = new GDPR_Modules_View();
|
304 |
$modal_options = $this->gdpr_options;
|
305 |
$wpml_lang = $this->wpml_lang;
|
306 |
$gdpr_default_content = new Moove_GDPR_Content();
|
307 |
-
|
308 |
$layout = isset( $modal_options['moove_gdpr_plugin_layout'] ) ? $modal_options['moove_gdpr_plugin_layout'] : 'v1';
|
309 |
$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');
|
310 |
$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();
|
311 |
-
|
312 |
$data = new stdClass();
|
313 |
$data->options = $modal_options;
|
314 |
$data->wpml_lang = $wpml_lang;
|
@@ -316,12 +321,12 @@ class GDPR_Modules {
|
|
316 |
$data->tab_content = wpautop( $tab_content );
|
317 |
$data->show = isset( $modal_options['moove_gdpr_cookie_policy_enable'] ) && intval( $modal_options['moove_gdpr_cookie_policy_enable'] ) === 1 ? true : false;
|
318 |
$data->visibility = $layout === 'v1' ? 'style="display:none"' : '';
|
319 |
-
|
320 |
return $view_controller->load( 'modal.content-sections.cookiepolicy', $data );
|
321 |
}
|
322 |
|
323 |
-
|
324 |
-
|
|
|
325 |
public function get_tab_footer_buttons() {
|
326 |
$view_controller = new GDPR_Modules_View();
|
327 |
$modal_options = $this->gdpr_options;
|
@@ -333,6 +338,9 @@ class GDPR_Modules {
|
|
333 |
return $view_controller->load( 'modal.tab-footer-buttons', $data );
|
334 |
}
|
335 |
|
|
|
|
|
|
|
336 |
public function get_tab_navigation() {
|
337 |
$view_controller = new GDPR_Modules_View();
|
338 |
$modal_options = $this->gdpr_options;
|
@@ -364,8 +372,6 @@ class GDPR_Modules {
|
|
364 |
$data->cookiepolicy->show = isset( $modal_options['moove_gdpr_cookie_policy_enable'] ) && intval( $modal_options['moove_gdpr_cookie_policy_enable'] ) === 1 ? true : false;
|
365 |
$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');
|
366 |
|
367 |
-
|
368 |
-
|
369 |
return $view_controller->load( 'modal.tab-navigation', $data );
|
370 |
}
|
371 |
|
17 |
* @author Gaspar Nemes
|
18 |
*/
|
19 |
class GDPR_Modules {
|
20 |
+
|
21 |
protected $gdpr_options;
|
22 |
protected $wpml_lang;
|
23 |
+
|
24 |
/**
|
25 |
* Construct function
|
26 |
*/
|
33 |
$this->wpml_lang = $wpml_lang;
|
34 |
}
|
35 |
|
36 |
+
/**
|
37 |
+
* GDPR Module - Floating Button view & content
|
38 |
+
*/
|
39 |
public function get_floating_button() {
|
40 |
$view_controller = new GDPR_Modules_View();
|
41 |
$modal_options = $this->gdpr_options;
|
42 |
$wpml_lang = $this->wpml_lang;
|
|
|
43 |
$floating_button_visibility = 'display: block;';
|
44 |
$floating_button_class = '';
|
45 |
$infobar_hidden = isset( $modal_options['moove_gdpr_infobar_visibility'] ) && $modal_options['moove_gdpr_infobar_visibility'] === 'hidden' ? true : false;
|
50 |
$data = new stdClass();
|
51 |
$data->options = $modal_options;
|
52 |
$data->wpml_lang = $wpml_lang;
|
53 |
+
$data->is_enabled = ( isset( $modal_options['moove_gdpr_floating_button_enable'] ) && intval( $modal_options['moove_gdpr_floating_button_enable'] ) === 1 ) ? true : false;
|
54 |
$data->styles = $floating_button_visibility . $floating_button_position;
|
55 |
$data->class = $floating_button_class;
|
56 |
if ( $floating_button_position ) :
|
57 |
$data->class = $floating_button_class .= ' gdpr-floating-button-custom-position';
|
58 |
endif;
|
59 |
$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');
|
|
|
60 |
return $view_controller->load( 'infobar.floating-button', $data );
|
61 |
}
|
62 |
|
63 |
+
/**
|
64 |
+
* GDPR Module - Base structure
|
65 |
+
*/
|
66 |
public function get_modal_base() {
|
67 |
$view_controller = new GDPR_Modules_View();
|
68 |
$modal_options = $this->gdpr_options;
|
69 |
$wpml_lang = $this->wpml_lang;
|
70 |
$layout = isset( $modal_options['moove_gdpr_plugin_layout'] ) ? $modal_options['moove_gdpr_plugin_layout'] : 'v1';
|
|
|
71 |
$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');
|
|
|
|
|
72 |
$data = new stdClass();
|
73 |
$data->logo_position = isset( $modal_options['moove_gdpr_logo_position'] ) ? $modal_options['moove_gdpr_logo_position'] : 'left';
|
74 |
$data->theme = $modal_theme = 'moove_gdpr_modal_theme_' . $layout;
|
75 |
$data->modal_title = $layout === 'v1' ? false : $tab_title;
|
|
|
76 |
$view_type = $layout === 'v1' ? 'tabs' : 'onepage';
|
77 |
return $view_controller->load( 'modal.modal-base-' . $view_type, $data );
|
78 |
}
|
79 |
|
80 |
+
/**
|
81 |
+
* GDPR Module - Infobar structure
|
82 |
+
*/
|
83 |
public function get_infobar_base() {
|
84 |
$view_controller = new GDPR_Modules_View();
|
85 |
$modal_options = $this->gdpr_options;
|
86 |
$wpml_lang = $this->wpml_lang;
|
87 |
$data = new stdClass();
|
|
|
|
|
|
|
88 |
$infobar_classes = array(
|
89 |
'moove-gdpr-info-bar-hidden',
|
90 |
'moove-gdpr-align-center',
|
91 |
);
|
92 |
$modal_scheme = isset( $modal_options['moove_gdpr_colour_scheme'] ) ? ( ( intval( $modal_options['moove_gdpr_colour_scheme'] ) === 1 || intval( $modal_options['moove_gdpr_colour_scheme'] ) === 2 ) ? intval( $modal_options['moove_gdpr_colour_scheme'] ) : 1 ) : 1;
|
|
|
93 |
$scheme_class = $modal_scheme === 2 ? 'moove-gdpr-light-scheme' : 'moove-gdpr-dark-scheme';
|
|
|
|
|
94 |
$infobar_position = isset( $modal_options['moove_gdpr_infobar_position'] ) ? $modal_options['moove_gdpr_infobar_position'] : 'bottom';
|
95 |
$infobar_classes[] = $scheme_class;
|
96 |
$infobar_classes[] = 'gdpr_infobar_postion_' . $infobar_position;
|
97 |
$infobar_classes = apply_filters( 'gdpr_info_bar_class_extension', $infobar_classes );
|
98 |
$infobar_hidden = isset( $modal_options['moove_gdpr_infobar_visibility'] ) && $modal_options['moove_gdpr_infobar_visibility'] === 'hidden' ? true : false;
|
|
|
99 |
$data->show = $infobar_hidden ? false : true;
|
100 |
+
$data->class = implode( ' ', $infobar_classes );
|
|
|
|
|
101 |
$infobar_content = apply_filters( 'gdpr_info_bar_popup_content', $view_controller->load( 'infobar.infobar-base', $data ) );
|
|
|
102 |
return $infobar_content;
|
103 |
|
104 |
}
|
105 |
|
106 |
+
/**
|
107 |
+
* GDPR Module - Infobar Main Content
|
108 |
+
*/
|
109 |
public function get_infobar_content() {
|
110 |
$view_controller = new GDPR_Modules_View();
|
111 |
$modal_options = $this->gdpr_options;
|
112 |
+
$wpml_lang = $this->wpml_lang;
|
|
|
113 |
$_content = '<p>'.__('This website uses cookies to provide you with the best browsing experience.','gdpr-cookie-compliance').'</p>'.
|
114 |
'<p>'.__('Find out more or adjust your [setting]settings[/setting].','gdpr-cookie-compliance').'</p>';
|
115 |
$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;
|
121 |
return $view_controller->load( 'infobar.infobar-content', $data );
|
122 |
}
|
123 |
|
124 |
+
/**
|
125 |
+
* GDPR Module - Infobar button & extensions
|
126 |
+
*/
|
127 |
public function get_infobar_buttons() {
|
128 |
$view_controller = new GDPR_Modules_View();
|
129 |
$modal_options = $this->gdpr_options;
|
130 |
$wpml_lang = $this->wpml_lang;
|
|
|
131 |
$data = new stdClass();
|
132 |
$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');
|
133 |
return $view_controller->load( 'infobar.infobar-buttons', $data );
|
134 |
|
135 |
}
|
136 |
|
137 |
+
/**
|
138 |
+
* GDPR Module - Company Logo
|
139 |
+
*/
|
140 |
public function get_company_logo() {
|
141 |
$view_controller = new GDPR_Modules_View();
|
142 |
$modal_options = $this->gdpr_options;
|
150 |
return $view_controller->load( 'modal.company-logo', $data );
|
151 |
}
|
152 |
|
153 |
+
/**
|
154 |
+
* GDPR Module - Branding Options
|
155 |
+
*/
|
156 |
public function get_gdpr_branding() {
|
157 |
$view_controller = new GDPR_Modules_View();
|
158 |
$moove_actions_cnt = new Moove_GDPR_Actions();
|
162 |
$data->options = $modal_options;
|
163 |
$data->wpml_lang = $wpml_lang;
|
164 |
$data->text = $moove_actions_cnt->moove_gdpr_footer_branding_content();
|
165 |
+
$data->is_enabled = isset( $modal_options['moove_gdpr_modal_powered_by_disable'] ) && intval( $modal_options['moove_gdpr_modal_powered_by_disable'] === 1 ) ? false : true;
|
|
|
|
|
166 |
return $view_controller->load( 'modal.gdpr-branding', $data );
|
167 |
}
|
168 |
|
169 |
+
/**
|
170 |
+
* GDPR Module - Privacy Overview Content
|
171 |
+
*/
|
172 |
public function get_section_overview() {
|
173 |
$view_controller = new GDPR_Modules_View();
|
174 |
$modal_options = $this->gdpr_options;
|
175 |
$wpml_lang = $this->wpml_lang;
|
176 |
$gdpr_default_content = new Moove_GDPR_Content();
|
|
|
177 |
$layout = isset( $modal_options['moove_gdpr_plugin_layout'] ) ? $modal_options['moove_gdpr_plugin_layout'] : 'v1';
|
178 |
$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');
|
179 |
$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();
|
|
|
180 |
$data = new stdClass();
|
181 |
$data->options = $modal_options;
|
182 |
$data->wpml_lang = $wpml_lang;
|
187 |
return $view_controller->load( 'modal.content-sections.overview', $data );
|
188 |
|
189 |
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* GPDR Module - Strictly Necessary Cookies
|
193 |
+
*/
|
194 |
public function get_section_strictly() {
|
195 |
$view_controller = new GDPR_Modules_View();
|
196 |
$modal_options = $this->gdpr_options;
|
197 |
$wpml_lang = $this->wpml_lang;
|
198 |
$gdpr_default_content = new Moove_GDPR_Content();
|
|
|
199 |
$layout = isset( $modal_options['moove_gdpr_plugin_layout'] ) ? $modal_options['moove_gdpr_plugin_layout'] : 'v1';
|
200 |
$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');
|
201 |
$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();
|
|
|
202 |
$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;
|
203 |
$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();
|
|
|
204 |
$data = new stdClass();
|
205 |
$data->options = $modal_options;
|
206 |
$data->wpml_lang = $wpml_lang;
|
214 |
$data->warning_message_bottom = $layout === 'v1' ? wpautop( $warning_msg ) : false;
|
215 |
$data->checkbox_state = $strictly !== 1 ? 'gdpr-checkbox-disabled checkbox-selected' : '';
|
216 |
$data->visibility = $layout === 'v1' ? 'style="display:none"' : '';
|
|
|
217 |
return $view_controller->load( 'modal.content-sections.strictly', $data );
|
218 |
}
|
219 |
+
|
220 |
+
/**
|
221 |
+
* GDPR Module - Advanced Cookies
|
222 |
+
*/
|
223 |
public function get_section_advanced() {
|
224 |
$view_controller = new GDPR_Modules_View();
|
225 |
$modal_options = $this->gdpr_options;
|
230 |
$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'.$wpml_lang,'gdpr-cookie-compliance');
|
231 |
$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();
|
232 |
$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;
|
|
|
233 |
$data = new stdClass();
|
234 |
$data->options = $modal_options;
|
235 |
$data->wpml_lang = $wpml_lang;
|
243 |
$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();
|
244 |
$data->warning_message = wpautop( $data->warning_message );
|
245 |
$data->visibility = $layout === 'v1' ? 'style="display:none"' : '';
|
|
|
246 |
return $view_controller->load( 'modal.content-sections.advanced', $data );
|
247 |
}
|
248 |
+
|
249 |
+
/**
|
250 |
+
* GDPR Module - Third Party Cookies
|
251 |
+
*/
|
252 |
public function get_section_third_party() {
|
253 |
$view_controller = new GDPR_Modules_View();
|
254 |
$modal_options = $this->gdpr_options;
|
255 |
$wpml_lang = $this->wpml_lang;
|
256 |
$gdpr_default_content = new Moove_GDPR_Content();
|
|
|
257 |
$layout = isset( $modal_options['moove_gdpr_plugin_layout'] ) ? $modal_options['moove_gdpr_plugin_layout'] : 'v1';
|
258 |
$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');
|
259 |
$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();
|
260 |
$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;
|
|
|
261 |
$data = new stdClass();
|
262 |
$data->options = $modal_options;
|
263 |
$data->wpml_lang = $wpml_lang;
|
271 |
$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();
|
272 |
$data->warning_message = wpautop( $data->warning_message );
|
273 |
$data->visibility = $layout === 'v1' ? 'style="display:none"' : '';
|
|
|
274 |
return $view_controller->load( 'modal.content-sections.third_party', $data );
|
275 |
}
|
276 |
|
277 |
+
/**
|
278 |
+
* GDPR Module - Custom CSS for branding
|
279 |
+
*/
|
280 |
public function get_branding_styles() {
|
281 |
$view_controller = new GDPR_Modules_View();
|
282 |
$modal_options = $this->gdpr_options;
|
291 |
$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";
|
292 |
endif;
|
293 |
endif;
|
|
|
294 |
$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" );
|
|
|
295 |
$data = new stdClass();
|
296 |
$data->primary_colour = isset( $modal_options['moove_gdpr_brand_colour'] ) && $modal_options['moove_gdpr_brand_colour'] ? $modal_options['moove_gdpr_brand_colour'] : '#0C4DA2';
|
297 |
$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';
|
299 |
$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';
|
300 |
$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';
|
301 |
$data->font_family = $font_family;
|
|
|
302 |
return $view_controller->load( 'branding-styles', $data );
|
303 |
|
304 |
}
|
305 |
+
|
306 |
+
/**
|
307 |
+
* GDPR Module - Cookie Policy Page
|
308 |
+
*/
|
309 |
public function get_section_cookiepolicy() {
|
310 |
$view_controller = new GDPR_Modules_View();
|
311 |
$modal_options = $this->gdpr_options;
|
312 |
$wpml_lang = $this->wpml_lang;
|
313 |
$gdpr_default_content = new Moove_GDPR_Content();
|
|
|
314 |
$layout = isset( $modal_options['moove_gdpr_plugin_layout'] ) ? $modal_options['moove_gdpr_plugin_layout'] : 'v1';
|
315 |
$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');
|
316 |
$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();
|
|
|
317 |
$data = new stdClass();
|
318 |
$data->options = $modal_options;
|
319 |
$data->wpml_lang = $wpml_lang;
|
321 |
$data->tab_content = wpautop( $tab_content );
|
322 |
$data->show = isset( $modal_options['moove_gdpr_cookie_policy_enable'] ) && intval( $modal_options['moove_gdpr_cookie_policy_enable'] ) === 1 ? true : false;
|
323 |
$data->visibility = $layout === 'v1' ? 'style="display:none"' : '';
|
|
|
324 |
return $view_controller->load( 'modal.content-sections.cookiepolicy', $data );
|
325 |
}
|
326 |
|
327 |
+
/**
|
328 |
+
* GDPR Module - Footer Button inside the Modal
|
329 |
+
*/
|
330 |
public function get_tab_footer_buttons() {
|
331 |
$view_controller = new GDPR_Modules_View();
|
332 |
$modal_options = $this->gdpr_options;
|
338 |
return $view_controller->load( 'modal.tab-footer-buttons', $data );
|
339 |
}
|
340 |
|
341 |
+
/**
|
342 |
+
* GDPR Module - Navigation inside the modal
|
343 |
+
*/
|
344 |
public function get_tab_navigation() {
|
345 |
$view_controller = new GDPR_Modules_View();
|
346 |
$modal_options = $this->gdpr_options;
|
372 |
$data->cookiepolicy->show = isset( $modal_options['moove_gdpr_cookie_policy_enable'] ) && intval( $modal_options['moove_gdpr_cookie_policy_enable'] ) === 1 ? true : false;
|
373 |
$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');
|
374 |
|
|
|
|
|
375 |
return $view_controller->load( 'modal.tab-navigation', $data );
|
376 |
}
|
377 |
|
readme.txt
CHANGED
@@ -179,6 +179,8 @@ THIS PLUGIN DOES NOT MAKE YOUR WEBSITE COMPLIANT. YOU ARE RESPONSIBLE FOR ENSURI
|
|
179 |
30. GDPR Cookie Compliance - Admin - Iframe Blocker / Pages [Premium]
|
180 |
|
181 |
== Changelog ==
|
|
|
|
|
182 |
|
183 |
= 2.0.1 =
|
184 |
* Added support to WP Multilang plugin
|
179 |
30. GDPR Cookie Compliance - Admin - Iframe Blocker / Pages [Premium]
|
180 |
|
181 |
== Changelog ==
|
182 |
+
= 2.0.2 =
|
183 |
+
* Fixed PHP notices
|
184 |
|
185 |
= 2.0.1 =
|
186 |
* Added support to WP Multilang plugin
|