Cookie Notice by dFactory - Version 1.2.9

Version Description

  • Tweak: Enable HTML in cookie message text
  • New: Option to donate this plugin :)
Download this release

Release Info

Developer dfactory
Plugin Icon 128x128 Cookie Notice by dFactory
Version 1.2.9
Comparing to
See all releases

Code changes from version 1.2.8 to 1.2.9

Files changed (4) hide show
  1. cookie-notice.php +25 -20
  2. css/admin.css +2 -0
  3. js/admin.js +0 -1
  4. readme.txt +11 -4
cookie-notice.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Cookie Notice
4
  Description: Cookie Notice allows you to elegantly inform users that your site uses cookies and to comply with the EU cookie law regulations.
5
- Version: 1.2.8
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/cookie-notice/
@@ -53,7 +53,7 @@ class Cookie_Notice
53
  'translate' => true,
54
  'deactivation_delete' => 'no'
55
  ),
56
- 'version' => '1.2.8'
57
  );
58
  private $positions = array();
59
  private $styles = array();
@@ -152,11 +152,11 @@ class Cookie_Notice
152
  )
153
  );
154
 
155
- if($this->options['general']['translate'] === TRUE)
156
  {
157
- $this->options['general']['translate'] = FALSE;
158
 
159
- $this->options['general']['message_text'] = sanitize_text_field(__('We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.', 'cookie-notice'));
160
  $this->options['general']['accept_text'] = sanitize_text_field(__('Ok', 'cookie-notice'));
161
  $this->options['general']['see_more_opt']['text'] = sanitize_text_field(__('Read more', 'cookie-notice'));
162
 
@@ -178,7 +178,7 @@ class Cookie_Notice
178
  */
179
  public function load_textdomain()
180
  {
181
- load_plugin_textdomain('cookie-notice', FALSE, dirname(plugin_basename(__FILE__)).'/languages/');
182
  }
183
 
184
 
@@ -210,7 +210,13 @@ class Cookie_Notice
210
  <p class="inner"><a href="http://wordpress.org/support/view/plugin-reviews/cookie-notice" target="_blank" title="'.__('Rate it 5', 'cookie-notice').'">'.__('Rate it 5', 'cookie-notice').'</a> '.__('on WordPress.org', 'cookie-notice').'<br />'.
211
  __('Blog about it & link to the', 'cookie-notice').' <a href="http://dfactory.eu/plugins/cookie-notice/" target="_blank" title="'.__('plugin page', 'cookie-notice').'">'.__('plugin page', 'cookie-notice').'</a><br />'.
212
  __('Check out our other', 'cookie-notice').' <a href="http://dfactory.eu/plugins/" target="_blank" title="'.__('WordPress plugins', 'cookie-notice').'">'.__('WordPress plugins', 'cookie-notice').'</a>
213
- </p>
 
 
 
 
 
 
214
  <hr />
215
  <p class="df-link inner">Created by <a href="http://www.dfactory.eu" target="_blank" title="dFactory - Quality plugins for WordPress"><img src="'.plugins_url('/images/logo-dfactory.png' , __FILE__ ).'" title="dFactory - Quality plugins for WordPress" alt="dFactory - Quality plugins for WordPress" /></a></p>
216
  </div>
@@ -220,7 +226,7 @@ class Cookie_Notice
220
  wp_nonce_field('update-options');
221
  settings_fields('cookie_notice_options');
222
  do_settings_sections('cookie_notice_options');
223
- submit_button('', 'primary', 'save_cookie_notice_options', TRUE);
224
 
225
  echo '
226
  </form>
@@ -304,7 +310,7 @@ class Cookie_Notice
304
  $val = esc_attr($val);
305
 
306
  echo '
307
- <input id="cn-see-more-'.$val.'" type="radio" name="cookie_notice_options[see_more]" value="'.$val.'" '.checked($val, $this->options['general']['see_more'], FALSE).' />
308
  <label for="cn-see-more-'.$val.'">'.esc_html($trans).'</label>';
309
  }
310
 
@@ -321,7 +327,7 @@ class Cookie_Notice
321
  $val = esc_attr($val);
322
 
323
  echo '
324
- <input id="cn-see-more-link-'.$val.'" type="radio" name="cookie_notice_options[see_more_opt][link_type]" value="'.$val.'" '.checked($val, $this->options['general']['see_more_opt']['link_type'], FALSE).' />
325
  <label for="cn-see-more-link-'.$val.'">'.esc_html($trans).'</label>';
326
  }
