Plugin Directory

Changeset 3473643


Ignore:
Timestamp:
03/03/2026 12:50:38 PM (4 weeks ago)
Author:
cookiebot
Message:

Releasing version 4.6.5

Location:
cookiebot/trunk
Files:
8 added
28 edited

Legend:

Unmodified
Added
Removed
  • cookiebot/trunk/README.md

    r2869906 r3473643  
    88https://core.trac.wordpress.org/ticket/44043
    99
    10 # Travis CI Status
     10# CI Status
    1111
    12 [![Build Status](https://travis-ci.com/CybotAS/CookiebotWP.svg?branch=master)](https://app.travis-ci.com/github/CybotAS/CookiebotWP)
     12[![Test](https://github.com/CybotAS/CookiebotWP/actions/workflows/test.yml/badge.svg)](https://github.com/CybotAS/CookiebotWP/actions/workflows/test.yml)
    1313
    1414# Sonarcloud status
  • cookiebot/trunk/assets/css/backend/cookiebot_admin_main.css

    r3302726 r3473643  
    5656    text-decoration: none;
    5757    display: grid;
    58     grid-template-columns: 1fr 8fr;
     58    grid-template-columns: auto 1fr auto;
    5959    grid-column-gap: 5px;
    6060    align-items: center;
     
    9393}
    9494
     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
    95107.dashboard-icon {
    96108    -webkit-mask-image: url(../../img/icons/dashboard.svg);
     
    121133    -webkit-mask-image: url(../../img/icons/debug.svg);
    122134    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;
    123155}
    124156
  • cookiebot/trunk/assets/css/backend/dashboard-old.css

    r3399794 r3473643  
    170170}
    171171
     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
    172222.cb-main__card__content {
    173223    align-self: end;
     
    307357.legislations_card .cb-btn.cb-right-btn {
    308358    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;
    309433}
    310434
  • cookiebot/trunk/readme.txt

    r3459843 r3473643  
    163163## Changelog ##
    164164**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 ###
     168Release date: March 3rd 2026
     169
     170Cookiebot 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
    165187
    166188### 4.6.4 ###
  • cookiebot/trunk/src/addons/Cookiebot_Addons.php

    r3313089 r3473643  
    181181                if ( ! is_a( $addon, Base_Cookiebot_Addon::class ) ) {
    182182                    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 ) )
    184184                    );
    185185                }
     
    187187            } else {
    188188                throw new InvalidAddonClassException(
    189                     sprintf( 'Class %s not found', $addon_class )
     189                    sprintf( 'Class %s not found', esc_html( $addon_class ) )
    190190                );
    191191            }
  • cookiebot/trunk/src/addons/addons.php

    r2984274 r3473643  
    3030    use cybot\cookiebot\addons\controller\addons\simple_share_buttons_adder\Simple_Share_Buttons_Adder;
    3131    use cybot\cookiebot\addons\controller\addons\wd_google_analytics\Wd_Google_Analytics;
     32    use cybot\cookiebot\addons\controller\addons\woocommerce\WooCommerce;
    3233    use cybot\cookiebot\addons\controller\addons\woocommerce_google_analytics_pro\Woocommerce_Google_Analytics_Pro;
    3334    use cybot\cookiebot\addons\controller\addons\wp_analytify\Wp_Analytify;
     
    5859        Optinmonster::class,
    5960        Pixel_Caffeine::class,
     61        WooCommerce::class,
    6062        Woocommerce_Google_Analytics_Pro::class,
    6163        Wp_Analytify::class,
  • cookiebot/trunk/src/addons/controller/addons/Base_Cookiebot_Addon.php

    r3230472 r3473643  
    124124        foreach ( static::ALTERNATIVE_ADDON_VERSIONS as $version_string => $alternative_version_addon_class ) {
    125125            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 ) . '"' );
    127127            }
    128128            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 ) . '"' );
    130130            }
    131131            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 ) . '"' );
    133133            }
    134134        }
  • cookiebot/trunk/src/admin_notices/Cookiebot_Base_Notice.php

    r3230472 r3473643  
    6060     */
    6161    private function save_notice_link() {
     62        if ( ! current_user_can( 'manage_options' ) ) {
     63            return;
     64        }
    6265        if ( isset( $_GET[ static::COOKIEBOT_NOTICE_OPTION_KEY ] ) ) {
    6366            foreach ( static::COOKIEBOT_NOTICE_TIMES as $item ) {
    6467                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'] ) ) {
    6670                    $option = $item['time'];
    6771                    if ( isset( $item['str'] ) && $item['str'] === true ) {
     
    9195            // "Never show again" is clicked
    9296            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'] ) );
    9498            } elseif ( is_numeric( $option ) ) {
    9599                if ( ! self::notice_check_option_date( $option ) ) {
  • cookiebot/trunk/src/lib/Account_Service.php

    r3343491 r3473643  
    110110        }
    111111
    112         $cbid = isset( $_POST['cbid'] ) ? sanitize_text_field( $_POST['cbid'] ) : '';
     112        $cbid = isset( $_POST['cbid'] ) ? sanitize_text_field( wp_unslash( $_POST['cbid'] ) ) : '';
    113113
    114114        if ( empty( $cbid ) ) {
     
    127127        }
    128128
    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'] ) ) : '';
    130130
    131131        if ( empty( $scan_id ) ) {
     
    143143        }
    144144
     145        // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- JSON payload validated by json_decode() below.
    145146        $raw_data = isset( $_POST['data'] ) ? wp_unslash( $_POST['data'] ) : '';
    146147
     
    151152
    152153        $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        }
    153158        update_option( 'cookiebot-user-data', $data );
    154159
     
    172177        }
    173178
    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'] ) ) : '';
    176181
    177182        update_option( 'cookiebot-scan-id', $scan_id );
     
    187192        }
    188193
    189         $value = isset( $_POST['value'] ) ? trim( $_POST['value'] ) : '';
     194        $value = isset( $_POST['value'] ) ? sanitize_text_field( wp_unslash( $_POST['value'] ) ) : '';
    190195
    191196        // Save option value
     
    200205        }
    201206
    202         $value = isset( $_POST['value'] ) ? trim( $_POST['value'] ) : '';
     207        $value = isset( $_POST['value'] ) ? sanitize_text_field( wp_unslash( $_POST['value'] ) ) : '';
    203208
    204209        // Save option value
     
    222227        }
    223228
    224         $value = isset( $_POST['value'] ) ? trim( $_POST['value'] ) : '';
     229        $value = isset( $_POST['value'] ) ? sanitize_text_field( wp_unslash( $_POST['value'] ) ) : '';
    225230
    226231        // Save option value
     
    259264        }
    260265
    261         $code = isset( $_POST['code'] ) ? sanitize_text_field( $_POST['code'] ) : '';
     266        $code = isset( $_POST['code'] ) ? sanitize_text_field( wp_unslash( $_POST['code'] ) ) : '';
    262267
    263268        if ( empty( $code ) ) {
     
    336341        }
    337342
     343        // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- JSON payload validated by json_decode() below.
    338344        $configuration = isset( $_POST['configuration'] ) ? wp_unslash( $_POST['configuration'] ) : '';
    339345
  • cookiebot/trunk/src/lib/Cookie_Consent.php

    r3230472 r3473643  
    3535     */
    3636    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;
    3838
    3939        $this->scan_cookie();
  • cookiebot/trunk/src/lib/Cookiebot_Review.php

    r3421804 r3473643  
    138138    public function send_uninstall_survey() {
    139139        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' ) ) {
    141141            wp_send_json_error( esc_html__( 'Sorry you are not allowed to do this.', 'cookiebot' ), 401 );
    142142        }
     
    145145        }
    146146        $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'] ) ) : '',
    148148            'reason_slug'    => sanitize_text_field( wp_unslash( $_POST['reason_id'] ) ),
    149149            'reason_detail'  => ! empty( $_POST['reason_text'] ) ? sanitize_text_field( wp_unslash( $_POST['reason_text'] ) ) : null,
  • cookiebot/trunk/src/lib/Cookiebot_WP.php

    r3459843 r3473643  
    1212use cybot\cookiebot\widgets\Dashboard_Widget_Cookiebot_Status;
    1313use cybot\cookiebot\lib\Account_Service;
     14use cybot\cookiebot\settings\pages\PPG_Page;
    1415use DomainException;
    1516use RuntimeException;
     
    8687                self::COOKIEBOT_MIN_PHP_VERSION
    8788            );
    88             throw new DomainException( $message );
     89            throw new DomainException( esc_html( $message ) );
    8990        }
    9091    }
     
    102103            ( new Cookiebot_Notices() )->register_hooks();
    103104            ( new Cookiebot_Review() )->register_hooks();
     105            ( new PPG_Page() )->register_ajax_hooks();
    104106        }
    105107
  • cookiebot/trunk/src/lib/Dependency_Container.php

    r3230472 r3473643  
    3131    public function set( $key, $dependency ) {
    3232        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' );
    3434        }
    3535        $this->dependencies[ $key ] = $dependency;
     
    4444    public function get( $key ) {
    4545        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' );
    4747        }
    4848
  • cookiebot/trunk/src/lib/helper.php

    r3421804 r3473643  
    512512    function cookiebot_get_local_file_contents( $file_path ) {
    513513        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' );
    515515        }
    516516
     
    531531        $absolute_path = CYBOT_COOKIEBOT_PLUGIN_DIR . 'src/view/' . $relative_path;
    532532        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 ) . '"' );
    534534        }
    535535        // phpcs:ignore WordPress.PHP.DontExtract.extract_extract
     
    557557        $absolute_path = CYBOT_COOKIEBOT_PLUGIN_DIR . CYBOT_COOKIEBOT_PLUGIN_ASSETS_DIR . $relative_path;
    558558        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 ) . '"' );
    560560        }
    561561        return $absolute_path;
     
    572572        $url           = esc_url( CYBOT_COOKIEBOT_PLUGIN_URL . CYBOT_COOKIEBOT_PLUGIN_ASSETS_DIR . $relative_path );
    573573        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 ) . '"' );
    575575        }
    576576        return $url;
     
    585585        $url           = esc_url( CYBOT_COOKIEBOT_PLUGIN_URL . CYBOT_COOKIEBOT_PLUGIN_LOGO_FILE );
    586586        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 ) . '"' );
    588588        }
    589589        return $url;
  • cookiebot/trunk/src/lib/traits/Class_Constant_Override_Validator_Trait.php

    r3230472 r3473643  
    3434                sprintf(
    3535                    'Class constant "%s" should be changed by %s',
    36                     $fixed_class_constant_name,
    37                     static::class
     36                    esc_html( $fixed_class_constant_name ),
     37                    esc_html( static::class )
    3838                )
    3939            );
     
    6666                sprintf(
    6767                    'Class constant "%s" must be a non-empty string in %s',
    68                     $required_string_constant_name,
    69                     static::class
     68                    esc_html( $required_string_constant_name ),
     69                    esc_html( static::class )
    7070                )
    7171            );
     
    9898                sprintf(
    9999                    'Class constant "%s" must be a boolean in %s',
    100                     $required_boolean_constant_name,
    101                     static::class
     100                    esc_html( $required_boolean_constant_name ),
     101                    esc_html( static::class )
    102102                )
    103103            );
     
    131131                sprintf(
    132132                    'Class constant "%s" must be an array in %s',
    133                     $required_array_constant_name,
    134                     static::class
     133                    esc_html( $required_array_constant_name ),
     134                    esc_html( static::class )
    135135                )
    136136            );
     
    142142                        sprintf(
    143143                            'Class constant "%s" array items should be one of "%s" in %s',
    144                             $required_array_constant_name,
    145                             implode( ', ', $allowed_item_values ),
    146                             static::class
     144                            esc_html( $required_array_constant_name ),
     145                            esc_html( implode( ', ', $allowed_item_values ) ),
     146                            esc_html( static::class )
    147147                        )
    148148                    );
  • cookiebot/trunk/src/settings/Menu_Settings.php

    r3343491 r3473643  
    99use cybot\cookiebot\settings\pages\Settings_Page;
    1010use cybot\cookiebot\settings\pages\Support_Page;
     11use cybot\cookiebot\settings\pages\PPG_Page;
    1112use cybot\cookiebot\lib\Cookiebot_WP;
    1213
     
    1819        Support_Page::class,
    1920        Settings_Page::class,
     21        PPG_Page::class,
    2022    );
    2123
  • cookiebot/trunk/src/settings/Network_Menu_Settings.php

    r3343491 r3473643  
    6969        check_admin_referer( 'cookiebot-network-settings' );
    7070
     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
    7175        update_site_option(
    7276            'cookiebot-cbid',
    73             ! empty( $_POST['cookiebot-cbid'] ) ? $_POST['cookiebot-cbid'] : ''
     77            ! empty( $_POST['cookiebot-cbid'] ) ? sanitize_text_field( wp_unslash( $_POST['cookiebot-cbid'] ) ) : ''
    7478        );
    7579        update_site_option(
    7680            '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'] ) ) : ''
    7882        );
    7983        update_site_option(
    8084            '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'] ) ) : ''
    8286        );
    8387        update_site_option(
    8488            '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'] ) ) : ''
    8690        );
    8791        update_site_option(
    8892            'cookiebot-autoupdate',
    89             ! empty( $_POST['cookiebot-autoupdate'] ) ? $_POST['cookiebot-autoupdate'] : ''
     93            ! empty( $_POST['cookiebot-autoupdate'] ) ? sanitize_text_field( wp_unslash( $_POST['cookiebot-autoupdate'] ) ) : ''
    9094        );
    9195        update_site_option(
    9296            'cookiebot-nooutput',
    93             ! empty( $_POST['cookiebot-nooutput'] ) ? $_POST['cookiebot-nooutput'] : ''
     97            ! empty( $_POST['cookiebot-nooutput'] ) ? sanitize_text_field( wp_unslash( $_POST['cookiebot-nooutput'] ) ) : ''
    9498        );
    9599        update_site_option(
    96100            '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'] ) ) : ''
    98102        );
    99103        update_site_option(
  • cookiebot/trunk/src/view/admin/cb_frame/dashboard-page.php

    r3289355 r3473643  
    5656                </div>
    5757
    58                 <?php if ( $cbid ) : ?>
     58            <?php if ( $cbid ) : ?>
     59                <div class="cb-main__dashboard__card--row">
    5960                    <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">
    6162                            <h3 class="cb-main__card__subtitle">
    6263                                <?php echo esc_html__( 'Your opinion matters', 'cookiebot' ); ?>
     
    7172                        </div>
    7273                    </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">
    9176                            <h3 class="cb-main__card__subtitle">
    9277                                <?php echo esc_html__( 'Learn more about how to optimize your Cookiebot CMP setup?', 'cookiebot' ); ?>
     
    9681                                <?php echo esc_html__( 'Visit Help Center', 'cookiebot' ); ?>
    9782                            </a>
    98                         <?php endif; ?>
     83                        </div>
    9984                    </div>
    10085                </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; ?>
    101104            </div>
    102105
    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">
    107114                            <iframe src="https://www.youtube.com/embed/1-lvuJa42P0"
    108115                                    title="Cookiebot WordPress Installation"
  • cookiebot/trunk/src/view/admin/cb_frame/settings-page.php

    r3230472 r3473643  
    3434
    3535// 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;
    3737
    3838$header->display();
  • cookiebot/trunk/src/view/admin/common/dashboard-page-old.php

    r3289355 r3473643  
    5353                    </div>
    5454
    55                     <?php if ( ! empty( $template_args['cbid'] ) ) : ?>
     55                <?php if ( ! empty( $template_args['cbid'] ) ) : ?>
     56                    <div class="cb-main__dashboard__card--row">
    5657                        <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">
    5859                                <h3 class="cb-main__card__subtitle">
    5960                                    <?php echo esc_html__( 'Your opinion matters', 'cookiebot' ); ?>
     
    6869                            </div>
    6970                        </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">
    8873                                <h3 class="cb-main__card__subtitle">
    8974                                    <?php echo esc_html__( 'Learn more about how to optimize your Cookiebot CMP setup?', 'cookiebot' ); ?>
     
    9378                                    <?php echo esc_html__( 'Visit Help Center', 'cookiebot' ); ?>
    9479                                </a>
    95                             <?php endif; ?>
     80                            </div>
    9681                        </div>
    9782                    </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; ?>
    98101                </div>
    99102            </div>
    100103
    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">
    105112                            <iframe src="https://www.youtube.com/embed/1-lvuJa42P0"
    106113                                    title="Cookiebot WordPress Installation"
  • cookiebot/trunk/src/view/admin/common/settings-page.php

    r3459839 r3473643  
    1616
    1717// 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;
    1919
    2020$header->display();
  • cookiebot/trunk/src/view/admin/common/templates/main-tabs.php

    r3366362 r3473643  
    77use cybot\cookiebot\addons\config\Settings_Config;
    88use cybot\cookiebot\settings\pages\Support_Page;
     9use cybot\cookiebot\settings\pages\PPG_Page;
    910
    1011/**
     
    8081    <?php endif; ?>
    8182
     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
    8294    <div class="cb-feedback_link">
    8395        <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  
    4242                </div>
    4343
    44                 <?php if ( $cbid ) : ?>
     44            <?php if ( $cbid ) : ?>
     45                <div class="cb-main__dashboard__card--row">
    4546                    <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">
    4748                            <h3 class="cb-main__card__subtitle">
    4849                                <?php echo esc_html__( 'Your opinion matters', 'cookiebot' ); ?>
     
    5758                        </div>
    5859                    </div>
    59 
    6060                    <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>
    7169                        </div>
    7270                    </div>
    73                 <?php endif; ?>
     71                </div>
     72            <?php endif; ?>
    7473            </div>
    7574
    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">
    8184                        <div class="cb-main__legislation__item">
    8285                            <div class="cb-main__legislation____icon">
  • cookiebot/trunk/src/view/admin/uc_frame/settings-page.php

    r3298601 r3473643  
    3434
    3535// 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;
    3737
    3838// Check if user was onboarded via signup
  • cookiebot/trunk/tests/integration/addons/Test_Custom_Facebook_Feed.php

    r3262995 r3473643  
    2020
    2121        $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\' ]);' ) );
    2424    }
    2525}
  • cookiebot/trunk/tests/integration/addons/Test_Instagram_Feed.php

    r3262995 r3473643  
    1919        $content = Instagram_Feed::get_svn_file_content( 'inc/if-functions.php' );
    2020
    21         $this->assertNotFalse( strpos( $content, 'add_action( \'wp_enqueue_scripts\', \'sb_instagram_scripts_enqueue\', 2 );' ) );
     21        $this->assertNotFalse( strpos( $content, '\'sb_instagram_scripts_enqueue\'' ) );
    2222    }
    2323}
  • cookiebot/trunk/tests/integration/addons/Test_Official_Facebook_Pixel.php

    r3262995 r3473643  
    2525n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
    2626t.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');
     27document,'script','https://connect.facebook.net/en_US/fbevents.js');
    2828</script>
    2929<!-- End Meta Pixel Code -->
  • cookiebot/trunk/tests/integration/addons/Test_Wp_Seopress.php

    r3262995 r3473643  
    2020
    2121        // 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 );" ) );
    2323    }
    2424}
Note: See TracChangeset for help on using the changeset viewer.