Cookiebot_Base_Notice.php
2 years ago
Cookiebot_Bf_Notice.php
1 year ago
Cookiebot_Notices.php
1 year ago
Cookiebot_Recommendation_Notice.php
2 years ago
Cookiebot_Temp_Notice.php
2 years ago
Cookiebot_Bf_Notice.php
59 lines
| 1 | <?php |
| 2 | |
| 3 | namespace cybot\cookiebot\admin_notices; |
| 4 | |
| 5 | use function cybot\cookiebot\lib\get_view_html; |
| 6 | |
| 7 | class Cookiebot_Bf_Notice extends Cookiebot_Base_Notice { |
| 8 | const COOKIEBOT_NOTICE_OPTION_KEY = 'cookiebot_bf_notice'; |
| 9 | const COOKIEBOT_NOTICE_TEMPLATE_PATH = 'admin/notices/cookiebot-bf-notice.php'; |
| 10 | const COOKIEBOT_NOTICE_LINK_TEMPLATE_PATH = 'admin/notices/cookiebot-notice-single-cta.php'; |
| 11 | |
| 12 | const COOKIEBOT_NOTICE_TIMES = array( |
| 13 | 'later' => array( |
| 14 | 'msg' => 'Never show again is clicked', |
| 15 | 'action' => 'hide_view_notice', |
| 16 | 'name' => 'view_nonce', |
| 17 | 'time' => 'hide', |
| 18 | ), |
| 19 | 'hide' => array( |
| 20 | 'msg' => 'Never show again is clicked', |
| 21 | 'action' => 'hide_view_notice', |
| 22 | 'name' => 'view_nonce', |
| 23 | 'time' => 'hide', |
| 24 | ), |
| 25 | ); |
| 26 | |
| 27 | const COOKIEBOT_NOTICE_TIMES_REVERT = true; |
| 28 | |
| 29 | public function __construct() { |
| 30 | parent::__construct(); |
| 31 | if ( get_option( self::COOKIEBOT_NOTICE_OPTION_KEY, false ) === false ) { |
| 32 | add_option( self::COOKIEBOT_NOTICE_OPTION_KEY, strtotime( '2024-12-03' ) ); |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | public function get_link_html() { |
| 37 | return get_view_html( |
| 38 | static::COOKIEBOT_NOTICE_LINK_TEMPLATE_PATH, |
| 39 | array( |
| 40 | 'url' => 'https://admin.cookiebot.com/signup?coupon=BFRIDAYWP10&utm_source=wordpress&utm_medium=referral&utm_campaign=banner', |
| 41 | 'text' => __( 'Sign up now', 'cookiebot' ), |
| 42 | ) |
| 43 | ); |
| 44 | } |
| 45 | |
| 46 | public function define_translations() { |
| 47 | $this->translations = array( |
| 48 | 'title' => __( |
| 49 | 'Get 10% off for 6 months', |
| 50 | 'cookiebot' |
| 51 | ), |
| 52 | 'msg' => __( |
| 53 | 'Limited offer for new users! Sign up by Dec 2, 2024, to get a 10% discount for the first 6 months.', |
| 54 | 'cookiebot' |
| 55 | ), |
| 56 | ); |
| 57 | } |
| 58 | } |
| 59 |