Cookie Notice by dFactory - Version 1.2.0

Version Description

  • Fix: Cookie not saving in IE
  • Fix: Notice hidden under Admin bar bug
  • Tweak: Improved WPML & Polylang compatibility
Download this release

Release Info

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

Code changes from version 1.1.0 to 1.2.0

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.1.0
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/cookie-notice/
@@ -41,7 +41,8 @@ class Cookie_Notice
41
  'link_type' => 'custom',
42
  'id' => 'empty',
43
  'link' => ''
44
- )
 
45
  );
46
  private $positions = array();
47
  private $styles = array();
@@ -63,6 +64,11 @@ class Cookie_Notice
63
  register_activation_hook(__FILE__, array(&$this, 'activation'));
64
  register_deactivation_hook(__FILE__, array(&$this, 'deactivation'));
65
 
 
 
 
 
 
66
  //actions
67
  add_action('admin_init', array(&$this, 'register_settings'));
68
  add_action('admin_menu', array(&$this, 'admin_menu_options'));
@@ -135,7 +141,23 @@ class Cookie_Notice
135
  )
136
  );
137
 
138
- $this->options = get_option('cookie_notice_options');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  }
140
 
141
 
@@ -243,9 +265,11 @@ class Cookie_Notice
243
 
244
  foreach($this->choices as $val => $trans)
245
  {
 
 
246
  echo '
247
- <input id="cn-see-more-'.$val.'" type="radio" name="cookie_notice_options[see_more]" value="'.esc_attr($val).'" '.checked($val, $this->options['see_more'], FALSE).' />
248
- <label for="cn-see-more-'.$val.'">'.$trans.'</label>';
249
  }
250
 
251
  echo '
@@ -258,9 +282,11 @@ class Cookie_Notice
258
 
259
  foreach($this->links as $val => $trans)
260
  {
 
 
261
  echo '
262
- <input id="cn-see-more-link-'.$val.'" type="radio" name="cookie_notice_options[see_more_opt][link_type]" value="'.esc_attr($val).'" '.checked($val, $this->options['see_more_opt']['link_type'], FALSE).' />
263
- <label for="cn-see-more-link-'.$val.'">'.$trans.'</label>';
264
  }
265
 
266
  echo '
@@ -273,7 +299,7 @@ class Cookie_Notice
273
  foreach($this->pages as $page)
274
  {
275
  echo '
276
- <option value="'.$page->ID.'" '.selected($page->ID, $this->options['see_more_opt']['id'], FALSE).'>'.$page->post_title.'</option>';
277
  }
278
 
279
  echo '
@@ -296,7 +322,9 @@ class Cookie_Notice
296
 
297
  foreach($this->times as $time => $arr)
298
  {
299
- echo '<option value="'.$time.'" '.selected($time, $this->options['time']).'>'.$arr[0].'</option>';
 
 
300
  }
301
 
302
  echo '
@@ -313,9 +341,11 @@ class Cookie_Notice
313
 
314
  foreach($this->positions as $val => $trans)
315
  {
 
 
316
  echo '
317
- <input id="cn-position-'.$val.'" type="radio" name="cookie_notice_options[position]" value="'.esc_attr($val).'" '.checked($val, $this->options['position'], FALSE).' />
318
- <label for="cn-position-'.$val.'">'.$trans.'</label>';
319
  }
320
 
321
  echo '
@@ -331,9 +361,11 @@ class Cookie_Notice
331
 
332
  foreach($this->effects as $val => $trans)
333
  {
 
 
334
  echo '
335
- <input id="cn-hide-effect-'.$val.'" type="radio" name="cookie_notice_options[hide_effect]" value="'.esc_attr($val).'" '.checked($val, $this->options['hide_effect'], FALSE).' />
336
- <label for="cn-hide-effect-'.$val.'">'.$trans.'</label>';
337
  }
338
 
339
  echo '