327
 
@@ -330,12 +336,12 @@ class Cookie_Notice
330
  <p class="description">'.__('Select where to redirect user for more information about cookies.', 'cookie-notice').'</p>
331
  <div id="cn_see_more_opt_page"'.($this->options['general']['see_more_opt']['link_type'] === 'custom' ? ' style="display: none;"' : '').'>
332
  <select name="cookie_notice_options[see_more_opt][id]">
333
- <option value="empty" '.selected('empty', $this->options['general']['see_more_opt']['id'], FALSE).'>'.__('-- select page --', 'cookie-notice').'</option>';
334
 
335
  foreach($this->pages as $page)
336
  {
337
  echo '
338
- <option value="'.$page->ID.'" '.selected($page->ID, $this->options['general']['see_more_opt']['id'], FALSE).'>'.esc_html($page->post_title).'</option>';
339
  }
340
 
341
  echo '
@@ -400,7 +406,7 @@ class Cookie_Notice
400
  $val = esc_attr($val);
401
 
402
  echo '
403
- <input id="cn-hide-effect-'.$val.'" type="radio" name="cookie_notice_options[hide_effect]" value="'.$val.'" '.checked($val, $this->options['general']['hide_effect'], FALSE).' />
404
  <label for="cn-hide-effect-'.$val.'">'.esc_html($trans).'</label>';
405
  }
406
 
@@ -420,7 +426,7 @@ class Cookie_Notice
420
  $val = esc_attr($val);
421
 
422
  echo '
423
- <input id="cn-css-style-'.$val.'" type="radio" name="cookie_notice_options[css_style]" value="'.$val.'" '.checked($val, $this->options['general']['css_style'], FALSE).' />
424
  <label for="cn-css-style-'.$val.'">'.esc_html($trans).'</label>';
425
  }
426
 
@@ -462,7 +468,7 @@ class Cookie_Notice
462
  $input['colors']['bar'] = sanitize_text_field(isset($input['colors']['bar']) && $input['colors']['bar'] !== '' && preg_match('/^#[a-f0-9]{6}$/', $input['colors']['bar']) === 1 ? $input['colors']['bar'] : $this->defaults['general']['colors']['bar']);
463
 
464
  //texts
465
- $input['message_text'] = sanitize_text_field(isset($input['message_text']) && $input['message_text'] !== '' ? $input['message_text'] : $this->defaults['general']['message_text']);
466
  $input['accept_text'] = sanitize_text_field(isset($input['accept_text']) && $input['accept_text'] !== '' ? $input['accept_text'] : $this->defaults['general']['accept_text']);
467
 
468
  //css
@@ -491,7 +497,7 @@ class Cookie_Notice
491
  $input['see_more_opt']['id'] = ($input['see_more'] === 'yes' ? (int)$input['see_more_opt']['id'] : 'empty');
492
  }
493
 
494
- $input['translate'] = FALSE;
495
  }
496
 
497
  return $input;
@@ -511,7 +517,7 @@ class Cookie_Notice
511
  }
512
 
513
  if(function_exists('icl_object_id'))
514
- $this->options['general']['see_more_opt']['id'] = icl_object_id($this->options['general']['see_more_opt']['id'], 'page', TRUE);
515
 
