PluginProbe ʕ •ᴥ•ʔ
Cookiebot by Usercentrics – Automatic Cookie Banner for GDPR/CCPA & Google Consent Mode / trunk
Cookiebot by Usercentrics – Automatic Cookie Banner for GDPR/CCPA & Google Consent Mode vtrunk
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 / abilities / Get_Status_Ability.php
cookiebot / src / abilities Last commit date
Ability_Audit_Logger.php 1 month ago Cookiebot_Abilities_Registrar.php 1 month ago Cookiebot_Ability_Interface.php 1 month ago Get_Compliance_Summary_Ability.php 1 month ago Get_Status_Ability.php 1 month ago Install_Ppg_Ability.php 1 month ago Set_Cbid_Ability.php 1 month ago Toggle_Gcm_Ability.php 1 month ago Verify_Setup_Ability.php 1 month ago
Get_Status_Ability.php
74 lines
1 <?php
2 /**
3 * Get_Status_Ability class.
4 *
5 * @package cookiebot
6 * @subpackage abilities
7 */
8
9 namespace cybot\cookiebot\abilities;
10
11 use cybot\cookiebot\lib\Cookiebot_WP;
12
13 /**
14 * Ability to get Cookiebot CMP status.
15 *
16 * @since 4.8.0
17 */
18 class Get_Status_Ability implements Cookiebot_Ability_Interface {
19
20 /**
21 * Returns the ability name.
22 *
23 * @return string
24 *
25 * @since 4.8.0
26 */
27 public function get_name() {
28 return 'cookiebot/get-status';
29 }
30
31 /**
32 * Returns the ability arguments.
33 *
34 * @return array
35 *
36 * @since 4.8.0
37 */
38 public function get_args() {
39 return array(
40 'label' => __( 'Get Cookiebot Status', 'cookiebot' ),
41 'description' => __( 'Returns the current Cookiebot CMP plugin configuration: whether a Domain Group ID is set, GCM v2 status, cookie blocking mode, banner state, and plugin version.', 'cookiebot' ),
42 'category' => 'cookiebot',
43 'output_schema' => array(
44 'type' => 'object',
45 'properties' => array(
46 'cbid_set' => array( 'type' => 'boolean', 'description' => 'Whether a Domain Group ID has been configured.' ),
47 'gcm_enabled' => array( 'type' => 'boolean', 'description' => 'Whether Google Consent Mode v2 is enabled.' ),
48 'blocking_mode' => array( 'type' => 'string', 'description' => 'Cookie blocking mode: auto or manual.' ),
49 'banner_enabled' => array( 'type' => 'boolean', 'description' => 'Whether the consent banner is enabled.' ),
50 'plugin_version' => array( 'type' => 'string', 'description' => 'Installed plugin version.' ),
51 ),
52 'additionalProperties' => false,
53 ),
54 'execute_callback' => function() {
55 $cbid = Cookiebot_WP::get_cbid();
56 return array(
57 'cbid_set' => ! empty( $cbid ),
58 'gcm_enabled' => Cookiebot_WP::get_gcm_enabled() === '1',
59 'blocking_mode' => Cookiebot_WP::get_cookie_blocking_mode(),
60 'banner_enabled' => Cookiebot_WP::get_banner_enabled() === '1',
61 'plugin_version' => Cookiebot_WP::COOKIEBOT_PLUGIN_VERSION,
62 );
63 },
64 'permission_callback' => function() {
65 return current_user_can( 'manage_options' );
66 },
67 'meta' => array(
68 'annotations' => array( 'readonly' => true, 'destructive' => false, 'idempotent' => true ),
69 'show_in_rest' => true,
70 ),
71 );
72 }
73 }
74