header.php
53 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * @var string $cookiebot_logo |
| 5 | * @var string $subscription_status |
| 6 | * @var int $days_left |
| 7 | */ |
| 8 | |
| 9 | use cybot\cookiebot\lib\Cookiebot_WP; |
| 10 | use function cybot\cookiebot\lib\cookiebot_is_trial_expired; |
| 11 | |
| 12 | ?> |
| 13 | <?php |
| 14 | // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 15 | if ( ! empty( $_GET['settings-updated'] ) ) : |
| 16 | ?> |
| 17 | <div class="cb-submit__msg"><?php esc_html_e( 'Changes has been saved', 'cookiebot' ); ?></div> |
| 18 | <?php endif; ?> |
| 19 | <?php |
| 20 | $cbid = Cookiebot_WP::get_cbid(); |
| 21 | $user_data = Cookiebot_WP::get_user_data(); |
| 22 | $trial_expired = cookiebot_is_trial_expired(); |
| 23 | |
| 24 | if ( ! $trial_expired && ! empty( $user_data ) ) : |
| 25 | ?> |
| 26 | <div class="trial-banner"> |
| 27 | <div class="trial-info"> |
| 28 | <span class="trial-icon"></span> |
| 29 | <span class="trial-text"> |
| 30 | <span class="trial-label"><?php echo esc_html__( 'Premium Trial:', 'cookiebot' ); ?></span> |
| 31 | <span class="days-left"><?php /* translators: %d is replaced with "integer" */ echo sprintf( esc_html__( '%d days left', 'cookiebot' ), absint( $days_left ) ); ?></span> |
| 32 | </span> |
| 33 | </div> |
| 34 | <?php if ( isset( $user_data['subscriptions']['active']['subscription_id'] ) ) : ?> |
| 35 | <a href="https://account.usercentrics.eu/subscription/<?php echo esc_attr( $user_data['subscriptions']['active']['subscription_id'] ); ?>/manage" target="_blank" class="upgrade-button"> |
| 36 | <?php else : ?> |
| 37 | <a href="https://account.usercentrics.eu/subscription/manage" target="_blank" class="upgrade-button"> |
| 38 | <?php endif; ?> |
| 39 | <?php echo esc_html__( 'Upgrade now', 'cookiebot' ); ?> |
| 40 | <span class="arrow-icon">→</span> |
| 41 | </a> |
| 42 | </div> |
| 43 | <?php endif; ?> |
| 44 | <div class="cb-header"> |
| 45 | <div class="cb-wrapper"> |
| 46 | <a href="https://www.cookiebot.com/?utm_source=wordpress&utm_medium=referral&utm_campaign=banner"> |
| 47 | <img |
| 48 | src="<?php echo esc_url( $cookiebot_logo ); ?>" |
| 49 | alt="Cookiebot logo"> |
| 50 | </a> |
| 51 | </div> |
| 52 | </div> |
| 53 |