516
  $options = apply_filters('cn_cookie_notice_args', array(
517
  'position' => $this->options['general']['position'],
@@ -526,7 +532,7 @@ class Cookie_Notice
526
  $output = '
527
  <div id="cookie-notice" class="cn-'.($options['position']).($options['css_style'] !== 'none' ? ' '.$options['css_style'] : '').'" style="color: '.$options['colors']['text'].'; background-color: '.$options['colors']['bar'].';">'
528
  .'<div class="cookie-notice-container">'
529
- .$options['message_text']
530
  .'<a href="" id="cn-accept-cookie" class="button'.($options['css_style'] !== 'none' ? ' '.$options['css_style'] : '').'">'.$options['accept_text'].'</a>'
531
  .($options['see_more'] === 'yes' ? '<a href="'.($options['see_more_opt']['link_type'] === 'custom' ? $options['see_more_opt']['link'] : get_permalink($options['see_more_opt']['id'])).'" target="_blank" class="button'.($options['css_style'] !== 'none' ? ' '.$options['css_style'] : '').'">'.$options['see_more_opt']['text'].'</a>' : '').'
532
  </div>
@@ -623,12 +629,11 @@ class Cookie_Notice
623
  wp_enqueue_script(
624
  'cookie-notice-admin',
625
  plugins_url('js/admin.js', __FILE__),
626
- array('jquery', 'jquery-ui-core', 'jquery-ui-button', 'wp-color-picker')
627
  );
628
 
629
  wp_enqueue_style('wp-color-picker');
630
  wp_enqueue_style('cookie-notice-admin', plugins_url('css/admin.css', __FILE__));
631
- wp_enqueue_style('cookie-notice-wplike', plugins_url('css/wp-like-ui-theme.css', __FILE__));
632
  }
633
 
634
 
2
  /*
3
  Plugin Name: Cookie Notice
4
  Description: Cookie Notice allows you to elegantly inform users that your site uses cookies and to comply with the EU cookie law regulations.
5
+ Version: 1.2.9
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/cookie-notice/
53
  'translate' => true,
54
  'deactivation_delete' => 'no'
55
  ),
56
+ 'version' => '1.2.9'
57
  );
58
  private $positions = array();
59
  private $styles = array();
152
  )
153
  );
154
 
155
+ if($this->options['general']['translate'] === true)
156
  {
157
+ $this->options['general']['translate'] = false;
158
 
159
+ $this->options['general']['message_text'] = esc_textarea(__('We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.', 'cookie-notice'));
160
  $this->options['general']['accept_text'] = sanitize_text_field(__('Ok', 'cookie-notice'));
161
  $this->options['general']['see_more_opt']['text'] = sanitize_text_field(__('Read more', 'cookie-notice'));
162
 
178
  */
179
  public function load_textdomain()
180
  {
181
+ load_plugin_textdomain('cookie-notice', false, dirname(plugin_basename(__FILE__)).'/languages/');
182
  }
183
 
184
 
210
  <p class="inner"><a href="http://wordpress.org/support/view/plugin-reviews/cookie-notice" target="_blank" title="'.__('Rate it 5', 'cookie-notice').'">'.__('Rate it 5', 'cookie-notice').'</a> '.__('on WordPress.org', 'cookie-notice').'<br />'.
211
  __('Blog about it & link to the', 'cookie-notice').' <a href="http://dfactory.eu/plugins/cookie-notice/" target="_blank" title="'.__('plugin page', 'cookie-notice').'">'.__('plugin page', 'cookie-notice').'</a><br />'.
212
  __('Check out our other', 'cookie-notice').' <a href="http://dfactory.eu/plugins/" target="_blank" title="'.__('WordPress plugins', 'cookie-notice').'">'.__('WordPress plugins', 'cookie-notice').'</a>
213
+ </p>
214
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank" class="inner">
215
+ <input type="hidden" name="cmd" value="_s-xclick">
216
+ <input type="hidden" name="hosted_button_id" value="38CLZJPBEN9ZW">
217
+ <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
218
+ <img alt="" border="0" src="https://www.paypalobjects.com/pl_PL/i/scr/pixel.gif" width="1" height="1">
219
+ </form>
220
  <hr />
221
  <p class="df-link inner">Created by <a href="http://www.dfactory.eu" target="_blank" title="dFactory - Quality plugins for WordPress"><img src="'.plugins_url('/images/logo-dfactory.png' , __FILE__ ).'" title="dFactory - Quality plugins for WordPress" alt="dFactory - Quality plugins for WordPress" /></a></p>
222
  </div>
226
  wp_nonce_field('update-options');
227
  settings_fields('cookie_notice_options');
228
  do_settings_sections('cookie_notice_options');
229
+ submit_button('', 'primary', 'save_cookie_notice_options', true);
230
 
231
  echo '
232
  </form>
310
  $val = esc_attr($val);
311
 
312
  echo '
313
+ <input id="cn-see-more-'.$val.'" type="radio" name="cookie_notice_options[see_more]" value="'.$val.'" '.checked($val, $this->options['general']['see_more'], false).' />
314
  <label for="cn-see-more-'.$val.'">'.esc_html($trans).'</label>';
315
  }
316
 
327
  $val = esc_attr($val);
328
 
329
  echo '
330
+ <input id="cn-see-more-link-'.$val.'" type="radio" name="cookie_notice_options[see_more_opt][link_type]" value="'.$val.'" '.checked($val, $this->options['general']['see_more_opt']['link_type'], false).' />
331
  <label for="cn-see-more-link-'.$val.'">'.esc_html($trans).'</label>';
332
  }
333
 
336
  <p class="description">'.__('Select where to redirect user for more information about cookies.', 'cookie-notice').'</p>
