Skip to content

Commit 39edbcb

Browse files
authored
Merge pull request #337 from CybotAS/v4.5.2
Fix: remove auto-refresh of the scan process status
2 parents 10a8a2b + e8408f7 commit 39edbcb

File tree

5 files changed

+12
-25
lines changed

5 files changed

+12
-25
lines changed

assets/js/backend/account.js

+1-19
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// const API_BASE_URL = 'https://api.ea.dev.usercentrics.cloud/v1';
21
const API_BASE_URL = 'https://api.ea.prod.usercentrics.cloud/v1';
32
let authToken = '';
43

@@ -16,11 +15,7 @@ const createFormData = (action, data = {}) => {
1615
};
1716

1817
// Function to check scan status
19-
let scanCheckInterval = null;
20-
2118
async function checkScanStatus(scanId) {
22-
console.log('Checking scan status for scanId:', scanId);
23-
2419
try {
2520
const response = await fetch(`${API_BASE_URL}/scan/${scanId}`, {
2621
method: 'GET',
@@ -33,9 +28,6 @@ async function checkScanStatus(scanId) {
3328

3429
const data = await response.json();
3530

36-
// If scan is still in progress and we don't have an interval set, start one
37-
scanCheckInterval = setInterval(() => checkScanStatus(scanId), 180000);
38-
3931
if (data.status === 'DONE') {
4032
await fetch(cookiebot_account.ajax_url, {
4133
method: 'POST',
@@ -45,8 +37,6 @@ async function checkScanStatus(scanId) {
4537
}),
4638
credentials: 'same-origin'
4739
});
48-
clearInterval(scanCheckInterval);
49-
scanCheckInterval = null;
5040
return;
5141
}
5242

@@ -61,8 +51,6 @@ async function checkScanStatus(scanId) {
6151
});
6252

6353
if (!response.ok) {
64-
clearInterval(scanCheckInterval);
65-
scanCheckInterval = null;
6654
await fetch(cookiebot_account.ajax_url, {
6755
method: 'POST',
6856
body: createFormData('cookiebot_store_scan_details', {
@@ -73,7 +61,7 @@ async function checkScanStatus(scanId) {
7361
});
7462
}
7563
} catch (error) {
76-
console.log('Error checking scan status:', error);
64+
console.error('Error checking scan status:', error);
7765
}
7866
}
7967

@@ -93,7 +81,6 @@ const checkUserData = async () => {
9381
...userData,
9482
onboarded_via_signup: true
9583
};
96-
console.log('update user data', userDataWithFlag);
9784
userResponseData = await fetch(cookiebot_account.ajax_url, {
9885
method: 'POST',
9986
body: createFormData('cookiebot_post_user_data', {
@@ -166,7 +153,6 @@ document.addEventListener('DOMContentLoaded', async () => {
166153

167154
// For existing users, no account registration workflow is needed
168155
if (cookiebot_account.has_cbid && !cookiebot_account.has_user_data) {
169-
console.log('Existing user');
170156
return;
171157
}
172158

@@ -195,7 +181,6 @@ document.addEventListener('DOMContentLoaded', async () => {
195181
credentials: 'same-origin'
196182
}).then(r => r.json()).then(data => data.data);
197183

198-
console.log('user already exists just attaching new auth token', authToken);
199184
if (!response.ok) throw new Error(`Auth failed: ${response.status}`);
200185
const newUrl = new URL(window.location.href);
201186
newUrl.searchParams.delete('uc_api_code');
@@ -268,7 +253,6 @@ document.addEventListener('DOMContentLoaded', async () => {
268253
}
269254

270255
if (!isAuthenticatedCondition && cookiebot_account.has_user_data) {
271-
console.log('user data exists and is not authenticated');
272256
const callbackUrl = window.location.protocol + '//' + window.location.hostname + '/wp-admin/admin.php?page=cookiebot';
273257
window.location.href = `${API_BASE_URL}/auth/auth0/authorize?origin=wordpress_plugin&callback_domain=${encodeURIComponent(callbackUrl)}`;
274258

@@ -324,7 +308,6 @@ document.addEventListener('DOMContentLoaded', async () => {
324308
if (!scanResponse.ok) throw new Error(`Scan initiation failed: ${scanResponse.status}`);
325309

326310
const scanData = await scanResponse.json();
327-
console.log('Scan response:', scanData); // Add logging to debug
328311

329312
// Check for scan ID in different possible response structures
330313
const scanId = scanData?.scan?.scan_id || scanData?.scan_id || scanData?.id;
@@ -435,7 +418,6 @@ document.getElementById('banner-close-btn')?.addEventListener('click', async ()
435418
document.getElementById('get-started-button')?.addEventListener('click', async (e) => {
436419
e.preventDefault();
437420
try {
438-
439421
// If multisite is enabled the url might include also the directory for the site
440422
// e.g.: http://domain/site1/wp-admin/admin.php?page=cookiebot
441423
const callbackUrl = window.location.href.substring(0, window.location.href.indexOf('/wp-admin')) + '/wp-admin/admin.php?page=cookiebot';

assets/js/backend/dashboard.js

-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ jQuery(document).ready(function($) {
66
console.error(`Toggle element not found: ${toggleId}`);
77
return;
88
}
9-
console.log(`Initializing toggle: ${toggleId}`);
109

1110
toggle.addEventListener('click', async function(event) {
1211
const isEnabled = this.checked;
@@ -58,8 +57,6 @@ jQuery(document).ready(function($) {
5857
});
5958
}
6059

61-
// Initialize toggles
62-
console.log('Initializing toggles...');
6360
handleToggle('cookiebot-banner-enabled', 'cookiebot_set_banner_enabled', '1');
6461
handleToggle('cookiebot-gcm', 'cookiebot_set_gcm_enabled', '1');
6562

cookiebot.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Plugin URI: https://www.cookiebot.com/
66
Description: The Cookiebot CMP WordPress cookie banner and cookie policy help you comply with the major data protection laws (GDPR, ePrivacy, CCPA, LGPD, etc.) in a simple and fully automated way. Secure your website and get peace of mind.
77
Author: Usercentrics A/S
8-
Version: 4.5.1
8+
Version: 4.5.2
99
Author URI: https://www.cookiebot.com/
1010
Text Domain: cookiebot
1111
Domain Path: /langs

readme.txt

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Tags: WordPress cookie banner, GDPR, privacy compliance, cookie policy, cmp
44
* Requires at least: 4.4
55
* Tested up to: 6.7.1
6-
* Stable tag: 4.5.1
6+
* Stable tag: 4.5.2
77
* Requires PHP: 5.6
88
* License: GPLv2 or later
99

@@ -285,6 +285,14 @@ If your favorite plugin isn't supported, feel free to request it via our [GitHub
285285
## Changelog ##
286286
**Cookiebot CMP Plugin will soon no longer support PHP 5. If your website still runs on this version we recommend upgrading so you can continue enjoying the features Cookiebot CMP offers.**
287287

288+
### 4.5.2 ###
289+
Release date: March 28th 2025
290+
291+
Cookiebot CMP version 4.5.2 is out! This release adds a bugfix.
292+
293+
####Bugfixes####
294+
* Fix: remove auto-refresh of the scan process status
295+
288296
### 4.5.1 ###
289297
Release date: March 27th 2025
290298

src/lib/Cookiebot_WP.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static function debug_log( $message ) {
2828
}
2929
}
3030

31-
const COOKIEBOT_PLUGIN_VERSION = '4.5.1';
31+
const COOKIEBOT_PLUGIN_VERSION = '4.5.2';
3232
const COOKIEBOT_MIN_PHP_VERSION = '5.6.0';
3333

3434
/**

0 commit comments

Comments
 (0)