@@ -349,9 +381,11 @@ class Cookie_Notice
349
 
350
  foreach($this->styles as $val => $trans)
351
  {
 
 
352
  echo '
353
- <input id="cn-css-style-'.$val.'" type="radio" name="cookie_notice_options[css_style]" value="'.esc_attr($val).'" '.checked($val, $this->options['css_style'], FALSE).' />
354
- <label for="cn-css-style-'.$val.'">'.$trans.'</label>';
355
  }
356
 
357
  echo '
@@ -367,8 +401,10 @@ class Cookie_Notice
367
 
368
  foreach($this->colors as $val => $trans)
369
  {
 
 
370
  echo '
371
- <p><label>'.$trans.'</label>
372
  <input class="cn-color" type="text" name="cookie_notice_options[colors]['.$val.']" value="'.esc_attr($this->options['colors'][$val]).'" />'.
373
  '</p>';
374
  }
@@ -415,6 +451,8 @@ class Cookie_Notice
415
  {
416
  $input['see_more_opt']['id'] = ($input['see_more'] === 'yes' ? (int)$input['see_more_opt']['id'] : 'empty');
417
  }
 
 
418
  }
419
 
420
  return $input;
@@ -425,12 +463,19 @@ class Cookie_Notice
425
  {
426
  if(!(isset($_COOKIE[$this->cookie['name']]) && $_COOKIE[$this->cookie['name']] === $this->cookie['value']))
427
  {
 
 
 
 
 
 
 
428
  echo '
429
  <div id="cookie-notice" class="cn-'.($this->options['position']).($this->options['css_style'] !== 'none' ? ' '.$this->options['css_style'] : '').'" style="color: '.$this->options['colors']['text'].'; background-color: '.$this->options['colors']['bar'].';">'
430
  .'<div class="cookie-notice-container">'
431
  .$this->options['message_text']
432
  .'<a href="" id="cn-accept-cookie" class="button'.($this->options['css_style'] !== 'none' ? ' '.$this->options['css_style'] : '').'">'.$this->options['accept_text'].'</a>'
433
- .($this->options['see_more'] === 'yes' ? '<a href="'.($this->options['see_more_opt']['link_type'] === 'custom' ? $this->options['see_more_opt']['link'] : get_permalink($this->options['see_more_opt']['id'])).'" class="button'.($this->options['css_style'] !== 'none' ? ' '.$this->options['css_style'] : '').'">'.apply_filters('cn_see_more_text', $this->options['see_more_opt']['text']).'</a>' : '').'
434
  </div>
435
  </div>';
436
  }
@@ -485,8 +530,6 @@ class Cookie_Notice
485
  */
486
  public function activation()
487
  {
488
- $this->set_translations();
489
-
490
  add_option('cookie_notice_options', $this->defaults, '', 'no');
491
  }
492
 
@@ -500,14 +543,6 @@ class Cookie_Notice
500
  }
501
 
502
 
503
- private function set_translations()
504
- {
505
- $this->defaults['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'));
506
- $this->defaults['accept_text'] = sanitize_text_field(__('Ok', 'cookie-notice'));
507
- $this->defaults['see_more_opt']['text'] = sanitize_text_field(__('Read more', 'cookie-notice'));
508
- }
509
-
510
-
511
  /**
512
  * Loads scripts and styles - admin side
513
  */
@@ -550,8 +585,8 @@ class Cookie_Notice
550
  'cookieName' => $this->cookie['name'],
551
  'cookieValue' => $this->cookie['value'],
552
  'cookieTime' => $this->times[$this->options['time']][1],
553
- 'cookiePath' => COOKIEPATH,
554
- 'cookieDomain' => COOKIE_DOMAIN
555
  )
556
  );
557
 
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.0
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/cookie-notice/
41
  'link_type' => 'custom',
42
  'id' => 'empty',
43
  'link' => ''
44
+ ),
45
+ 'translate' => TRUE
46
  );
47
  private $positions = array();
