PluginProbe
CookieAdmin – Cookie Consent Banner / 1.2.3
CookieAdmin – Cookie Consent Banner v1.2.3
1.2.3 1.2.2 1.2.1 1.2.0 1.1.9 trunk 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 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8
← All changes | includes/functions.php +64 -29 1.1.91.2.3 View file →
@@ -19,8 +19,16 @@
19 19 // No update required
20 20 if($current_version == COOKIEADMIN_VERSION){
21 21 return true;
22 22 }
23 +
24 + // We added a option to disable Script Delaying
25 + if($version < 120){
26 + $settings = get_option('cookieadmin_settings', []);
27 + $settings['block_scripts'] = true;
28 +
29 + update_option('cookieadmin_settings', $settings);
30 + }
23 31
24 32 // Save the new Version
25 33 update_option('cookieadmin_version', COOKIEADMIN_VERSION);
26 34
@@ -61,9 +69,13 @@
61 69
62 70 add_action('wp_enqueue_scripts', '\CookieAdmin\Enduser::enqueue_scripts');
63 71
64 72 // Insert Cookie blocker in the head.
65 - //add_action('send_headers', '\CookieAdmin\Enduser::cookieadmin_block_cookie_init_php', 100);
73 + add_action('send_headers', '\CookieAdmin\Enduser::cookieadmin_block_cookie_init_php', 100);
74 + add_filter( 'rest_pre_serve_request', function ( $served ) {
75 + \CookieAdmin\Enduser::cookieadmin_block_cookie_init_php();
76 + return $served;
77 + }, 999 );
66 78 // add_action('init', '\CookieAdmin\Enduser::cookieadmin_block_cookie_head_js', 0);
67 79
68 80 //add Cookie Banner to user page
69 81 if(!cookieadmin_is_editor_mode()){
@@ -69,9 +81,9 @@
69 81 if(!cookieadmin_is_editor_mode()){
70 82 add_action('wp_footer', '\CookieAdmin\Enduser::cookieadmin_show_banner');
71 83 }
72 84
73 - add_filter('script_loader_tag', '\CookieAdmin\Enduser::check_if_cookies_allowed', 10, 3);
85 + add_action('template_redirect', '\CookieAdmin\Enduser::block_scripts', 1);
74 86
75 87 }
76 88
77 89 function cookieadmin_load_plugin_admin(){
@@ -110,8 +122,18 @@
110 122 if (isset($_GET['pagelayer-live']) || isset($_GET['fl_builder'])) {
111 123 return true;
112 124 }
113 125
126 + // Avada builder
127 + if(isset($_GET['fb-edit']) || isset($_GET['builder']) || isset($_GET['builder_id'])){
128 + return true;
129 + }
130 +
131 + // Bricks Builder
132 + if(isset($_GET['bricks']) || isset($_GET['brickspreview'])){
133 + return true;
134 + }
135 +
114 136 if(isset($_GET['vc_action']) && $_GET['vc_action'] == 'vc_inline'){
115 137 return true;
116 138 }
117 139
@@ -118,8 +140,12 @@
118 140 if(isset($_GET['elementor-preview']) || (isset($_GET['action']) && $_GET['action'] == 'elementor')){
119 141 return true;
120 142 }
121 143
144 + if(isset($_GET['et_fb']) && ($_GET['et_fb'] == 1)){
145 + return true;
146 + }
147 +
122 148 return false;
123 149
124 150 }
125 151
@@ -138,9 +164,11 @@
138 164 'scan_cookies' => '\CookieAdmin\Admin\Scan::scan_cookies_ajax',
139 165 'cookieadmin-edit-cookie' => '\CookieAdmin\Admin\Scan::edit_cookies',
140 166 'cookieadmin-delete-cookie' => '\CookieAdmin\Admin\Scan::delete_cookies',
141 167 'close-update-notice' => '\CookieAdmin\Admin::close_plugin_update_notice',
142 - 'close-notice' => '\CookieAdmin\Admin::close_notices'
168 + 'close-notice' => '\CookieAdmin\Admin::close_notices',
169 + 'install_recommended_plugin' => '\CookieAdmin\Admin\Dashboard::install_recommended_plugin',
170 + 'activate_recommended_plugin' => '\CookieAdmin\Admin\Dashboard::activate_recommended_plugin',
143 171 );
144 172
145 173 $general_actions = array(
146 174 'categorize_cookies' => 'cookieadmin_categorize_cookies',
@@ -207,33 +235,37 @@
207 235 $cookieadmin_powered_by_html = apply_filters('cookieadmin_powered_by_html', $cookieadmin_powered_by_html);
208 236 $privacy_policy_links = apply_filters('cookieadmin_privacy_policy_links', array(), $policy);
209 237 $reconsent_icon_url = apply_filters('cookieadmin_reconsent_icon_url', '', $policy);
210 238
211 - return [
212 - 'override_gpc' => apply_filters('cookieadmin_override_gpc_html', ''),
213 - 'powered_by_html' => $cookieadmin_powered_by_html,
214 - 'banner_policy_links' => !empty($privacy_policy_links['banner']) ? $privacy_policy_links['banner'] : '',
215 - 'modal_policy_links' => !empty($privacy_policy_links['modal']) ? $privacy_policy_links['modal'] : '',
216 - 'reconsent_icon_url' => esc_url($reconsent_icon_url),
217 - 'logo_svg' => cookieadmin_logo_svg(),
218 - 'plugin_url' => esc_url(COOKIEADMIN_PLUGIN_URL),
219 - 'powered_by' => __('Powered by', 'cookieadmin'),
220 - 'reconsent' => __('Re-consent', 'cookieadmin'),
221 - 'cookie_preferences' => __('Cookie Preferences', 'cookieadmin'),
222 - 'remark_standard' => __('Always Active', 'cookieadmin'),
223 - 'remark' => __('Remark', 'cookieadmin'),
224 - 'none' => __('None', 'cookieadmin'),
225 - 'necessary_cookies' => __('Necessary Cookies', 'cookieadmin'),
226 - 'necessary_cookies_desc' => __('Necessary cookies enable essential site features like secure log-ins and consent preference adjustments. They do not store personal data.', 'cookieadmin'),
227 - 'functional_cookies' => __('Functional Cookies', 'cookieadmin'),
228 - 'functional_cookies_desc' => __('Functional cookies support features like content sharing on social media, collecting feedback, and enabling third-party tools.', 'cookieadmin'),
229 - 'analytical_cookies' => __('Analytical Cookies', 'cookieadmin'),
230 - 'analytical_cookies_desc' => __('Analytical cookies track visitor interactions, providing insights on metrics like visitor count, bounce rate, and traffic sources.', 'cookieadmin'),
231 - 'advertisement_cookies' => __('Advertisement Cookies', 'cookieadmin'),
232 - 'advertisement_cookies_desc' => __('Advertisement cookies deliver personalized ads based on your previous visits and analyze the effectiveness of ad campaigns.', 'cookieadmin'),
233 - 'unclassified_cookies' => __('Unclassified Cookies', 'cookieadmin'),
234 - 'unclassified_cookies_desc' => __('Unclassified cookies are cookies that we are in the process of classifying, together with the providers of individual cookies.', 'cookieadmin'),
235 - ];
239 + $strings = [
240 + 'override_gpc' => apply_filters('cookieadmin_override_gpc_html', ''),
241 + 'powered_by_html' => $cookieadmin_powered_by_html,
242 + 'banner_policy_links' => !empty($privacy_policy_links['banner']) ? $privacy_policy_links['banner'] : '',
243 + 'modal_policy_links' => !empty($privacy_policy_links['modal']) ? $privacy_policy_links['modal'] : '',
244 + 'reconsent_icon_url' => esc_url($reconsent_icon_url),
245 + 'logo_svg' => cookieadmin_logo_svg(),
246 + 'plugin_url' => esc_url(COOKIEADMIN_PLUGIN_URL),
247 + 'powered_by' => __('Powered by', 'cookieadmin'),
248 + 'reconsent' => __('Re-consent', 'cookieadmin'),
249 + 'close' => __('Close', 'cookieadmin'),
250 + 'cookie_consent' => __('Cookie Consent', 'cookieadmin'),
251 + 'cookie_preferences' => __('Cookie Preferences', 'cookieadmin'),
252 + 'remark_standard' => __('Always Active', 'cookieadmin'),
253 + 'remark' => __('Remark', 'cookieadmin'),
254 + 'none' => __('None', 'cookieadmin'),
255 + 'necessary_cookies' => __('Necessary Cookies', 'cookieadmin'),
256 + 'necessary_cookies_desc' => __('Necessary cookies enable essential site features like secure log-ins and consent preference adjustments. They do not store personal data.', 'cookieadmin'),
257 + 'functional_cookies' => __('Functional Cookies', 'cookieadmin'),
258 + 'functional_cookies_desc' => __('Functional cookies support features like content sharing on social media, collecting feedback, and enabling third-party tools.', 'cookieadmin'),
259 + 'analytical_cookies' => __('Analytical Cookies', 'cookieadmin'),
260 + 'analytical_cookies_desc' => __('Analytical cookies track visitor interactions, providing insights on metrics like visitor count, bounce rate, and traffic sources.', 'cookieadmin'),
261 + 'advertisement_cookies' => __('Advertisement Cookies', 'cookieadmin'),
262 + 'advertisement_cookies_desc' => __('Advertisement cookies deliver personalized ads based on your previous visits and analyze the effectiveness of ad campaigns.', 'cookieadmin'),
263 + 'unclassified_cookies' => __('Unclassified Cookies', 'cookieadmin'),
264 + 'unclassified_cookies_desc' => __('Unclassified cookies are cookies that we are in the process of classifying, together with the providers of individual cookies.', 'cookieadmin'),
265 + ];
266 +
267 + return apply_filters('cookieadmin_default_strings', $strings);
236 268 }
237 269
238 270 //Loads consent data from file
239 271 function cookieadmin_load_consent_template($policy, $view){
@@ -272,9 +304,9 @@
272 304 $template[$view] = str_replace('[['.$ck.']]', $cv, $template[$view]);
273 305 }
274 306
275 307 $template[$view] = apply_filters('cookieadmin_consent_banner_template', $template[$view]);
276 -
308 +
277 309 return $template;
278 310
279 311 }
280 312
@@ -461,8 +493,11 @@
461 493 'placeholder' => true,
462 494 );
463 495
464 496 $allowed_tags['defs'] = array();
497 +
498 + // aria-modal is not part of the wp_kses post-context globals
499 + $allowed_tags['div']['aria-modal'] = true;
465 500
466 501 $allowed_tags['a'] = array(
467 502 'href' => true,
468 503 'target' => true,