PluginProbe ʕ •ᴥ•ʔ
Complianz – GDPR/CCPA Cookie Consent / 6.5.6
Complianz – GDPR/CCPA Cookie Consent v6.5.6
7.4.7 7.4.6 trunk 6.5.6 7.0.4 7.0.5 7.1.0 7.1.4 7.1.5 7.2.0 7.3.0 7.3.1 7.4.0 7.4.0.1 7.4.1 7.4.2 7.4.3 7.4.4 7.4.4.1 7.4.4.2 7.4.5 beta
complianz-gdpr / callback-notices.php
complianz-gdpr Last commit date
DNSMPD 2 years ago assets 2 years ago config 2 years ago cookie 2 years ago cookiebanner 2 years ago cron 3 years ago grid 3 years ago gutenberg 2 years ago integrations 2 years ago languages 2 years ago proof-of-consent 3 years ago rest-api 3 years ago settings 2 years ago shepherd 3 years ago templates 2 years ago upgrade 2 years ago LICENSE.txt 4 years ago README.md 4 years ago callback-notices.php 3 years ago class-admin.php 2 years ago class-company.php 4 years ago class-cookie-blocker.php 2 years ago class-document.php 2 years ago class-export.php 3 years ago class-field.php 2 years ago class-installer.php 2 years ago class-review.php 3 years ago class-wizard.php 3 years ago complianz-gpdr.php 2 years ago composer.json 3 years ago functions.php 2 years ago gulpfile.js 3 years ago index.php 7 years ago loco.xml 4 years ago readme.txt 2 years ago security.md 2 years ago system-status.php 3 years ago uninstall.php 3 years ago upgrade.php 2 years ago
callback-notices.php
387 lines
1 <?php
2 defined( 'ABSPATH' ) or die( "you do not have access to this page!" );
3
4 add_action( 'cmplz_notice_compile_statistics', 'cmplz_compile_statistics' );
5 function cmplz_compile_statistics() {
6 if ( get_option( 'cmplz_detected_stats_type' )
7 || get_option( 'cmplz_detected_stats_data' )
8 ) {
9 cmplz_sidebar_notice( __( "This field has been pre-filled based on the scan results.", 'complianz-gdpr' ) );
10 }
11 }
12
13 function cmplz_notice_cookiedatabase_sync(){
14 if (!COMPLIANZ::$cookie_admin->use_cdb_api() ) {
15 cmplz_sidebar_notice(__("Cookiedatabase.org synchronization disabled.", "complianz-gdpr"),'warning');
16 }
17
18 if ( ! function_exists( 'curl_version' ) ) {
19 cmplz_sidebar_notice( __( 'Your server does not have CURL installed, which is required for the sync. Please contact your hosting company to install CURL.',
20 'complianz-gdpr' ), 'warning' );
21 }
22
23 $data_cookies = COMPLIANZ::$cookie_admin->get_syncable_cookies();
24 $data_services = COMPLIANZ::$cookie_admin->get_syncable_services();
25 if ( $data_cookies['count'] == 0 && $data_services['count'] == 0 ) {
26 cmplz_sidebar_notice( __( 'Synchronization disabled: This happens when all cookies have synchronized to cookiedatabase.org in the last week.',
27 'complianz-gdpr' ), 'warning' );
28 }
29 }
30 add_action( 'cmplz_notice_cookiedatabase_sync', 'cmplz_notice_cookiedatabase_sync' );
31
32 function cmplz_notice_stats_non_functional() {
33 if ( get_option( 'cmplz_detected_stats_type' )
34 || get_option( 'cmplz_detected_stats_data' )
35 ) {
36 cmplz_sidebar_notice( __( "This field has been pre-filled based on the scan results.", 'complianz-gdpr' ) . "&nbsp;"
37 . __( "Please make sure you remove your current implementation to prevent double statistics tracking.", 'complianz-gdpr' ) );
38 } else {
39 cmplz_sidebar_notice( __( 'If you add the ID for your statistics tool here, Complianz will configure your site for statistics tracking.', 'complianz-gdpr' ) );
40 }
41 }
42 add_action( 'cmplz_notice_GTM_code', 'cmplz_notice_stats_non_functional' );
43 add_action( 'cmplz_notice_UA_code', 'cmplz_notice_stats_non_functional' );
44 add_action( 'cmplz_notice_matomo_site_id', 'cmplz_notice_stats_non_functional' );
45
46 add_action( 'cmplz_notice_compile_statistics', 'cmplz_show_compile_statistics_notice', 10, 1 );
47 function cmplz_show_compile_statistics_notice( $args ) {
48 $stats = cmplz_scan_detected_stats();
49 if ( $stats ) {
50 $type = reset( $stats );
51 $type = COMPLIANZ::$config->stats[ $type ];
52
53 cmplz_sidebar_notice( cmplz_sprintf( __( "The cookie scan detected %s on your site, which means the answer to this question should be %s.", 'complianz-gdpr' ), $type, $type ) );
54 }
55 }
56
57 add_action( 'cmplz_notice_uses_social_media',
58 'cmplz_uses_social_media_notice' );
59 function cmplz_uses_social_media_notice() {
60 $social_media = cmplz_scan_detected_social_media();
61 if ( $social_media ) {
62 foreach ( $social_media as $key => $social_medium ) {
63 $social_media[ $key ]
64 = COMPLIANZ::$config->thirdparty_socialmedia[ $social_medium ];
65 }
66 $social_media = implode( ', ', $social_media );
67 cmplz_sidebar_notice( cmplz_sprintf( __( "The scan found social media buttons or widgets for %s on your site, which means the answer should be yes",
68 'complianz-gdpr' ), $social_media ) );
69 }
70 }
71
72
73 add_action( 'cmplz_notice_purpose_personaldata', 'cmplz_purpose_personaldata' );
74 function cmplz_purpose_personaldata() {
75 $contact_forms = cmplz_site_uses_contact_forms();
76 if ( $contact_forms ) {
77 cmplz_sidebar_notice( __( 'The scan found forms on your site, which means answer should probably include "contact".',
78 'complianz-gdpr' ) );
79 }
80 }
81
82 add_action( 'cmplz_notice_uses_thirdparty_services', 'cmplz_uses_thirdparty_services_notice' );
83 function cmplz_uses_thirdparty_services_notice() {
84 $thirdparties = cmplz_scan_detected_thirdparty_services();
85 if ( $thirdparties ) {
86 foreach ( $thirdparties as $key => $thirdparty ) {
87 $thirdparties[ $key ] = COMPLIANZ::$config->thirdparty_services[ $thirdparty ];
88 }
89 $thirdparties = implode( ', ', $thirdparties );
90 cmplz_sidebar_notice( cmplz_sprintf( __( "The scan found third-party services on your website: %s, this means the answer should be yes.",
91 'complianz-gdpr' ), $thirdparties ) );
92 }
93 }
94
95
96 add_action( 'cmplz_notice_purpose_personaldata', 'cmplz_purpose_personaldata_notice' );
97 function cmplz_purpose_personaldata_notice() {
98 if ( cmplz_has_region('us') && COMPLIANZ::$cookie_admin->site_shares_data()
99 ) {
100 cmplz_sidebar_notice( __( "The cookie scan detected cookies from services that share data with Third Parties. According to US privacy laws, your website is considered to sell personal data if it collects and shares any personal data in return for money or services. This includes a service like Google Analytics.",
101 'complianz-gdpr' ) );
102 }
103 }
104
105 function cmplz_notice_cookie_scan() {
106 if ( ! function_exists( 'curl_version' ) ) {
107 cmplz_sidebar_notice( __( 'Your server does not have CURL installed, which is required for the scan. Please contact your hosting company to install CURL.', 'complianz-gdpr' ), 'warning' );
108 }
109
110 if ( ( isset( $_SERVER['HTTP_DNT'] )
111 && $_SERVER['HTTP_DNT'] == 1 )
112 || isset( $_SERVER['HTTP_SEC_GPC'] )
113 ) {
114 cmplz_sidebar_notice( __( "Your browser has the Do Not Track or Global Privacy Control setting enabled.","complianz-gdpr")."&nbsp;".__("This will prevent most cookies from being placed.","complianz-gdpr")."&nbsp;".__("Please run the scan with these browser options disabled.", 'complianz-gdpr' ), 'warning' );
115 }
116 ?>
117
118 <div id="cmplz_adblock_warning" style="display: none">
119 <?php cmplz_sidebar_notice( __( "You are using an ad blocker. This will prevent most cookies from being placed. Please run the scan without an adblocker enabled.", 'complianz-gdpr' ), 'warning' ) ?>
120 </div>
121 <div id="cmplz_anonymous_window_warning" style="display: none">
122 <?php cmplz_sidebar_notice( __( "You are using an anonymous window. This will prevent most cookies from being placed. Please run the scan in a normal browser window.",
123 'complianz-gdpr' ), 'warning' ) ?>
124 </div>
125 <?php
126 }
127 add_action( 'cmplz_notice_cookie_scan', 'cmplz_notice_cookie_scan' );
128
129
130 function cmplz_google_fonts_warning() {
131 //Divi specific notice
132 if (function_exists('et_setup_theme')) {
133 cmplz_sidebar_notice( __( "Your site uses Divi. If you use reCAPTCHA on your site, you may need to disable the reCAPTCHA integration in Complianz. ", 'complianz-gdpr' ).cmplz_read_more( "https://complianz.io/blocking-recaptcha-on-divi/" ) , 'warning');
134 }
135 }
136 add_action( 'cmplz_notice_thirdparty_services_on_site', 'cmplz_google_fonts_warning' );
137
138
139 function cmplz_used_cookies_notice() {
140
141 if ( cmplz_uses_only_functional_cookies() ) {
142 return;
143 }
144
145 //not relevant if cookie blocker is disabled
146 if ( !cmplz_can_run_cookie_blocker() ) {
147 return;
148 }
149
150 cmplz_sidebar_notice( cmplz_sprintf( __( "Because your site uses third-party cookies, the cookie blocker is now activated. If you experience issues on the front-end of your site due to blocked scripts, you can disable specific services or plugin integrations in the %sintegrations section%s, or you can disable the cookie blocker entirely on the %ssettings page%s",
151 'complianz-gdpr' ),
152 '<a href="' . admin_url( 'admin.php?page=cmplz-script-center' ) . '">',
153 '</a>',
154 '<a href="' . admin_url( 'admin.php?page=cmplz-script-center' ) . '">',
155 '</a>' ), 'warning' );
156
157 }
158 add_action( 'cmplz_notice_used_cookies', 'cmplz_used_cookies_notice' );
159
160 function cmplz_data_disclosed_us() {
161
162 if ( COMPLIANZ::$cookie_admin->site_shares_data() ) {
163 cmplz_sidebar_notice( __( "The cookie scan detected cookies from services which share data with Third Parties. If these cookies were also used in the past 12 months, you should at least select the option 'Internet activity...'",
164 'complianz-gdpr' ) );
165 }
166 }
167 add_action( 'cmplz_notice_data_disclosed_us', 'cmplz_data_disclosed_us' );
168
169 function cmplz_data_sold_us() {
170
171 if ( COMPLIANZ::$cookie_admin->site_shares_data() ) {
172 cmplz_sidebar_notice( __( "The cookie scan detected cookies from services which share data with Third Parties. If these cookies were also used in the past 12 months, you should at least select the option 'Internet activity...'",
173 'complianz-gdpr' ) );
174 }
175
176 }
177 add_action( 'cmplz_notice_data_sold_us', 'cmplz_data_sold_us' );
178
179 function cmplz_notice_block_recaptcha_service() {
180 cmplz_sidebar_notice( __( "If you choose to block reCAPTCHA, please make sure you add a placeholder to your forms.",
181 'complianz-gdpr' )
182 . cmplz_read_more( 'https://complianz.io/blocking-recaptcha-manually/' ) );
183 }
184 add_action( 'cmplz_notice_block_recaptcha_service', 'cmplz_notice_block_recaptcha_service' );
185
186 function cmplz_notice_statistics_script() {
187 cmplz_sidebar_notice( __( 'You have indicated you use a statistics tool which tracks personal data. You can insert this script here so it only fires if the user consents to this.',
188 'intro cookie usage', 'complianz-gdpr' ) );
189
190 }
191 add_action( 'cmplz_notice_statistics_script', 'cmplz_notice_statistics_script' );
192
193 add_action('cmplz_notice_create_pages', 'cmplz_notice_custom_create_pages');
194 function cmplz_notice_custom_create_pages(){
195
196 $created_pages = COMPLIANZ::$document->get_created_pages();
197 $required_pages = COMPLIANZ::$document->get_required_pages();
198 if (count($required_pages) > count($created_pages) ){
199 cmplz_sidebar_notice( __( 'You haven\'t created all required pages yet. You can add missing pages in the previous step, or create them manually with the shortcode. You can come back later to this step to add your pages to the desired menu, or do it manually via Appearance > Menu.',
200 'complianz-gdpr' )
201 );
202 }
203 }
204
205 function cmplz_notice_add_pages_to_menu() {
206 $created_pages = COMPLIANZ::$document->get_created_pages();
207 $pages_not_in_menu = COMPLIANZ::$document->pages_not_in_menu();
208 if ( $pages_not_in_menu ) {
209 $docs = implode( ", ", $pages_not_in_menu );
210 //not using cmplz_sprintf( here, as one variant does not include a %s, causing a translation error notice
211 cmplz_sidebar_notice( sprintf( esc_html( _n( 'The generated document %s has not been assigned to a menu yet, you can do this now, or skip this step and do it later.',
212 'Not all generated documents have been assigned to a menu yet, you can do this now, or skip this step and do it later.',
213 count( $pages_not_in_menu ), 'complianz-gdpr' ) ), $docs ),
214 'warning' );
215 } else {
216 if (count($created_pages)>0 ) {
217 cmplz_sidebar_notice( __( "Great! All your generated documents have been assigned to a menu, so you can skip this step.",
218 'complianz-gdpr' ), 'warning' );
219 }
220 }
221 }
222
223 add_action( 'cmplz_notice_add_pages_to_menu', 'cmplz_notice_add_pages_to_menu' );
224 add_action( 'cmplz_notice_add_pages_to_menu_region_redirected', 'cmplz_notice_add_pages_to_menu' );
225
226 function cmplz_show_category_marketing_notice() {
227 if ( COMPLIANZ::$cookie_admin->uses_google_tagmanager() ) {
228 cmplz_sidebar_notice( __( "You're using Google Tag Manager. This means you need to configure Tag Manager to use the below categories.", 'complianz-gdpr' ).cmplz_read_more('https://complianz.io/definitive-guide-to-tag-manager-and-complianz/'), 'warning' );
229 }
230 }
231 add_action( 'cmplz_notice_category_marketing', 'cmplz_show_category_marketing_notice' );
232
233 function cmplz_show_category_statistics_notice() {
234 if ( COMPLIANZ::$cookie_admin->cookie_warning_required_stats( 'eu' ) ) {
235 cmplz_sidebar_notice( __( "Categories are mandatory for your statistics configuration.", 'complianz-gdpr' ) . cmplz_read_more( 'https://complianz.io/statistics-as-mandatory-category' ), 'warning' );
236 }
237 }
238 add_action( 'cmplz_notice_category_statistics', 'cmplz_show_category_statistics_notice' );
239
240 /**
241 * For the cookie page and the US banner we need a link to the privacy statement.
242 * In free, and in premium when the privacy statement is not enabled, we choose the WP privacy page. If it is not set, the user needs to create one.
243 * */
244
245 function cmplz_notice_missing_privacy_page() {
246 if (cmplz_has_region('us') || cmplz_has_region('ca') || cmplz_has_region('au')){
247 cmplz_sidebar_notice( __( "It is recommended to select a Privacy Statement.", 'complianz-gdpr' )." ".__("The link to the Privacy Statement is used in the cookie banner and in your Cookie Policy.", 'complianz-gdpr' ) );
248 } else {
249 cmplz_sidebar_notice( __( "It is recommended to select a Privacy Statement.", 'complianz-gdpr' )." ".__("The link to the Privacy Statement is used in your Cookie Policy.", 'complianz-gdpr' ) );
250 }
251
252 }
253 add_action( 'cmplz_notice_privacy-statement', 'cmplz_notice_missing_privacy_page' );
254
255 /**
256 * If a plugin places marketing cookie as first party, we can't block it automatically, unless the wp consent api is used.
257 * User should be warned, and category marketing is necessary
258 * */
259
260 function cmplz_notice_firstparty_marketing() {
261 if ( cmplz_detected_firstparty_marketing() ) {
262 cmplz_sidebar_notice( __( "You use plugins which place first-party marketing cookies. You can view these plugins on the integrations page. Complianz cannot automatically block first-party marketing cookies unless these plugins conform to the WP Consent API.", 'complianz-gdpr' )
263 . cmplz_read_more( 'https://complianz.io/first-party-marketing-cookies' )
264 );
265 }
266 }
267 add_action( 'cmplz_notice_uses_firstparty_marketing_cookies', 'cmplz_notice_firstparty_marketing' );
268
269
270 add_action( 'cmplz_notice_sensitive_information_processed',
271 'cmplz_notice_sensitive_information_processed' );
272 function cmplz_notice_sensitive_information_processed() {
273 if ( cmplz_uses_sensitive_data() ) {
274 cmplz_sidebar_notice( __( "You have selected options that indicate your site processes sensitive, personal data. You should select 'Yes'",
275 'complianz-gdpr' ) );
276 }
277 }
278
279 add_filter( 'cmplz_default_value', 'cmplz_set_default', 10, 2 );
280 function cmplz_set_default( $value, $fieldname ) {
281 if ( $fieldname == 'compile_statistics' ) {
282 $stats = cmplz_scan_detected_stats();
283 if ( $stats ) {
284 return reset( $stats );
285 }
286 }
287
288 if ( $fieldname == 'purpose_personaldata' ) {
289 if ( cmplz_has_region('us')
290 && COMPLIANZ::$cookie_admin->site_shares_data()
291 ) {
292 //possibly not an array yet, when it's empty
293 if ( ! is_array( $value ) ) {
294 $value = array();
295 }
296 $value['selling-data-thirdparty'] = 1;
297
298 return $value;
299 }
300 }
301
302 if ( $fieldname == 'sensitive_information_processed' ) {
303 if ( cmplz_uses_sensitive_data() ) {
304 return 'yes';
305 }
306 }
307
308 if ( $fieldname == 'purpose_personaldata' ) {
309 $contact_forms = cmplz_site_uses_contact_forms();
310 if ( $contact_forms ) {
311 //possibly not an array yet, when it's empty
312 if ( ! is_array( $value ) ) {
313 $value = array();
314 }
315 $value['contact'] = 1;
316
317 return $value;
318 }
319 }
320
321 if ( $fieldname == 'country_company' ) {
322 $country_code = substr( get_locale(), 3, 2 );
323 if ( isset( COMPLIANZ::$config->countries[ $country_code ] ) ) {
324 $value = $country_code;
325 }
326
327 }
328
329 if ( $fieldname === 'uses_social_media' ) {
330 $social_media = cmplz_scan_detected_social_media();
331 if ( $social_media ) {
332 return 'yes';
333 }
334 }
335
336 if ( $fieldname === 'socialmedia_on_site' ) {
337 $social_media = cmplz_scan_detected_social_media();
338 if ( $social_media ) {
339 $current_social_media = array();
340 foreach ( $social_media as $key ) {
341 $current_social_media[ $key ] = 1;
342 }
343
344 return $current_social_media;
345 }
346 }
347
348 if ( $fieldname === 'uses_thirdparty_services' ) {
349 $blocked_scripts = COMPLIANZ::$cookie_blocker->blocked_scripts();
350 $custom_thirdparty_scripts = is_array($blocked_scripts) && count( $blocked_scripts ) > 0;
351 if ( cmplz_scan_detected_thirdparty_services() || $custom_thirdparty_scripts ) {
352 return 'yes';
353 }
354 }
355 if ( $fieldname === 'thirdparty_services_on_site' ) {
356 $thirdparty = cmplz_scan_detected_thirdparty_services();
357 if ( $thirdparty ) {
358 $current_thirdparty = array();
359 foreach ( $thirdparty as $key ) {
360 $current_thirdparty[ $key ] = 1;
361 }
362
363 return $current_thirdparty;
364 }
365 }
366
367 if ( $fieldname === 'data_disclosed_us' || $fieldname === 'data_sold_us' ) {
368 if ( COMPLIANZ::$cookie_admin->site_shares_data() ) {
369 //possibly not an array yet.
370 if ( ! is_array( $value ) ) {
371 $value = array();
372 }
373 $value['internet'] = 1;
374
375 return $value;
376 }
377 }
378
379 if ( $fieldname === 'uses_firstparty_marketing_cookies' ) {
380 if ( cmplz_detected_firstparty_marketing() ) {
381 return 'yes';
382 }
383 }
384
385 return $value;
386 }
387