48
  private $styles = array();
64
  register_activation_hook(__FILE__, array(&$this, 'activation'));
65
  register_deactivation_hook(__FILE__, array(&$this, 'deactivation'));
66
 
67
+ //settings
68
+ $this->options = array_merge(
69
+ (($options = get_option('cookie_notice_options')) === FALSE ? $this->defaults : array_merge($this->defaults, $options))
70
+ );
71
+
72
  //actions
73
  add_action('admin_init', array(&$this, 'register_settings'));
74
  add_action('admin_menu', array(&$this, 'admin_menu_options'));
141
  )
142
  );
143
 
144
+ if($this->options['translate'] === TRUE)
145
+ {
146
+ $this->options['translate'] = FALSE;
147
+
148
+ $this->options['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'));
149
+ $this->options['accept_text'] = sanitize_text_field(__('Ok', 'cookie-notice'));
150
+ $this->options['see_more_opt']['text'] = sanitize_text_field(__('Read more', 'cookie-notice'));
151
+
152
+ update_option('cookie_notice_options', $this->options);
153
+ }
154
+
155
+ if(function_exists('icl_register_string'))
156
+ {
157
+ icl_register_string('Cookie Notice', 'Message in the notice', $this->options['message_text']);
158
+ icl_register_string('Cookie Notice', 'Button text', $this->options['accept_text']);
159
+ icl_register_string('Cookie Notice', 'Read more text', $this->options['see_more_opt']['text']);
160
+ }
161
  }
162
 
163
 
265
 
266
  foreach($this->choices as $val => $trans)
267
  {
268
+ $val = esc_attr($val);
269
+
270
  echo '
271
+ <input id="cn-see-more-'.$val.'" type="radio" name="cookie_notice_options[see_more]" value="'.$val.'" '.checked($val, $this->options['see_more'], FALSE).' />
272
+ <label for="cn-see-more-'.$val.'">'.esc_html($trans).'</label>';
273
  }
274
 
275
  echo '
282
 
283
  foreach($this->links as $val => $trans)
284
  {
285
+ $val = esc_attr($val);
286
+
287
  echo '
288
+ <input id="cn-see-more-link-'.$val.'" type="radio" name="cookie_notice_options[see_more_opt][link_type]" value="'.$val.'" '.checked($val, $this->options['see_more_opt']['link_type'], FALSE).' />
289
+ <label for="cn-see-more-link-'.$val.'">'.esc_html($trans).'</label>';
290
  }
291
 
292
  echo '
299
  foreach($this->pages as $page)
300
  {
301
  echo '
302
+ <option value="'.$page->ID.'" '.selected($page->ID, $this->options['see_more_opt']['id'], FALSE).'>'.esc_html($page->post_title).'</option>';
303
  }
304
 
305
  echo '
322
 
323
  foreach($this->times as $time => $arr)
324
  {
325
+ $time = esc_attr($time);
326
+
327
+ echo '<option value="'.$time.'" '.selected($time, $this->options['time']).'>'.esc_html($arr[0]).'</option>';
328
  }
329
 
330
  echo '
341
 
342
  foreach($this->positions as $val => $trans)
343
  {
344
+ $val = esc_attr($val);
345
+
346
  echo '
347
+ <input id="cn-position-'.$val.'" type="radio" name="cookie_notice_options[position]" value="'.$val.'" '.checked($val, $this->options['position'], FALSE).' />
348
+ <label for="cn-position-'.$val.'">'.esc_html($trans).'</label>';
349
  }
350
 
351
  echo '
361
 
362
  foreach($this->effects as $val => $trans)
363
  {
364
+ $val = esc_attr($val);
365
+
366
  echo '
367
+ <input id="cn-hide-effect-'.$val.'" type="radio" name="cookie_notice_options[hide_effect]" value="'.$val.'" '.checked($val, $this->options['hide_effect'], FALSE).' />
368
+ <label for="cn-hide-effect-'.$val.'">'.esc_html($trans).'</label>';
369
  }
