Changeset 3473643
- Timestamp:
- 03/03/2026 12:50:38 PM (4 weeks ago)
- Location:
- cookiebot/trunk
- Files:
-
- 8 added
- 28 edited
-
README.md (modified) (1 diff)
-
assets/css/backend/cookiebot_admin_main.css (modified) (3 diffs)
-
assets/css/backend/dashboard-old.css (modified) (2 diffs)
-
assets/css/backend/ppg_page.css (added)
-
assets/img/ppg-hero.png (added)
-
assets/js/backend/ppg-page.js (added)
-
readme.txt (modified) (1 diff)
-
src/addons/Cookiebot_Addons.php (modified) (2 diffs)
-
src/addons/addons.php (modified) (2 diffs)
-
src/addons/controller/addons/Base_Cookiebot_Addon.php (modified) (1 diff)
-
src/addons/controller/addons/woocommerce (added)
-
src/addons/controller/addons/woocommerce/WooCommerce.php (added)
-
src/admin_notices/Cookiebot_Base_Notice.php (modified) (2 diffs)
-
src/lib/Account_Service.php (modified) (10 diffs)
-
src/lib/Cookie_Consent.php (modified) (1 diff)
-
src/lib/Cookiebot_Review.php (modified) (2 diffs)
-
src/lib/Cookiebot_WP.php (modified) (3 diffs)
-
src/lib/Dependency_Container.php (modified) (2 diffs)
-
src/lib/helper.php (modified) (5 diffs)
-
src/lib/traits/Class_Constant_Override_Validator_Trait.php (modified) (5 diffs)
-
src/settings/Menu_Settings.php (modified) (2 diffs)
-
src/settings/Network_Menu_Settings.php (modified) (1 diff)
-
src/settings/pages/PPG_Page.php (added)
-
src/view/admin/cb_frame/dashboard-page.php (modified) (3 diffs)
-
src/view/admin/cb_frame/settings-page.php (modified) (1 diff)
-
src/view/admin/common/dashboard-page-old.php (modified) (3 diffs)
-
src/view/admin/common/ppg-page.php (added)
-
src/view/admin/common/settings-page.php (modified) (1 diff)
-
src/view/admin/common/templates/main-tabs.php (modified) (2 diffs)
-
src/view/admin/common/templates/ppg-banner.php (added)
-
src/view/admin/uc_frame/dashboard-page.php (modified) (2 diffs)
-
src/view/admin/uc_frame/settings-page.php (modified) (1 diff)
-
tests/integration/addons/Test_Custom_Facebook_Feed.php (modified) (1 diff)
-
tests/integration/addons/Test_Instagram_Feed.php (modified) (1 diff)
-
tests/integration/addons/Test_Official_Facebook_Pixel.php (modified) (1 diff)
-
tests/integration/addons/Test_Wp_Seopress.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cookiebot/trunk/README.md
r2869906 r3473643 8 8 https://core.trac.wordpress.org/ticket/44043 9 9 10 # Travis CI Status10 # CI Status 11 11 12 [](https://app.travis-ci.com/github/CybotAS/CookiebotWP)12 [](https://github.com/CybotAS/CookiebotWP/actions/workflows/test.yml) 13 13 14 14 # Sonarcloud status -
cookiebot/trunk/assets/css/backend/cookiebot_admin_main.css
r3302726 r3473643 56 56 text-decoration: none; 57 57 display: grid; 58 grid-template-columns: 1fr 8fr;58 grid-template-columns: auto 1fr auto; 59 59 grid-column-gap: 5px; 60 60 align-items: center; … … 93 93 } 94 94 95 .cb-feedback_link a { 96 font-size: 15px; 97 font-weight: 600; 98 line-height: 1.6; 99 letter-spacing: 0.1px; 100 color:#1032CF; 101 text-decoration: none; 102 } 103 .cb-feedback_link a:hover { 104 text-decoration: underline; 105 } 106 95 107 .dashboard-icon { 96 108 -webkit-mask-image: url(../../img/icons/dashboard.svg); … … 121 133 -webkit-mask-image: url(../../img/icons/debug.svg); 122 134 mask-image: url(../../img/icons/debug.svg); 135 } 136 137 .cb-main__tabs_separator { 138 height: 1px; 139 width: 100%; 140 background-color: #D6D6D6; 141 margin: 14px 0; 142 } 143 144 .cb-main__tabs__badge { 145 display: inline-block; 146 background-color: #4C2293; 147 color: #ffffff; 148 font-size: 10px; 149 font-weight: 700; 150 line-height: 1.4; 151 padding: 3px 8px; 152 border-radius: 100px; 153 text-transform: uppercase; 154 white-space: nowrap; 123 155 } 124 156 -
cookiebot/trunk/assets/css/backend/dashboard-old.css
r3399794 r3473643 170 170 } 171 171 172 /* Side-by-side card row (e.g. "Your opinion matters" + "Learn more") */ 173 .cb-main__dashboard__card--row { 174 display: flex; 175 gap: 24px; 176 align-items: stretch; 177 width: 100%; 178 } 179 180 .cb-main__dashboard__card--row .cb-main__dashboard__card { 181 flex: 1 0 0; 182 margin-bottom: 0; 183 } 184 185 .cb-main__card__inner.bordered_card { 186 background-color: #ffffff; 187 border: 1px solid #d6d6d6; 188 border-radius: 16px; 189 padding: 32px; 190 display: flex; 191 flex-direction: column; 192 gap: 16px; 193 height: 100%; 194 box-sizing: border-box; 195 } 196 197 .cb-main__card__inner.bordered_card .cb-main__card__subtitle { 198 font-size: 21px; 199 font-weight: 600; 200 color: #141414; 201 line-height: 1.4; 202 margin: 0; 203 } 204 205 .cb-main__card__inner.bordered_card .cb-main__review__text { 206 font-size: 15px; 207 font-weight: 400; 208 color: #141414; 209 line-height: 1.6; 210 letter-spacing: 0.3px; 211 margin: 0; 212 } 213 214 .cb-main__card__inner.bordered_card .cb-btn.cb-link-btn { 215 margin: auto 0 0 0; 216 font-size: 15px; 217 font-weight: 600; 218 text-decoration: underline; 219 letter-spacing: 0.1px; 220 } 221 172 222 .cb-main__card__content { 173 223 align-self: end; … … 307 357 .legislations_card .cb-btn.cb-right-btn { 308 358 justify-self: end; 359 } 360 361 /* PPG Banner Section */ 362 .cb-ppg-section { 363 padding:40px 0; 364 margin: 10px 0; 365 border-top: 1px solid #D6D6D6; 366 border-bottom: 1px solid #D6D6D6; 367 } 368 369 .cb-ppg-section__title { 370 font-size: 21px; 371 font-weight: 700; 372 color: #141414; 373 line-height: 1.4; 374 margin: 0 0 16px; 375 } 376 377 .cb-ppg-banner { 378 display: flex; 379 align-items: center; 380 gap: 32px; 381 padding: 32px 40px; 382 border-radius: 16px; 383 background: 384 radial-gradient(ellipse at 95% 105%, rgba(0, 125, 212, 0.48) 0%, rgba(128, 190, 234, 0.24) 30%, rgba(255, 255, 255, 0) 60%), 385 radial-gradient(ellipse at -10% -5%, rgba(0, 125, 212, 0.64) 0%, rgba(128, 190, 234, 0.32) 30%, rgba(255, 255, 255, 0) 60%), 386 #eff2f5; 387 overflow: hidden; 388 flex-wrap: wrap; 389 } 390 391 .cb-ppg-banner__icon { 392 width: 80px; 393 height: 80px; 394 flex-shrink: 0; 395 } 396 397 .cb-ppg-banner__icon img { 398 width: 100%; 399 height: 100%; 400 object-fit: cover; 401 border-radius: 12px; 402 } 403 404 .cb-ppg-banner__content { 405 flex: 1; 406 min-width: 200px; 407 } 408 409 .cb-ppg-banner__headline { 410 font-size: 21px; 411 font-weight: 600; 412 color: #141414; 413 line-height: 1.4; 414 margin: 0 0 4px; 415 } 416 417 .cb-ppg-banner__description { 418 font-size: 15px; 419 font-weight: 400; 420 color: #595959; 421 line-height: 1.6; 422 letter-spacing: 0.3px; 423 margin: 0; 424 } 425 426 .cb-ppg-banner__cta { 427 flex-shrink: 0; 428 } 429 430 .cb-btn.cb-ppg-btn { 431 min-width: 132px; 432 text-align: center; 309 433 } 310 434 -
cookiebot/trunk/readme.txt
r3459843 r3473643 163 163 ## Changelog ## 164 164 **Cookiebot by Usercentrics 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 by Usercentrics offers.** 165 166 167 ### 4.6.5 ### 168 Release date: March 3rd 2026 169 170 Cookiebot by Usercentrics version 4.6.5 is out! This release adds new features and improvements. 171 172 ####New Features#### 173 174 * Added Privacy Policy Generator (PPG) plugin page — install and activate the Usercentrics Privacy Policy Generator directly from the Cookiebot admin 175 * Added PPG promotional banner to dashboard pages for connected accounts 176 * Added WooCommerce addon to block Order Attribution Tracking scripts (SourceBuster) until consent is given 177 * Added "NEW" badge and separator to the sidebar navigation for the Policy Generator Plugin tab 178 179 ####Improvements#### 180 181 * Added user capability checks for admin actions in notices, network settings, and survey submissions 182 * Sanitized and unslashed all input data across settings, cookie consent, and AJAX handlers 183 * Escaped dynamic values in error and exception messages to prevent potential XSS 184 * Added JSON validation for user data payloads before storing 185 * Redesigned dashboard cards into a side-by-side layout with bordered styling for connected accounts 186 * Updated feedback link styling 165 187 166 188 ### 4.6.4 ### -
cookiebot/trunk/src/addons/Cookiebot_Addons.php
r3313089 r3473643 181 181 if ( ! is_a( $addon, Base_Cookiebot_Addon::class ) ) { 182 182 throw new InvalidAddonClassException( 183 sprintf( 'Class %s could not be instantiated', $addon_class)183 sprintf( 'Class %s could not be instantiated', esc_html( $addon_class ) ) 184 184 ); 185 185 } … … 187 187 } else { 188 188 throw new InvalidAddonClassException( 189 sprintf( 'Class %s not found', $addon_class)189 sprintf( 'Class %s not found', esc_html( $addon_class ) ) 190 190 ); 191 191 } -
cookiebot/trunk/src/addons/addons.php
r2984274 r3473643 30 30 use cybot\cookiebot\addons\controller\addons\simple_share_buttons_adder\Simple_Share_Buttons_Adder; 31 31 use cybot\cookiebot\addons\controller\addons\wd_google_analytics\Wd_Google_Analytics; 32 use cybot\cookiebot\addons\controller\addons\woocommerce\WooCommerce; 32 33 use cybot\cookiebot\addons\controller\addons\woocommerce_google_analytics_pro\Woocommerce_Google_Analytics_Pro; 33 34 use cybot\cookiebot\addons\controller\addons\wp_analytify\Wp_Analytify; … … 58 59 Optinmonster::class, 59 60 Pixel_Caffeine::class, 61 WooCommerce::class, 60 62 Woocommerce_Google_Analytics_Pro::class, 61 63 Wp_Analytify::class, -
cookiebot/trunk/src/addons/controller/addons/Base_Cookiebot_Addon.php
r3230472 r3473643 124 124 foreach ( static::ALTERNATIVE_ADDON_VERSIONS as $version_string => $alternative_version_addon_class ) { 125 125 if ( ! version_compare( $version_string, '0.0.1', '>=' ) ) { 126 throw new InvalidArgumentException( 'Invalid version number "' . $version_string. '"' );126 throw new InvalidArgumentException( 'Invalid version number "' . esc_html( $version_string ) . '"' ); 127 127 } 128 128 if ( ! class_exists( $alternative_version_addon_class ) ) { 129 throw new InvalidArgumentException( 'Class not found at "' . $alternative_version_addon_class. '"' );129 throw new InvalidArgumentException( 'Class not found at "' . esc_html( $alternative_version_addon_class ) . '"' ); 130 130 } 131 131 if ( ! is_subclass_of( $alternative_version_addon_class, self::class ) ) { 132 throw new InvalidArgumentException( 'Class "' . $alternative_version_addon_class . '" is not a subclass of "' . self::class. '"' );132 throw new InvalidArgumentException( 'Class "' . esc_html( $alternative_version_addon_class ) . '" is not a subclass of "' . esc_html( self::class ) . '"' ); 133 133 } 134 134 } -
cookiebot/trunk/src/admin_notices/Cookiebot_Base_Notice.php
r3230472 r3473643 60 60 */ 61 61 private function save_notice_link() { 62 if ( ! current_user_can( 'manage_options' ) ) { 63 return; 64 } 62 65 if ( isset( $_GET[ static::COOKIEBOT_NOTICE_OPTION_KEY ] ) ) { 63 66 foreach ( static::COOKIEBOT_NOTICE_TIMES as $item ) { 64 67 if ( isset( $_GET[ $item['name'] ] ) && 65 wp_verify_nonce( $_GET[ $item['name'] ], $item['action'] ) ) { 68 // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Nonce value verified by wp_verify_nonce(). 69 wp_verify_nonce( wp_unslash( $_GET[ $item['name'] ] ), $item['action'] ) ) { 66 70 $option = $item['time']; 67 71 if ( isset( $item['str'] ) && $item['str'] === true ) { … … 91 95 // "Never show again" is clicked 92 96 if ( array_key_exists( $option, static::COOKIEBOT_NOTICE_TIMES ) ) { 93 throw new LogicException( static::COOKIEBOT_NOTICE_TIMES[ $option ]['msg']);97 throw new LogicException( esc_html( static::COOKIEBOT_NOTICE_TIMES[ $option ]['msg'] ) ); 94 98 } elseif ( is_numeric( $option ) ) { 95 99 if ( ! self::notice_check_option_date( $option ) ) { -
cookiebot/trunk/src/lib/Account_Service.php
r3343491 r3473643 110 110 } 111 111 112 $cbid = isset( $_POST['cbid'] ) ? sanitize_text_field( $_POST['cbid']) : '';112 $cbid = isset( $_POST['cbid'] ) ? sanitize_text_field( wp_unslash( $_POST['cbid'] ) ) : ''; 113 113 114 114 if ( empty( $cbid ) ) { … … 127 127 } 128 128 129 $scan_id = isset( $_POST['scan_id'] ) ? sanitize_text_field( $_POST['scan_id']) : '';129 $scan_id = isset( $_POST['scan_id'] ) ? sanitize_text_field( wp_unslash( $_POST['scan_id'] ) ) : ''; 130 130 131 131 if ( empty( $scan_id ) ) { … … 143 143 } 144 144 145 // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- JSON payload validated by json_decode() below. 145 146 $raw_data = isset( $_POST['data'] ) ? wp_unslash( $_POST['data'] ) : ''; 146 147 … … 151 152 152 153 $data = json_decode( $raw_data, true ); 154 if ( json_last_error() !== JSON_ERROR_NONE ) { 155 wp_send_json_error( 'Invalid user data format', 400 ); 156 return; 157 } 153 158 update_option( 'cookiebot-user-data', $data ); 154 159 … … 172 177 } 173 178 174 $scan_id = isset( $_POST['scan_id'] ) ? sanitize_text_field( $_POST['scan_id']) : '';175 $scan_status = isset( $_POST['scan_status'] ) ? wp_unslash( $_POST['scan_status']) : '';179 $scan_id = isset( $_POST['scan_id'] ) ? sanitize_text_field( wp_unslash( $_POST['scan_id'] ) ) : ''; 180 $scan_status = isset( $_POST['scan_status'] ) ? sanitize_text_field( wp_unslash( $_POST['scan_status'] ) ) : ''; 176 181 177 182 update_option( 'cookiebot-scan-id', $scan_id ); … … 187 192 } 188 193 189 $value = isset( $_POST['value'] ) ? trim( $_POST['value']) : '';194 $value = isset( $_POST['value'] ) ? sanitize_text_field( wp_unslash( $_POST['value'] ) ) : ''; 190 195 191 196 // Save option value … … 200 205 } 201 206 202 $value = isset( $_POST['value'] ) ? trim( $_POST['value']) : '';207 $value = isset( $_POST['value'] ) ? sanitize_text_field( wp_unslash( $_POST['value'] ) ) : ''; 203 208 204 209 // Save option value … … 222 227 } 223 228 224 $value = isset( $_POST['value'] ) ? trim( $_POST['value']) : '';229 $value = isset( $_POST['value'] ) ? sanitize_text_field( wp_unslash( $_POST['value'] ) ) : ''; 225 230 226 231 // Save option value … … 259 264 } 260 265 261 $code = isset( $_POST['code'] ) ? sanitize_text_field( $_POST['code']) : '';266 $code = isset( $_POST['code'] ) ? sanitize_text_field( wp_unslash( $_POST['code'] ) ) : ''; 262 267 263 268 if ( empty( $code ) ) { … … 336 341 } 337 342 343 // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- JSON payload validated by json_decode() below. 338 344 $configuration = isset( $_POST['configuration'] ) ? wp_unslash( $_POST['configuration'] ) : ''; 339 345 -
cookiebot/trunk/src/lib/Cookie_Consent.php
r3230472 r3473643 35 35 */ 36 36 public function __construct( $default_cookie = null ) { 37 $this->cookie = ( isset( $_COOKIE['CookieConsent'] ) ) ? $_COOKIE['CookieConsent']: $default_cookie;37 $this->cookie = ( isset( $_COOKIE['CookieConsent'] ) ) ? sanitize_text_field( wp_unslash( $_COOKIE['CookieConsent'] ) ) : $default_cookie; 38 38 39 39 $this->scan_cookie(); -
cookiebot/trunk/src/lib/Cookiebot_Review.php
r3421804 r3473643 138 138 public function send_uninstall_survey() { 139 139 global $wpdb; 140 if ( ! check_ajax_referer( 'cookiebot_survey_nonce', 'survey_nonce', false ) ) {140 if ( ! check_ajax_referer( 'cookiebot_survey_nonce', 'survey_nonce', false ) || ! current_user_can( 'manage_options' ) ) { 141 141 wp_send_json_error( esc_html__( 'Sorry you are not allowed to do this.', 'cookiebot' ), 401 ); 142 142 } … … 145 145 } 146 146 $data = array( 147 'survey_check' => sanitize_text_field( wp_unslash( $_POST['survey_check'] ) ),147 'survey_check' => isset( $_POST['survey_check'] ) ? sanitize_text_field( wp_unslash( $_POST['survey_check'] ) ) : '', 148 148 'reason_slug' => sanitize_text_field( wp_unslash( $_POST['reason_id'] ) ), 149 149 'reason_detail' => ! empty( $_POST['reason_text'] ) ? sanitize_text_field( wp_unslash( $_POST['reason_text'] ) ) : null, -
cookiebot/trunk/src/lib/Cookiebot_WP.php
r3459843 r3473643 12 12 use cybot\cookiebot\widgets\Dashboard_Widget_Cookiebot_Status; 13 13 use cybot\cookiebot\lib\Account_Service; 14 use cybot\cookiebot\settings\pages\PPG_Page; 14 15 use DomainException; 15 16 use RuntimeException; … … 86 87 self::COOKIEBOT_MIN_PHP_VERSION 87 88 ); 88 throw new DomainException( $message);89 throw new DomainException( esc_html( $message ) ); 89 90 } 90 91 } … … 102 103 ( new Cookiebot_Notices() )->register_hooks(); 103 104 ( new Cookiebot_Review() )->register_hooks(); 105 ( new PPG_Page() )->register_ajax_hooks(); 104 106 } 105 107 -
cookiebot/trunk/src/lib/Dependency_Container.php
r3230472 r3473643 31 31 public function set( $key, $dependency ) { 32 32 if ( isset( $this->dependencies[ $key ] ) ) { 33 throw new InvalidArgumentException( 'Dependency key ' . $key. ' already exists' );33 throw new InvalidArgumentException( 'Dependency key ' . esc_html( $key ) . ' already exists' ); 34 34 } 35 35 $this->dependencies[ $key ] = $dependency; … … 44 44 public function get( $key ) { 45 45 if ( ! isset( $this->dependencies[ $key ] ) ) { 46 throw new InvalidArgumentException( 'Dependency key ' . $key . ' does not exists' );46 throw new InvalidArgumentException( 'Dependency key ' . esc_html( $key ) . ' does not exist' ); 47 47 } 48 48 -
cookiebot/trunk/src/lib/helper.php
r3421804 r3473643 512 512 function cookiebot_get_local_file_contents( $file_path ) { 513 513 if ( ! file_exists( $file_path ) ) { 514 throw new InvalidArgumentException( 'File ' . $file_path. ' does not exist' );514 throw new InvalidArgumentException( 'File ' . esc_html( $file_path ) . ' does not exist' ); 515 515 } 516 516 … … 531 531 $absolute_path = CYBOT_COOKIEBOT_PLUGIN_DIR . 'src/view/' . $relative_path; 532 532 if ( ! file_exists( $absolute_path ) ) { 533 throw new InvalidArgumentException( 'View could not be loaded from "' . $absolute_path. '"' );533 throw new InvalidArgumentException( 'View could not be loaded from "' . esc_html( $absolute_path ) . '"' ); 534 534 } 535 535 // phpcs:ignore WordPress.PHP.DontExtract.extract_extract … … 557 557 $absolute_path = CYBOT_COOKIEBOT_PLUGIN_DIR . CYBOT_COOKIEBOT_PLUGIN_ASSETS_DIR . $relative_path; 558 558 if ( ! file_exists( $absolute_path ) ) { 559 throw new InvalidArgumentException( 'Asset could not be loaded from "' . $absolute_path. '"' );559 throw new InvalidArgumentException( 'Asset could not be loaded from "' . esc_html( $absolute_path ) . '"' ); 560 560 } 561 561 return $absolute_path; … … 572 572 $url = esc_url( CYBOT_COOKIEBOT_PLUGIN_URL . CYBOT_COOKIEBOT_PLUGIN_ASSETS_DIR . $relative_path ); 573 573 if ( ! file_exists( $absolute_path ) || empty( $url ) ) { 574 throw new InvalidArgumentException( 'Asset could not be loaded from "' . $absolute_path. '"' );574 throw new InvalidArgumentException( 'Asset could not be loaded from "' . esc_html( $absolute_path ) . '"' ); 575 575 } 576 576 return $url; … … 585 585 $url = esc_url( CYBOT_COOKIEBOT_PLUGIN_URL . CYBOT_COOKIEBOT_PLUGIN_LOGO_FILE ); 586 586 if ( ! file_exists( $absolute_path ) || empty( $url ) ) { 587 throw new InvalidArgumentException( 'Asset could not be loaded from "' . $absolute_path. '"' );587 throw new InvalidArgumentException( 'Asset could not be loaded from "' . esc_html( $absolute_path ) . '"' ); 588 588 } 589 589 return $url; -
cookiebot/trunk/src/lib/traits/Class_Constant_Override_Validator_Trait.php
r3230472 r3473643 34 34 sprintf( 35 35 'Class constant "%s" should be changed by %s', 36 $fixed_class_constant_name,37 static::class36 esc_html( $fixed_class_constant_name ), 37 esc_html( static::class ) 38 38 ) 39 39 ); … … 66 66 sprintf( 67 67 'Class constant "%s" must be a non-empty string in %s', 68 $required_string_constant_name,69 static::class68 esc_html( $required_string_constant_name ), 69 esc_html( static::class ) 70 70 ) 71 71 ); … … 98 98 sprintf( 99 99 'Class constant "%s" must be a boolean in %s', 100 $required_boolean_constant_name,101 static::class100 esc_html( $required_boolean_constant_name ), 101 esc_html( static::class ) 102 102 ) 103 103 ); … … 131 131 sprintf( 132 132 'Class constant "%s" must be an array in %s', 133 $required_array_constant_name,134 static::class133 esc_html( $required_array_constant_name ), 134 esc_html( static::class ) 135 135 ) 136 136 ); … … 142 142 sprintf( 143 143 'Class constant "%s" array items should be one of "%s" in %s', 144 $required_array_constant_name,145 implode( ', ', $allowed_item_values),146 static::class144 esc_html( $required_array_constant_name ), 145 esc_html( implode( ', ', $allowed_item_values ) ), 146 esc_html( static::class ) 147 147 ) 148 148 ); -
cookiebot/trunk/src/settings/Menu_Settings.php
r3343491 r3473643 9 9 use cybot\cookiebot\settings\pages\Settings_Page; 10 10 use cybot\cookiebot\settings\pages\Support_Page; 11 use cybot\cookiebot\settings\pages\PPG_Page; 11 12 use cybot\cookiebot\lib\Cookiebot_WP; 12 13 … … 18 19 Support_Page::class, 19 20 Settings_Page::class, 21 PPG_Page::class, 20 22 ); 21 23 -
cookiebot/trunk/src/settings/Network_Menu_Settings.php
r3343491 r3473643 69 69 check_admin_referer( 'cookiebot-network-settings' ); 70 70 71 if ( ! current_user_can( 'manage_network_options' ) ) { 72 wp_die( esc_html__( 'You do not have permission to manage network options.', 'cookiebot' ), 403 ); 73 } 74 71 75 update_site_option( 72 76 'cookiebot-cbid', 73 ! empty( $_POST['cookiebot-cbid'] ) ? $_POST['cookiebot-cbid']: ''77 ! empty( $_POST['cookiebot-cbid'] ) ? sanitize_text_field( wp_unslash( $_POST['cookiebot-cbid'] ) ) : '' 74 78 ); 75 79 update_site_option( 76 80 'cookiebot-ruleset-id', 77 ! empty( $_POST['cookiebot-ruleset-id'] ) ? $_POST['cookiebot-ruleset-id']: ''81 ! empty( $_POST['cookiebot-ruleset-id'] ) ? sanitize_text_field( wp_unslash( $_POST['cookiebot-ruleset-id'] ) ) : '' 78 82 ); 79 83 update_site_option( 80 84 'cookiebot-script-tag-uc-attribute', 81 ! empty( $_POST['cookiebot-script-tag-uc-attribute'] ) ? $_POST['cookiebot-script-tag-uc-attribute']: ''85 ! empty( $_POST['cookiebot-script-tag-uc-attribute'] ) ? sanitize_text_field( wp_unslash( $_POST['cookiebot-script-tag-uc-attribute'] ) ) : '' 82 86 ); 83 87 update_site_option( 84 88 'cookiebot-script-tag-cd-attribute', 85 ! empty( $_POST['cookiebot-script-tag-cd-attribute'] ) ? $_POST['cookiebot-script-tag-cd-attribute']: ''89 ! empty( $_POST['cookiebot-script-tag-cd-attribute'] ) ? sanitize_text_field( wp_unslash( $_POST['cookiebot-script-tag-cd-attribute'] ) ) : '' 86 90 ); 87 91 update_site_option( 88 92 'cookiebot-autoupdate', 89 ! empty( $_POST['cookiebot-autoupdate'] ) ? $_POST['cookiebot-autoupdate']: ''93 ! empty( $_POST['cookiebot-autoupdate'] ) ? sanitize_text_field( wp_unslash( $_POST['cookiebot-autoupdate'] ) ) : '' 90 94 ); 91 95 update_site_option( 92 96 'cookiebot-nooutput', 93 ! empty( $_POST['cookiebot-nooutput'] ) ? $_POST['cookiebot-nooutput']: ''97 ! empty( $_POST['cookiebot-nooutput'] ) ? sanitize_text_field( wp_unslash( $_POST['cookiebot-nooutput'] ) ) : '' 94 98 ); 95 99 update_site_option( 96 100 'cookiebot-nooutput-admin', 97 ! empty( $_POST['cookiebot-nooutput-admin'] ) ? $_POST['cookiebot-nooutput-admin']: ''101 ! empty( $_POST['cookiebot-nooutput-admin'] ) ? sanitize_text_field( wp_unslash( $_POST['cookiebot-nooutput-admin'] ) ) : '' 98 102 ); 99 103 update_site_option( -
cookiebot/trunk/src/view/admin/cb_frame/dashboard-page.php
r3289355 r3473643 56 56 </div> 57 57 58 <?php if ( $cbid ) : ?> 58 <?php if ( $cbid ) : ?> 59 <div class="cb-main__dashboard__card--row"> 59 60 <div class="cb-main__dashboard__card"> 60 <div class="cb-main__card__inner <?php echo $cbid ? 'start_card' : 'new_card'; ?>">61 <div class="cb-main__card__inner bordered_card"> 61 62 <h3 class="cb-main__card__subtitle"> 62 63 <?php echo esc_html__( 'Your opinion matters', 'cookiebot' ); ?> … … 71 72 </div> 72 73 </div> 73 <?php endif; ?> 74 75 <div class="cb-main__dashboard__card"> 76 <div class="cb-main__card__inner <?php echo $cbid ? 'start_card' : 'new_card'; ?>"> 77 <?php if ( ! $cbid ) : ?> 78 <div class="cb-main__card__content"> 79 <p class="cb-main__card__label"> 80 <?php echo esc_html__( 'Get started', 'cookiebot' ); ?> 81 </p> 82 <h2 class="cb-main__card__title"> 83 <?php echo esc_html__( 'Create a new Cookiebot CMP account', 'cookiebot' ); ?> 84 </h2> 85 <a href="https://admin.cookiebot.com/signup/?utm_source=wordpress&utm_medium=referral&utm_campaign=banner" 86 target="_blank" class="cb-btn cb-white-btn" rel="noopener"> 87 <?php echo esc_html__( 'Create a new account', 'cookiebot' ); ?> 88 </a> 89 </div> 90 <?php else : ?> 74 <div class="cb-main__dashboard__card"> 75 <div class="cb-main__card__inner bordered_card"> 91 76 <h3 class="cb-main__card__subtitle"> 92 77 <?php echo esc_html__( 'Learn more about how to optimize your Cookiebot CMP setup?', 'cookiebot' ); ?> … … 96 81 <?php echo esc_html__( 'Visit Help Center', 'cookiebot' ); ?> 97 82 </a> 98 < ?php endif; ?>83 </div> 99 84 </div> 100 85 </div> 86 <?php else : ?> 87 <div class="cb-main__dashboard__card"> 88 <div class="cb-main__card__inner new_card"> 89 <div class="cb-main__card__content"> 90 <p class="cb-main__card__label"> 91 <?php echo esc_html__( 'Get started', 'cookiebot' ); ?> 92 </p> 93 <h2 class="cb-main__card__title"> 94 <?php echo esc_html__( 'Create a new Cookiebot CMP account', 'cookiebot' ); ?> 95 </h2> 96 <a href="https://admin.cookiebot.com/signup/?utm_source=wordpress&utm_medium=referral&utm_campaign=banner" 97 target="_blank" class="cb-btn cb-white-btn" rel="noopener"> 98 <?php echo esc_html__( 'Create a new account', 'cookiebot' ); ?> 99 </a> 100 </div> 101 </div> 102 </div> 103 <?php endif; ?> 101 104 </div> 102 105 103 <div class="cb-main__dashboard__card--container"> 104 <div class="cb-main__dashboard__card"> 105 <div class="cb-main__card__inner start_card"> 106 <div class="cb-main__video"> 106 <?php if ( $cbid ) : ?> 107 <?php include CYBOT_COOKIEBOT_PLUGIN_DIR . 'src/view/admin/common/templates/ppg-banner.php'; ?> 108 <?php endif; ?> 109 110 <div class="cb-main__dashboard__card--container"> 111 <div class="cb-main__dashboard__card"> 112 <div class="cb-main__card__inner start_card"> 113 <div class="cb-main__video"> 107 114 <iframe src="https://www.youtube.com/embed/1-lvuJa42P0" 108 115 title="Cookiebot WordPress Installation" -
cookiebot/trunk/src/view/admin/cb_frame/settings-page.php
r3230472 r3473643 34 34 35 35 // phpcs:ignore WordPress.Security.NonceVerification.Recommended 36 $active_tab = ! empty( $_GET['tab'] ) ? $_GET['tab']: false;36 $active_tab = ! empty( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : false; 37 37 38 38 $header->display(); -
cookiebot/trunk/src/view/admin/common/dashboard-page-old.php
r3289355 r3473643 53 53 </div> 54 54 55 <?php if ( ! empty( $template_args['cbid'] ) ) : ?> 55 <?php if ( ! empty( $template_args['cbid'] ) ) : ?> 56 <div class="cb-main__dashboard__card--row"> 56 57 <div class="cb-main__dashboard__card"> 57 <div class="cb-main__card__inner <?php echo ! empty( $template_args['cbid'] ) ? 'start_card' : 'new_card'; ?>">58 <div class="cb-main__card__inner bordered_card"> 58 59 <h3 class="cb-main__card__subtitle"> 59 60 <?php echo esc_html__( 'Your opinion matters', 'cookiebot' ); ?> … … 68 69 </div> 69 70 </div> 70 <?php endif; ?> 71 72 <div class="cb-main__dashboard__card"> 73 <div class="cb-main__card__inner <?php echo ! empty( $template_args['cbid'] ) ? 'start_card' : 'new_card'; ?>"> 74 <?php if ( empty( $template_args['cbid'] ) ) : ?> 75 <div class="cb-main__card__content"> 76 <p class="cb-main__card__label"> 77 <?php echo esc_html__( 'Get started', 'cookiebot' ); ?> 78 </p> 79 <h2 class="cb-main__card__title"> 80 <?php echo esc_html__( 'Create a new Cookiebot CMP account', 'cookiebot' ); ?> 81 </h2> 82 <a href="https://admin.cookiebot.com/signup/?utm_source=wordpress&utm_medium=referral&utm_campaign=banner" 83 target="_blank" class="cb-btn cb-white-btn" rel="noopener"> 84 <?php echo esc_html__( 'Create a new account', 'cookiebot' ); ?> 85 </a> 86 </div> 87 <?php else : ?> 71 <div class="cb-main__dashboard__card"> 72 <div class="cb-main__card__inner bordered_card"> 88 73 <h3 class="cb-main__card__subtitle"> 89 74 <?php echo esc_html__( 'Learn more about how to optimize your Cookiebot CMP setup?', 'cookiebot' ); ?> … … 93 78 <?php echo esc_html__( 'Visit Help Center', 'cookiebot' ); ?> 94 79 </a> 95 < ?php endif; ?>80 </div> 96 81 </div> 97 82 </div> 83 <?php else : ?> 84 <div class="cb-main__dashboard__card"> 85 <div class="cb-main__card__inner new_card"> 86 <div class="cb-main__card__content"> 87 <p class="cb-main__card__label"> 88 <?php echo esc_html__( 'Get started', 'cookiebot' ); ?> 89 </p> 90 <h2 class="cb-main__card__title"> 91 <?php echo esc_html__( 'Create a new Cookiebot CMP account', 'cookiebot' ); ?> 92 </h2> 93 <a href="https://admin.cookiebot.com/signup/?utm_source=wordpress&utm_medium=referral&utm_campaign=banner" 94 target="_blank" class="cb-btn cb-white-btn" rel="noopener"> 95 <?php echo esc_html__( 'Create a new account', 'cookiebot' ); ?> 96 </a> 97 </div> 98 </div> 99 </div> 100 <?php endif; ?> 98 101 </div> 99 102 </div> 100 103 101 <div class="cb-main__dashboard__card--container"> 102 <div class="cb-main__dashboard__card"> 103 <div class="cb-main__card__inner start_card"> 104 <div class="cb-main__video"> 104 <?php if ( ! empty( $template_args['cbid'] ) ) : ?> 105 <?php include __DIR__ . '/templates/ppg-banner.php'; ?> 106 <?php endif; ?> 107 108 <div class="cb-main__dashboard__card--container"> 109 <div class="cb-main__dashboard__card"> 110 <div class="cb-main__card__inner start_card"> 111 <div class="cb-main__video"> 105 112 <iframe src="https://www.youtube.com/embed/1-lvuJa42P0" 106 113 title="Cookiebot WordPress Installation" -
cookiebot/trunk/src/view/admin/common/settings-page.php
r3459839 r3473643 16 16 17 17 // phpcs:ignore WordPress.Security.NonceVerification.Recommended 18 $active_tab = ! empty( $_GET['tab'] ) ? $_GET['tab']: false;18 $active_tab = ! empty( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : false; 19 19 20 20 $header->display(); -
cookiebot/trunk/src/view/admin/common/templates/main-tabs.php
r3366362 r3473643 7 7 use cybot\cookiebot\addons\config\Settings_Config; 8 8 use cybot\cookiebot\settings\pages\Support_Page; 9 use cybot\cookiebot\settings\pages\PPG_Page; 9 10 10 11 /** … … 80 81 <?php endif; ?> 81 82 83 <div class="cb-main__tabs_separator"></div> 84 85 <div class="cb-main__tabs_item <?php echo $active_tab === 'ppg' ? 'active-item' : ''; ?>"> 86 <a href="<?php echo esc_url( add_query_arg( 'page', PPG_Page::ADMIN_SLUG, admin_url( 'admin.php' ) ) ); ?>" 87 class="cb-main__tabs__link"> 88 <div class="cb-main__tabs__icon plugins-icon"></div> 89 <span><?php esc_html_e( 'Policy Generator Plugin', 'cookiebot' ); ?></span> 90 <span class="cb-main__tabs__badge"><?php esc_html_e( 'NEW', 'cookiebot' ); ?></span> 91 </a> 92 </div> 93 82 94 <div class="cb-feedback_link"> 83 95 <a href="<?php echo esc_url( $feedback_url ); ?>" target="_blank"><?php echo esc_html__( 'Help us improve', 'cookiebot' ); ?></a> -
cookiebot/trunk/src/view/admin/uc_frame/dashboard-page.php
r3421804 r3473643 42 42 </div> 43 43 44 <?php if ( $cbid ) : ?> 44 <?php if ( $cbid ) : ?> 45 <div class="cb-main__dashboard__card--row"> 45 46 <div class="cb-main__dashboard__card"> 46 <div class="cb-main__card__inner <?php echo $cbid ? 'start_card' : 'new_card'; ?>">47 <div class="cb-main__card__inner bordered_card"> 47 48 <h3 class="cb-main__card__subtitle"> 48 49 <?php echo esc_html__( 'Your opinion matters', 'cookiebot' ); ?> … … 57 58 </div> 58 59 </div> 59 60 60 <div class="cb-main__dashboard__card"> 61 <div class="cb-main__card__inner start_card"> 62 <div class="cb-main__card--content"> 63 <h3 class="cb-main__card__subtitle"> 64 <?php echo esc_html__( 'How to set up Cookiebot by Usercentrics WordPress Plugin', 'cookiebot' ); ?> 65 </h3> 66 <a href="https://support.cookiebot.com/hc/en-us/articles/4408356523282-Getting-started" 67 target="_blank" class="cb-btn cb-link-btn" rel="noopener"> 68 <?php echo esc_html__( 'Learn more', 'cookiebot' ); ?> 69 </a> 70 </div> 61 <div class="cb-main__card__inner bordered_card"> 62 <h3 class="cb-main__card__subtitle"> 63 <?php echo esc_html__( 'How to set up Cookiebot by Usercentrics WordPress Plugin', 'cookiebot' ); ?> 64 </h3> 65 <a href="https://support.cookiebot.com/hc/en-us/articles/4408356523282-Getting-started" 66 target="_blank" class="cb-btn cb-link-btn" rel="noopener"> 67 <?php echo esc_html__( 'Learn more', 'cookiebot' ); ?> 68 </a> 71 69 </div> 72 70 </div> 73 <?php endif; ?> 71 </div> 72 <?php endif; ?> 74 73 </div> 75 74 76 <div class="cb-main__dashboard__card--container"> 77 <div class="cb-main__dashboard__card"> 78 </div> 79 <div class="cb-main__dashboard__card"> 80 <div class="cb-main__card__inner legislations_card"> 75 <?php if ( $cbid ) : ?> 76 <?php include CYBOT_COOKIEBOT_PLUGIN_DIR . 'src/view/admin/common/templates/ppg-banner.php'; ?> 77 <?php endif; ?> 78 79 <div class="cb-main__dashboard__card--container"> 80 <div class="cb-main__dashboard__card"> 81 </div> 82 <div class="cb-main__dashboard__card"> 83 <div class="cb-main__card__inner legislations_card"> 81 84 <div class="cb-main__legislation__item"> 82 85 <div class="cb-main__legislation____icon"> -
cookiebot/trunk/src/view/admin/uc_frame/settings-page.php
r3298601 r3473643 34 34 35 35 // phpcs:ignore WordPress.Security.NonceVerification.Recommended 36 $active_tab = ! empty( $_GET['tab'] ) ? $_GET['tab']: false;36 $active_tab = ! empty( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : false; 37 37 38 38 // Check if user was onboarded via signup -
cookiebot/trunk/tests/integration/addons/Test_Custom_Facebook_Feed.php
r3262995 r3473643 20 20 21 21 $this->assertNotFalse( strpos( $content, 'echo \'var cfflinkhashtags = "\' . $cff_link_hashtags . \'";\';' ) ); 22 $this->assertNotFalse( strpos( $content, 'wp_enqueue_script( \'cffscripts\');' ) );23 $this->assertNotFalse( strpos( $content, 'add_action( \'wp_footer\', [ self::$instance, \'cff_js\' ]);' ) );22 $this->assertNotFalse( strpos( $content, 'wp_enqueue_script(\'cffscripts\');' ) ); 23 $this->assertNotFalse( strpos( $content, 'add_action(\'wp_footer\', [ self::$instance, \'cff_js\' ]);' ) ); 24 24 } 25 25 } -
cookiebot/trunk/tests/integration/addons/Test_Instagram_Feed.php
r3262995 r3473643 19 19 $content = Instagram_Feed::get_svn_file_content( 'inc/if-functions.php' ); 20 20 21 $this->assertNotFalse( strpos( $content, ' add_action( \'wp_enqueue_scripts\', \'sb_instagram_scripts_enqueue\', 2 );' ) );21 $this->assertNotFalse( strpos( $content, '\'sb_instagram_scripts_enqueue\'' ) ); 22 22 } 23 23 } -
cookiebot/trunk/tests/integration/addons/Test_Official_Facebook_Pixel.php
r3262995 r3473643 25 25 n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0; 26 26 t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, 27 document,'script','https://connect.facebook.net/en_US/fbevents.js ?v=next');27 document,'script','https://connect.facebook.net/en_US/fbevents.js'); 28 28 </script> 29 29 <!-- End Meta Pixel Code --> -
cookiebot/trunk/tests/integration/addons/Test_Wp_Seopress.php
r3262995 r3473643 20 20 21 21 // test the content 22 $this->assertNotFalse( strpos( $content, "add_action( 'seopress_google_analytics_html', 'seopress_google_analytics_js', 10, 1);" ) );22 $this->assertNotFalse( strpos( $content, "add_action( 'seopress_google_analytics_html', 'seopress_google_analytics_js', 10, 1 );" ) ); 23 23 } 24 24 }
Note: See TracChangeset
for help on using the changeset viewer.