PluginProbe ʕ •ᴥ•ʔ
Cookiebot by Usercentrics – Automatic Cookie Banner for GDPR/CCPA & Google Consent Mode / 4.3.12
Cookiebot by Usercentrics – Automatic Cookie Banner for GDPR/CCPA & Google Consent Mode v4.3.12
4.7.2 4.7.1 trunk 2.3.0 2.4.0 2.4.1 2.4.2 2.5.0 3.0.0 3.0.1 3.1.0 3.10.0 3.10.1 3.11.1 3.11.2 3.11.3 3.2.0 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.6.1 3.6.2 3.6.5 3.6.6 3.7.0 3.7.1 3.8.0 3.9.0 4.0.0 4.0.1 4.0.2 4.0.3 4.1.0 4.1.1 4.2.0 4.2.1 4.2.10 4.2.11 4.2.12 4.2.13 4.2.14 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 4.3.1 4.3.10 4.3.11 4.3.12 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7 4.3.7.1 4.3.8 4.3.9 4.3.9.1 4.4.0 4.4.1 4.4.2 4.5.0 4.5.1 4.5.10 4.5.11 4.5.2 4.5.3 4.5.4 4.5.5 4.5.6 4.5.7 4.5.8 4.5.9 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.6.6 4.6.7 4.7.0
cookiebot / src / admin_notices / Cookiebot_Recommendation_Notice.php
cookiebot / src / admin_notices Last commit date
Cookiebot_Base_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_Recommendation_Notice.php
95 lines
1 <?php
2
3 namespace cybot\cookiebot\admin_notices;
4
5 use function cybot\cookiebot\lib\get_view_html;
6
7 class Cookiebot_Recommendation_Notice extends Cookiebot_Base_Notice {
8 const COOKIEBOT_NOTICE_OPTION_KEY = 'cookiebot_notice_recommend';
9 const COOKIEBOT_NOTICE_TEMPLATE_PATH = 'admin/notices/cookiebot-recommendation-notice.php';
10 const COOKIEBOT_NOTICE_LINK_TEMPLATE_PATH = 'admin/notices/cookiebot-recommendation-notice-links.php';
11
12 const COOKIEBOT_NOTICE_TIMES = array(
13 'later' => array(
14 'msg' => 'Never show again is clicked',
15 'action' => 'hide_temp_notice',
16 'name' => 'review_nonce',
17 'str' => false,
18 'time' => 'hide',
19 ),
20 'hide' => array(
21 'msg' => 'Never show again is clicked',
22 'action' => 'hide_recommendation',
23 'name' => 'review_nonce',
24 'str' => false,
25 'time' => 'hide',
26 ),
27 'visit' => array(
28 'msg' => 'Show me after 1 day',
29 'action' => 'hide_recommendation_next',
30 'name' => 'review_nonce',
31 'str' => true,
32 'time' => '+1 day',
33 ),
34 'two_week' => array(
35 'msg' => 'Show me after 2 weeks',
36 'action' => 'hide_recommendation_for_two_weeks',
37 'name' => 'review_nonce',
38 'str' => true,
39 'time' => '+2 weeks',
40 ),
41 );
42
43 public function __construct() {
44 parent::__construct();
45 // Check if recommendation notice delay option exists
46 if ( get_option( static::COOKIEBOT_NOTICE_OPTION_KEY, false ) === false ) {
47 // Delay in 1 day
48 add_option( static::COOKIEBOT_NOTICE_OPTION_KEY, strtotime( '+1 day' ) );
49 }
50 }
51
52 /**
53 * @return string
54 */
55 public function get_link_html() {
56 $two_week_review_ignore = wp_nonce_url(
57 add_query_arg( array( static::COOKIEBOT_NOTICE_OPTION_KEY => 'hide' ) ),
58 static::COOKIEBOT_NOTICE_TIMES['hide']['action'],
59 static::COOKIEBOT_NOTICE_TIMES['hide']['name']
60 );
61 $two_week_review_temp = wp_nonce_url(
62 add_query_arg( array( static::COOKIEBOT_NOTICE_OPTION_KEY => 'two_week' ) ),
63 static::COOKIEBOT_NOTICE_TIMES['two_week']['action'],
64 static::COOKIEBOT_NOTICE_TIMES['two_week']['name']
65 );
66 $visit_review_temp = wp_nonce_url(
67 add_query_arg( array( static::COOKIEBOT_NOTICE_OPTION_KEY => 'visit' ) ),
68 static::COOKIEBOT_NOTICE_TIMES['visit']['action'],
69 static::COOKIEBOT_NOTICE_TIMES['visit']['name']
70 );
71
72 return get_view_html(
73 static::COOKIEBOT_NOTICE_LINK_TEMPLATE_PATH,
74 array(
75 'two_week_review_ignore' => $two_week_review_ignore,
76 'two_week_review_temp' => $two_week_review_temp,
77 'visit_review_temp' => $visit_review_temp,
78 )
79 );
80 }
81
82 public function define_translations() {
83 $this->translations = array(
84 'title' => __(
85 'Share your experience',
86 'cookiebot'
87 ),
88 'msg' => __(
89 'Hi there! We are thrilled you love the Cookiebot CMP plugin. Could you do us a huge favor and leave a 5-star rating on WordPress? Your support will help us spread the word and empower more WordPress websites to meet GDPR and CCPA compliance standards effortlessly. Thank you for your support!',
90 'cookiebot'
91 ),
92 );
93 }
94 }
95