| 1 |
<?php |
| 2 |
|
| 3 |
namespace cybot\cookiebot\addons\controller\addons\pixel_caffeine; |
| 4 |
|
| 5 |
use cybot\cookiebot\addons\controller\addons\Base_Cookiebot_Plugin_Addon; |
| 6 |
|
| 7 |
class Pixel_Caffeine extends Base_Cookiebot_Plugin_Addon { |
| 8 |
|
| 9 |
|
| 10 |
const ADDON_NAME = 'Pixel Caffeine'; |
| 11 |
const DEFAULT_PLACEHOLDER_CONTENT = 'Please accept [renew_consent]%cookie_types[/renew_consent] cookies to enable tracking.'; |
| 12 |
const OPTION_NAME = 'pixel_caffeine'; |
| 13 |
const PLUGIN_FILE_PATH = 'pixel-caffeine/pixel-caffeine.php'; |
| 14 |
const DEFAULT_COOKIE_TYPES = array( 'statistics', 'marketing' ); |
| 15 |
const ENABLE_ADDON_BY_DEFAULT = false; |
| 16 |
const SVN_URL_BASE_PATH = 'https://plugins.svn.wordpress.org/pixel-caffeine/trunk/'; |
| 17 |
const SVN_URL_DEFAULT_SUB_PATH = 'pixel-caffeine.php'; |
| 18 |
|
| 19 |
/** |
| 20 |
* Disable scripts if state not accepted |
| 21 |
* |
| 22 |
* @since 1.4.0 |
| 23 |
*/ |
| 24 |
public function load_addon_configuration() { |
| 25 |
$this->script_loader_tag->add_tag( 'aepc-pixel-events', $this->get_cookie_types() ); |
| 26 |
|
| 27 |
$this->buffer_output->add_tag( |
| 28 |
'wp_head', |
| 29 |
99, |
| 30 |
array( |
| 31 |
'aepc_pixel' => $this->get_cookie_types(), |
| 32 |
), |
| 33 |
false |
| 34 |
); |
| 35 |
|
| 36 |
$this->buffer_output->add_tag( |
| 37 |
'wp_footer', |
| 38 |
1, |
| 39 |
array( |
| 40 |
'aepc_pixel' => $this->get_cookie_types(), |
| 41 |
), |
| 42 |
false |
| 43 |
); |
| 44 |
} |
| 45 |
|
| 46 |
/** |
| 47 |
* Default placeholder content |
| 48 |
* |
| 49 |
* @return string |
| 50 |
* |
| 51 |
* @since 1.8.0 |
| 52 |
*/ |
| 53 |
public function get_default_placeholder() { |
| 54 |
return 'Please accept [renew_consent]%cookie_types[/renew_consent] cookies to enable Facebook pixel.'; |
| 55 |
} |
| 56 |
} |
| 57 |
|