Version Description
Download this release
Release Info
Developer | cookiebot |
Plugin | Cookiebot | GDPR Compliant Cookie Consent and Notice |
Version | 3.6.2 |
Comparing to | |
See all releases |
Code changes from version 3.6.1 to 3.6.2
addons/addons.json
CHANGED
@@ -70,5 +70,11 @@
|
|
70 |
},
|
71 |
"Addthis": {
|
72 |
"class": "cookiebot_addons\\controller\\addons\\addthis\\Addthis"
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
}
|
74 |
}
|
70 |
},
|
71 |
"Addthis": {
|
72 |
"class": "cookiebot_addons\\controller\\addons\\addthis\\Addthis"
|
73 |
+
},
|
74 |
+
"Wp_Mautic": {
|
75 |
+
"class": "cookiebot_addons\\controller\\addons\\wp_mautic\\Wp_Mautic"
|
76 |
+
},
|
77 |
+
"Wp_Rocket": {
|
78 |
+
"class": "cookiebot_addons\\controller\\addons\\wp_rocket\\Wp_Rocket"
|
79 |
}
|
80 |
}
|
addons/controller/addons/wp-mautic/wp-mautic.php
ADDED
@@ -0,0 +1,308 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace cookiebot_addons\controller\addons\wp_mautic;
|
4 |
+
|
5 |
+
use cookiebot_addons\controller\addons\Cookiebot_Addons_Interface;
|
6 |
+
use cookiebot_addons\lib\Cookie_Consent_Interface;
|
7 |
+
use cookiebot_addons\lib\Settings_Service_Interface;
|
8 |
+
use cookiebot_addons\lib\script_loader_tag\Script_Loader_Tag_Interface;
|
9 |
+
use cookiebot_addons\lib\buffer\Buffer_Output_Interface;
|
10 |
+
|
11 |
+
class Wp_Mautic implements Cookiebot_Addons_Interface {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* @var Settings_Service_Interface
|
15 |
+
*
|
16 |
+
* @since 1.5.0
|
17 |
+
*/
|
18 |
+
protected $settings;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @var Script_Loader_Tag_Interface
|
22 |
+
*
|
23 |
+
* @since 1.5.0
|
24 |
+
*/
|
25 |
+
protected $script_loader_tag;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @var Cookie_Consent_Interface
|
29 |
+
*
|
30 |
+
* @since 1.5.0
|
31 |
+
*/
|
32 |
+
public $cookie_consent;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* @var Buffer_Output_Interface
|
36 |
+
*
|
37 |
+
* @since 1.5.0
|
38 |
+
*/
|
39 |
+
protected $buffer_output;
|
40 |
+
|
41 |
+
/**
|
42 |
+
* constructor.
|
43 |
+
*
|
44 |
+
* @param $settings Settings_Service_Interface
|
45 |
+
* @param $script_loader_tag Script_Loader_Tag_Interface
|
46 |
+
* @param $cookie_consent Cookie_Consent_Interface
|
47 |
+
* @param $buffer_output Buffer_Output_Interface
|
48 |
+
*
|
49 |
+
* @since 1.5.0
|
50 |
+
*/
|
51 |
+
public function __construct( Settings_Service_Interface $settings, Script_Loader_Tag_Interface $script_loader_tag, Cookie_Consent_Interface $cookie_consent, Buffer_Output_Interface $buffer_output ) {
|
52 |
+
$this->settings = $settings;
|
53 |
+
$this->script_loader_tag = $script_loader_tag;
|
54 |
+
$this->cookie_consent = $cookie_consent;
|
55 |
+
$this->buffer_output = $buffer_output;
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Loads addon configuration
|
60 |
+
*
|
61 |
+
* @since 1.5.0
|
62 |
+
*/
|
63 |
+
public function load_configuration() {
|
64 |
+
add_action( 'wp_loaded', array( $this, 'cookiebot_addon_mautic' ), 5 );
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Disable scripts if state not accepted
|
69 |
+
*
|
70 |
+
* @since 1.5.0
|
71 |
+
*/
|
72 |
+
public function cookiebot_addon_mautic() {
|
73 |
+
$this->buffer_output->add_tag( 'wp_head', 10, array(
|
74 |
+
'MauticTrackingObject' => $this->get_cookie_types()
|
75 |
+
), false );
|
76 |
+
$this->buffer_output->add_tag( 'wp_footer', 10, array(
|
77 |
+
'MauticTrackingObject' => $this->get_cookie_types()
|
78 |
+
), false );
|
79 |
+
|
80 |
+
//Remove noscript tracking
|
81 |
+
if( has_action( 'wp_footer', 'wpmautic_inject_noscript' ) ) {
|
82 |
+
remove_action( 'wp_footer', 'wpmautic_inject_noscript' );
|
83 |
+
}
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Return addon/plugin name
|
88 |
+
*
|
89 |
+
* @return string
|
90 |
+
*
|
91 |
+
* @since 1.5.0
|
92 |
+
*/
|
93 |
+
public function get_addon_name() {
|
94 |
+
return 'Mautic';
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Option name in the database
|
99 |
+
*
|
100 |
+
* @return string
|
101 |
+
*
|
102 |
+
* @since 1.5.0
|
103 |
+
*/
|
104 |
+
public function get_option_name() {
|
105 |
+
return 'mautic';
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Plugin file name
|
110 |
+
*
|
111 |
+
* @return string
|
112 |
+
*
|
113 |
+
* @since 1.5.0
|
114 |
+
*/
|
115 |
+
public function get_plugin_file() {
|
116 |
+
return 'wp-mautic/wpmautic.php';
|
117 |
+
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Returns checked cookie types
|
121 |
+
* @return mixed
|
122 |
+
*
|
123 |
+
* @since 1.5.0
|
124 |
+
*/
|
125 |
+
public function get_cookie_types() {
|
126 |
+
return $this->settings->get_cookie_types( $this->get_option_name(), $this->get_default_cookie_types() );
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Returns default cookie types
|
131 |
+
* @return array
|
132 |
+
*
|
133 |
+
* @since 1.5.0
|
134 |
+
*/
|
135 |
+
public function get_default_cookie_types() {
|
136 |
+
return array( 'statistics' );
|
137 |
+
}
|
138 |
+
|
139 |
+
/**
|
140 |
+
* Check if plugin is activated and checked in the backend
|
141 |
+
*
|
142 |
+
* @since 1.5.0
|
143 |
+
*/
|
144 |
+
public function is_addon_enabled() {
|
145 |
+
return $this->settings->is_addon_enabled( $this->get_option_name() );
|
146 |
+
}
|
147 |
+
|
148 |
+
/**
|
149 |
+
* Checks if addon is installed
|
150 |
+
*
|
151 |
+
* @since 1.5.0
|
152 |
+
*/
|
153 |
+
public function is_addon_installed() {
|
154 |
+
return $this->settings->is_addon_installed( $this->get_plugin_file() );
|
155 |
+
}
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Checks if addon is activated
|
159 |
+
*
|
160 |
+
* @since 1.5.0
|
161 |
+
*/
|
162 |
+
public function is_addon_activated() {
|
163 |
+
return $this->settings->is_addon_activated( $this->get_plugin_file() );
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Retrieves current installed version of the addon
|
168 |
+
*
|
169 |
+
* @return bool
|
170 |
+
*
|
171 |
+
* @since 2.2.1
|
172 |
+
*/
|
173 |
+
public function get_addon_version() {
|
174 |
+
return $this->settings->get_addon_version( $this->get_plugin_file() );
|
175 |
+
}
|
176 |
+
|
177 |
+
/**
|
178 |
+
* Default placeholder content
|
179 |
+
*
|
180 |
+
* @return string
|
181 |
+
*
|
182 |
+
* @since 1.8.0
|
183 |
+
*/
|
184 |
+
public function get_default_placeholder() {
|
185 |
+
return 'Please accept [renew_consent]%cookie_types[/renew_consent] cookies to watch this video.';
|
186 |
+
}
|
187 |
+
|
188 |
+
/**
|
189 |
+
* Get placeholder content
|
190 |
+
*
|
191 |
+
* This function will check following features:
|
192 |
+
* - Current language
|
193 |
+
*
|
194 |
+
* @param $src
|
195 |
+
*
|
196 |
+
* @return bool|mixed
|
197 |
+
*
|
198 |
+
* @since 1.8.0
|
199 |
+
*/
|
200 |
+
public function get_placeholder( $src = '' ) {
|
201 |
+
return $this->settings->get_placeholder( $this->get_option_name(), $this->get_default_placeholder(), cookiebot_addons_output_cookie_types( $this->get_cookie_types() ), $src );
|
202 |
+
}
|
203 |
+
|
204 |
+
/**
|
205 |
+
* Checks if it does have custom placeholder content
|
206 |
+
*
|
207 |
+
* @return mixed
|
208 |
+
*
|
209 |
+
* @since 1.8.0
|
210 |
+
*/
|
211 |
+
public function has_placeholder() {
|
212 |
+
return $this->settings->has_placeholder( $this->get_option_name() );
|
213 |
+
}
|
214 |
+
|
215 |
+
/**
|
216 |
+
* returns all placeholder contents
|
217 |
+
*
|
218 |
+
* @return mixed
|
219 |
+
*
|
220 |
+
* @since 1.8.0
|
221 |
+
*/
|
222 |
+
public function get_placeholders() {
|
223 |
+
return $this->settings->get_placeholders( $this->get_option_name() );
|
224 |
+
}
|
225 |
+
|
226 |
+
/**
|
227 |
+
* Return true if the placeholder is enabled
|
228 |
+
*
|
229 |
+
* @return mixed
|
230 |
+
*
|
231 |
+
* @since 1.8.0
|
232 |
+
*/
|
233 |
+
public function is_placeholder_enabled() {
|
234 |
+
return $this->settings->is_placeholder_enabled( $this->get_option_name() );
|
235 |
+
}
|
236 |
+
|
237 |
+
/**
|
238 |
+
* Adds extra information under the label
|
239 |
+
*
|
240 |
+
* @return string
|
241 |
+
*
|
242 |
+
* @since 1.8.0
|
243 |
+
*/
|
244 |
+
public function get_extra_information() {
|
245 |
+
return false;
|
246 |
+
}
|
247 |
+
|
248 |
+
/**
|
249 |
+
* Returns the url of WordPress SVN repository or another link where we can verify the plugin file.
|
250 |
+
*
|
251 |
+
* @return boolean
|
252 |
+
*
|
253 |
+
* @since 1.8.0
|
254 |
+
*/
|
255 |
+
public function get_svn_url() {
|
256 |
+
return 'https://plugins.svn.wordpress.org/wp-mautic/trunk/wpmautic.php';
|
257 |
+
}
|
258 |
+
|
259 |
+
/**
|
260 |
+
* Placeholder helper overlay in the settings page.
|
261 |
+
*
|
262 |
+
* @return string
|
263 |
+
*
|
264 |
+
* @since 1.8.0
|
265 |
+
*/
|
266 |
+
public function get_placeholder_helper() {
|
267 |
+
return '<p>Merge tags you can use in the placeholder text:</p><ul><li>%cookie_types - Lists required cookie types</li><li>[renew_consent]text[/renew_consent] - link to display cookie settings in frontend</li></ul>';
|
268 |
+
}
|
269 |
+
|
270 |
+
|
271 |
+
/**
|
272 |
+
* Returns parent class or false
|
273 |
+
*
|
274 |
+
* @return string|bool
|
275 |
+
*
|
276 |
+
* @since 2.1.3
|
277 |
+
*/
|
278 |
+
public function get_parent_class() {
|
279 |
+
return get_parent_class( $this );
|
280 |
+
}
|
281 |
+
|
282 |
+
/**
|
283 |
+
* Action after enabling the addon on the settings page
|
284 |
+
*
|
285 |
+
* @since 2.2.0
|
286 |
+
*/
|
287 |
+
public function post_hook_after_enabling() {
|
288 |
+
//do nothing
|
289 |
+
}
|
290 |
+
|
291 |
+
/**
|
292 |
+
* Cookiebot plugin is deactivated
|
293 |
+
*
|
294 |
+
* @since 2.2.0
|
295 |
+
*/
|
296 |
+
public function plugin_deactivated() {
|
297 |
+
//do nothing
|
298 |
+
}
|
299 |
+
|
300 |
+
/**
|
301 |
+
* @return mixed
|
302 |
+
*
|
303 |
+
* @since 2.4.5
|
304 |
+
*/
|
305 |
+
public function extra_available_addon_option() {
|
306 |
+
//do nothing
|
307 |
+
}
|
308 |
+
}
|
addons/controller/addons/wp-rocket/wp-rocket.php
ADDED
@@ -0,0 +1,315 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace cookiebot_addons\controller\addons\wp_rocket;
|
4 |
+
|
5 |
+
use cookiebot_addons\controller\addons\Cookiebot_Addons_Interface;
|
6 |
+
use cookiebot_addons\lib\script_loader_tag\Script_Loader_Tag_Interface;
|
7 |
+
use cookiebot_addons\lib\Cookie_Consent_Interface;
|
8 |
+
use cookiebot_addons\lib\buffer\Buffer_Output_Interface;
|
9 |
+
use cookiebot_addons\lib\Settings_Service_Interface;
|
10 |
+
|
11 |
+
class Wp_Rocket implements Cookiebot_Addons_Interface {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* @var Settings_Service_Interface
|
15 |
+
*
|
16 |
+
* @since 1.3.0
|
17 |
+
*/
|
18 |
+
protected $settings;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @var Script_Loader_Tag_Interface
|
22 |
+
*
|
23 |
+
* @since 1.3.0
|
24 |
+
*/
|
25 |
+
protected $script_loader_tag;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @var Cookie_Consent_Interface
|
29 |
+
*
|
30 |
+
* @since 1.3.0
|
31 |
+
*/
|
32 |
+
public $cookie_consent;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* @var Buffer_Output_Interface
|
36 |
+
*
|
37 |
+
* @since 1.3.0
|
38 |
+
*/
|
39 |
+
protected $buffer_output;
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Jetpack constructor.
|
43 |
+
*
|
44 |
+
* @param $settings Settings_Service_Interface
|
45 |
+
* @param $script_loader_tag Script_Loader_Tag_Interface
|
46 |
+
* @param $cookie_consent Cookie_Consent_Interface
|
47 |
+
* @param $buffer_output Buffer_Output_Interface
|
48 |
+
*
|
49 |
+
* @since 1.3.0
|
50 |
+
*/
|
51 |
+
public function __construct(
|
52 |
+
Settings_Service_Interface $settings,
|
53 |
+
Script_Loader_Tag_Interface $script_loader_tag,
|
54 |
+
Cookie_Consent_Interface $cookie_consent,
|
55 |
+
Buffer_Output_Interface $buffer_output
|
56 |
+
) {
|
57 |
+
$this->settings = $settings;
|
58 |
+
$this->script_loader_tag = $script_loader_tag;
|
59 |
+
$this->cookie_consent = $cookie_consent;
|
60 |
+
$this->buffer_output = $buffer_output;
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Loads addon configuration
|
65 |
+
*
|
66 |
+
* @since 1.3.0
|
67 |
+
*/
|
68 |
+
public function load_configuration() {
|
69 |
+
/**
|
70 |
+
* Exclude Cookiebot files from defer setting
|
71 |
+
*/
|
72 |
+
add_filter( 'rocket_exclude_defer_js', array( $this, 'exclude_files' ) );
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Exclude scripts from WP Rocket’s defer JS option.
|
77 |
+
*
|
78 |
+
* @author Caspar Hübinger
|
79 |
+
* @param array $excluded_files Array of script URLs to be excluded
|
80 |
+
* @return array Extended array script URLs to be excluded
|
81 |
+
*
|
82 |
+
* @since 3.6.2
|
83 |
+
*/
|
84 |
+
public function exclude_files( $excluded_files = array() ) {
|
85 |
+
$excluded_files[] = 'consent.cookiebot.com';
|
86 |
+
|
87 |
+
return $excluded_files;
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Check if plugin is activated and checked in the backend
|
92 |
+
*
|
93 |
+
* @since 1.3.0
|
94 |
+
*/
|
95 |
+
public function is_addon_enabled() {
|
96 |
+
return $this->settings->is_addon_enabled( $this->get_option_name() );
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Option name in the database
|
101 |
+
*
|
102 |
+
* @return string
|
103 |
+
*
|
104 |
+
* @since 1.3.0
|
105 |
+
*/
|
106 |
+
public function get_option_name() {
|
107 |
+
return 'wp_rocket';
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Returns checked cookie types
|
112 |
+
* @return mixed
|
113 |
+
*
|
114 |
+
* @since 1.3.0
|
115 |
+
*/
|
116 |
+
public function get_cookie_types() {
|
117 |
+
return $this->settings->get_cookie_types( $this->get_option_name(), $this->get_default_cookie_types() );
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Returns default cookie types
|
122 |
+
* @return array
|
123 |
+
*
|
124 |
+
* @since 1.3.0
|
125 |
+
*/
|
126 |
+
public function get_default_cookie_types() {
|
127 |
+
return array( 'statistics' );
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Return addon/plugin name
|
132 |
+
*
|
133 |
+
* @return string
|
134 |
+
*
|
135 |
+
* @since 1.3.0
|
136 |
+
*/
|
137 |
+
public function get_addon_name() {
|
138 |
+
return 'WP Rocket';
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Checks if addon is installed
|
143 |
+
*
|
144 |
+
* @since 1.3.0
|
145 |
+
*/
|
146 |
+
public function is_addon_installed() {
|
147 |
+
return $this->settings->is_addon_installed( $this->get_plugin_file() );
|
148 |
+
}
|
149 |
+
|
150 |
+
/**
|
151 |
+
* Plugin file name
|
152 |
+
*
|
153 |
+
* @return string
|
154 |
+
*
|
155 |
+
* @since 1.3.0
|
156 |
+
*/
|
157 |
+
public function get_plugin_file() {
|
158 |
+
return 'wp-rocket/wp-rocket.php';
|
159 |
+
}
|
160 |
+
|
161 |
+
/**
|
162 |
+
* Checks if addon is activated
|
163 |
+
*
|
164 |
+
* @since 1.3.0
|
165 |
+
*/
|
166 |
+
public function is_addon_activated() {
|
167 |
+
return $this->settings->is_addon_activated( $this->get_plugin_file() );
|
168 |
+
}
|
169 |
+
|
170 |
+
/**
|
171 |
+
* Retrieves current installed version of the addon
|
172 |
+
*
|
173 |
+
* @return bool
|
174 |
+
*
|
175 |
+
* @since 2.2.1
|
176 |
+
*/
|
177 |
+
public function get_addon_version() {
|
178 |
+
return $this->settings->get_addon_version( $this->get_plugin_file() );
|
179 |
+
}
|
180 |
+
|
181 |
+
/**
|
182 |
+
* Default placeholder content
|
183 |
+
*
|
184 |
+
* @return string
|
185 |
+
*
|
186 |
+
* @since 1.8.0
|
187 |
+
*/
|
188 |
+
public function get_default_placeholder() {
|
189 |
+
return '';
|
190 |
+
}
|
191 |
+
|
192 |
+
/**
|
193 |
+
* Get placeholder content
|
194 |
+
*
|
195 |
+
* This function will check following features:
|
196 |
+
* - Current language
|
197 |
+
*
|
198 |
+
* @param $src
|
199 |
+
*
|
200 |
+
* @return bool|mixed
|
201 |
+
*
|
202 |
+
* @since 1.8.0
|
203 |
+
*/
|
204 |
+
public function get_placeholder( $src = '' ) {
|
205 |
+
return $this->settings->get_placeholder( $this->get_option_name(),
|
206 |
+
$this->get_default_placeholder(),
|
207 |
+
cookiebot_addons_output_cookie_types( $this->get_cookie_types() ),
|
208 |
+
$src );
|
209 |
+
}
|
210 |
+
|
211 |
+
/**
|
212 |
+
* Checks if it does have custom placeholder content
|
213 |
+
*
|
214 |
+
* @return mixed
|
215 |
+
*
|
216 |
+
* @since 1.8.0
|
217 |
+
*/
|
218 |
+
public function has_placeholder() {
|
219 |
+
return $this->settings->has_placeholder( $this->get_option_name() );
|
220 |
+
}
|
221 |
+
|
222 |
+
/**
|
223 |
+
* returns all placeholder contents
|
224 |
+
*
|
225 |
+
* @return mixed
|
226 |
+
*
|
227 |
+
* @since 1.8.0
|
228 |
+
*/
|
229 |
+
public function get_placeholders() {
|
230 |
+
return $this->settings->get_placeholders( $this->get_option_name() );
|
231 |
+
}
|
232 |
+
|
233 |
+
/**
|
234 |
+
* Return true if the placeholder is enabled
|
235 |
+
*
|
236 |
+
* @return mixed
|
237 |
+
*
|
238 |
+
* @since 1.8.0
|
239 |
+
*/
|
240 |
+
public function is_placeholder_enabled() {
|
241 |
+
return $this->settings->is_placeholder_enabled( $this->get_option_name() );
|
242 |
+
}
|
243 |
+
|
244 |
+
/**
|
245 |
+
* Adds extra information under the label
|
246 |
+
*
|
247 |
+
* @return string
|
248 |
+
*
|
249 |
+
* @since 1.8.0
|
250 |
+
*/
|
251 |
+
public function get_extra_information() {
|
252 |
+
return false;
|
253 |
+
}
|
254 |
+
|
255 |
+
/**
|
256 |
+
* Returns the url of WordPress SVN repository or another link where we can verify the plugin file.
|
257 |
+
*
|
258 |
+
* @return boolean
|
259 |
+
*
|
260 |
+
* @since 1.8.0
|
261 |
+
*/
|
262 |
+
public function get_svn_url() {
|
263 |
+
return false;
|
264 |
+
}
|
265 |
+
|
266 |
+
/**
|
267 |
+
* Placeholder helper overlay in the settings page.
|
268 |
+
*
|
269 |
+
* @return string
|
270 |
+
*
|
271 |
+
* @since 1.8.0
|
272 |
+
*/
|
273 |
+
public function get_placeholder_helper() {
|
274 |
+
return '<p>Merge tags you can use in the placeholder text:</p><ul><li>%cookie_types - Lists required cookie types</li><li>[renew_consent]text[/renew_consent] - link to display cookie settings in frontend</li></ul>';
|
275 |
+
}
|
276 |
+
|
277 |
+
|
278 |
+
/**
|
279 |
+
* Returns parent class or false
|
280 |
+
*
|
281 |
+
* @return string|bool
|
282 |
+
*
|
283 |
+
* @since 2.1.3
|
284 |
+
*/
|
285 |
+
public function get_parent_class() {
|
286 |
+
return get_parent_class( $this );
|
287 |
+
}
|
288 |
+
|
289 |
+
/**
|
290 |
+
* Action after enabling the addon on the settings page
|
291 |
+
*
|
292 |
+
* @since 2.2.0
|
293 |
+
*/
|
294 |
+
public function post_hook_after_enabling() {
|
295 |
+
//do nothing
|
296 |
+
}
|
297 |
+
|
298 |
+
/**
|
299 |
+
* Cookiebot plugin is deactivated
|
300 |
+
*
|
301 |
+
* @since 2.2.0
|
302 |
+
*/
|
303 |
+
public function plugin_deactivated() {
|
304 |
+
//do nothing
|
305 |
+
}
|
306 |
+
|
307 |
+
/**
|
308 |
+
* @return mixed
|
309 |
+
*
|
310 |
+
* @since 2.4.5
|
311 |
+
*/
|
312 |
+
public function extra_available_addon_option() {
|
313 |
+
//do nothing
|
314 |
+
}
|
315 |
+
}
|
addons/cookiebot-addons-init.php
CHANGED
@@ -23,7 +23,7 @@ define( 'COOKIEBOT_ADDONS_BASE_NAME', dirname( plugin_basename( __FILE__ ) ) );
|
|
23 |
/**
|
24 |
* Same version as the CookiebotWP
|
25 |
*/
|
26 |
-
define( 'COOKIEBOT_ADDONS_VERSION', '3.6.
|
27 |
|
28 |
/**
|
29 |
* Register autoloader to load files/classes dynamically
|
23 |
/**
|
24 |
* Same version as the CookiebotWP
|
25 |
*/
|
26 |
+
define( 'COOKIEBOT_ADDONS_VERSION', '3.6.2' );
|
27 |
|
28 |
/**
|
29 |
* Register autoloader to load files/classes dynamically
|
addons/tests/integration/addons/test-wp-mautic.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace cookiebot_addons\tests\integration\addons;
|
4 |
+
|
5 |
+
class Test_Wp_Mautic extends \WP_UnitTestCase {
|
6 |
+
|
7 |
+
public function setUp() {
|
8 |
+
|
9 |
+
}
|
10 |
+
|
11 |
+
/**
|
12 |
+
* This will validate if the hooks for "wpmautic" still exists
|
13 |
+
*
|
14 |
+
* @since 2.1.0
|
15 |
+
*/
|
16 |
+
public function test_wp_mautic() {
|
17 |
+
$content = file_get_contents( 'https://plugins.svn.wordpress.org/wp-mautic/trunk/wpmautic.php' );
|
18 |
+
|
19 |
+
$this->assertNotFalse( strpos( $content, 'add_action( \'wp_head\', \'wpmautic_inject_script\' );') );
|
20 |
+
$this->assertNotFalse( strpos( $content, 'add_action( \'wp_footer\', \'wpmautic_inject_script\' );') );
|
21 |
+
}
|
22 |
+
}
|
cookiebot.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Cookiebot | GDPR/CCPA Compliant Cookie Consent and Control
|
|
4 |
Plugin URI: https://cookiebot.com/
|
5 |
Description: Cookiebot is a cloud-driven solution that automatically controls cookies and trackers, enabling full GDPR/ePrivacy and CCPA compliance for websites.
|
6 |
Author: Cybot A/S
|
7 |
-
Version: 3.6.
|
8 |
Author URI: http://cookiebot.com
|
9 |
Text Domain: cookiebot
|
10 |
Domain Path: /langs
|
@@ -471,7 +471,7 @@ final class Cookiebot_WP {
|
|
471 |
<?php _e('Manual','cookiebot'); ?>
|
472 |
</label>
|
473 |
<p class="description">
|
474 |
-
<?php _e('Automatic block cookies (except necessary)
|
475 |
<a href="https://support.cookiebot.com/hc/en-us/articles/360009063100-Automatic-Cookie-Blocking-How-does-it-work-" target="_blank">
|
476 |
<?php _e('Learn more','cookiebot'); ?>
|
477 |
</a>
|
4 |
Plugin URI: https://cookiebot.com/
|
5 |
Description: Cookiebot is a cloud-driven solution that automatically controls cookies and trackers, enabling full GDPR/ePrivacy and CCPA compliance for websites.
|
6 |
Author: Cybot A/S
|
7 |
+
Version: 3.6.2
|
8 |
Author URI: http://cookiebot.com
|
9 |
Text Domain: cookiebot
|
10 |
Domain Path: /langs
|
471 |
<?php _e('Manual','cookiebot'); ?>
|
472 |
</label>
|
473 |
<p class="description">
|
474 |
+
<?php _e('Automatic block cookies (except necessary) until the user has given their consent.','cookiebot') ?>
|
475 |
<a href="https://support.cookiebot.com/hc/en-us/articles/360009063100-Automatic-Cookie-Blocking-How-does-it-work-" target="_blank">
|
476 |
<?php _e('Learn more','cookiebot'); ?>
|
477 |
</a>
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Tags: cookie, compliance, eu, gdpr, europe, cookie consent, consent, ccpa
|
4 |
* Requires at least: 4.4
|
5 |
* Tested up to: 5.3.2
|
6 |
-
* Stable tag: 3.6.
|
7 |
* Requires PHP: 5.6
|
8 |
* License: GPLv2 or later
|
9 |
|
@@ -190,6 +190,10 @@ You are able to define the mapping between Cookiebot and the WP Consent API in t
|
|
190 |
|
191 |
## Changelog ##
|
192 |
|
|
|
|
|
|
|
|
|
193 |
### 3.6.1 - 2020-03-12 ###
|
194 |
* Fix security issue - possible XSS
|
195 |
* Update tests for addons
|
3 |
* Tags: cookie, compliance, eu, gdpr, europe, cookie consent, consent, ccpa
|
4 |
* Requires at least: 4.4
|
5 |
* Tested up to: 5.3.2
|
6 |
+
* Stable tag: 3.6.2
|
7 |
* Requires PHP: 5.6
|
8 |
* License: GPLv2 or later
|
9 |
|
190 |
|
191 |
## Changelog ##
|
192 |
|
193 |
+
### 3.6.2 - 2020-04-22
|
194 |
+
* Adding WP Rocket addon
|
195 |
+
* Adding WP Mautic addon
|
196 |
+
|
197 |
### 3.6.1 - 2020-03-12 ###
|
198 |
* Fix security issue - possible XSS
|
199 |
* Update tests for addons
|