370
 
371
  echo '
381
 
382
  foreach($this->styles as $val => $trans)
383
  {
384
+ $val = esc_attr($val);
385
+
386
  echo '
387
+ <input id="cn-css-style-'.$val.'" type="radio" name="cookie_notice_options[css_style]" value="'.$val.'" '.checked($val, $this->options['css_style'], FALSE).' />
388
+ <label for="cn-css-style-'.$val.'">'.esc_html($trans).'</label>';
389
  }
390
 
391
  echo '
401
 
402
  foreach($this->colors as $val => $trans)
403
  {
404
+ $val = esc_attr($val);
405
+
406
  echo '
407
+ <p><label>'.esc_html($trans).'</label>
408
  <input class="cn-color" type="text" name="cookie_notice_options[colors]['.$val.']" value="'.esc_attr($this->options['colors'][$val]).'" />'.
409
  '</p>';
410
  }
451
  {
452
  $input['see_more_opt']['id'] = ($input['see_more'] === 'yes' ? (int)$input['see_more_opt']['id'] : 'empty');
453
  }
454
+
455
+ $input['translate'] = FALSE;
456
  }
457
 
458
  return $input;
463
  {
464
  if(!(isset($_COOKIE[$this->cookie['name']]) && $_COOKIE[$this->cookie['name']] === $this->cookie['value']))
465
  {
466
+ if(function_exists('icl_t'))
467
+ {
468
+ $this->options['message_text'] = icl_t('Cookie Notice', 'Message in the notice', $this->options['message_text']);
469
+ $this->options['accept_text'] = icl_t('Cookie Notice', 'Button text', $this->options['accept_text']);
470
+ $this->options['see_more_opt']['text'] = icl_t('Cookie Notice', 'Read more text', $this->options['see_more_opt']['text']);
471
+ }
472
+
473
  echo '
474
  <div id="cookie-notice" class="cn-'.($this->options['position']).($this->options['css_style'] !== 'none' ? ' '.$this->options['css_style'] : '').'" style="color: '.$this->options['colors']['text'].'; background-color: '.$this->options['colors']['bar'].';">'
475
  .'<div class="cookie-notice-container">'
476
  .$this->options['message_text']
477
  .'<a href="" id="cn-accept-cookie" class="button'.($this->options['css_style'] !== 'none' ? ' '.$this->options['css_style'] : '').'">'.$this->options['accept_text'].'</a>'
478
+ .($this->options['see_more'] === 'yes' ? '<a href="'.($this->options['see_more_opt']['link_type'] === 'custom' ? $this->options['see_more_opt']['link'] : get_permalink($this->options['see_more_opt']['id'])).'" class="button'.($this->options['css_style'] !== 'none' ? ' '.$this->options['css_style'] : '').'">'.$this->options['see_more_opt']['text'].'</a>' : '').'
479
  </div>
480
  </div>';
481
  }
530
  */
531
  public function activation()
532
  {
 
 
533
  add_option('cookie_notice_options', $this->defaults, '', 'no');
534
  }
535
 
543
  }
544
 
545
 
 
 
 
 
 
 
 
 
546
  /**
547
  * Loads scripts and styles - admin side
548
  */
585
  'cookieName' => $this->cookie['name'],
586
  'cookieValue' => $this->cookie['value'],
587
  'cookieTime' => $this->times[$this->options['time']][1],
588
+ 'cookiePath' => (defined('COOKIEPATH') ? COOKIEPATH : ''),
589
+ 'cookieDomain' => (defined('COOKIE_DOMAIN') ? COOKIE_DOMAIN : '')
590
  )
591
  );
592
 