337
  <div id="cn_see_more_opt_page"'.($this->options['general']['see_more_opt']['link_type'] === 'custom' ? ' style="display: none;"' : '').'>
338
  <select name="cookie_notice_options[see_more_opt][id]">
339
+ <option value="empty" '.selected('empty', $this->options['general']['see_more_opt']['id'], false).'>'.__('-- select page --', 'cookie-notice').'</option>';
340
 
341
  foreach($this->pages as $page)
342
  {
343
  echo '
344
+ <option value="'.$page->ID.'" '.selected($page->ID, $this->options['general']['see_more_opt']['id'], false).'>'.esc_html($page->post_title).'</option>';
345
  }
346
 
347
  echo '
406
  $val = esc_attr($val);
407
 
408
  echo '
409
+ <input id="cn-hide-effect-'.$val.'" type="radio" name="cookie_notice_options[hide_effect]" value="'.$val.'" '.checked($val, $this->options['general']['hide_effect'], false).' />
410
  <label for="cn-hide-effect-'.$val.'">'.esc_html($trans).'</label>';
411
  }
412
 
426
  $val = esc_attr($val);
427
 
428
  echo '
429
+ <input id="cn-css-style-'.$val.'" type="radio" name="cookie_notice_options[css_style]" value="'.$val.'" '.checked($val, $this->options['general']['css_style'], false).' />
430
  <label for="cn-css-style-'.$val.'">'.esc_html($trans).'</label>';
431
  }
432
 
468
  $input['colors']['bar'] = sanitize_text_field(isset($input['colors']['bar']) && $input['colors']['bar'] !== '' && preg_match('/^#[a-f0-9]{6}$/', $input['colors']['bar']) === 1 ? $input['colors']['bar'] : $this->defaults['general']['colors']['bar']);
469
 
470
  //texts
471
+ $input['message_text'] = wp_kses_post(isset($input['message_text']) && $input['message_text'] !== '' ? $input['message_text'] : $this->defaults['general']['message_text']);
472
  $input['accept_text'] = sanitize_text_field(isset($input['accept_text']) && $input['accept_text'] !== '' ? $input['accept_text'] : $this->defaults['general']['accept_text']);
473
 
474
  //css
497
  $input['see_more_opt']['id'] = ($input['see_more'] === 'yes' ? (int)$input['see_more_opt']['id'] : 'empty');
498
  }
499
 
500
+ $input['translate'] = false;
501
  }
502
 
503
  return $input;
517
  }
518
 
519
  if(function_exists('icl_object_id'))
520
+ $this->options['general']['see_more_opt']['id'] = icl_object_id($this->options['general']['see_more_opt']['id'], 'page', true);
521
 
