Cookie Notice by dFactory - Version 1.2.22

Version Description

  • Tweak: Swedish translation updated, thx to Ove Kaufeldt
Download this release

Release Info

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

Code changes from version 1.2.21 to 1.2.22

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.21
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/cookie-notice/
@@ -12,7 +12,7 @@ Text Domain: cookie-notice
12
  Domain Path: /languages
13
 
14
  Cookie Notice
15
- Copyright (C) 2013, Digital Factory - info@digitalfactory.pl
16
 
17
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
18
 
@@ -21,50 +21,51 @@ The above copyright notice and this permission notice shall be included in all c
21
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
  */
23
 
24
- // Exit if accessed directly
25
- if(!defined('ABSPATH')) exit;
 
26
 
27
- // Set plugin instance
28
  $cookie_notice = new Cookie_Notice();
29
 
30
- include_once(plugin_dir_path(__FILE__).'includes/update.php');
31
-
32
 
33
  /**
34
- * Cookie Notice class
35
  *
36
  * @class Cookie_Notice
37
- * @version 1.2.21
38
  */
39
  class Cookie_Notice {
 
40
  /**
41
  * @var $defaults
42
  */
43
  private $defaults = array(
44
- 'general' => array(
45
- 'position' => 'top',
46
- 'message_text' => '',
47
- 'css_style' => 'bootstrap',
48
- 'accept_text' => '',
49
- 'see_more' => 'no',
50
- 'link_target' => '_blank',
51
- 'time' => 'month',
52
- 'hide_effect' => 'fade',
53
- 'colors' => array(
54
- 'text' => '#fff',
55
- 'bar' => '#000',
56
  ),
57
- 'see_more_opt' => array(
58
- 'text' => '',
59
- 'link_type' => 'custom',
60
- 'id' => 'empty',
61
- 'link' => ''
62
  ),
63
- 'script_placement' => 'header',
64
- 'translate' => true,
65
- 'deactivation_delete' => 'no'
66
  ),
67
- 'version' => '1.2.21'
68
  );
69
  private $positions = array();
70
  private $styles = array();
@@ -77,38 +78,39 @@ class Cookie_Notice {
77
  private $effects = array();
78
  private $times = array();
79
  private $script_placements = array();
 
80
  /**
81
  * @var $cookie, holds cookie name
82
  */
83
  private $cookie = array(
84
- 'name' => 'cookie_notice_accepted',
85
- 'value' => 'TRUE'
86
  );
87
 
88
  /**
89
- * Constructor
90
  */
91
  public function __construct() {
92
- register_activation_hook(__FILE__, array($this, 'activation'));
93
- register_deactivation_hook(__FILE__, array($this, 'deactivation'));
94
 
95
  // settings
96
  $this->options = array(
97
- 'general' => array_merge($this->defaults['general'], get_option('cookie_notice_options', $this->defaults['general']))
98
  );
99
 
100
  // actions
101
- add_action('admin_init', array($this, 'register_settings'));
102
- add_action('admin_menu', array($this, 'admin_menu_options'));
103
- add_action('plugins_loaded', array($this, 'load_textdomain'));
104
- add_action('plugins_loaded', array($this, 'load_defaults'));
105
- add_action('admin_enqueue_scripts', array($this, 'admin_load_scripts_styles'));
106
- add_action('wp_enqueue_scripts', array($this, 'front_load_scripts_styles'));
107
- add_action('wp_footer', array($this, 'add_cookie_notice'), 1000);
108
 
109
  // filters
110
- add_filter('plugin_row_meta', array($this, 'plugin_extend_links'), 10, 2);
111
- add_filter('plugin_action_links', array($this, 'plugin_settings_link'), 10, 2);
112
  }
113
 
114
  /**
@@ -116,143 +118,139 @@ class Cookie_Notice {
116
  */
117
  public function load_defaults() {
118
  $this->positions = array(
119
- 'top' => __('Top', 'cookie-notice'),
120
- 'bottom' => __('Bottom', 'cookie-notice')
121
  );
122
 
123
  $this->styles = array(
124
- 'none' => __('None', 'cookie-notice'),
125
- 'wp-default' => __('WordPress', 'cookie-notice'),
126
- 'bootstrap' => __('Bootstrap', 'cookie-notice')
127
  );
128
 
129
  $this->choices = array(
130
- 'yes' => __('Enable', 'cookie-notice'),
131
- 'no' => __('Disable', 'cookie-notice')
132
  );
133
 
134
  $this->links = array(
135
- 'custom' => __('Custom link', 'cookie-notice'),
136
- 'page' => __('Page link', 'cookie-notice')
137
  );
138
-
139
  $this->link_target = array(
140
  '_blank',
141
  '_self'
142
  );
143
 
144
  $this->colors = array(
145
- 'text' => __('Text color', 'cookie-notice'),
146
- 'bar' => __('Bar color', 'cookie-notice'),
147
  );
148
 
149
  $this->times = array(
150
- 'day' => array(__('1 day', 'cookie-notice'), 86400),
151
- 'week' => array(__('1 week', 'cookie-notice'), 604800),
152
- 'month' => array(__('1 month', 'cookie-notice'), 2592000),
153
- '3months' => array(__('3 months', 'cookie-notice'), 7862400),
154
- '6months' => array(__('6 months', 'cookie-notice'), 15811200),
155
- 'year' => array(__('1 year', 'cookie-notice'), 31536000),
156
- 'infinity' => array(__('infinity', 'cookie-notice'), 31337313373)
157
  );
158
 
159
  $this->effects = array(
160
- 'none' => __('None', 'cookie-notice'),
161
- 'fade' => __('Fade', 'cookie-notice'),
162
- 'slide' => __('Slide', 'cookie-notice')
163
  );
164
-
165
  $this->script_placements = array(
166
- 'header' => __('Header', 'cookie-notice'),
167
- 'footer' => __('Footer', 'cookie-notice'),
168
  );
169
 
170
  $this->pages = get_pages(
171
  array(
172
- 'sort_order' => 'ASC',
173
- 'sort_column' => 'post_title',
174
- 'hierarchical' => 0,
175
- 'child_of' => 0,
176
- 'parent' => -1,
177
- 'offset' => 0,
178
- 'post_type' => 'page',
179
- 'post_status' => 'publish'
180
  )
181
  );
182
 
183
- if($this->options['general']['translate'] === true) {
184
  $this->options['general']['translate'] = false;
185
 
186
- $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'));
187
- $this->options['general']['accept_text'] = sanitize_text_field(__('Ok', 'cookie-notice'));
188
- $this->options['general']['see_more_opt']['text'] = sanitize_text_field(__('Read more', 'cookie-notice'));
189
 
190
- update_option('cookie_notice_options', $this->options['general']);
191
  }
192
-
193
  // WPML and Polylang compatibility
194
- if(function_exists('icl_register_string')) {
195
- icl_register_string('Cookie Notice', 'Message in the notice', $this->options['general']['message_text']);
196
- icl_register_string('Cookie Notice', 'Button text', $this->options['general']['accept_text']);
197
- icl_register_string('Cookie Notice', 'Read more text', $this->options['general']['see_more_opt']['text']);
198
- icl_register_string('Cookie Notice', 'Custom link', $this->options['general']['see_more_opt']['link']);
199
  }
200
  }
201
 
202
  /**
203
- * Load textdomain
204
  */
205
  public function load_textdomain() {
206
- load_plugin_textdomain('cookie-notice', false, dirname(plugin_basename(__FILE__)).'/languages/');
207
  }
208
 
209
  /**
210
- * Add submenu
211
  */
212
  public function admin_menu_options() {
213
  add_options_page(
214
- __('Cookie Notice', 'cookie-notice'),
215
- __('Cookie Notice', 'cookie-notice'),
216
- 'manage_options',
217
- 'cookie-notice',
218
- array($this, 'options_page')
219
  );
220
  }
221
 
222
  /**
223
- * Options page output
224
  */
225
  public function options_page() {
226
  echo '
227
- <div class="wrap">'.screen_icon().'
228
- <h2>'.__('Cookie Notice', 'cookie-notice').'</h2>
229
  <div class="cookie-notice-settings">
230
  <div class="df-credits">
231
- <h3 class="hndle">'.__('Cookie Notice', 'cookie-notice').' '.$this->defaults['version'].'</h3>
232
  <div class="inside">
233
- <h4 class="inner">'.__('Need support?', 'cookie-notice').'</h4>
234
- <p class="inner">'.__('If you are having problems with this plugin, please talk about them in the', 'cookie-notice').' <a href="http://dfactory.eu/support/" target="_blank" title="'.__('Support forum', 'cookie-notice').'">'.__('Support forum', 'cookie-notice').'</a></p>
235
  <hr />
236
- <h4 class="inner">'.__('Do you like this plugin?', 'cookie-notice').'</h4>
237
  <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank" class="inner">
238
  <input type="hidden" name="cmd" value="_s-xclick">
239
  <input type="hidden" name="hosted_button_id" value="38CLZJPBEN9ZW">
240
  <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!">
241
  <img alt="" border="0" src="https://www.paypalobjects.com/pl_PL/i/scr/pixel.gif" width="1" height="1">
242
  </form>
243
- <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 />'.
244
- __('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 />'.
245
- __('Check out our other', 'cookie-notice').' <a href="http://dfactory.eu/plugins/" target="_blank" title="'.__('WordPress plugins', 'cookie-notice').'">'.__('WordPress plugins', 'cookie-notice').'</a>
246
  </p>
247
  <hr />
248
- <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>
249
  </div>
250
  </div>
251
  <form action="options.php" method="post">';
252
 
253
- settings_fields('cookie_notice_options');
254
- do_settings_sections('cookie_notice_options');
255
- submit_button('', 'primary', 'save_cookie_notice_options', true);
256
 
257
  echo '
258
  </form>
@@ -262,257 +260,254 @@ class Cookie_Notice {
262
  }
263
 
264
  /**
265
- * Regiseter plugin settings
266
  */
267
- public function register_settings() {
268
- register_setting('cookie_notice_options', 'cookie_notice_options', array($this, 'validate_options'));
269
 
270
  // configuration
271
- add_settings_section('cookie_notice_configuration', __('Configuration', 'cookie-notice'), '', 'cookie_notice_options');
272
- add_settings_field('cn_message_text', __('Message', 'cookie-notice'), array($this, 'cn_message_text'), 'cookie_notice_options', 'cookie_notice_configuration');
273
- add_settings_field('cn_accept_text', __('Button text', 'cookie-notice'), array($this, 'cn_accept_text'), 'cookie_notice_options', 'cookie_notice_configuration');
274
- add_settings_field('cn_see_more', __('More info', 'cookie-notice'), array($this, 'cn_see_more'), 'cookie_notice_options', 'cookie_notice_configuration');
275
- add_settings_field('cn_link_target', __('Link target', 'cookie-notice'), array($this, 'cn_link_target'), 'cookie_notice_options', 'cookie_notice_configuration');
276
- add_settings_field('cn_time', __('Cookie expiry', 'cookie-notice'), array($this, 'cn_time'), 'cookie_notice_options', 'cookie_notice_configuration');
277
- add_settings_field('cn_script_placement', __('Script placement', 'cookie-notice'), array($this, 'cn_script_placement'), 'cookie_notice_options', 'cookie_notice_configuration');
278
- add_settings_field('cn_deactivation_delete', __('Deactivation', 'cookie-notice'), array($this, 'cn_deactivation_delete'), 'cookie_notice_options', 'cookie_notice_configuration');
279
 
280
  // design
281
- add_settings_section('cookie_notice_design', __('Design', 'cookie-notice'), '', 'cookie_notice_options');
282
- add_settings_field('cn_position', __('Position', 'cookie-notice'), array($this, 'cn_position'), 'cookie_notice_options', 'cookie_notice_design');
283
- add_settings_field('cn_hide_effect', __('Animation', 'cookie-notice'), array($this, 'cn_hide_effect'), 'cookie_notice_options', 'cookie_notice_design');
284
- add_settings_field('cn_css_style', __('Button style', 'cookie-notice'), array($this, 'cn_css_style'), 'cookie_notice_options', 'cookie_notice_design');
285
- add_settings_field('cn_colors', __('Colors', 'cookie-notice'), array($this, 'cn_colors'), 'cookie_notice_options', 'cookie_notice_design');
286
  }
287
 
288
  /**
289
- * Delete plugin data on deactivation
290
  */
291
  public function cn_deactivation_delete() {
292
  echo '
293
  <div id="cn_deactivation_delete">
294
  <fieldset>';
295
 
296
- foreach($this->choices as $val => $trans) {
297
  echo '
298
- <input id="cn-deactivation-delete-'.$val.'" type="radio" name="cookie_notice_options[deactivation_delete]" value="'.$val.'" '.checked($val, $this->options['general']['deactivation_delete'], false).'/><label for="cn-deactivation-delete-'.$val.'">'.$trans.'</label>';
299
  }
300
 
301
  echo '
302
  <br/>
303
- <span class="description">'.__('Enable if you want all plugin data to be deleted on deactivation.', 'cookie-notice').'</span>
304
  </fieldset>
305
  </div>';
306
  }
307
 
308
  /**
309
- * Cookie message option
310
  */
311
  public function cn_message_text() {
312
  echo '
313
  <div id="cn_message_text">
314
- <textarea name="cookie_notice_options[message_text]" class="large-text" cols="50" rows="5">'.esc_textarea($this->options['general']['message_text']).'</textarea>
315
- <p class="description">'.__('Enter the cookie notice message.', 'cookie-notice').'</p>
316
  </div>';
317
  }
318
 
319
  /**
320
- * Accept cookie label option
321
  */
322
  public function cn_accept_text() {
323
  echo '
324
  <div id="cn_accept_text">
325
- <input type="text" name="cookie_notice_options[accept_text]" value="'.esc_attr($this->options['general']['accept_text']).'" />
326
- <p class="description">'.__('The text of the option to accept the usage of the cookies and make the notification disappear.', 'cookie-notice').'</p>
327
  </div>';
328
  }
329
 
330
  /**
331
- * Read more link option
332
  */
333
  public function cn_see_more() {
334
  echo '
335
  <div id="cn_see_more">';
336
 
337
- foreach($this->choices as $val => $trans) {
338
- $val = esc_attr($val);
339
 
340
  echo '
341
- <input id="cn-see-more-'.$val.'" type="radio" name="cookie_notice_options[see_more]" value="'.$val.'" '.checked($val, $this->options['general']['see_more'], false).' />
342
- <label for="cn-see-more-'.$val.'">'.esc_html($trans).'</label>';
343
  }
344
 
345
  echo '
346
- <p class="description">'.__('Enable or Disable Read more button.', 'cookie-notice').'</p>
347
  </div>
348
- <div id="cn_see_more_opt"'.($this->options['general']['see_more'] === 'no' ? ' style="display: none;"' : '').'>
349
- <input type="text" name="cookie_notice_options[see_more_opt][text]" value="'.esc_attr($this->options['general']['see_more_opt']['text']).'" />
350
- <p class="description">'.__('Button text', 'cookie-notice').'</p>
351
  <div id="cn_see_more_opt_custom_link">';
352
 
353
- foreach($this->links as $val => $trans) {
354
- $val = esc_attr($val);
355
 
356
  echo '
357
- <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).' />
358
- <label for="cn-see-more-link-'.$val.'">'.esc_html($trans).'</label>';
359
  }
360
 
361
  echo '
362
  </div>
363
- <p class="description">'.__('Select where to redirect user for more information about cookies.', 'cookie-notice').'</p>
364
- <div id="cn_see_more_opt_page"'.($this->options['general']['see_more_opt']['link_type'] === 'custom' ? ' style="display: none;"' : '').'>
365
  <select name="cookie_notice_options[see_more_opt][id]">
366
- <option value="empty" '.selected('empty', $this->options['general']['see_more_opt']['id'], false).'>'.__('-- select page --', 'cookie-notice').'</option>';
367
 
368
- foreach($this->pages as $page) {
369
  echo '
370
- <option value="'.$page->ID.'" '.selected($page->ID, $this->options['general']['see_more_opt']['id'], false).'>'.esc_html($page->post_title).'</option>';
371
  }
372
 
373
  echo '
374
  </select>
375
- <p class="description">'.__('Select from one of your site\'s pages', 'cookie-notice').'</p>
376
  </div>
377
- <div id="cn_see_more_opt_link"'.($this->options['general']['see_more_opt']['link_type'] === 'page' ? ' style="display: none;"' : '').'>
378
- <input type="text" name="cookie_notice_options[see_more_opt][link]" value="'.esc_attr($this->options['general']['see_more_opt']['link']).'" />
379
- <p class="description">'.__('Enter the full URL starting with http://', 'cookie-notice').'</p>
380
  </div>
381
  </div>';
382
  }
383
-
384
  /**
385
- * Link target option
386
  */
387
  public function cn_link_target() {
388
  echo '
389
  <div id="cn_link_target">
390
  <select name="cookie_notice_options[link_target]">';
391
 
392
- foreach($this->link_target as $target)
393
- {
394
- echo '<option value="'.$target.'" '.selected($target, $this->options['general']['link_target']).'>'.esc_html($target).'</option>';
395
  }
396
 
397
  echo '
398
  </select>
399
- <p class="description">'.__('Select the link target for more info page.', 'cookie-notice').'</p>
400
  </div>';
401
  }
402
 
403
  /**
404
- * Expiration time option
405
  */
406
  public function cn_time() {
407
  echo '
408
  <div id="cn_time">
409
  <select name="cookie_notice_options[time]">';
410
 
411
- foreach($this->times as $time => $arr)
412
- {
413
- $time = esc_attr($time);
414
 
415
- echo '<option value="'.$time.'" '.selected($time, $this->options['general']['time']).'>'.esc_html($arr[0]).'</option>';
416
  }
417
 
418
  echo '
419
  </select>
420
- <p class="description">'.__('The ammount of time that cookie should be stored for.', 'cookie-notice').'</p>
421
  </div>';
422
  }
423
-
424
  /**
425
- * Script placement option
426
  */
427
  public function cn_script_placement() {
428
  echo '
429
  <div id="cn_time">
430
  <select name="cookie_notice_options[script_placement]">';
431
 
432
- foreach($this->script_placements as $placement => $name)
433
- {
434
- echo '<option value="'.$placement.'" '.selected($placement, $this->options['general']['script_placement']).'>'.esc_html($name).'</option>';
435
  }
436
 
437
  echo '
438
  </select>
439
- <p class="description">'.__('Select where all the plugin scripts should be placed.', 'cookie-notice').'</p>
440
  </div>';
441
  }
442
 
443
  /**
444
- * Position option
445
  */
446
  public function cn_position() {
447
  echo '
448
  <div id="cn_position">';
449
 
450
- foreach($this->positions as $val => $trans) {
451
- $val = esc_attr($val);
452
 
453
  echo '
454
- <input id="cn-position-'.$val.'" type="radio" name="cookie_notice_options[position]" value="'.$val.'" '.checked($val, $this->options['general']['position'], false).' />
455
- <label for="cn-position-'.$val.'">'.esc_html($trans).'</label>';
456
  }
457
 
458
  echo '
459
- <p class="description">'.__('Select location for your cookie notice.', 'cookie-notice').'</p>
460
  </div>';
461
  }
462
 
463
  /**
464
- * Animation effect option
465
  */
466
  public function cn_hide_effect() {
467
  echo '
468
  <div id="cn_hide_effect">';
469
 
470
- foreach($this->effects as $val => $trans) {
471
- $val = esc_attr($val);
472
 
473
  echo '
474
- <input id="cn-hide-effect-'.$val.'" type="radio" name="cookie_notice_options[hide_effect]" value="'.$val.'" '.checked($val, $this->options['general']['hide_effect'], false).' />
475
- <label for="cn-hide-effect-'.$val.'">'.esc_html($trans).'</label>';
476
  }
477
 
478
  echo '
479
- <p class="description">'.__('Cookie notice acceptance animation.', 'cookie-notice').'</p>
480
  </div>';
481
  }
482
 
483
  /**
484
- * CSS style option
485
  */
486
  public function cn_css_style() {
487
  echo '
488
  <div id="cn_css_style">';
489
 
490
- foreach($this->styles as $val => $trans) {
491
- $val = esc_attr($val);
492
 
493
  echo '
494
- <input id="cn-css-style-'.$val.'" type="radio" name="cookie_notice_options[css_style]" value="'.$val.'" '.checked($val, $this->options['general']['css_style'], false).' />
495
- <label for="cn-css-style-'.$val.'">'.esc_html($trans).'</label>';
496
  }
497
 
498
  echo '
499
- <p class="description">'.__('Choose buttons style.', 'cookie-notice').'</p>
500
  </div>';
501
  }
502
 
503
  /**
504
- * Colors option
505
  */
506
- public function cn_colors() {
507
  echo '
508
  <div id="cn_colors">';
509
 
510
- foreach($this->colors as $val => $trans) {
511
- $val = esc_attr($val);
512
 
513
  echo '
514
- <p><label>'.esc_html($trans).'</label>
515
- <input class="cn-color" type="text" name="cookie_notice_options[colors]['.$val.']" value="'.esc_attr($this->options['general']['colors'][$val]).'" />'.
516
  '</p>';
517
  }
518
 
@@ -521,50 +516,50 @@ class Cookie_Notice {
521
  }
522
 
523
  /**
524
- * Validate options
525
  */
526
- public function validate_options($input) {
527
-
528
- if(isset($_POST['save_cookie_notice_options'])) {
529
-
530
  // position
531
- $input['position'] = sanitize_text_field(isset($input['position']) && in_array($input['position'], array_keys($this->positions)) ? $input['position'] : $this->defaults['general']['position']);
532
 
533
  // colors
534
- $input['colors']['text'] = sanitize_text_field(isset($input['colors']['text']) && $input['colors']['text'] !== '' && preg_match('/^#[a-f0-9]{6}$/', $input['colors']['text']) === 1 ? $input['colors']['text'] : $this->defaults['general']['colors']['text']);
535
- $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']);
536
 
537
  // texts
538
- $input['message_text'] = wp_kses_post(isset($input['message_text']) && $input['message_text'] !== '' ? $input['message_text'] : $this->defaults['general']['message_text']);
539
- $input['accept_text'] = sanitize_text_field(isset($input['accept_text']) && $input['accept_text'] !== '' ? $input['accept_text'] : $this->defaults['general']['accept_text']);
540
 
541
  // css
542
- $input['css_style'] = sanitize_text_field(isset($input['css_style']) && in_array($input['css_style'], array_keys($this->styles)) ? $input['css_style'] : $this->defaults['general']['css_style']);
543
-
544
  // link target
545
- $input['link_target'] = sanitize_text_field(isset($input['link_target']) && in_array($input['link_target'], array_keys($this->link_target)) ? $input['link_target'] : $this->defaults['general']['link_target']);
546
 
547
  // time
548
- $input['time'] = sanitize_text_field(isset($input['time']) && in_array($input['time'], array_keys($this->times)) ? $input['time'] : $this->defaults['general']['time']);
549
-
550
  // script placement
551
- $input['script_placement'] = sanitize_text_field(isset($input['script_placement']) && in_array($input['script_placement'], array_keys($this->script_placements)) ? $input['script_placement'] : $this->defaults['general']['script_placement']);
552
 
553
  // hide effect
554
- $input['hide_effect'] = sanitize_text_field(isset($input['hide_effect']) && in_array($input['hide_effect'], array_keys($this->effects)) ? $input['hide_effect'] : $this->defaults['general']['hide_effect']);
555
 
556
  // deactivation
557
- $input['deactivation_delete'] = (isset($input['deactivation_delete']) && in_array($input['deactivation_delete'], array_keys($this->choices)) ? $input['deactivation_delete'] : $this->defaults['general']['deactivation_delete']);
558
 
559
  // read more
560
- $input['see_more'] = sanitize_text_field(isset($input['see_more']) && in_array($input['see_more'], array_keys($this->choices)) ? $input['see_more'] : $this->defaults['general']['see_more']);
561
- $input['see_more_opt']['text'] = sanitize_text_field(isset($input['see_more_opt']['text']) && $input['see_more_opt']['text'] !== '' ? $input['see_more_opt']['text'] : $this->defaults['general']['see_more_opt']['text']);
562
- $input['see_more_opt']['link_type'] = sanitize_text_field(isset($input['see_more_opt']['link_type']) && in_array($input['see_more_opt']['link_type'], array_keys($this->links)) ? $input['see_more_opt']['link_type'] : $this->defaults['general']['see_more_opt']['link_type']);
563
 
564
- if($input['see_more_opt']['link_type'] === 'custom')
565
- $input['see_more_opt']['link'] = esc_url($input['see_more'] === 'yes' ? $input['see_more_opt']['link'] : 'empty');
566
- elseif($input['see_more_opt']['link_type'] === 'page')
567
- $input['see_more_opt']['id'] = ($input['see_more'] === 'yes' ? (int)$input['see_more_opt']['id'] : 'empty');
568
 
569
  $input['translate'] = false;
570
  }
@@ -573,150 +568,140 @@ class Cookie_Notice {
573
  }
574
 
575
  /**
576
- * Cookie notice output
577
  */
578
- public function add_cookie_notice() {
579
- if(!(isset($_COOKIE[$this->cookie['name']]) && $_COOKIE[$this->cookie['name']] === $this->cookie['value'])) {
580
  // WPML and Polylang compatibility
581
- if(function_exists('icl_t')) {
582
- $this->options['general']['message_text'] = icl_t('Cookie Notice', 'Message in the notice', $this->options['general']['message_text']);
583
- $this->options['general']['accept_text'] = icl_t('Cookie Notice', 'Button text', $this->options['general']['accept_text']);
584
- $this->options['general']['see_more_opt']['text'] = icl_t('Cookie Notice', 'Read more text', $this->options['general']['see_more_opt']['text']);
585
- $this->options['general']['see_more_opt']['link'] = icl_t('Cookie Notice', 'Custom link', $this->options['general']['see_more_opt']['link']);
586
  }
587
 
588
- if(function_exists('icl_object_id'))
589
- $this->options['general']['see_more_opt']['id'] = icl_object_id($this->options['general']['see_more_opt']['id'], 'page', true);
590
-
591
  // get cookie container args
592
- $options = apply_filters('cn_cookie_notice_args', array(
593
- 'position' => $this->options['general']['position'],
594
- 'css_style' => $this->options['general']['css_style'],
595
- 'colors' => $this->options['general']['colors'],
596
- 'message_text' => $this->options['general']['message_text'],
597
- 'accept_text' => $this->options['general']['accept_text'],
598
- 'see_more' => $this->options['general']['see_more'],
599
- 'see_more_opt' => $this->options['general']['see_more_opt'],
600
- 'link_target' => $this->options['general']['link_target'],
601
- ));
602
-
603
  // message output
604
  $output = '
605
- <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'].';">'
606
- .'<div class="cookie-notice-container"><span id="cn-notice-text">'
607
- .$options['message_text']
608
- .'</span><a href="" id="cn-accept-cookie" class="button'.($options['css_style'] !== 'none' ? ' '.$options['css_style'] : '').'">'.$options['accept_text'].'</a>'
609
- .($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="'.$options['link_target'].'" id="cn-more-info" class="button'.($options['css_style'] !== 'none' ? ' '.$options['css_style'] : '').'">'.$options['see_more_opt']['text'].'</a>' : '').'
610
  </div>
611
  </div>';
612
 
613
- echo apply_filters('cn_cookie_notice_output', $output);
614
  }
615
  }
616
 
617
  /**
618
- * Add links to Support Forum
619
  */
620
- public function plugin_extend_links($links, $file) {
621
- if(!current_user_can('install_plugins'))
622
  return $links;
623
 
624
- $plugin = plugin_basename(__FILE__);
625
 
626
- if($file == $plugin)
627
- return array_merge($links, array(sprintf('<a href="http://www.dfactory.eu/support/forum/cookie-notice/" target="_blank">%s</a>', __('Support', 'cookie-notice'))));
628
 
629
  return $links;
630
  }
631
 
632
  /**
633
- * Get default settings
634
  */
635
  public function get_defaults() {
636
  return $this->defaults;
637
  }
638
 
639
  /**
640
- * Add links to settings page
641
  */
642
- function plugin_settings_link($links, $file) {
643
-
644
- if(!is_admin() || !current_user_can('edit_theme_options'))
645
  return $links;
646
 
647
- static $plugin;
648
-
649
- $plugin = plugin_basename(__FILE__);
650
 
651
- if($file == $plugin)
652
- array_unshift($links, sprintf('<a href="%s">%s</a>', admin_url('options-general.php?page=cookie-notice'), __('Settings', 'cookie-notice')));
653
 
654
  return $links;
655
  }
656
 
657
  /**
658
- * Activate the plugin
659
  */
660
  public function activation() {
661
- add_option('cookie_notice_options', $this->defaults['general'], '', 'no');
662
- add_option('cookie_notice_version', $this->defaults['version'], '', 'no');
663
  }
664
 
665
  /**
666
- * Deactivate the plugin
667
  */
668
  public function deactivation() {
669
- if($this->options['general']['deactivation_delete'] === 'yes')
670
- delete_option('cookie_notice_options');
671
  }
672
 
673
  /**
674
- * Load scripts and styles - admin
675
  */
676
- public function admin_load_scripts_styles($page) {
677
- if($page !== 'settings_page_cookie-notice')
678
  return;
679
 
680
  wp_enqueue_script(
681
- 'cookie-notice-admin',
682
- plugins_url('js/admin.js', __FILE__),
683
- array('jquery', 'wp-color-picker'),
684
- $this->defaults['version']
685
  );
686
 
687
- wp_enqueue_style('wp-color-picker');
688
- wp_enqueue_style('cookie-notice-admin', plugins_url('css/admin.css', __FILE__));
689
  }
690
 
691
  /**
692
- * Load scripts and styles - frontend
693
  */
694
  public function front_load_scripts_styles() {
695
- if(!(isset($_COOKIE[$this->cookie['name']]) && $_COOKIE[$this->cookie['name']] === $this->cookie['value'])) {
696
  wp_enqueue_script(
697
- 'cookie-notice-front',
698
- plugins_url('js/front.js', __FILE__),
699
- array('jquery'),
700
- $this->defaults['version'],
701
- isset($this->options['general']['script_placement']) && $this->options['general']['script_placement'] === 'footer' ? true : false
702
  );
703
 
704
  wp_localize_script(
705
- 'cookie-notice-front',
706
- 'cnArgs',
707
- array(
708
- 'ajaxurl' => admin_url('admin-ajax.php'),
709
- 'hideEffect' => $this->options['general']['hide_effect'],
710
- 'cookieName' => $this->cookie['name'],
711
- 'cookieValue' => $this->cookie['value'],
712
- 'cookieTime' => $this->times[$this->options['general']['time']][1],
713
- 'cookiePath' => (defined('COOKIEPATH') ? COOKIEPATH : ''),
714
- 'cookieDomain' => (defined('COOKIE_DOMAIN') ? COOKIE_DOMAIN : '')
715
  )
716
  );
717
 
718
- wp_enqueue_style('cookie-notice-front', plugins_url('css/front.css', __FILE__));
719
  }
720
  }
 
721
  }
 
722
  ?>
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.22
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/cookie-notice/
12
  Domain Path: /languages
13
 
14
  Cookie Notice
15
+ Copyright (C) 2013-2015, Digital Factory - info@digitalfactory.pl
16
 
17
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
18
 
21
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
  */
23
 
24
+ // exit if accessed directly
25
+ if ( ! defined( 'ABSPATH' ) )
26
+ exit;
27
 
28
+ // set plugin instance
29
  $cookie_notice = new Cookie_Notice();
30
 
31
+ include_once(plugin_dir_path( __FILE__ ) . 'includes/update.php');
 
32
 
33
  /**
34
+ * Cookie Notice class.
35
  *
36
  * @class Cookie_Notice
37
+ * @version 1.2.22
38
  */
39
  class Cookie_Notice {
40
+
41
  /**
42
  * @var $defaults
43
  */
44
  private $defaults = array(
45
+ 'general' => array(
46
+ 'position' => 'top',
47
+ 'message_text' => '',
48
+ 'css_style' => 'bootstrap',
49
+ 'accept_text' => '',
50
+ 'see_more' => 'no',
51
+ 'link_target' => '_blank',
52
+ 'time' => 'month',
53
+ 'hide_effect' => 'fade',
54
+ 'colors' => array(
55
+ 'text' => '#fff',
56
+ 'bar' => '#000',
57
  ),
58
+ 'see_more_opt' => array(
59
+ 'text' => '',
60
+ 'link_type' => 'custom',
61
+ 'id' => 'empty',
62
+ 'link' => ''
63
  ),
64
+ 'script_placement' => 'header',
65
+ 'translate' => true,
66
+ 'deactivation_delete' => 'no'
67
  ),
68
+ 'version' => '1.2.22'
69
  );
70
  private $positions = array();
71
  private $styles = array();
78
  private $effects = array();
79
  private $times = array();
80
  private $script_placements = array();
81
+
82
  /**
83
  * @var $cookie, holds cookie name
84
  */
85
  private $cookie = array(
86
+ 'name' => 'cookie_notice_accepted',
87
+ 'value' => 'TRUE'
88
  );
89
 
90
  /**
91
+ * Constructor.
92
  */
93
  public function __construct() {
94
+ register_activation_hook( __FILE__, array( $this, 'activation' ) );
95
+ register_deactivation_hook( __FILE__, array( $this, 'deactivation' ) );
96
 
97
  // settings
98
  $this->options = array(
99
+ 'general' => array_merge( $this->defaults['general'], get_option( 'cookie_notice_options', $this->defaults['general'] ) )
100
  );
101
 
102
  // actions
103
+ add_action( 'admin_init', array( $this, 'register_settings' ) );
104
+ add_action( 'admin_menu', array( $this, 'admin_menu_options' ) );
105
+ add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
106
+ add_action( 'plugins_loaded', array( $this, 'load_defaults' ) );
107
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_load_scripts_styles' ) );
108
+ add_action( 'wp_enqueue_scripts', array( $this, 'front_load_scripts_styles' ) );
109
+ add_action( 'wp_footer', array( $this, 'add_cookie_notice' ), 1000 );
110
 
111
  // filters
112
+ add_filter( 'plugin_row_meta', array( $this, 'plugin_extend_links' ), 10, 2 );
113
+ add_filter( 'plugin_action_links', array( $this, 'plugin_settings_link' ), 10, 2 );
114
  }
115
 
116
  /**
118
  */
119
  public function load_defaults() {
120
  $this->positions = array(
121
+ 'top' => __( 'Top', 'cookie-notice' ),
122
+ 'bottom' => __( 'Bottom', 'cookie-notice' )
123
  );
124
 
125
  $this->styles = array(
126
+ 'none' => __( 'None', 'cookie-notice' ),
127
+ 'wp-default' => __( 'WordPress', 'cookie-notice' ),
128
+ 'bootstrap' => __( 'Bootstrap', 'cookie-notice' )
129
  );
130
 
131
  $this->choices = array(
132
+ 'yes' => __( 'Enable', 'cookie-notice' ),
133
+ 'no' => __( 'Disable', 'cookie-notice' )
134
  );
135
 
136
  $this->links = array(
137
+ 'custom' => __( 'Custom link', 'cookie-notice' ),
138
+ 'page' => __( 'Page link', 'cookie-notice' )
139
  );
140
+
141
  $this->link_target = array(
142
  '_blank',
143
  '_self'
144
  );
145
 
146
  $this->colors = array(
147
+ 'text' => __( 'Text color', 'cookie-notice' ),
148
+ 'bar' => __( 'Bar color', 'cookie-notice' ),
149
  );
150
 
151
  $this->times = array(
152
+ 'day' => array( __( '1 day', 'cookie-notice' ), 86400 ),
153
+ 'week' => array( __( '1 week', 'cookie-notice' ), 604800 ),
154
+ 'month' => array( __( '1 month', 'cookie-notice' ), 2592000 ),
155
+ '3months' => array( __( '3 months', 'cookie-notice' ), 7862400 ),
156
+ '6months' => array( __( '6 months', 'cookie-notice' ), 15811200 ),
157
+ 'year' => array( __( '1 year', 'cookie-notice' ), 31536000 ),
158
+ 'infinity' => array( __( 'infinity', 'cookie-notice' ), 31337313373 )
159
  );
160
 
161
  $this->effects = array(
162
+ 'none' => __( 'None', 'cookie-notice' ),
163
+ 'fade' => __( 'Fade', 'cookie-notice' ),
164
+ 'slide' => __( 'Slide', 'cookie-notice' )
165
  );
166
+
167
  $this->script_placements = array(
168
+ 'header' => __( 'Header', 'cookie-notice' ),
169
+ 'footer' => __( 'Footer', 'cookie-notice' ),
170
  );
171
 
172
  $this->pages = get_pages(
173
  array(
174
+ 'sort_order' => 'ASC',
175
+ 'sort_column' => 'post_title',
176
+ 'hierarchical' => 0,
177
+ 'child_of' => 0,
178
+ 'parent' => -1,
179
+ 'offset' => 0,
180
+ 'post_type' => 'page',
181
+ 'post_status' => 'publish'
182
  )
183
  );
184
 
185
+ if ( $this->options['general']['translate'] === true ) {
186
  $this->options['general']['translate'] = false;
187
 
188
+ $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' ) );
189
+ $this->options['general']['accept_text'] = sanitize_text_field( __( 'Ok', 'cookie-notice' ) );
190
+ $this->options['general']['see_more_opt']['text'] = sanitize_text_field( __( 'Read more', 'cookie-notice' ) );
191
 
192
+ update_option( 'cookie_notice_options', $this->options['general'] );
193
  }
194
+
195
  // WPML and Polylang compatibility
196
+ if ( function_exists( 'icl_register_string' ) ) {
197
+ icl_register_string( 'Cookie Notice', 'Message in the notice', $this->options['general']['message_text'] );
198
+ icl_register_string( 'Cookie Notice', 'Button text', $this->options['general']['accept_text'] );
199
+ icl_register_string( 'Cookie Notice', 'Read more text', $this->options['general']['see_more_opt']['text'] );
200
+ icl_register_string( 'Cookie Notice', 'Custom link', $this->options['general']['see_more_opt']['link'] );
201
  }
202
  }
203
 
204
  /**
205
+ * Load textdomain.
206
  */
207
  public function load_textdomain() {
208
+ load_plugin_textdomain( 'cookie-notice', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
209
  }
210
 
211
  /**
212
+ * Add submenu.
213
  */
214
  public function admin_menu_options() {
215
  add_options_page(
216
+ __( 'Cookie Notice', 'cookie-notice' ), __( 'Cookie Notice', 'cookie-notice' ), 'manage_options', 'cookie-notice', array( $this, 'options_page' )
 
 
 
 
217
  );
218
  }
219
 
220
  /**
221
+ * Options page output.
222
  */
223
  public function options_page() {
224
  echo '
225
+ <div class="wrap">' . screen_icon() . '
226
+ <h2>' . __( 'Cookie Notice', 'cookie-notice' ) . '</h2>
227
  <div class="cookie-notice-settings">
228
  <div class="df-credits">
229
+ <h3 class="hndle">' . __( 'Cookie Notice', 'cookie-notice' ) . ' ' . $this->defaults['version'] . '</h3>
230
  <div class="inside">
231
+ <h4 class="inner">' . __( 'Need support?', 'cookie-notice' ) . '</h4>
232
+ <p class="inner">' . __( 'If you are having problems with this plugin, please talk about them in the', 'cookie-notice' ) . ' <a href="http://dfactory.eu/support/" target="_blank" title="' . __( 'Support forum', 'cookie-notice' ) . '">' . __( 'Support forum', 'cookie-notice' ) . '</a></p>
233
  <hr />
234
+ <h4 class="inner">' . __( 'Do you like this plugin?', 'cookie-notice' ) . '</h4>
235
  <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank" class="inner">
236
  <input type="hidden" name="cmd" value="_s-xclick">
237
  <input type="hidden" name="hosted_button_id" value="38CLZJPBEN9ZW">
238
  <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!">
239
  <img alt="" border="0" src="https://www.paypalobjects.com/pl_PL/i/scr/pixel.gif" width="1" height="1">
240
  </form>
241
+ <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 />' .
242
+ __( '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 />' .
243
+ __( 'Check out our other', 'cookie-notice' ) . ' <a href="http://dfactory.eu/plugins/" target="_blank" title="' . __( 'WordPress plugins', 'cookie-notice' ) . '">' . __( 'WordPress plugins', 'cookie-notice' ) . '</a>
244
  </p>
245
  <hr />
246
+ <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>
247
  </div>
248
  </div>
249
  <form action="options.php" method="post">';
250
 
251
+ settings_fields( 'cookie_notice_options' );
252
+ do_settings_sections( 'cookie_notice_options' );
253
+ submit_button( '', 'primary', 'save_cookie_notice_options', true );
254
 
255
  echo '
256
  </form>
260
  }
261
 
262
  /**
263
+ * Regiseter plugin settings.
264
  */
265
+ public function register_settings() {
266
+ register_setting( 'cookie_notice_options', 'cookie_notice_options', array( $this, 'validate_options' ) );
267
 
268
  // configuration
269
+ add_settings_section( 'cookie_notice_configuration', __( 'Configuration', 'cookie-notice' ), '', 'cookie_notice_options' );
270
+ add_settings_field( 'cn_message_text', __( 'Message', 'cookie-notice' ), array( $this, 'cn_message_text' ), 'cookie_notice_options', 'cookie_notice_configuration' );
271
+ add_settings_field( 'cn_accept_text', __( 'Button text', 'cookie-notice' ), array( $this, 'cn_accept_text' ), 'cookie_notice_options', 'cookie_notice_configuration' );
272
+ add_settings_field( 'cn_see_more', __( 'More info', 'cookie-notice' ), array( $this, 'cn_see_more' ), 'cookie_notice_options', 'cookie_notice_configuration' );
273
+ add_settings_field( 'cn_link_target', __( 'Link target', 'cookie-notice' ), array( $this, 'cn_link_target' ), 'cookie_notice_options', 'cookie_notice_configuration' );
274
+ add_settings_field( 'cn_time', __( 'Cookie expiry', 'cookie-notice' ), array( $this, 'cn_time' ), 'cookie_notice_options', 'cookie_notice_configuration' );
275
+ add_settings_field( 'cn_script_placement', __( 'Script placement', 'cookie-notice' ), array( $this, 'cn_script_placement' ), 'cookie_notice_options', 'cookie_notice_configuration' );
276
+ add_settings_field( 'cn_deactivation_delete', __( 'Deactivation', 'cookie-notice' ), array( $this, 'cn_deactivation_delete' ), 'cookie_notice_options', 'cookie_notice_configuration' );
277
 
278
  // design
279
+ add_settings_section( 'cookie_notice_design', __( 'Design', 'cookie-notice' ), '', 'cookie_notice_options' );
280
+ add_settings_field( 'cn_position', __( 'Position', 'cookie-notice' ), array( $this, 'cn_position' ), 'cookie_notice_options', 'cookie_notice_design' );
281
+ add_settings_field( 'cn_hide_effect', __( 'Animation', 'cookie-notice' ), array( $this, 'cn_hide_effect' ), 'cookie_notice_options', 'cookie_notice_design' );
282
+ add_settings_field( 'cn_css_style', __( 'Button style', 'cookie-notice' ), array( $this, 'cn_css_style' ), 'cookie_notice_options', 'cookie_notice_design' );
283
+ add_settings_field( 'cn_colors', __( 'Colors', 'cookie-notice' ), array( $this, 'cn_colors' ), 'cookie_notice_options', 'cookie_notice_design' );
284
  }
285
 
286
  /**
287
+ * Delete plugin data on deactivation.
288
  */
289
  public function cn_deactivation_delete() {
290
  echo '
291
  <div id="cn_deactivation_delete">
292
  <fieldset>';
293
 
294
+ foreach ( $this->choices as $val => $trans ) {
295
  echo '
296
+ <input id="cn-deactivation-delete-' . $val . '" type="radio" name="cookie_notice_options[deactivation_delete]" value="' . $val . '" ' . checked( $val, $this->options['general']['deactivation_delete'], false ) . '/><label for="cn-deactivation-delete-' . $val . '">' . $trans . '</label>';
297
  }
298
 
299
  echo '
300
  <br/>
301
+ <span class="description">' . __( 'Enable if you want all plugin data to be deleted on deactivation.', 'cookie-notice' ) . '</span>
302
  </fieldset>
303
  </div>';
304
  }
305
 
306
  /**
307
+ * Cookie message option.
308
  */
309
  public function cn_message_text() {
310
  echo '
311
  <div id="cn_message_text">
312
+ <textarea name="cookie_notice_options[message_text]" class="large-text" cols="50" rows="5">' . esc_textarea( $this->options['general']['message_text'] ) . '</textarea>
313
+ <p class="description">' . __( 'Enter the cookie notice message.', 'cookie-notice' ) . '</p>
314
  </div>';
315
  }
316
 
317
  /**
318
+ * Accept cookie label option.
319
  */
320
  public function cn_accept_text() {
321
  echo '
322
  <div id="cn_accept_text">
323
+ <input type="text" name="cookie_notice_options[accept_text]" value="' . esc_attr( $this->options['general']['accept_text'] ) . '" />
324
+ <p class="description">' . __( 'The text of the option to accept the usage of the cookies and make the notification disappear.', 'cookie-notice' ) . '</p>
325
  </div>';
326
  }
327
 
328
  /**
329
+ * Read more link option.
330
  */
331
  public function cn_see_more() {
332
  echo '
333
  <div id="cn_see_more">';
334
 
335
+ foreach ( $this->choices as $val => $trans ) {
336
+ $val = esc_attr( $val );
337
 
338
  echo '
339
+ <input id="cn-see-more-' . $val . '" type="radio" name="cookie_notice_options[see_more]" value="' . $val . '" ' . checked( $val, $this->options['general']['see_more'], false ) . ' />
340
+ <label for="cn-see-more-' . $val . '">' . esc_html( $trans ) . '</label>';
341
  }
342
 
343
  echo '
344
+ <p class="description">' . __( 'Enable or Disable Read more button.', 'cookie-notice' ) . '</p>
345
  </div>
346
+ <div id="cn_see_more_opt"' . ($this->options['general']['see_more'] === 'no' ? ' style="display: none;"' : '') . '>
347
+ <input type="text" name="cookie_notice_options[see_more_opt][text]" value="' . esc_attr( $this->options['general']['see_more_opt']['text'] ) . '" />
348
+ <p class="description">' . __( 'Button text', 'cookie-notice' ) . '</p>
349
  <div id="cn_see_more_opt_custom_link">';
350
 
351
+ foreach ( $this->links as $val => $trans ) {
352
+ $val = esc_attr( $val );
353
 
354
  echo '
355
+ <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 ) . ' />
356
+ <label for="cn-see-more-link-' . $val . '">' . esc_html( $trans ) . '</label>';
357
  }
358
 
359
  echo '
360
  </div>
361
+ <p class="description">' . __( 'Select where to redirect user for more information about cookies.', 'cookie-notice' ) . '</p>
362
+ <div id="cn_see_more_opt_page"' . ($this->options['general']['see_more_opt']['link_type'] === 'custom' ? ' style="display: none;"' : '') . '>
363
  <select name="cookie_notice_options[see_more_opt][id]">
364
+ <option value="empty" ' . selected( 'empty', $this->options['general']['see_more_opt']['id'], false ) . '>' . __( '-- select page --', 'cookie-notice' ) . '</option>';
365
 
366
+ foreach ( $this->pages as $page ) {
367
  echo '
368
+ <option value="' . $page->ID . '" ' . selected( $page->ID, $this->options['general']['see_more_opt']['id'], false ) . '>' . esc_html( $page->post_title ) . '</option>';
369
  }
370
 
371
  echo '
372
  </select>
373
+ <p class="description">' . __( 'Select from one of your site\'s pages', 'cookie-notice' ) . '</p>
374
  </div>
375
+ <div id="cn_see_more_opt_link"' . ($this->options['general']['see_more_opt']['link_type'] === 'page' ? ' style="display: none;"' : '') . '>
376
+ <input type="text" name="cookie_notice_options[see_more_opt][link]" value="' . esc_attr( $this->options['general']['see_more_opt']['link'] ) . '" />
377
+ <p class="description">' . __( 'Enter the full URL starting with http://', 'cookie-notice' ) . '</p>
378
  </div>
379
  </div>';
380
  }
381
+
382
  /**
383
+ * Link target option.
384
  */
385
  public function cn_link_target() {
386
  echo '
387
  <div id="cn_link_target">
388
  <select name="cookie_notice_options[link_target]">';
389
 
390
+ foreach ( $this->link_target as $target ) {
391
+ echo '<option value="' . $target . '" ' . selected( $target, $this->options['general']['link_target'] ) . '>' . esc_html( $target ) . '</option>';
 
392
  }
393
 
394
  echo '
395
  </select>
396
+ <p class="description">' . __( 'Select the link target for more info page.', 'cookie-notice' ) . '</p>
397
  </div>';
398
  }
399
 
400
  /**
401
+ * Expiration time option.
402
  */
403
  public function cn_time() {
404
  echo '
405
  <div id="cn_time">
406
  <select name="cookie_notice_options[time]">';
407
 
408
+ foreach ( $this->times as $time => $arr ) {
409
+ $time = esc_attr( $time );
 
410
 
411
+ echo '<option value="' . $time . '" ' . selected( $time, $this->options['general']['time'] ) . '>' . esc_html( $arr[0] ) . '</option>';
412
  }
413
 
414
  echo '
415
  </select>
416
+ <p class="description">' . __( 'The ammount of time that cookie should be stored for.', 'cookie-notice' ) . '</p>
417
  </div>';
418
  }
419
+
420
  /**
421
+ * Script placement option.
422
  */
423
  public function cn_script_placement() {
424
  echo '
425
  <div id="cn_time">
426
  <select name="cookie_notice_options[script_placement]">';
427
 
428
+ foreach ( $this->script_placements as $placement => $name ) {
429
+ echo '<option value="' . $placement . '" ' . selected( $placement, $this->options['general']['script_placement'] ) . '>' . esc_html( $name ) . '</option>';
 
430
  }
431
 
432
  echo '
433
  </select>
434
+ <p class="description">' . __( 'Select where all the plugin scripts should be placed.', 'cookie-notice' ) . '</p>
435
  </div>';
436
  }
437
 
438
  /**
439
+ * Position option.
440
  */
441
  public function cn_position() {
442
  echo '
443
  <div id="cn_position">';
444
 
445
+ foreach ( $this->positions as $val => $trans ) {
446
+ $val = esc_attr( $val );
447
 
448
  echo '
449
+ <input id="cn-position-' . $val . '" type="radio" name="cookie_notice_options[position]" value="' . $val . '" ' . checked( $val, $this->options['general']['position'], false ) . ' />
450
+ <label for="cn-position-' . $val . '">' . esc_html( $trans ) . '</label>';
451
  }
452
 
453
  echo '
454
+ <p class="description">' . __( 'Select location for your cookie notice.', 'cookie-notice' ) . '</p>
455
  </div>';
456
  }
457
 
458
  /**
459
+ * Animation effect option.
460
  */
461
  public function cn_hide_effect() {
462
  echo '
463
  <div id="cn_hide_effect">';
464
 
465
+ foreach ( $this->effects as $val => $trans ) {
466
+ $val = esc_attr( $val );
467
 
468
  echo '
469
+ <input id="cn-hide-effect-' . $val . '" type="radio" name="cookie_notice_options[hide_effect]" value="' . $val . '" ' . checked( $val, $this->options['general']['hide_effect'], false ) . ' />
470
+ <label for="cn-hide-effect-' . $val . '">' . esc_html( $trans ) . '</label>';
471
  }
472
 
473
  echo '
474
+ <p class="description">' . __( 'Cookie notice acceptance animation.', 'cookie-notice' ) . '</p>
475
  </div>';
476
  }
477
 
478
  /**
479
+ * CSS style option.
480
  */
481
  public function cn_css_style() {
482
  echo '
483
  <div id="cn_css_style">';
484
 
485
+ foreach ( $this->styles as $val => $trans ) {
486
+ $val = esc_attr( $val );
487
 
488
  echo '
489
+ <input id="cn-css-style-' . $val . '" type="radio" name="cookie_notice_options[css_style]" value="' . $val . '" ' . checked( $val, $this->options['general']['css_style'], false ) . ' />
490
+ <label for="cn-css-style-' . $val . '">' . esc_html( $trans ) . '</label>';
491
  }
492
 
493
  echo '
494
+ <p class="description">' . __( 'Choose buttons style.', 'cookie-notice' ) . '</p>
495
  </div>';
496
  }
497
 
498
  /**
499
+ * Colors option.
500
  */
501
+ public function cn_colors() {
502
  echo '
503
  <div id="cn_colors">';
504
 
505
+ foreach ( $this->colors as $val => $trans ) {
506
+ $val = esc_attr( $val );
507
 
508
  echo '
509
+ <p><label>' . esc_html( $trans ) . '</label>
510
+ <input class="cn-color" type="text" name="cookie_notice_options[colors][' . $val . ']" value="' . esc_attr( $this->options['general']['colors'][$val] ) . '" />' .
511
  '</p>';
512
  }
513
 
516
  }
517
 
518
  /**
519
+ * Validate options.
520
  */
521
+ public function validate_options( $input ) {
522
+
523
+ if ( isset( $_POST['save_cookie_notice_options'] ) ) {
524
+
525
  // position
526
+ $input['position'] = sanitize_text_field( isset( $input['position'] ) && in_array( $input['position'], array_keys( $this->positions ) ) ? $input['position'] : $this->defaults['general']['position'] );
527
 
528
  // colors
529
+ $input['colors']['text'] = sanitize_text_field( isset( $input['colors']['text'] ) && $input['colors']['text'] !== '' && preg_match( '/^#[a-f0-9]{6}$/', $input['colors']['text'] ) === 1 ? $input['colors']['text'] : $this->defaults['general']['colors']['text'] );
530
+ $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'] );
531
 
532
  // texts
533
+ $input['message_text'] = wp_kses_post( isset( $input['message_text'] ) && $input['message_text'] !== '' ? $input['message_text'] : $this->defaults['general']['message_text'] );
534
+ $input['accept_text'] = sanitize_text_field( isset( $input['accept_text'] ) && $input['accept_text'] !== '' ? $input['accept_text'] : $this->defaults['general']['accept_text'] );
535
 
536
  // css
537
+ $input['css_style'] = sanitize_text_field( isset( $input['css_style'] ) && in_array( $input['css_style'], array_keys( $this->styles ) ) ? $input['css_style'] : $this->defaults['general']['css_style'] );
538
+
539
  // link target
540
+ $input['link_target'] = sanitize_text_field( isset( $input['link_target'] ) && in_array( $input['link_target'], array_keys( $this->link_target ) ) ? $input['link_target'] : $this->defaults['general']['link_target'] );
541
 
542
  // time
543
+ $input['time'] = sanitize_text_field( isset( $input['time'] ) && in_array( $input['time'], array_keys( $this->times ) ) ? $input['time'] : $this->defaults['general']['time'] );
544
+
545
  // script placement
546
+ $input['script_placement'] = sanitize_text_field( isset( $input['script_placement'] ) && in_array( $input['script_placement'], array_keys( $this->script_placements ) ) ? $input['script_placement'] : $this->defaults['general']['script_placement'] );
547
 
548
  // hide effect
549
+ $input['hide_effect'] = sanitize_text_field( isset( $input['hide_effect'] ) && in_array( $input['hide_effect'], array_keys( $this->effects ) ) ? $input['hide_effect'] : $this->defaults['general']['hide_effect'] );
550
 
551
  // deactivation
552
+ $input['deactivation_delete'] = (isset( $input['deactivation_delete'] ) && in_array( $input['deactivation_delete'], array_keys( $this->choices ) ) ? $input['deactivation_delete'] : $this->defaults['general']['deactivation_delete']);
553
 
554
  // read more
555
+ $input['see_more'] = sanitize_text_field( isset( $input['see_more'] ) && in_array( $input['see_more'], array_keys( $this->choices ) ) ? $input['see_more'] : $this->defaults['general']['see_more'] );
556
+ $input['see_more_opt']['text'] = sanitize_text_field( isset( $input['see_more_opt']['text'] ) && $input['see_more_opt']['text'] !== '' ? $input['see_more_opt']['text'] : $this->defaults['general']['see_more_opt']['text'] );
557
+ $input['see_more_opt']['link_type'] = sanitize_text_field( isset( $input['see_more_opt']['link_type'] ) && in_array( $input['see_more_opt']['link_type'], array_keys( $this->links ) ) ? $input['see_more_opt']['link_type'] : $this->defaults['general']['see_more_opt']['link_type'] );
558
 
559
+ if ( $input['see_more_opt']['link_type'] === 'custom' )
560
+ $input['see_more_opt']['link'] = esc_url( $input['see_more'] === 'yes' ? $input['see_more_opt']['link'] : 'empty' );
561
+ elseif ( $input['see_more_opt']['link_type'] === 'page' )
562
+ $input['see_more_opt']['id'] = ($input['see_more'] === 'yes' ? (int) $input['see_more_opt']['id'] : 'empty');
563
 
564
  $input['translate'] = false;
565
  }
568
  }
569
 
570
  /**
571
+ * Cookie notice output.
572
  */
573
+ public function add_cookie_notice() {
574
+ if ( ! (isset( $_COOKIE[$this->cookie['name']] ) && $_COOKIE[$this->cookie['name']] === $this->cookie['value']) ) {
575
  // WPML and Polylang compatibility
576
+ if ( function_exists( 'icl_t' ) ) {
577
+ $this->options['general']['message_text'] = icl_t( 'Cookie Notice', 'Message in the notice', $this->options['general']['message_text'] );
578
+ $this->options['general']['accept_text'] = icl_t( 'Cookie Notice', 'Button text', $this->options['general']['accept_text'] );
579
+ $this->options['general']['see_more_opt']['text'] = icl_t( 'Cookie Notice', 'Read more text', $this->options['general']['see_more_opt']['text'] );
580
+ $this->options['general']['see_more_opt']['link'] = icl_t( 'Cookie Notice', 'Custom link', $this->options['general']['see_more_opt']['link'] );
581
  }
582
 
583
+ if ( function_exists( 'icl_object_id' ) )
584
+ $this->options['general']['see_more_opt']['id'] = icl_object_id( $this->options['general']['see_more_opt']['id'], 'page', true );
585
+
586
  // get cookie container args
587
+ $options = apply_filters( 'cn_cookie_notice_args', array(
588
+ 'position' => $this->options['general']['position'],
589
+ 'css_style' => $this->options['general']['css_style'],
590
+ 'colors' => $this->options['general']['colors'],
591
+ 'message_text' => $this->options['general']['message_text'],
592
+ 'accept_text' => $this->options['general']['accept_text'],
593
+ 'see_more' => $this->options['general']['see_more'],
594
+ 'see_more_opt' => $this->options['general']['see_more_opt'],
595
+ 'link_target' => $this->options['general']['link_target'],
596
+ ) );
597
+
598
  // message output
599
  $output = '
600
+ <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'] . ';">'
601
+ . '<div class="cookie-notice-container"><span id="cn-notice-text">'
602
+ . $options['message_text']
603
+ . '</span><a href="" id="cn-accept-cookie" class="button' . ($options['css_style'] !== 'none' ? ' ' . $options['css_style'] : '') . '">' . $options['accept_text'] . '</a>'
604
+ . ($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="' . $options['link_target'] . '" id="cn-more-info" class="button' . ($options['css_style'] !== 'none' ? ' ' . $options['css_style'] : '') . '">' . $options['see_more_opt']['text'] . '</a>' : '') . '
605
  </div>
606
  </div>';
607
 
608
+ echo apply_filters( 'cn_cookie_notice_output', $output );
609
  }
610
  }
611
 
612
  /**
613
+ * Add links to Support Forum.
614
  */
615
+ public function plugin_extend_links( $links, $file ) {
616
+ if ( ! current_user_can( 'install_plugins' ) )
617
  return $links;
618
 
619
+ $plugin = plugin_basename( __FILE__ );
620
 
621
+ if ( $file == $plugin )
622
+ return array_merge( $links, array( sprintf( '<a href="http://www.dfactory.eu/support/forum/cookie-notice/" target="_blank">%s</a>', __( 'Support', 'cookie-notice' ) ) ) );
623
 
624
  return $links;
625
  }
626
 
627
  /**
628
+ * Get default settings.
629
  */
630
  public function get_defaults() {
631
  return $this->defaults;
632
  }
633
 
634
  /**
635
+ * Add links to settings page.
636
  */
637
+ public function plugin_settings_link( $links, $file ) {
638
+ if ( ! current_user_can( 'manage_options' ) )
 
639
  return $links;
640
 
641
+ $plugin = plugin_basename( __FILE__ );
 
 
642
 
643
+ if ( $file == $plugin )
644
+ array_unshift( $links, sprintf( '<a href="%s">%s</a>', admin_url( 'options-general.php?page=cookie-notice' ), __( 'Settings', 'cookie-notice' ) ) );
645
 
646
  return $links;
647
  }
648
 
649
  /**
650
+ * Activate the plugin.
651
  */
652
  public function activation() {
653
+ add_option( 'cookie_notice_options', $this->defaults['general'], '', 'no' );
654
+ add_option( 'cookie_notice_version', $this->defaults['version'], '', 'no' );
655
  }
656
 
657
  /**
658
+ * Deactivate the plugin.
659
  */
660
  public function deactivation() {
661
+ if ( $this->options['general']['deactivation_delete'] === 'yes' )
662
+ delete_option( 'cookie_notice_options' );
663
  }
664
 
665
  /**
666
+ * Load scripts and styles - admin.
667
  */
668
+ public function admin_load_scripts_styles( $page ) {
669
+ if ( $page !== 'settings_page_cookie-notice' )
670
  return;
671
 
672
  wp_enqueue_script(
673
+ 'cookie-notice-admin', plugins_url( 'js/admin.js', __FILE__ ), array( 'jquery', 'wp-color-picker' ), $this->defaults['version']
 
 
 
674
  );
675
 
676
+ wp_enqueue_style( 'wp-color-picker' );
677
+ wp_enqueue_style( 'cookie-notice-admin', plugins_url( 'css/admin.css', __FILE__ ) );
678
  }
679
 
680
  /**
681
+ * Load scripts and styles - frontend.
682
  */
683
  public function front_load_scripts_styles() {
684
+ if ( ! (isset( $_COOKIE[$this->cookie['name']] ) && $_COOKIE[$this->cookie['name']] === $this->cookie['value']) ) {
685
  wp_enqueue_script(
686
+ 'cookie-notice-front', plugins_url( 'js/front.js', __FILE__ ), array( 'jquery' ), $this->defaults['version'], isset( $this->options['general']['script_placement'] ) && $this->options['general']['script_placement'] === 'footer' ? true : false
 
 
 
 
687
  );
688
 
689
  wp_localize_script(
690
+ 'cookie-notice-front', 'cnArgs', array(
691
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
692
+ 'hideEffect' => $this->options['general']['hide_effect'],
693
+ 'cookieName' => $this->cookie['name'],
694
+ 'cookieValue' => $this->cookie['value'],
695
+ 'cookieTime' => $this->times[$this->options['general']['time']][1],
696
+ 'cookiePath' => (defined( 'COOKIEPATH' ) ? COOKIEPATH : ''),
697
+ 'cookieDomain' => (defined( 'COOKIE_DOMAIN' ) ? COOKIE_DOMAIN : '')
 
 
698
  )
699
  );
700
 
701
+ wp_enqueue_style( 'cookie-notice-front', plugins_url( 'css/front.css', __FILE__ ) );
702
  }
703
  }
704
+
705
  }
706
+
707
  ?>
includes/update.php CHANGED
@@ -1,40 +1,36 @@
1
  <?php
2
- if(!defined('ABSPATH')) exit;
 
3
 
4
- new Cookie_Notice_Update($cookie_notice);
5
 
6
- class Cookie_Notice_Update
7
- {
8
- private $defaults;
9
 
 
10
 
11
- public function __construct($cookie_notice)
12
- {
13
  // attributes
14
  $this->defaults = $cookie_notice->get_defaults();
15
 
16
  // actions
17
- add_action('init', array($this, 'check_update'));
18
  }
19
 
20
-
21
  /**
22
  *
23
- */
24
- public function check_update()
25
- {
26
- if(!current_user_can('manage_options'))
27
  return;
28
 
29
  // gets current database version
30
- $current_db_version = get_option('cookie_notice_version', '1.0.0');
31
 
32
  // new version?
33
- if(version_compare($current_db_version, $this->defaults['version'], '<'))
34
- {
35
  // updates plugin version
36
- update_option('cookie_notice_version', $this->defaults['version']);
37
  }
38
  }
 
39
  }
40
- ?>
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
 
5
+ new Cookie_Notice_Update( $cookie_notice );
6
 
7
+ class Cookie_Notice_Update {
 
 
8
 
9
+ private $defaults;
10
 
11
+ public function __construct( $cookie_notice ) {
 
12
  // attributes
13
  $this->defaults = $cookie_notice->get_defaults();
14
 
15
  // actions
16
+ add_action( 'init', array( $this, 'check_update' ) );
17
  }
18
 
 
19
  /**
20
  *
21
+ */
22
+ public function check_update() {
23
+ if ( ! current_user_can( 'manage_options' ) )
 
24
  return;
25
 
26
  // gets current database version
27
+ $current_db_version = get_option( 'cookie_notice_version', '1.0.0' );
28
 
29
  // new version?
30
+ if ( version_compare( $current_db_version, $this->defaults['version'], '<' ) ) {
 
31
  // updates plugin version
32
+ update_option( 'cookie_notice_version', $this->defaults['version'] );
33
  }
34
  }
35
+
36
  }
 
js/admin.js CHANGED
@@ -1,32 +1,32 @@
1
- (function($) {
2
-
3
- $(document).ready(function() {
4
-
5
  // initialize color picker
6
- $('.cn-color').wpColorPicker();
7
-
8
  // read more option
9
- $('#cn-see-more-yes, #cn-see-more-no').change(function() {
10
- if($('#cn-see-more-yes:checked').val() === 'yes') {
11
- $('#cn_see_more_opt').fadeIn(300);
12
- } else if($('#cn-see-more-no:checked').val() === 'no') {
13
- $('#cn_see_more_opt').fadeOut(300);
14
  }
15
- });
16
-
17
  // read more link
18
- $('#cn-see-more-link-custom, #cn-see-more-link-page').change(function() {
19
- if($('#cn-see-more-link-custom:checked').val() === 'custom') {
20
- $('#cn_see_more_opt_page').fadeOut(300, function() {
21
- $('#cn_see_more_opt_link').fadeIn(300);
22
- });
23
- } else if($('#cn-see-more-link-page:checked').val() === 'page') {
24
- $('#cn_see_more_opt_link').fadeOut(300, function() {
25
- $('#cn_see_more_opt_page').fadeIn(300);
26
- });
27
  }
28
- });
29
-
30
- });
31
-
32
- })(jQuery);
1
+ ( function ( $ ) {
2
+
3
+ $( document ).ready( function () {
4
+
5
  // initialize color picker
6
+ $( '.cn-color' ).wpColorPicker();
7
+
8
  // read more option
9
+ $( '#cn-see-more-yes, #cn-see-more-no' ).change( function () {
10
+ if ( $( '#cn-see-more-yes:checked' ).val() === 'yes' ) {
11
+ $( '#cn_see_more_opt' ).fadeIn( 300 );
12
+ } else if ( $( '#cn-see-more-no:checked' ).val() === 'no' ) {
13
+ $( '#cn_see_more_opt' ).fadeOut( 300 );
14
  }
15
+ } );
16
+
17
  // read more link
18
+ $( '#cn-see-more-link-custom, #cn-see-more-link-page' ).change( function () {
19
+ if ( $( '#cn-see-more-link-custom:checked' ).val() === 'custom' ) {
20
+ $( '#cn_see_more_opt_page' ).fadeOut( 300, function () {
21
+ $( '#cn_see_more_opt_link' ).fadeIn( 300 );
22
+ } );
23
+ } else if ( $( '#cn-see-more-link-page:checked' ).val() === 'page' ) {
24
+ $( '#cn_see_more_opt_link' ).fadeOut( 300, function () {
25
+ $( '#cn_see_more_opt_page' ).fadeIn( 300 );
26
+ } );
27
  }
28
+ } );
29
+
30
+ } );
31
+
32
+ } )( jQuery );
js/front.js CHANGED
@@ -1,47 +1,47 @@
1
- (function($) {
2
-
3
- $(document).ready(function() {
4
-
5
  // handle close button click
6
- $(document).on('click', '#cn-accept-cookie', function(event) {
7
  event.preventDefault();
8
-
9
  var cnTime = new Date();
10
  var cnLater = new Date();
11
-
12
  // set expiry time in seconds
13
- cnLater.setTime(parseInt(cnTime.getTime()) + parseInt(cnArgs.cookieTime) * 1000);
14
-
15
  // set cookie
16
- document.cookie = cnArgs.cookieName+'=true'+';expires='+cnLater.toGMTString()+';'+(cnArgs.cookieDomain !== undefined && cnArgs.cookieDomain !== '' ? 'domain='+cnArgs.cookieDomain+';' : '')+(cnArgs.cookiePath !== undefined && cnArgs.cookiePath !== '' ? 'path='+cnArgs.cookiePath+';' : '');
17
-
18
  // hide message container
19
- if(cnArgs.hideEffect === 'fade') {
20
- $('#cookie-notice').fadeOut(300, function() {
21
- $(this).remove();
22
- });
23
- } else if(cnArgs.hideEffect === 'slide') {
24
- $('#cookie-notice').slideUp(300, function() {
25
- $(this).remove();
26
- });
27
  } else {
28
- $('#cookie-notice').remove();
29
  }
30
- });
31
-
32
  // display cookie notice
33
- if(document.cookie.indexOf('cookie_notice_accepted') === -1) {
34
- if(cnArgs.hideEffect === 'fade') {
35
- $('#cookie-notice').fadeIn(300);
36
- } else if(cnArgs.hideEffect === 'slide') {
37
- $('#cookie-notice').slideDown(300);
38
  } else {
39
- $('#cookie-notice').show();
40
  }
41
  } else {
42
- $('#cookie-notice').remove();
43
  }
44
-
45
- });
46
-
47
- })(jQuery);
1
+ ( function ( $ ) {
2
+
3
+ $( document ).ready( function () {
4
+
5
  // handle close button click
6
+ $( document ).on( 'click', '#cn-accept-cookie', function ( event ) {
7
  event.preventDefault();
8
+
9
  var cnTime = new Date();
10
  var cnLater = new Date();
11
+
12
  // set expiry time in seconds
13
+ cnLater.setTime( parseInt( cnTime.getTime() ) + parseInt( cnArgs.cookieTime ) * 1000 );
14
+
15
  // set cookie
16
+ document.cookie = cnArgs.cookieName + '=true' + ';expires=' + cnLater.toGMTString() + ';' + ( cnArgs.cookieDomain !== undefined && cnArgs.cookieDomain !== '' ? 'domain=' + cnArgs.cookieDomain + ';' : '' ) + ( cnArgs.cookiePath !== undefined && cnArgs.cookiePath !== '' ? 'path=' + cnArgs.cookiePath + ';' : '' );
17
+
18
  // hide message container
19
+ if ( cnArgs.hideEffect === 'fade' ) {
20
+ $( '#cookie-notice' ).fadeOut( 300, function () {
21
+ $( this ).remove();
22
+ } );
23
+ } else if ( cnArgs.hideEffect === 'slide' ) {
24
+ $( '#cookie-notice' ).slideUp( 300, function () {
25
+ $( this ).remove();
26
+ } );
27
  } else {
28
+ $( '#cookie-notice' ).remove();
29
  }
30
+ } );
31
+
32
  // display cookie notice
33
+ if ( document.cookie.indexOf( 'cookie_notice_accepted' ) === -1 ) {
34
+ if ( cnArgs.hideEffect === 'fade' ) {
35
+ $( '#cookie-notice' ).fadeIn( 300 );
36
+ } else if ( cnArgs.hideEffect === 'slide' ) {
37
+ $( '#cookie-notice' ).slideDown( 300 );
38
  } else {
39
+ $( '#cookie-notice' ).show();
40
  }
41
  } else {
42
+ $( '#cookie-notice' ).remove();
43
  }
44
+
45
+ } );
46
+
47
+ } )( jQuery );
languages/cookie-notice-sv_SE.mo CHANGED
Binary file
languages/cookie-notice-sv_SE.po CHANGED
@@ -1,99 +1,107 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: \n"
4
- "POT-Creation-Date: 2014-07-25 09:45+0100\n"
5
- "PO-Revision-Date: 2014-09-17 22:11+0200\n"
6
- "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "Language: sv_SE\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.6.9\n"
13
  "X-Poedit-Basepath: .\n"
14
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
 
16
- #: ../cookie-notice.php:101
17
  msgid "Top"
18
  msgstr "Högst upp"
19
 
20
- #: ../cookie-notice.php:102
21
  msgid "Bottom"
22
  msgstr "Längst ner"
23
 
24
- #: ../cookie-notice.php:106 ../cookie-notice.php:137
25
  msgid "None"
26
  msgstr "Ingen"
27
 
28
- #: ../cookie-notice.php:107
29
  msgid "WordPress"
30
  msgstr "WordPress"
31
 
32
- #: ../cookie-notice.php:108
33
  msgid "Bootstrap"
34
  msgstr "Bootstrap"
35
 
36
- #: ../cookie-notice.php:112
37
  msgid "Enable"
38
  msgstr "Aktivera"
39
 
40
- #: ../cookie-notice.php:113
41
  msgid "Disable"
42
  msgstr "Inaktivera"
43
 
44
- #: ../cookie-notice.php:117
45
  msgid "Custom link"
46
  msgstr "Anpassad länk"
47
 
48
- #: ../cookie-notice.php:118
49
  msgid "Page link"
50
  msgstr "Sidlänk"
51
 
52
- #: ../cookie-notice.php:122
53
  msgid "Text color"
54
  msgstr "Textfärg"
55
 
56
- #: ../cookie-notice.php:123
57
  msgid "Bar color"
58
  msgstr "Balkfärg"
59
 
60
- #: ../cookie-notice.php:127
61
  msgid "1 day"
62
  msgstr "1 dag"
63
 
64
- #: ../cookie-notice.php:128
65
  msgid "1 week"
66
  msgstr "1 vecka"
67
 
68
- #: ../cookie-notice.php:129
69
  msgid "1 month"
70
  msgstr "1 månad"
71
 
72
- #: ../cookie-notice.php:130
73
  msgid "3 months"
74
  msgstr "3 månader"
75
 
76
- #: ../cookie-notice.php:131
77
  msgid "6 months"
78
  msgstr "6 månader"
79
 
80
- #: ../cookie-notice.php:132
81
  msgid "1 year"
82
  msgstr "1 år"
83
 
84
- #: ../cookie-notice.php:133
85
  msgid "infinity"
86
  msgstr "oändligt"
87
 
88
- #: ../cookie-notice.php:138
89
  msgid "Fade"
90
  msgstr "Fade"
91
 
92
- #: ../cookie-notice.php:139
93
  msgid "Slide"
94
  msgstr "Glid"
95
 
 
 
 
 
96
  #: ../cookie-notice.php:159
 
 
 
 
97
  msgid ""
98
  "We use cookies to ensure that we give you the best experience on our "
99
  "website. If you continue to use this site we will assume that you are happy "
@@ -103,157 +111,180 @@ msgstr ""
103
  "vår hemsida. Om du fortsätter att använda den här webbplatsen kommer vi att "
104
  "anta att du godkänner detta."
105
 
106
- #: ../cookie-notice.php:160
107
  msgid "Ok"
108
  msgstr "Ok"
109
 
110
- #: ../cookie-notice.php:161
111
  msgid "Read more"
112
  msgstr "Läs mer"
113
 
114
- #: ../cookie-notice.php:188 ../cookie-notice.php:189 ../cookie-notice.php:201
115
- #: ../cookie-notice.php:204
116
  msgid "Cookie Notice"
117
  msgstr "Cookie meddelande"
118
 
119
- #: ../cookie-notice.php:206
120
  msgid "Need support?"
121
  msgstr "Behöver du hjälp?"
122
 
123
- #: ../cookie-notice.php:207
124
  msgid ""
125
  "If you are having problems with this plugin, please talk about them in the"
126
  msgstr "Om du har problem med detta tillägg så kan du besöka vårt"
127
 
128
- #: ../cookie-notice.php:207
129
  msgid "Support forum"
130
  msgstr "Supportforum"
131
 
132
- #: ../cookie-notice.php:209
133
  msgid "Do you like this plugin?"
134
  msgstr "Tycker du om detta tillägg?"
135
 
136
- #: ../cookie-notice.php:210
137
  msgid "Rate it 5"
138
  msgstr "Ge det en 5:a"
139
 
140
- #: ../cookie-notice.php:210
141
  msgid "on WordPress.org"
142
  msgstr "på WordPress.org"
143
 
144
- #: ../cookie-notice.php:211
145
  msgid "Blog about it & link to the"
146
  msgstr "Blogga om det och länka till"
147
 
148
- #: ../cookie-notice.php:211
149
  msgid "plugin page"
150
  msgstr "tilläggets webbplats"
151
 
152
- #: ../cookie-notice.php:212
153
  msgid "Check out our other"
154
  msgstr "Kolla våra andra"
155
 
156
- #: ../cookie-notice.php:212
157
  msgid "WordPress plugins"
158
  msgstr "WordPress tillägg"
159
 
160
- #: ../cookie-notice.php:238
161
  msgid "Configuration"
162
  msgstr "Konfiguration"
163
 
164
- #: ../cookie-notice.php:239
165
  msgid "Message"
166
  msgstr "Meddelande"
167
 
168
- #: ../cookie-notice.php:240 ../cookie-notice.php:316
169
  msgid "Button text"
170
  msgstr "Knapptext"
171
 
172
- #: ../cookie-notice.php:241
173
  msgid "More info"
174
  msgstr "Mera info"
175
 
176
- #: ../cookie-notice.php:242
 
 
 
 
177
  msgid "Cookie expiry"
178
  msgstr "Utgång av cookie"
179
 
180
- #: ../cookie-notice.php:243
 
 
 
 
181
  msgid "Deactivation"
182
  msgstr "Avaktivering"
183
 
184
- #: ../cookie-notice.php:246
185
  msgid "Design"
186
  msgstr "Design"
187
 
188
- #: ../cookie-notice.php:247
189
  msgid "Position"
190
  msgstr "Position"
191
 
192
- #: ../cookie-notice.php:248
193
  msgid "Animation"
194
  msgstr "Animation"
195
 
196
- #: ../cookie-notice.php:249
197
  msgid "Button style"
198
  msgstr "Knappstil"
199
 
200
- #: ../cookie-notice.php:250
201
  msgid "Colors"
202
  msgstr "Färger"
203
 
204
- #: ../cookie-notice.php:271
205
  msgid "Enable if you want all plugin data to be deleted on deactivation."
206
  msgstr ""
207
  "Aktivera om du vill att all data ska tas bort vid avaktivering av tillägget."
208
 
209
- #: ../cookie-notice.php:282
210
  msgid "Enter the cookie notice message."
211
  msgstr "Ange notismeddelandet för cookien."
212
 
213
- #: ../cookie-notice.php:292
214
- msgid "The text to show on the button when cookies have not been accepted"
215
- msgstr "Texten som visas knappen cookies inte ännu blivit godkända"
 
 
 
 
216
 
217
- #: ../cookie-notice.php:312
218
  msgid "Enable or Disable Read more button."
219
  msgstr "Aktivera eller inaktivera läs mer-knappen"
220
 
221
- #: ../cookie-notice.php:330
222
  msgid "Select where to redirect user for more information about cookies."
223
  msgstr "Välj var du vill omdirigera användaren för mer information om cookies."
224
 
225
- #: ../cookie-notice.php:333
226
  msgid "-- select page --"
227
  msgstr "-- välj sida --"
228
 
229
- #: ../cookie-notice.php:343
230
  msgid "Select from one of your site's pages"
231
  msgstr "Välj från en av dina sidor på din webbplats."
232
 
233
- #: ../cookie-notice.php:347
234
  msgid "Enter the full URL starting with http://"
235
  msgstr "Ange den fullständiga webbadressen som börjar med http: //"
236
 
237
- #: ../cookie-notice.php:368
 
 
 
 
238
  msgid "The ammount of time that cookie should be stored for."
239
  msgstr "Den tid som cookien ska lagras."
240
 
241
- #: ../cookie-notice.php:388
 
 
 
 
242
  msgid "Select location for your cookie notice."
243
  msgstr "Välj plats för din cookie meddelande."
244
 
245
- #: ../cookie-notice.php:408
246
  msgid "Cookie notice acceptance animation."
247
  msgstr "Animation för godkännande av cookie meddelandet."
248
 
249
- #: ../cookie-notice.php:428
250
  msgid "Choose buttons style."
251
  msgstr "Välj knapparnas stil."
252
 
253
- #: ../cookie-notice.php:555
254
  msgid "Support"
255
  msgstr "Support"
256
 
257
- #: ../cookie-notice.php:586
258
  msgid "Settings"
259
  msgstr "Inställningar"
 
 
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: \n"
4
+ "POT-Creation-Date: 2015-03-24 11:30+0100\n"
5
+ "PO-Revision-Date: 2015-04-30 13:58+0100\n"
6
+ "Last-Translator: Ove Kaufeldt <ove.kaufeldt@shin-ken.se>\n"
7
  "Language-Team: \n"
8
  "Language: sv_SE\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.7.6\n"
13
  "X-Poedit-Basepath: .\n"
14
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
 
16
+ #: ../cookie-notice.php:111
17
  msgid "Top"
18
  msgstr "Högst upp"
19
 
20
+ #: ../cookie-notice.php:112
21
  msgid "Bottom"
22
  msgstr "Längst ner"
23
 
24
+ #: ../cookie-notice.php:116 ../cookie-notice.php:152
25
  msgid "None"
26
  msgstr "Ingen"
27
 
28
+ #: ../cookie-notice.php:117
29
  msgid "WordPress"
30
  msgstr "WordPress"
31
 
32
+ #: ../cookie-notice.php:118
33
  msgid "Bootstrap"
34
  msgstr "Bootstrap"
35
 
36
+ #: ../cookie-notice.php:122
37
  msgid "Enable"
38
  msgstr "Aktivera"
39
 
40
+ #: ../cookie-notice.php:123
41
  msgid "Disable"
42
  msgstr "Inaktivera"
43
 
44
+ #: ../cookie-notice.php:127
45
  msgid "Custom link"
46
  msgstr "Anpassad länk"
47
 
48
+ #: ../cookie-notice.php:128
49
  msgid "Page link"
50
  msgstr "Sidlänk"
51
 
52
+ #: ../cookie-notice.php:137
53
  msgid "Text color"
54
  msgstr "Textfärg"
55
 
56
+ #: ../cookie-notice.php:138
57
  msgid "Bar color"
58
  msgstr "Balkfärg"
59
 
60
+ #: ../cookie-notice.php:142
61
  msgid "1 day"
62
  msgstr "1 dag"
63
 
64
+ #: ../cookie-notice.php:143
65
  msgid "1 week"
66
  msgstr "1 vecka"
67
 
68
+ #: ../cookie-notice.php:144
69
  msgid "1 month"
70
  msgstr "1 månad"
71
 
72
+ #: ../cookie-notice.php:145
73
  msgid "3 months"
74
  msgstr "3 månader"
75
 
76
+ #: ../cookie-notice.php:146
77
  msgid "6 months"
78
  msgstr "6 månader"
79
 
80
+ #: ../cookie-notice.php:147
81
  msgid "1 year"
82
  msgstr "1 år"
83
 
84
+ #: ../cookie-notice.php:148
85
  msgid "infinity"
86
  msgstr "oändligt"
87
 
88
+ #: ../cookie-notice.php:153
89
  msgid "Fade"
90
  msgstr "Fade"
91
 
92
+ #: ../cookie-notice.php:154
93
  msgid "Slide"
94
  msgstr "Glid"
95
 
96
+ #: ../cookie-notice.php:158
97
+ msgid "Header"
98
+ msgstr "Sidhuvud"
99
+
100
  #: ../cookie-notice.php:159
101
+ msgid "Footer"
102
+ msgstr "Sidfot"
103
+
104
+ #: ../cookie-notice.php:179
105
  msgid ""
106
  "We use cookies to ensure that we give you the best experience on our "
107
  "website. If you continue to use this site we will assume that you are happy "
111
  "vår hemsida. Om du fortsätter att använda den här webbplatsen kommer vi att "
112
  "anta att du godkänner detta."
113
 
114
+ #: ../cookie-notice.php:180
115
  msgid "Ok"
116
  msgstr "Ok"
117
 
118
+ #: ../cookie-notice.php:181
119
  msgid "Read more"
120
  msgstr "Läs mer"
121
 
122
+ #: ../cookie-notice.php:211 ../cookie-notice.php:212 ../cookie-notice.php:227
123
+ #: ../cookie-notice.php:230
124
  msgid "Cookie Notice"
125
  msgstr "Cookie meddelande"
126
 
127
+ #: ../cookie-notice.php:232
128
  msgid "Need support?"
129
  msgstr "Behöver du hjälp?"
130
 
131
+ #: ../cookie-notice.php:233
132
  msgid ""
133
  "If you are having problems with this plugin, please talk about them in the"
134
  msgstr "Om du har problem med detta tillägg så kan du besöka vårt"
135
 
136
+ #: ../cookie-notice.php:233
137
  msgid "Support forum"
138
  msgstr "Supportforum"
139
 
140
+ #: ../cookie-notice.php:235
141
  msgid "Do you like this plugin?"
142
  msgstr "Tycker du om detta tillägg?"
143
 
144
+ #: ../cookie-notice.php:242
145
  msgid "Rate it 5"
146
  msgstr "Ge det en 5:a"
147
 
148
+ #: ../cookie-notice.php:242
149
  msgid "on WordPress.org"
150
  msgstr "på WordPress.org"
151
 
152
+ #: ../cookie-notice.php:243
153
  msgid "Blog about it & link to the"
154
  msgstr "Blogga om det och länka till"
155
 
156
+ #: ../cookie-notice.php:243
157
  msgid "plugin page"
158
  msgstr "tilläggets webbplats"
159
 
160
+ #: ../cookie-notice.php:244
161
  msgid "Check out our other"
162
  msgstr "Kolla våra andra"
163
 
164
+ #: ../cookie-notice.php:244
165
  msgid "WordPress plugins"
166
  msgstr "WordPress tillägg"
167
 
168
+ #: ../cookie-notice.php:272
169
  msgid "Configuration"
170
  msgstr "Konfiguration"
171
 
172
+ #: ../cookie-notice.php:273
173
  msgid "Message"
174
  msgstr "Meddelande"
175
 
176
+ #: ../cookie-notice.php:274 ../cookie-notice.php:361
177
  msgid "Button text"
178
  msgstr "Knapptext"
179
 
180
+ #: ../cookie-notice.php:275
181
  msgid "More info"
182
  msgstr "Mera info"
183
 
184
+ #: ../cookie-notice.php:276
185
+ msgid "Link target"
186
+ msgstr "Länkmål"
187
+
188
+ #: ../cookie-notice.php:277
189
  msgid "Cookie expiry"
190
  msgstr "Utgång av cookie"
191
 
192
+ #: ../cookie-notice.php:278
193
+ msgid "Script placement"
194
+ msgstr "Skriptplacering"
195
+
196
+ #: ../cookie-notice.php:279
197
  msgid "Deactivation"
198
  msgstr "Avaktivering"
199
 
200
+ #: ../cookie-notice.php:282
201
  msgid "Design"
202
  msgstr "Design"
203
 
204
+ #: ../cookie-notice.php:283
205
  msgid "Position"
206
  msgstr "Position"
207
 
208
+ #: ../cookie-notice.php:284
209
  msgid "Animation"
210
  msgstr "Animation"
211
 
212
+ #: ../cookie-notice.php:285
213
  msgid "Button style"
214
  msgstr "Knappstil"
215
 
216
+ #: ../cookie-notice.php:286
217
  msgid "Colors"
218
  msgstr "Färger"
219
 
220
+ #: ../cookie-notice.php:307
221
  msgid "Enable if you want all plugin data to be deleted on deactivation."
222
  msgstr ""
223
  "Aktivera om du vill att all data ska tas bort vid avaktivering av tillägget."
224
 
225
+ #: ../cookie-notice.php:321
226
  msgid "Enter the cookie notice message."
227
  msgstr "Ange notismeddelandet för cookien."
228
 
229
+ #: ../cookie-notice.php:334
230
+ msgid ""
231
+ "The text of the option to accept the usage of the cookies and make the "
232
+ "notification disappear."
233
+ msgstr ""
234
+ "Texten i alternativet för att acceptera användningen av cookies och få "
235
+ "meddelandet att försvinna."
236
 
237
+ #: ../cookie-notice.php:357
238
  msgid "Enable or Disable Read more button."
239
  msgstr "Aktivera eller inaktivera läs mer-knappen"
240
 
241
+ #: ../cookie-notice.php:375
242
  msgid "Select where to redirect user for more information about cookies."
243
  msgstr "Välj var du vill omdirigera användaren för mer information om cookies."
244
 
245
+ #: ../cookie-notice.php:378
246
  msgid "-- select page --"
247
  msgstr "-- välj sida --"
248
 
249
+ #: ../cookie-notice.php:388
250
  msgid "Select from one of your site's pages"
251
  msgstr "Välj från en av dina sidor på din webbplats."
252
 
253
+ #: ../cookie-notice.php:392
254
  msgid "Enter the full URL starting with http://"
255
  msgstr "Ange den fullständiga webbadressen som börjar med http: //"
256
 
257
+ #: ../cookie-notice.php:414
258
+ msgid "Select the link target for more info page."
259
+ msgstr "Välj länk till sidan för den som vill ha mer information."
260
+
261
+ #: ../cookie-notice.php:437
262
  msgid "The ammount of time that cookie should be stored for."
263
  msgstr "Den tid som cookien ska lagras."
264
 
265
+ #: ../cookie-notice.php:458
266
+ msgid "Select where all the plugin scripts should be placed."
267
+ msgstr "Välj var alla tilläggets skript ska placeras."
268
+
269
+ #: ../cookie-notice.php:481
270
  msgid "Select location for your cookie notice."
271
  msgstr "Välj plats för din cookie meddelande."
272
 
273
+ #: ../cookie-notice.php:504
274
  msgid "Cookie notice acceptance animation."
275
  msgstr "Animation för godkännande av cookie meddelandet."
276
 
277
+ #: ../cookie-notice.php:527
278
  msgid "Choose buttons style."
279
  msgstr "Välj knapparnas stil."
280
 
281
+ #: ../cookie-notice.php:663
282
  msgid "Support"
283
  msgstr "Support"
284
 
285
+ #: ../cookie-notice.php:691
286
  msgid "Settings"
287
  msgstr "Inställningar"
288
+
289
+ #~ msgid "The text to show on the button when cookies have not been accepted"
290
+ #~ msgstr "Texten som visas på knappen då cookies inte ännu blivit godkända"
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: 4.1.1
7
- Stable tag: 1.2.21
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
@@ -66,6 +66,9 @@ No questions yet.
66
 
67
  == Changelog ==
68
 
 
 
 
69
  = 1.2.21 =
70
  * New: Plugin development moved to [dFactory GitHub Repository](https://github.com/dfactoryplugins)
71
  * Tweak: Code cleanup
@@ -158,6 +161,5 @@ Initial release
158
 
159
  == Upgrade Notice ==
160
 
161
- = 1.2.21 =
162
- * New: Plugin development moved to [dFactory GitHub Repository](https://github.com/dfactoryplugins)
163
- * Tweak: Code cleanup
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: 4.2.1
7
+ Stable tag: 1.2.22
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
66
 
67
  == Changelog ==
68
 
69
+ = 1.2.22 =
70
+ * Tweak: Swedish translation updated, thx to Ove Kaufeldt
71
+
72
  = 1.2.21 =
73
  * New: Plugin development moved to [dFactory GitHub Repository](https://github.com/dfactoryplugins)
74
  * Tweak: Code cleanup
161
 
162
  == Upgrade Notice ==
163
 
164
+ = 1.2.22 =
165
+ * Tweak: Swedish translation updated, thx to Ove Kaufeldt