css/cookie-notice-admin.css DELETED
@@ -1,13 +0,0 @@
1
- .cookie-notice { width:68%; margin-right:20px; }
2
- .cookie-notice h3 { font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", sans-serif; font-weight: bold; }
3
- .cookie-notice hr, .df-credits hr { border: solid #ddd; border-width: 1px 0 0; clear: both; height: 0; -moz-box-shadow: 0px 1px 0px #fff; -webkit-box-shadow: 0px 1px 0px #fff; box-shadow: 0px 1px 0px #fff; margin:15px 0; }
4
- .cookie-notice .form-table { border-bottom:1px solid #ddd; margin-bottom:20px; }
5
- .cookie-notice .form-table input { width: 25em; }
6
- #cn_colors label { min-width: 10em; display:inline-block; }
7
- #cn_colors div { vertical-align:middle; }
8
- .df-credits { width:28%; max-width:350px; margin-top:20px; border:1px solid #ddd; background:#fcfcfc; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; }
9
- .df-credits h3 { margin-top:5px; }
10
- .df-credits h3.metabox-title { background: #f9f9f9 url(images/bg_fallback.png) 0 -50px repeat-x; background: -moz-linear-gradient(top, #2e9fd2 0%, #21759B 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#2e9fd2), color-stop(100%,#21759B)); background: -webkit-linear-gradient(top, #2e9fd2 0%,#21759B 100%); background: -o-linear-gradient(top, #2e9fd2 0%,#21759B 100%); background: -ms-linear-gradient(top, #2e9fd2 0%,#21759B 100%); background: linear-gradient(top, #2e9fd2 0%,#21759B 100%); -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset; -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset; border: 1px solid; border-color: #21759b; border-bottom-color: #1e6a8d; -webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.5); box-shadow: inset 0 1px 0 rgba(120,200,230,0.5); color: #fff; text-decoration: none; text-shadow: 0 1px 0 rgba(0,0,0,0.5); margin:0; line-height:32px; font-weight:normal; padding:0 10px; }
11
- .df-credits .inner { padding:15px 10px; }
12
- .df-credits .df-link { font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; font-style:italic; margin:0; }
13
- .df-credits .df-link a { vertical-align: middle; padding: 5px 0 0 4px; }
 
 
 
 
 
 
 
 
 
 
 
 
 
css/cookie-notice-front.css DELETED
@@ -1,86 +0,0 @@
1
- #cookie-notice {
2
- position: fixed;
3
- min-width: 100%;
4
- height: auto;
5
- z-index: 999;
6
- font-size:12px;
7
- line-height:18px;
8
- }
9
- .cookie-notice-container { padding:10px; }
10
- .cn-top { top:0; }
11
- .cn-bottom { bottom:0; }
12
- #cookie-notice .button { margin-left: 10px; }
13
- #cookie-notice .button.wp-default {
14
- font-family: sans-serif;
15
- line-height: 18px;
16
- padding: 2px 12px;
17
- background: linear-gradient(to bottom, #FEFEFE, #F4F4F4) repeat scroll 0 0 #F3F3F3;
18
- border-color: #BBB;
19
- color: #333;
20
- text-shadow: 0 1px 0 #FFF;
21
- -moz-box-sizing: border-box;
22
- border-radius: 3px 3px 3px 3px;
23
- border-style: solid;
24
- border-width: 1px;
25
- cursor: pointer;
26
- display: inline-block;
27
- font-size: 12px;
28
- font-style:normal;
29
- text-decoration: none;
30
- white-space: nowrap;
31
- outline: none;
32
- }
33
- #cookie-notice .button.wp-default:hover, #cookie-notice .button.wp-default:focus {
34
- background: linear-gradient(to bottom, #FFFFFF, #F3F3F3) repeat scroll 0 0 #F3F3F3;
35
- border-color: #999999;
36
- color: #222222;
37
- }
38
- #cookie-notice .button.bootstrap {
39
- font-family: sans-serif;
40
- display: inline-block;
41
- *display: inline;
42
- padding: 4px 12px;
43
- margin-right:0.3em;
44
- margin-bottom: 0;
45
- *margin-left: .3em;
46
- line-height: 20px;
47
- color: #333333;
48
- text-align: center;
49
- text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
50
- font-style:normal;
51
- vertical-align: middle;
52
- cursor: pointer;
53
- color: #ffffff;
54
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
55
- background-color: #006dcc;
56
- *background-color: #0044cc;
57
- background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
58
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
59
- background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
60
- background-image: -o-linear-gradient(top, #0088cc, #0044cc);
61
- background-image: linear-gradient(to bottom, #0088cc, #0044cc);
62
- background-repeat: repeat-x;
63
- border-style: solid;
64
- border-width: 1px;
65
- border-color: #0044cc #0044cc #002a80;
66
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
67
- box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05);
68
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);
69
- filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
70
- padding: 2px 10px;
71
- font-size: 12px;
72
- text-decoration: none;
73
- -webkit-border-radius: 3px;
74
- -moz-border-radius: 3px;
75
- border-radius: 3px;
76
- outline:none;
77
- }
78
- #cookie-notice .button.bootstrap:hover, #cookie-notice .button.bootstrap:focus {
79
- color: #ffffff;
80
- background-color: #0044cc;
81
- *background-color: #003bb3;background-position: 0 -15px;
82
- -webkit-transition: background-position 0.1s linear;
83
- -moz-transition: background-position 0.1s linear;
84
- -o-transition: background-position 0.1s linear;
85
- transition: background-position 0.1s linear;
86
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/front.css CHANGED
@@ -3,7 +3,7 @@
3
  position: fixed;
4
  min-width: 100%;
5
  height: auto;
6
- z-index: 999;
7
  font-size: 12px;
8
  line-height: 18px;
9
  left: 0;
3
  position: fixed;
4
  min-width: 100%;
5
  height: auto;
6
+ z-index: 100000;
7
  font-size: 12px;
8
  line-height: 18px;
9
  left: 0;
js/cookie-notice-admin.js DELETED
@@ -1,35 +0,0 @@
1
- jQuery(document).ready(function($) {
2
-
3
- //.click(function() { e.preventDefault(); })
4
- $('#cn_position, #cn_hide_effect, #cn_see_more, #cn_css_style, #cn_see_more_opt_custom_link').buttonset();
5
-
6
- $('.cn-color').wpColorPicker();
7
-
8
- $('#cn-see-more-yes, #cn-see-more-no').change(function()
9
- {
10
- if($('#cn-see-more-yes:checked').val() === 'yes')
11
- {
12
- $('#cn_see_more_opt').fadeIn(300);
13
- }
14
- else if($('#cn-see-more-no:checked').val() === 'no')
15
- {
16
- $('#cn_see_more_opt').fadeOut(300);
17
- }
18
- });
19
-
20
- $('#cn-see-more-link-custom, #cn-see-more-link-page').change(function()
21
- {
22
- if($('#cn-see-more-link-custom:checked').val() === 'custom')
23
- {
24
- $('#cn_see_more_opt_page').fadeOut(300, function() {
25
- $('#cn_see_more_opt_link').fadeIn(300);
26
- });
27
- }
28
- else if($('#cn-see-more-link-page:checked').val() === 'page')
29
- {
30
- $('#cn_see_more_opt_link').fadeOut(300, function() {
31
- $('#cn_see_more_opt_page').fadeIn(300);
32
- });
33
- }
34
- });
35
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/cookie-notice-front.js DELETED
@@ -1,49 +0,0 @@
1
- jQuery(document).ready(function($) {
2
-
3
- $(document).on('click', '#cn-accept-cookie', function(event) {
4
- event.preventDefault();
5
- $.ajax({
6
- type: 'POST',
7
- url: cnArgs.ajaxurl,
8
- data: {
9
- action: 'cn-save-cookie'
10
- },
11
- dataType: 'html'
12
- })
13
- .done(function(data) {
14
- if(data === 'CN_OK') {
15
- cnHideFrontBox();
16
- } else {
17
- cnSetCookie();
18
- cnHideFrontBox();
19
- }
20
- }).fail(function(data) {
21
- cnSetCookie();
22
- cnHideFrontBox();
23
- });
24
- });
25
-
26
-
27
- function cnHideFrontBox() {
28
- if(cnArgs.hideEffect === 'fade') {
29
- $('#cookie-notice').fadeOut(300, function() {
30
- $(this).remove();
31
- });
32
- } else if(cnArgs.hideEffect === 'slide') {
33
- $('#cookie-notice').slideUp(300, function() {
34
- $(this).remove();
35
- });
36
- } else {
37
- $('#cookie-notice').remove();
38
- }
39
- }
40
-
41
-
42
- function cnSetCookie() {
43
- var cnTime = new Date();
44
- var cnLater = new Date();
45
-
46
- cnLater.setTime(cnTime.getTime() + cnArgs.cookieTime);
47
- document.cookie = cnArgs.cookieName+"="+escape(cnArgs.cookieValue)+";expires="+cnLater.toGMTString()+';domain='+cnArgs.cookieDomain+';path='+cnArgs.cookiePath;
48
- }
49
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/front.js CHANGED
@@ -10,7 +10,7 @@ jQuery(document).ready(function($) {
10
  cnLater.setTime(parseInt(cnTime.getTime()) + parseInt(cnArgs.cookieTime) * 1000);
11
 
12
  //set cookie
13
- document.cookie = cnArgs.cookieName+"="+escape(cnArgs.cookieValue)+";expires="+cnLater.toGMTString()+';domain='+cnArgs.cookieDomain+';path='+cnArgs.cookiePath;
14
 
15
  //hide box
16
  if(cnArgs.hideEffect === 'fade') {
10
  cnLater.setTime(parseInt(cnTime.getTime()) + parseInt(cnArgs.cookieTime) * 1000);
11
 
12
  //set cookie
13
+ document.cookie = cnArgs.cookieName+'=true'+';expires='+cnLater.toGMTString()+';'+(cnArgs.cookieDomain !== undefined && cnArgs.cookieDomain !== '' ? 'domain='+cnArgs.cookieDomain+';' : '')+(cnArgs.cookiePath !== undefined && cnArgs.cookiePath !== '' ? 'path='+cnArgs.cookiePath+';' : '');
14
 
15
  //hide box
16
  if(cnArgs.hideEffect === 'fade') {
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: dfactory
3
  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.8
7
- Stable tag: 1.1.0
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
@@ -48,6 +48,11 @@ No questions yet.
48
 
49
  == Changelog ==
50
 
 
 
 
 
 
51
  = 1.1.0 =
52
  * New: Rewritten cookie setting method to pure JS
53
  * Fix: Compatibility with WP Super Cache and other caching plugins
@@ -63,6 +68,7 @@ Initial release
63
 
64
  == Upgrade Notice ==
65
 
66
- = 1.1.0 =
67
- * New: Rewritten cookie setting method to pure JS
68
- * Fix: Compatibility with WP Super Cache and other caching plugins
 
3
  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.8.1
7
+ Stable tag: 1.2.0
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
48
 
49
  == Changelog ==
50
 
51
+ = 1.2.0 =
52
+ * Fix: Cookie not saving in IE
53
+ * Fix: Notice hidden under Admin bar bug
54
+ * Tweak: Improved WPML & Polylang compatibility
55
+
56
  = 1.1.0 =
57
  * New: Rewritten cookie setting method to pure JS
58
  * Fix: Compatibility with WP Super Cache and other caching plugins
68
 
69
  == Upgrade Notice ==
70
 
71
+ = 1.2.0 =
72
+ * Fix: Cookie not saving in IE
73
+ * Fix: Notice hidden under Admin bar bug
74
+ * Tweak: Improved WPML & Polylang compatibility