522
  $options = apply_filters('cn_cookie_notice_args', array(
523
  'position' => $this->options['general']['position'],
532
  $output = '
533
  <div id="cookie-notice" class="cn-'.($options['position']).($options['css_style'] !== 'none' ? ' '.$options['css_style'] : '').'" style="color: '.$options['colors']['text'].'; background-color: '.$options['colors']['bar'].';">'
534
  .'<div class="cookie-notice-container">'
535
+ .wpautop($options['message_text'])
536
  .'<a href="" id="cn-accept-cookie" class="button'.($options['css_style'] !== 'none' ? ' '.$options['css_style'] : '').'">'.$options['accept_text'].'</a>'
537
  .($options['see_more'] === 'yes' ? '<a href="'.($options['see_more_opt']['link_type'] === 'custom' ? $options['see_more_opt']['link'] : get_permalink($options['see_more_opt']['id'])).'" target="_blank" class="button'.($options['css_style'] !== 'none' ? ' '.$options['css_style'] : '').'">'.$options['see_more_opt']['text'].'</a>' : '').'
538
  </div>
629
  wp_enqueue_script(
630
  'cookie-notice-admin',
631
  plugins_url('js/admin.js', __FILE__),
632
+ array('jquery', 'wp-color-picker')
633
  );
634
 
635
  wp_enqueue_style('wp-color-picker');
636
  wp_enqueue_style('cookie-notice-admin', plugins_url('css/admin.css', __FILE__));
 
637
  }
638
 
639
 
css/admin.css CHANGED
@@ -4,6 +4,8 @@
4
  .df-credits h3 { font-size: 14px; line-height: 1.4; margin: 0; padding: 8px 12px; border-bottom: 1px solid #eee; }
5
  .df-credits .df-link { font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; font-style:italic; padding-bottom: 10px; margin: 0; }
6
  .df-credits .df-link a { vertical-align: middle; padding: 5px 0 0 4px; }
 
 
7
  .cookie-notice-settings { margin-right: 300px; }
8
  .cookie-notice-settings hr, .df-credits hr { border: solid #eee; border-width: 1px 0 0; clear: both; height: 0; }
9
  .cookie-notice-settings form { float: left; min-width: 463px; width: 100%; }
4
  .df-credits h3 { font-size: 14px; line-height: 1.4; margin: 0; padding: 8px 12px; border-bottom: 1px solid #eee; }
5
  .df-credits .df-link { font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; font-style:italic; padding-bottom: 10px; margin: 0; }
6
  .df-credits .df-link a { vertical-align: middle; padding: 5px 0 0 4px; }
7
+ .cookie-notice-settings .df-credits form { min-width: 260px; margin-bottom: 1em; }
8
+ .cookie-notice-settings .df-credits form input { margin: 0; padding: 0; }
9
  .cookie-notice-settings { margin-right: 300px; }
10
  .cookie-notice-settings hr, .df-credits hr { border: solid #eee; border-width: 1px 0 0; clear: both; height: 0; }
11
  .cookie-notice-settings form { float: left; min-width: 463px; width: 100%; }
js/admin.js CHANGED
@@ -1,6 +1,5 @@
1
  jQuery(document).ready(function($) {
2
 
3
- $('#cn_position, #cn_hide_effect, #cn_see_more, #cn_css_style, #cn_see_more_opt_custom_link').buttonset();
4
  $('.cn-color').wpColorPicker();
5
 
6
  $('#cn-see-more-yes, #cn-see-more-no').change(function() {
1
  jQuery(document).ready(function($) {
2
 
 
3
  $('.cn-color').wpColorPicker();
4
 
5
  $('#cn-see-more-yes, #cn-see-more-no').change(function() {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.dfactory.eu/
4
  Tags: cookie, cookies, notice, notification, notify, cookie, cookie compliance, cookie law, eu cookie, privacy, privacy directive, consent, Bootstrap
5
  Requires at least: 3.3
6
  Tested up to: 3.9.2
7
- Stable tag: 1.2.8
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
@@ -28,9 +28,11 @@ For more information, check out plugin page at [dFactory](http://www.dfactory.eu
28
  * .pot file for translations included
29
 
30
  = Translations: =
31
- * German - by Alex Ernst
 
32
  * Dutch - by [Heleen van den Bos](http://www.bostekst.nl/)
33
  * French - by [Laura Orsal](http://www.traductrice-independante.fr)
 
34
  * Polish - by Bartosz Arendt
35
  * Portuguese - by Luis Maia
36
  * Spanish - by Fernando Blasco
@@ -52,6 +54,10 @@ No questions yet.
52
 
53
  == Changelog ==
54
 
 
 
 
 
55
  = 1.2.8 =
56
  * New: Czech translation, thanks to [Adam Laita](http://laita.cz)
57
 
@@ -97,5 +103,6 @@ Initial release
97
 
98
  == Upgrade Notice ==
99
 
100
- = 1.2.8 =
101
- * New: Czech translation, thanks to [Adam Laita](http://laita.cz)
 
4
  Tags: cookie, cookies, notice, notification, notify, cookie, cookie compliance, cookie law, eu cookie, privacy, privacy directive, consent, Bootstrap
5
  Requires at least: 3.3
6
  Tested up to: 3.9.2
7
+ Stable tag: 1.2.9
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
28
  * .pot file for translations included
29
 
30
  = Translations: =
31
+
32
+ * Czech - by [Adam Laita](http://laita.cz)
33
  * Dutch - by [Heleen van den Bos](http://www.bostekst.nl/)
34
  * French - by [Laura Orsal](http://www.traductrice-independante.fr)
35
+ * German - by Alex Ernst
36
  * Polish - by Bartosz Arendt
37
  * Portuguese - by Luis Maia
38
  * Spanish - by Fernando Blasco
54
 
55
  == Changelog ==
56
 
57
+ = 1.2.9 =
58
+ * Tweak: Enable HTML in cookie message text
59
+ * New: Option to donate this plugin :)
60
+
61
  = 1.2.8 =
62
  * New: Czech translation, thanks to [Adam Laita](http://laita.cz)
63
 
103
 
104
  == Upgrade Notice ==
105
 
106
+ = 1.2.9 =
107
+ * Tweak: Enable HTML in cookie message text
108
+ * New: Option to donate this plugin :)