@@ -40,7 +40,6 @@ public function init() {
40
40
add_action ( 'admin_enqueue_scripts ' , [ $ this , 'registerStartupScripts ' ] );
41
41
42
42
43
-
44
43
}
45
44
46
45
public function about () {
@@ -51,9 +50,9 @@ public function about() {
51
50
<?= __ ( "EUCookieLaw3 is a revamped version of the plugin EUCookieLaw. " , EUCookieLaw3::LANG_DOMAIN ) ?>
52
51
</p>
53
52
<p>
54
- <?= sprintf (
55
- __ ("Read the <a href= \"%s \">on-line documentation</a> " , EUCookieLaw3::LANG_DOMAIN ),
56
- 'https://github.com/diegolamonica/EUCookieLaw3/ '
53
+ <?= sprintf (
54
+ __ ( "Read the <a href= \"%s \">on-line documentation</a> " , EUCookieLaw3::LANG_DOMAIN ),
55
+ 'https://github.com/diegolamonica/EUCookieLaw3/ '
57
56
); ?>
58
57
</p>
59
58
<p>
@@ -77,7 +76,7 @@ public function about() {
77
76
}
78
77
79
78
private function buildScreen ( $ screen ) {
80
- add_screen_option ( 'layout_columns ' , array ( 'max ' => 2 , 'default ' => 2 ) );
79
+ add_screen_option ( 'layout_columns ' , [ 'max ' => 2 , 'default ' => 2 ] );
81
80
?>
82
81
<div class="wrap">
83
82
<h2>EUCookieLaw</h2>
@@ -101,7 +100,7 @@ class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns(
101
100
102
101
public function settings () {
103
102
$ screen = WP_Screen::get ();
104
- add_screen_option ( 'layout_columns ' , array ( 'max ' => 2 , 'default ' => 2 ) );
103
+ add_screen_option ( 'layout_columns ' , [ 'max ' => 2 , 'default ' => 2 ] );
105
104
add_meta_box (
106
105
'eucookielaw-banner-code ' . $ screen ->id ,
107
106
__ ( 'Banner ' , EUCookieLaw3::LANG_DOMAIN ),
@@ -112,14 +111,14 @@ public function settings() {
112
111
add_meta_box (
113
112
'eucookielaw-message-support ' . $ screen ->id ,
114
113
__ ( 'Support ' , EUCookieLaw3::LANG_DOMAIN ),
115
- array ( $ this , 'outputMessagesSupport ' ) ,
114
+ [ $ this , 'outputMessagesSupport ' ] ,
116
115
$ screen , 'side ' , 'high '
117
116
);
118
117
119
118
add_meta_box (
120
119
'eucookielaw-donation ' . $ screen ->id ,
121
120
__ ( 'Donation ' , EUCookieLaw3::LANG_DOMAIN ),
122
- array ( $ this , 'donationsMetabox ' ) ,
121
+ [ $ this , 'donationsMetabox ' ] ,
123
122
$ screen , 'side ' , 'high '
124
123
);
125
124
$ this ->buildScreen ( $ screen );
@@ -157,25 +156,25 @@ public function donationsMetabox() {
157
156
"family and your hobbies! :) " , EUCookieLaw3::LANG_DOMAIN ),
158
157
"https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=me%40diegolamonica%2einfo&lc=IT&item_name=EU%20Cookie%20Law%203&no_note=0¤cy_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest " ,
159
158
"http://amzn.eu/h0ngjnC "
160
- ); ?>
159
+ ); ?>
161
160
</p
162
161
<p>
163
162
<?= sprintf (
164
- __ ( 'You can find further informations about this plugin on <a href="%s">GitHub</a> ' , EUCookieLaw3::LANG_DOMAIN ), 'https://github.com/diegolamonica/EUCookieLaw3/ ' ); ?>
163
+ __ ( 'You can find further informations about this plugin on <a href="%s">GitHub</a> ' , EUCookieLaw3::LANG_DOMAIN ), 'https://github.com/diegolamonica/EUCookieLaw3/ ' ); ?>
165
164
</p>
166
165
<?php
167
166
$ this ->displayFBLike ();
168
167
}
169
168
170
169
public function outputMessagesSupport () {
171
170
?>
172
- <h3><?php _e ( "Save settings " , EUCookieLaw3::LANG_DOMAIN ); ?> </h3>
171
+ <h3><?php _e ( "Save settings " , EUCookieLaw3::LANG_DOMAIN ); ?> </h3>
173
172
174
173
175
174
<p>
176
- <p class="eucookielaw-info-submit"><strong>EUCookieLaw version <?php echo EUCookieLaw3::VERSION ?> </strong></p>
175
+ <p class="eucookielaw-info-submit"><strong>EUCookieLaw version <?php echo EUCookieLaw3::VERSION ?> </strong></p>
177
176
<p>
178
- <input type="hidden" name="nonce" value="<?php echo wp_create_nonce ( __CLASS__ ); ?> " />
177
+ <input type="hidden" name="nonce" value="<?php echo wp_create_nonce ( __CLASS__ ); ?> "/>
179
178
<input type="submit" name="submit" id="submit" class="button button-primary" value="<?php _e ( "Save " ); ?> ">
180
179
</p>
181
180
<?php
@@ -189,58 +188,62 @@ public function outputMessagesSupport() {
189
188
}
190
189
191
190
public function bannerMetabox () {
192
- if ( isset ( $ _POST ['nonce ' ] ) && wp_verify_nonce ( $ _POST ['nonce ' ], __CLASS__ ) ) {
191
+ if ( isset ( $ _POST [ 'nonce ' ] ) && wp_verify_nonce ( $ _POST [ 'nonce ' ], __CLASS__ ) ) {
193
192
194
193
$ _POST = stripslashes_deep ( $ _POST );
195
194
196
195
update_option ( EUCookieLaw3::OPT_SCRIPT , $ _POST [ 'banner ' ] );
197
196
update_option ( EUCookieLaw3::OPT_STYLE , $ _POST [ 'style ' ] );
198
- update_option ( EUCookieLaw3::OPT_REGISTER_CONSENT , isset ($ _POST [ 'consent ' ]) );
197
+ update_option ( EUCookieLaw3::OPT_REGISTER_CONSENT , isset ( $ _POST [ 'consent ' ] ) );
199
198
}
200
- $ script = get_option ( EUCookieLaw3::OPT_SCRIPT , '' );
199
+ $ script = get_option ( EUCookieLaw3::OPT_SCRIPT , '' );
201
200
$ consent = get_option ( EUCookieLaw3::OPT_REGISTER_CONSENT , false );
202
- $ style = get_option ( EUCookieLaw3::OPT_STYLE , false );
201
+ $ style = get_option ( EUCookieLaw3::OPT_STYLE , false );
203
202
204
- $ settings = array (
205
- 'codeEditor ' => wp_enqueue_code_editor ( array ( 'mode ' => 'text/html ' ) ),
206
- ) ;
203
+ $ settings = [
204
+ 'codeEditor ' => wp_enqueue_code_editor ( [ 'mode ' => 'text/html ' ] ),
205
+ ] ;
207
206
wp_enqueue_script ( 'wp-theme-plugin-editor ' );
208
207
209
208
?>
210
- <h3><?= __ ("What the hell?!?! " , EUCookieLaw3::LANG_DOMAIN ) ?> </h3>
209
+ <h3><?= __ ( "What the hell?!?! " , EUCookieLaw3::LANG_DOMAIN ) ?> </h3>
211
210
<p>
212
- <strong><?= __ ("Where are all EUCookieLaw settings??? " , EUCookieLaw3::LANG_DOMAIN ) ?> </strong><br />
213
- <?= __ ("Don't worry, nowdays all is more simple than in the past! Now you can use the <a href= \"https://diegolamonica.info/tools/eucookielaw/builder/ \">online Configuration Builder</a> to produce the right configuration for your site! " , EUCookieLaw3::LANG_DOMAIN ) ?>
211
+ <strong><?= __ ( "Where are all EUCookieLaw settings??? " , EUCookieLaw3::LANG_DOMAIN ) ?> </strong><br/>
212
+ <?= __ ( "Don't worry, nowdays all is more simple than in the past! Now you can use the <a href= \"https://diegolamonica.info/tools/eucookielaw/builder/ \">online Configuration Builder</a> to produce the right configuration for your site! " , EUCookieLaw3::LANG_DOMAIN ) ?>
214
213
</p>
215
214
<p></p>
216
215
217
- <label for="code-editor"><?php _e ( "EUCookieLaw Banner source code " , EUCookieLaw3::LANG_DOMAIN ); ?> </label></th>
216
+ <label
217
+ for="code-editor"><?php _e ( "EUCookieLaw Banner source code " , EUCookieLaw3::LANG_DOMAIN ); ?> </label></th>
218
218
219
219
<textarea id="code-editor" name="banner" cols="30" rows="18"
220
- class="large-text"><?= htmlspecialchars ($ script) ?> </textarea>
220
+ class="large-text"><?= htmlspecialchars ( $ script ) ?> </textarea>
221
221
<p class="help">
222
- <?= __ ( "Paste the code obtained from the builder " , EUCookieLaw3::LANG_DOMAIN ); ?>
222
+ <?= __ ( "Paste the code obtained from the builder " , EUCookieLaw3::LANG_DOMAIN ); ?>
223
223
</p>
224
224
<div>
225
225
<label>
226
- <input type="checkbox" value="1" name="consent" <?php checked ($ consent) ?> >
227
- <strong><?= __ ("Register user consent " , EUCookieLaw3::LANG_DOMAIN ) ?> </strong>
226
+ <input type="checkbox" value="1" name="consent" <?php checked ( $ consent ) ?> >
227
+ <strong><?= __ ( "Register user consent " , EUCookieLaw3::LANG_DOMAIN ) ?> </strong>
228
228
</label>
229
229
<p class="help">
230
- <?= __ ('Enable this flag if you want that all consents and rejections should be tracked ' , EUCookieLaw3::LANG_DOMAIN ); ?>
230
+ <?= __ ( 'Enable this flag if you want that all consents and rejections should be tracked ' , EUCookieLaw3::LANG_DOMAIN ); ?>
231
231
</p>
232
232
</div>
233
233
<div>
234
234
<label>
235
- <?= __ ("Select banner aspect: " , EUCookieLaw3::LANG_DOMAIN ); ?>
235
+ <?= __ ( "Select banner aspect: " , EUCookieLaw3::LANG_DOMAIN ); ?>
236
236
<select name="style">
237
- <option value="" <?php selected ($ style =='' ) ?> ><?= _e ( "No decoration " , EUCookieLaw3::LANG_DOMAIN ); ?> </option>
238
- <option value="bootstrap-like.css" <?php selected ($ style =='bootstrap-like.css ' ) ?> >Bootstrap Like</option>
239
- <option value="darky-miky.css" <?php selected ($ style =='darky-miky.css ' ) ?> >Dark Style</option>
237
+ <option
238
+ value="" <?php selected ( $ style == '' ) ?> ><?= __ ( "No decoration " , EUCookieLaw3::LANG_DOMAIN ); ?> </option>
239
+ <option value="bootstrap-like.css" <?php selected ( $ style == 'bootstrap-like.css ' ) ?> >Bootstrap
240
+ Like
241
+ </option>
242
+ <option value="darky-miky.css" <?php selected ( $ style == 'darky-miky.css ' ) ?> >Dark Style</option>
240
243
</select>
241
244
<p class="help">
242
- <?= sprintf (
243
- __ ("You can set a default style or you should define the rules for the Banner following the <a href= \"%s \">design guideguide documentation</a> " , EUCookieLaw3::LANG_DOMAIN ), "https://github.com/diegolamonica/EUCookieLaw3-themes " ); ?>
245
+ <?= sprintf (
246
+ __ ( "You can set a default style or you should define the rules for the Banner following the <a href= \"%s \">design guideguide documentation</a> " , EUCookieLaw3::LANG_DOMAIN ), "https://github.com/diegolamonica/EUCookieLaw3-themes " ); ?>
244
247
</p>
245
248
</label>
246
249
</div>
@@ -249,8 +252,8 @@ class="large-text"><?=htmlspecialchars($script)?></textarea>
249
252
250
253
public function tools () {
251
254
?>
252
- <h1><?= __ ("Useful resource for good people! " , EUCookieLaw3::LANG_DOMAIN ); ?> </h1>
253
- <?
255
+ <h1><?= __ ( "Useful resource for good people! " , EUCookieLaw3::LANG_DOMAIN ); ?> </h1>
256
+ <?php
254
257
255
258
$ response = wp_remote_get ( "https://diegolamonica.info/tools/eucookielaw/tools.json " );
256
259
@@ -264,31 +267,31 @@ public function tools() {
264
267
265
268
if ( ! $ toolsList ) {
266
269
_e ( "I am not able to retrieve useful resource list at the moment... please try later " , EUCookieLaw3::LANG_DOMAIN );
267
- }else {
270
+ } else {
268
271
269
272
?>
270
273
271
274
<p>
272
- <?= __ ("The following resources are not directly related to this plugin. " , EUCookieLaw3::LANG_DOMAIN ) ?>
275
+ <?= __ ( "The following resources are not directly related to this plugin. " , EUCookieLaw3::LANG_DOMAIN ) ?>
273
276
</p>
274
277
<p>
275
- <?= sprintf (
278
+ <?= sprintf (
276
279
277
- __ ("If you discover some useful resources online related to CookieLaw and GDPR and you want to share with all, " .
278
- "let me knwo at <a href= \"mailto:%s \">%1 \$s</a>. " , EUCookieLaw3::LANG_DOMAIN ),
279
- 'diego.lamonica@gmail.com ' );
280
- ?>
280
+ __ ( "If you discover some useful resources online related to CookieLaw and GDPR and you want to share with all, " .
281
+ "let me knwo at <a href= \"mailto:%s \">%1 \$s</a>. " , EUCookieLaw3::LANG_DOMAIN ),
282
+ 'diego.lamonica@gmail.com ' );
283
+ ?>
281
284
</p>
282
285
283
286
<ul class="tool-list">
284
287
<?php
285
288
foreach ( $ toolsList as $ item ) {
286
- if ( empty ($ item ->icon ) ){
289
+ if ( empty ( $ item ->icon ) ) {
287
290
$ item ->icon = plugins_url ( '/img/logo.png ' , __FILE__ );
288
291
}
289
292
?>
290
293
<li class="tool-item">
291
- <img class="tool-icon" src="<?= $ item ->icon ?> " alt="" />
294
+ <img class="tool-icon" src="<?= $ item ->icon ?> " alt=""/>
292
295
<div class="tool-info">
293
296
<h2 class="tool-title"><?= $ item ->title ?> </h2>
294
297
<p class="tool-description"><?= $ item ->description ?> </p>
@@ -351,7 +354,7 @@ public function setAdminColumns( $cols ) {
351
354
$ cols = [
352
355
'cb ' => '<input type="checkbox" /> ' ,
353
356
EUCookieLaw3::MD_CONSENTID => __ ( 'Consent Identifier ' , EUCookieLaw3::LANG_DOMAIN ),
354
- EUCookieLaw3::MD_SERVICE => __ ( 'Service ' , EUCookieLaw3::LANG_DOMAIN ),
357
+ EUCookieLaw3::MD_SERVICE => __ ( 'Service ' , EUCookieLaw3::LANG_DOMAIN ),
355
358
EUCookieLaw3::MD_STATUS => __ ( 'Consent status ' , EUCookieLaw3::LANG_DOMAIN ),
356
359
EUCookieLaw3::MD_WHEN => __ ( 'Since ' , EUCookieLaw3::LANG_DOMAIN ),
357
360
EUCookieLaw3::MD_USER_ADDRESS => __ ( 'IP Address ' , EUCookieLaw3::LANG_DOMAIN ),
@@ -383,13 +386,16 @@ public function showAdminColumns( $col ) {
383
386
384
387
385
388
public function registerStartupScripts () {
386
- wp_enqueue_script ('cm_xml ' );
387
- wp_enqueue_script ('cm_javascript ' );
388
- wp_enqueue_script ('cm_css ' );
389
- wp_enqueue_script ( __CLASS__ , plugins_url ( '/scripts/backend.js ' , __FILE__ ), [ 'jquery ' ,'wp-codemirror ' ], EUCookieLaw3::VERSION , false );
390
- wp_enqueue_style (__CLASS__ , plugins_url ( '/css/backend.css ' , __FILE__ ), [], EUCookieLaw3::VERSION , false );
391
- wp_enqueue_style ('codemirror ' );
392
- wp_enqueue_style ('cm_blackboard ' );
389
+ wp_enqueue_script ( 'cm_xml ' );
390
+ wp_enqueue_script ( 'cm_javascript ' );
391
+ wp_enqueue_script ( 'cm_css ' );
392
+ wp_enqueue_script ( __CLASS__ , plugins_url ( '/scripts/backend.js ' , __FILE__ ), [
393
+ 'jquery ' ,
394
+ 'wp-codemirror ' ,
395
+ ], EUCookieLaw3::VERSION , false );
396
+ wp_enqueue_style ( __CLASS__ , plugins_url ( '/css/backend.css ' , __FILE__ ), [], EUCookieLaw3::VERSION , false );
397
+ wp_enqueue_style ( 'codemirror ' );
398
+ wp_enqueue_style ( 'cm_blackboard ' );
393
399
}
394
400
395
401
public function saveEUCookieLawStatus ( $ postId ) {
0 commit comments