Changeset 3298601
- Timestamp:
- 05/22/2025 10:06:02 AM (9 months ago)
- Location:
- cookiebot/trunk
- Files:
-
- 10 edited
-
assets/js/backend/account.js (modified) (5 diffs)
-
readme.txt (modified) (1 diff)
-
src/lib/Account_Service.php (modified) (2 diffs)
-
src/settings/Menu_Settings.php (modified) (1 diff)
-
src/settings/pages/Dashboard_Page.php (modified) (8 diffs)
-
src/view/admin/common/dashboard-page.php (modified) (8 diffs)
-
src/view/admin/common/templates/header.php (modified) (1 diff)
-
src/view/admin/uc_frame/settings-page.php (modified) (1 diff)
-
src/view/admin/uc_frame/settings/general-page.php (modified) (1 diff)
-
uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cookiebot/trunk/assets/js/backend/account.js
r3289738 r3298601 29 29 const data = await response.json(); 30 30 31 if (data.status === 'DONE') {31 if (data.status?.toLowerCase() === 'done') { 32 32 await fetch(cookiebot_account.ajax_url, { 33 33 method: 'POST', … … 198 198 const urlParams = new URLSearchParams(window.location.search); 199 199 const ucApiCode = urlParams.get('uc_api_code'); 200 const companyId = urlParams.get('company_id'); 201 200 202 // if (!cookiebot_account.has_cbid) { 201 203 // window.trackAmplitudeEvent('Get Started Page Visited'); … … 206 208 } 207 209 210 if (cookiebot_account.cbid !== cookiebot_account.scan_id) { 211 await fetch(cookiebot_account.ajax_url, { 212 method: 'POST', 213 body: createFormData('cookiebot_update_scan_id', { 214 scan_id: cookiebot_account.cbid 215 }), 216 credentials: 'same-origin' 217 }); 218 if (canReload()) { 219 window.location.reload(); 220 } 221 } 222 208 223 // For previously onboarded users that disconnected the account, no new account registration workflow is needed 209 if (!cookiebot_account.has_cbid && cookiebot_account.was_onboarded) {210 return;211 }224 // if (!cookiebot_account.has_cbid && cookiebot_account.was_onboarded) { 225 // return; 226 // } 212 227 213 228 try { … … 317 332 } 318 333 319 if (!cbid ) {334 if (!cbid && companyId) { 320 335 try { 321 336 // Create new configuration … … 334 349 data_controller: "", 335 350 legal_framework_template: "gdpr", 336 domains: [formattedDomain] 351 domains: [formattedDomain], 352 company_id: companyId 337 353 }) 338 354 }); -
cookiebot/trunk/readme.txt
r3291994 r3298601 200 200 ## Changelog ## 201 201 **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.** 202 203 ### 4.5.7 ### 204 Release date: May 22th 2025 205 206 Cookiebot CMP version 4.5.7 is out! This release has some bugfixes 207 208 ####Bugfixes#### 209 210 * Fixed issues with user login sessions 211 * Resolved problems when disconnecting accounts or deactivating the plugin 212 * Prevented duplicate companies from being created 213 * Improved enforcement of user entitlements 202 214 203 215 ### 4.5.6 ### -
cookiebot/trunk/src/lib/Account_Service.php
r3284229 r3298601 52 52 add_action( 'wp_ajax_cookiebot_delete_auth_token', array( $this, 'ajax_delete_auth_token' ) ); 53 53 add_action( 'wp_ajax_cookiebot_store_onboarding_status', array( $this, 'ajax_store_onboarding_status' ) ); 54 add_action( 'wp_ajax_cookiebot_update_scan_id', array( $this, 'ajax_update_scan_id' ) ); 54 55 } 55 56 … … 123 124 } 124 125 126 public function ajax_update_scan_id() { 127 if ( ! check_ajax_referer( 'cookiebot-account', 'nonce', false ) || ! current_user_can( 'manage_options' ) ) { 128 wp_send_json_error( 'Unauthorized', 401 ); 129 } 130 131 $scan_id = isset( $_POST['scan_id'] ) ? sanitize_text_field( $_POST['scan_id'] ) : ''; 132 133 if ( empty( $scan_id ) ) { 134 wp_send_json_error( 'Scan ID is required', 400 ); 135 } 136 137 update_option( 'cookiebot-scan-id', $scan_id ); 138 wp_send_json_success(); 139 } 140 125 141 public function ajax_post_user_data() { 126 142 if ( ! check_ajax_referer( 'cookiebot-account', 'nonce', false ) || ! current_user_can( 'manage_options' ) ) { -
cookiebot/trunk/src/settings/Menu_Settings.php
r3284229 r3298601 45 45 $user_data = Cookiebot_WP::get_user_data(); 46 46 47 if ( $option_name === 'cookiebot-cbid' && empty( $option_value ) && ! empty( $auth_token ) && ! empty( $user_data )) {47 if ( $option_name === 'cookiebot-cbid' && empty( $option_value ) ) { 48 48 Cookiebot_WP::debug_log( 'Account Disconnected: clearing user_data' ); 49 // Clean up all user data 50 delete_option( 'cookiebot-auth-token' ); 49 51 delete_option( 'cookiebot-user-data' ); 52 delete_option( 'cookiebot-configuration' ); 53 delete_option( 'cookiebot-scan-id' ); 54 delete_option( 'cookiebot-scan-status' ); 55 delete_option( 'cookiebot-banner-enabled' ); 56 delete_option( 'cookiebot_banner_live_dismissed' ); 57 delete_option( 'cookiebot-cookie-blocking-mode' ); 58 delete_option( 'cookiebot-uc-auto-blocking-mode' ); 59 delete_option( 'cookiebot-uc-onboarded-via-signup' ); 50 60 } 51 61 } -
cookiebot/trunk/src/settings/pages/Dashboard_Page.php
r3284229 r3298601 65 65 $user_data = Cookiebot_WP::get_user_data(); 66 66 $scan_status = Cookiebot_WP::get_scan_status(); 67 $scan_id = get_option( 'cookiebot-scan-id' ); 67 68 $banner_enabled = Cookiebot_WP::get_banner_enabled(); 68 69 $auto_blocking_mode = Cookiebot_WP::get_auto_blocking_mode(); … … 71 72 $legal_framework = Cookiebot_WP::get_legal_framwework(); 72 73 $is_authenticated = ! empty( Cookiebot_WP::get_auth_token() ); 74 $is_cb_user = Cookiebot_Frame::is_cb_frame_type(); 73 75 74 76 // Get user data and check if they were onboarded via signup … … 81 83 'user_data' => $user_data, 82 84 'scan_status' => $scan_status, 85 'scan_id' => $scan_id, 83 86 'cb_wp' => CYBOT_COOKIEBOT_PLUGIN_URL . 'assets/img/cb-wp.png', 84 87 'europe_icon' => CYBOT_COOKIEBOT_PLUGIN_URL . 'assets/img/europe.png', … … 140 143 'nonce' => wp_create_nonce( 'cookiebot-account' ), 141 144 'cbid' => $cbid, 145 'scan_id' => $scan_id, 142 146 'has_user_data' => ! empty( $user_data ), 143 147 'has_cbid' => ! empty( $cbid ), … … 176 180 'nonce' => wp_create_nonce( 'cookiebot-account' ), 177 181 'cbid' => $cbid, 182 'scan_id' => $scan_id, 178 183 'has_user_data' => ! empty( $user_data ), 179 184 'has_cbid' => ! empty( $cbid ), … … 187 192 } 188 193 189 // Modified condition to check for onboarding status190 if ( ! empty( $cbid ) && ( empty( $user_data ) && ! $was_onboarded) ) {194 // Redirect CB users to previous dashboard page 195 if ( ( ! empty( $cbid ) && $is_cb_user ) || ( ! empty( $cbid ) && empty( $user_data ) ) ) { 191 196 wp_enqueue_style( 192 197 'cookiebot-dashboard-backup-css', … … 211 216 'nonce' => wp_create_nonce( 'cookiebot-account' ), 212 217 'cbid' => $cbid, 218 'scan_id' => $scan_id, 213 219 'has_user_data' => ! empty( $user_data ), 214 220 'has_cbid' => ! empty( $cbid ), … … 261 267 'nonce' => wp_create_nonce( 'cookiebot-account' ), 262 268 'cbid' => $cbid, 269 'scan_id' => $scan_id, 263 270 'has_user_data' => ! empty( $user_data ), 264 271 'has_cbid' => ! empty( $cbid ), -
cookiebot/trunk/src/view/admin/common/dashboard-page.php
r3289355 r3298601 63 63 <?php endif; ?> 64 64 65 <!-- Banner connected notice -->66 <?php if ( ! empty( $template_args['cbid'] ) && empty( $template_args['user_data'] ) ) : ?>67 <div class="header-top-banners connected-banner">68 <div class="banner-content">69 <img src="<?php echo \esc_url( CYBOT_COOKIEBOT_PLUGIN_URL . 'assets/img/icons/check-green.svg' ); ?>"70 alt="Check Icon">71 <div>72 <h3><?php echo esc_html__( 'Your banner is connected!', 'cookiebot' ); ?></h3>73 <p style="text-wrap: nowrap;">74 <?php echo esc_html__( 'Everything works as before. Manage your banner in the', 'cookiebot' ); ?>75 <a href="<?php echo esc_url( $template_args['cookiebot_admin_link'] ); ?>" target="_blank"><?php echo esc_html__( 'Cookiebot Manager', 'cookiebot' ); ?></a>76 <?php echo esc_html__( 'or', 'cookiebot' ); ?>77 <a href="<?php echo esc_url( $template_args['uc_admin_link'] ); ?>" target="_blank"><?php echo esc_html__( 'Usercentrics Admin', 'cookiebot' ); ?></a>.78 </p>79 </div>80 </div>81 </div>82 <?php endif; ?>83 84 65 <!-- Banner is live notice --> 85 66 <?php … … 126 107 <div class="header-section-no-margin"> 127 108 <img src="<?php echo \esc_url( CYBOT_COOKIEBOT_PLUGIN_URL . 'assets/img/icons/set-up-icon.svg' ); ?>" alt="Usercentrics Logo"> 128 <?php if ( ! empty( $template_args['cbid'] ) && empty( $template_args['user_data'] ) ) : ?> 129 <h1><?php echo \esc_html__( 'Simplify your banner management', 'cookiebot' ); ?></h1> 130 <?php else : ?> 131 <h1><?php echo \esc_html__( 'Set up your consent banner', 'cookiebot' ); ?></h1> 132 <?php endif; ?> 109 <h1><?php echo \esc_html__( 'Set up your consent banner', 'cookiebot' ); ?></h1> 133 110 </div> 134 111 <div class="header-section"> 135 <?php if ( empty( $template_args['cbid'] ) && empty( $template_args['user_data'] ) ) : ?> 136 <p class="subtitle"> 137 <?php echo esc_html__( 'Get your site GDPR-compliant in', 'cookiebot' ); ?> 138 <strong><?php echo esc_html__( 'just a few clicks.', 'cookiebot' ); ?></strong> 139 <?php echo esc_html__( 'Enter your email, verify it, and create your password.', 'cookiebot' ); ?> 140 </p> 141 <?php endif; ?> 142 <?php if ( ! empty( $template_args['cbid'] ) && empty( $template_args['user_data'] ) ) : ?> 143 <p class="subtitle"> 144 <?php echo esc_html__( 'Your setup is good to go - but we\'re making banner control even easier inside WordPress.', 'cookiebot' ); ?> 145 <strong><?php echo esc_html__( 'Get access to new features', 'cookiebot' ); ?></strong> 146 <?php echo esc_html__( 'by updating your banner today.', 'cookiebot' ); ?> 147 </p> 148 <?php endif; ?> 149 </div> 150 112 <p class="subtitle"> 113 <?php echo esc_html__( 'Get your site GDPR-compliant in', 'cookiebot' ); ?> 114 <strong><?php echo esc_html__( 'just a few clicks.', 'cookiebot' ); ?></strong> 115 <?php echo esc_html__( 'Enter your email, verify it, and create your password.', 'cookiebot' ); ?> 116 </p> 117 </div> 151 118 152 119 <!-- Steps Container --> … … 155 122 <div class="step-box <?php echo ! empty( $template_args['cbid'] ) ? 'completed' : ''; ?>"> 156 123 <div class="step-row"> 157 158 <?php if ( ! empty( $template_args['cbid'] ) && empty( $template_args['user_data'] ) ) : ?>159 <div class="step-icon">160 <div class="empty-circle"></div>161 </div>162 <div class="step-content">163 <h2><?php echo \esc_html__( 'Unlock new banner', 'cookiebot' ); ?></h2>164 </div>165 <?php endif; ?>166 167 <?php if ( empty( $template_args['cbid'] ) && empty( $template_args['user_data'] ) ) : ?>168 <div class="step-icon">169 <div class="empty-circle"></div>170 </div>171 <div class="step-content">172 <h2><?php echo \esc_html__( 'Get your banner live in seconds', 'cookiebot' ); ?></h2>173 </div>174 <?php endif; ?>175 176 124 <?php if ( ! empty( $template_args['cbid'] ) && ! empty( $template_args['user_data'] ) ) : ?> 177 125 <div class="step-icon"> … … 182 130 </div> 183 131 <span class="done-status">Done!</span> 132 <?php else : ?> 133 <div class="step-icon"> 134 <div class="empty-circle"></div> 135 </div> 136 <div class="step-content"> 137 <h2><?php echo \esc_html__( 'Get your banner live in seconds', 'cookiebot' ); ?></h2> 138 </div> 184 139 <?php endif; ?> 185 186 </div> 187 188 <?php if ( empty( $template_args['user_data'] ) ) : ?> 140 </div> 141 142 <?php if ( empty( $template_args['user_data'] ) || empty( $template_args['cbid'] ) && ! empty( $template_args['scan_id'] ) ) : ?> 189 143 <div class="banner-preview-container"> 190 144 <div class="divider"></div> 191 <?php if ( ! empty( $template_args['cbid'] ) && empty( $template_args['user_data'] ) ) : ?> 192 <p class="step-description"> 193 <?php echo esc_html__( 'We\'ve simplified privacy compliance for you. Save time with auto-setup, website scanning for data processing services, and consent-first blocking.', 'cookiebot' ); ?> 194 </p> 195 <?php else : ?> 196 <p class="step-description"> 197 <?php 198 echo wp_kses( 199 __( 'Instant setup with automatic cookie blocking. Try all features free for 14 days - no credit card needed.<br> Choose Free or Premium before your trial ends to stay live.', 'cookiebot' ), 200 array( 201 'strong' => array(), 202 'br' => array(), 203 ) 204 ); 205 ?> 206 </p> 207 <?php endif; ?> 145 <p class="step-description"> 146 <?php 147 echo wp_kses( 148 __( 'Instant setup with automatic cookie blocking. Try all features free for 14 days - no credit card needed.<br> Choose Free or Premium before your trial ends to stay live.', 'cookiebot' ), 149 array( 150 'strong' => array(), 151 'br' => array(), 152 ) 153 ); 154 ?> 155 </p> 208 156 <div class="banner-images"> 209 157 <?php … … 228 176 </div> 229 177 230 <?php if ( ! empty( $template_args['cbid'] ) ) : ?>231 <div class="note-text">232 <img class="note-icon" src="<?php echo esc_url( CYBOT_COOKIEBOT_PLUGIN_URL . 'assets/img/icons/info.svg' ); ?>" />233 <span>Note: A new account comes with a new banner, which will replace your existing one.</span>234 </div>235 <?php endif; ?>236 178 <div> 237 179 <div class="cb-general__info__text"> … … 249 191 250 192 <!-- Scan website step - only show when CBID exists --> 251 <?php if ( ! empty( $template_args['user_data'] ) ) : ?>193 <?php if ( ! empty( $template_args['user_data'] ) && ! empty( $template_args['cbid'] ) ) : ?> 252 194 <div class="step-box"> 253 195 <div class="step-row"> … … 313 255 314 256 <!-- Upgrade your plan step --> 315 <?php if ( ! empty( $template_args['user_data'] ) ) : ?>257 <?php if ( ! empty( $template_args['user_data'] ) && ! empty( $template_args['cbid'] ) ) : ?> 316 258 <div class="step-box"> 317 259 <div class="step-row"> … … 401 343 402 344 <!-- Right Side - Banner Control (only show when CBID exists) --> 403 <?php if ( $template_args['user_data'] ) : ?>345 <?php if ( $template_args['user_data'] && $template_args['cbid'] ) : ?> 404 346 <div class="gray-box-overview"> 405 347 <div class="header-section"> -
cookiebot/trunk/src/view/admin/common/templates/header.php
r3284229 r3298601 31 31 if ( ! empty( $_GET['settings-updated'] ) ) : 32 32 ?> 33 <div class="cb-submit__msg"><?php esc_html_e( 'Changes ha sbeen saved', 'cookiebot' ); ?></div>33 <div class="cb-submit__msg"><?php esc_html_e( 'Changes have been saved', 'cookiebot' ); ?></div> 34 34 <?php endif; ?> 35 35 <?php -
cookiebot/trunk/src/view/admin/uc_frame/settings-page.php
r3284229 r3298601 37 37 38 38 // Check if user was onboarded via signup 39 $was_onboarded = Cookiebot_WP::was_onboarded_via_signup() ;39 $was_onboarded = Cookiebot_WP::was_onboarded_via_signup() && ! empty( Cookiebot_WP::get_auth_token() ); 40 40 41 41 $header->display(); -
cookiebot/trunk/src/view/admin/uc_frame/settings/general-page.php
r3289355 r3298601 16 16 17 17 // Check if user was onboarded via signup 18 $was_onboarded = Cookiebot_WP::was_onboarded_via_signup() ;18 $was_onboarded = Cookiebot_WP::was_onboarded_via_signup() && ! empty( Cookiebot_WP::get_auth_token() ); 19 19 20 20 ?> -
cookiebot/trunk/uninstall.php
r3270554 r3298601 1 1 <?php // exit if uninstall constant is not defined 2 if (!defined('WP_UNINSTALL_PLUGIN')) exit; 2 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { 3 exit; 4 } 3 5 4 // All new and legacy config params (except param: 'cookiebot-uc-onboarded-via-signup') 6 // All new and legacy config params 7 // phpcs:ignore 8 // phpcs:ignore 5 9 $options = array( 6 'cookiebot-cbid', 7 'cookiebot-auth-token', 8 'cookiebot-user-data', 9 'cookiebot-configuration', 10 'cookiebot-scan-id', 11 'cookiebot-scan-status', 12 'cookiebot-banner-enabled', 13 'cookiebot_banner_live_dismissed', 14 'cookiebot-uc-auto-blocking-mode', 10 'cookiebot-cbid', 11 'cookiebot-auth-token', 12 'cookiebot-user-data', 13 'cookiebot-configuration', 14 'cookiebot-scan-id', 15 'cookiebot-scan-status', 16 'cookiebot-banner-enabled', 17 'cookiebot_banner_live_dismissed', 18 'cookiebot-uc-auto-blocking-mode', 19 'cookiebot-uc-onboarded-via-signup', 15 20 16 'cookiebot-ruleset-id',17 'cookiebot-language',18 'cookiebot-front-language',19 'cookiebot-nooutput',20 'cookiebot-nooutput-admin',21 'cookiebot-output-logged-in',22 'cookiebot-ignore-scripts',23 'cookiebot-autoupdate',24 'cookiebot-script-tag-uc-attribute',25 'cookiebot-script-tag-cd-attribute',26 'cookiebot-cookie-blocking-mode',27 'cookiebot-iab',28 'cookiebot-tcf-version',29 'cookiebot-tcf-purposes',30 'cookiebot-tcf-special-purposes',31 'cookiebot-tcf-features',32 'cookiebot-tcf-special-features',33 'cookiebot-tcf-vendors',34 'cookiebot-tcf-disallowed',35 'cookiebot-tcf-ac-vendors',36 'cookiebot-ccpa',37 'cookiebot-ccpa-domain-group-id',38 'cookiebot-gtm',39 'cookiebot-gtm-id',40 'cookiebot-gtm-cookies',41 'cookiebot-data-layer',42 'cookiebot-gcm',43 'cookiebot-gcm-first-run',44 'cookiebot-gcm-url-passthrough',45 'cookiebot-gcm-cookies',46 'cookiebot-multiple-config',47 'cookiebot-second-banner-regions',48 'cookiebot-second-banner-id',49 'cookiebot-multiple-banners',21 'cookiebot-ruleset-id', 22 'cookiebot-language', 23 'cookiebot-front-language', 24 'cookiebot-nooutput', 25 'cookiebot-nooutput-admin', 26 'cookiebot-output-logged-in', 27 'cookiebot-ignore-scripts', 28 'cookiebot-autoupdate', 29 'cookiebot-script-tag-uc-attribute', 30 'cookiebot-script-tag-cd-attribute', 31 'cookiebot-cookie-blocking-mode', 32 'cookiebot-iab', 33 'cookiebot-tcf-version', 34 'cookiebot-tcf-purposes', 35 'cookiebot-tcf-special-purposes', 36 'cookiebot-tcf-features', 37 'cookiebot-tcf-special-features', 38 'cookiebot-tcf-vendors', 39 'cookiebot-tcf-disallowed', 40 'cookiebot-tcf-ac-vendors', 41 'cookiebot-ccpa', 42 'cookiebot-ccpa-domain-group-id', 43 'cookiebot-gtm', 44 'cookiebot-gtm-id', 45 'cookiebot-gtm-cookies', 46 'cookiebot-data-layer', 47 'cookiebot-gcm', 48 'cookiebot-gcm-first-run', 49 'cookiebot-gcm-url-passthrough', 50 'cookiebot-gcm-cookies', 51 'cookiebot-multiple-config', 52 'cookiebot-second-banner-regions', 53 'cookiebot-second-banner-id', 54 'cookiebot-multiple-banners', 50 55 ); 51 52 56 // Delete all config params 57 // phpcs:ignore 53 58 foreach ( $options as $option ) { 54 delete_option( $option );59 delete_option( $option ); 55 60 }
Note: See TracChangeset
for help on using the changeset viewer.