Cookie Consent - Version 1.3

Version Description

Reinstated user-defined permalink field

Download this release

Release Info

Developer Catapult
Plugin Icon 128x128 Cookie Consent
Version 1.3
Comparing to
See all releases

Code changes from version 1.25 to 1.3

Files changed (2) hide show
  1. readme.txt +8 -1
  2. uk-cookie-consent.php +25 -6
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: cookies, eu, cookie law, implied consent, uk cookie consent
5
  Requires at least: 3.3.2
6
  Tested up to: 3.3.2
7
- Stable tag: 1.25
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -30,6 +30,10 @@ Importantly, the plug-in does not disable cookies on your site or prevent the us
30
 
31
  You can find out more about the plug-in on [its plug-in page](http://catapultdesign.co.uk/plugin/uk-cookie-consent/).
32
 
 
 
 
 
33
  = Where can I find out more about the UK laws regarding cookies? =
34
 
35
  We have written a short article on [our interpretation of the UK cookie law](http://catapultdesign.co.uk/uk-cookie-consent/). This outlines some of the background to the regulations and the reasons for choosing the 'implied consent' method.
@@ -44,6 +48,9 @@ You will find more details of the regulations on the [Information Commissioner's
44
 
45
  == Changelog ==
46
 
 
 
 
47
  = 1.25 =
48
  Minor admin update
49
 
4
  Tags: cookies, eu, cookie law, implied consent, uk cookie consent
5
  Requires at least: 3.3.2
6
  Tested up to: 3.3.2
7
+ Stable tag: 1.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
30
 
31
  You can find out more about the plug-in on [its plug-in page](http://catapultdesign.co.uk/plugin/uk-cookie-consent/).
32
 
33
+ = Does this definitely cover me under the legislation? =
34
+
35
+ You have to make up your own mind about that or consult a legal expert.
36
+
37
  = Where can I find out more about the UK laws regarding cookies? =
38
 
39
  We have written a short article on [our interpretation of the UK cookie law](http://catapultdesign.co.uk/uk-cookie-consent/). This outlines some of the background to the regulations and the reasons for choosing the 'implied consent' method.
48
 
49
  == Changelog ==
50
 
51
+ = 1.3 =
52
+ Reinstated user-defined permalink field
53
+
54
  = 1.25 =
55
  Minor admin update
56
 
uk-cookie-consent.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: UK Cookie Consent
4
  Plugin URI: http://catapultdesign.co.uk/plugin/uk-cookie-consent/
5
  Description: Simple plug-in to help compliance with the UK interpretation of the EU regulations regarding usage of website cookies. A user to your site is presented with a clear yet unobtrusive notification that the site is using cookies and may then acknowledge and dismiss the notification or click to find out more. The plug-in does not disable cookies on your site or prevent the user from continuing to browse the site - it comes with standard wording on what cookies are and advice on how to disable them in the browser. The plug-in follows the notion of "implied consent" as described by the UK's Information Commissioner and makes the assumption that most users who choose not to accept cookies will do so for all websites.
6
  Author: Catapult
7
- Version: 1.25
8
  Author URI: http://catapultdesign.co.uk/
9
  */
10
 
@@ -51,7 +51,12 @@ function catapult_cookie_options_page() { ?>
51
  <?php settings_fields('catapult_cookie_options'); ?>
52
  <?php do_settings_sections('catapult_cookie'); ?>
53
  <input name="cat_submit" type="submit" id="submit" class="button-primary" style="margin-top:30px;" value="<?php esc_attr_e('Save Changes'); ?>" />
54
- <p>Your Cookies Policy page is <a href="<?php bloginfo ( 'url' ); ?>/cookie-policy/">here</a>. You may wish to create a menu item or other link on your site to this page.</p>
 
 
 
 
 
55
  </form>
56
  </div>
57
  </div>
@@ -76,11 +81,12 @@ function catapult_cookie_admin_init(){
76
  add_settings_section('catapult_cookie_main', '', 'catapult_cookie_section_text', 'catapult_cookie', 'catapult_cookie_main' );
77
  add_settings_field('catapult_cookie_text', 'Notification text', 'catapult_cookie_text_settings', 'catapult_cookie', 'catapult_cookie_main' );
78
  add_settings_field('catapult_cookie_accept', 'Accept text', 'catapult_cookie_accept_settings', 'catapult_cookie', 'catapult_cookie_main' );
79
- add_settings_field('catapult_cookie_more', 'More info text', 'catapult_cookie_more_settings', 'catapult_cookie', 'catapult_cookie_main' );
 
80
  }
81
 
82
  function catapult_cookie_section_text() {
83
- echo '<p>You can just use these settings as they are or update the text as you wish. We recommend keeping it brief.</p><p>For any support queries, please post on the <a href="http://wordpress.org/extend/plugins/uk-cookie-consent/">WordPress forum</a>.</p><p><strong>And if this plug-in has been helpful to you, then <a href="http://wordpress.org/extend/plugins/uk-cookie-consent/">please rate it</a>.</strong></p>';
84
  }
85
 
86
  function catapult_cookie_text_settings() {
@@ -107,12 +113,21 @@ function catapult_cookie_more_settings() {
107
  }
108
  echo "<input id='catapult_cookie_more_settings' name='catapult_cookie_options[catapult_cookie_more_settings]' size='50' type='text' value='{$value}' />";
109
  }
 
 
 
 
 
 
 
 
110
 
111
  function catapult_cookie_options_validate($input) {
112
  $options = get_option( 'catapult_cookie_options' );
113
  $options['catapult_cookie_text_settings'] = trim($input['catapult_cookie_text_settings']);
114
  $options['catapult_cookie_accept_settings'] = trim($input['catapult_cookie_accept_settings']);
115
  $options['catapult_cookie_more_settings'] = trim($input['catapult_cookie_more_settings']);
 
116
  return $options;
117
  }
118
 
@@ -204,8 +219,12 @@ function catapult_add_cookie_bar() {
204
  } else {
205
  $more_text = "Find out more";
206
  }
207
- $link_text = strtolower ( $options['catapult_cookie_link_settings'] );
208
- echo '<div id="catapult-cookie-bar">' . htmlspecialchars ( $current_text ) . '<button id="catapultCookie" onclick="catapultAcceptCookies()">' . htmlspecialchars ( $accept_text ) . '</button><a href="' . get_bloginfo ( 'url' ) . '/cookie-policy/' . '">' . htmlspecialchars ( $more_text ) . '</a></div>';
 
 
 
 
209
  }
210
  }
211
  add_action ( 'wp_footer', 'catapult_add_cookie_bar', 1000 );
4
  Plugin URI: http://catapultdesign.co.uk/plugin/uk-cookie-consent/
5
  Description: Simple plug-in to help compliance with the UK interpretation of the EU regulations regarding usage of website cookies. A user to your site is presented with a clear yet unobtrusive notification that the site is using cookies and may then acknowledge and dismiss the notification or click to find out more. The plug-in does not disable cookies on your site or prevent the user from continuing to browse the site - it comes with standard wording on what cookies are and advice on how to disable them in the browser. The plug-in follows the notion of "implied consent" as described by the UK's Information Commissioner and makes the assumption that most users who choose not to accept cookies will do so for all websites.
6
  Author: Catapult
7
+ Version: 1.3
8
  Author URI: http://catapultdesign.co.uk/
9
  */
10
 
51
  <?php settings_fields('catapult_cookie_options'); ?>
52
  <?php do_settings_sections('catapult_cookie'); ?>
53
  <input name="cat_submit" type="submit" id="submit" class="button-primary" style="margin-top:30px;" value="<?php esc_attr_e('Save Changes'); ?>" />
54
+ <?php $options = get_option('catapult_cookie_options');
55
+ $value = htmlentities ( $options['catapult_cookie_link_settings'], ENT_QUOTES );
56
+ if ( !$value ) {
57
+ $value = 'cookie-policy';
58
+ } ?>
59
+ <p>Your Cookies Policy page is <a href="<?php bloginfo ( 'url' ); ?>/<?php echo $value; ?>/">here</a>. You may wish to create a menu item or other link on your site to this page.</p>
60
  </form>
61
  </div>
62
  </div>
81
  add_settings_section('catapult_cookie_main', '', 'catapult_cookie_section_text', 'catapult_cookie', 'catapult_cookie_main' );
82
  add_settings_field('catapult_cookie_text', 'Notification text', 'catapult_cookie_text_settings', 'catapult_cookie', 'catapult_cookie_main' );
83
  add_settings_field('catapult_cookie_accept', 'Accept text', 'catapult_cookie_accept_settings', 'catapult_cookie', 'catapult_cookie_main' );
84
+ add_settings_field('catapult_cookie_more', 'More info text', 'catapult_cookie_more_settings', 'catapult_cookie', 'catapult_cookie_main' );
85
+ add_settings_field('catapult_cookie_link', 'Info page permalink', 'catapult_cookie_link_settings', 'catapult_cookie', 'catapult_cookie_main' );
86
  }
87
 
88
  function catapult_cookie_section_text() {
89
+ echo '<p>You can just use these settings as they are or update the text as you wish. We recommend keeping it brief.</p><p>The plug-in automatically creates a page called "Cookie Policy" and sets the default More Info link to yoursitename.com/cookie-policy.</p><p>If you find the page hasn\'t been created, hit the Save Changes button on this page.</p><p>If you would like to change the permalink, just update the Info page permalink setting, e.g. enter "?page_id=4" if you are using the default permalink settings (and 4 is the id of your new Cookie Policy page).</p><p>For any support queries, please post on the <a href="http://wordpress.org/extend/plugins/uk-cookie-consent/">WordPress forum</a>.</p><p><strong>And if this plug-in has been helpful to you, then <a href="http://wordpress.org/extend/plugins/uk-cookie-consent/">please rate it</a>.</strong></p>';
90
  }
91
 
92
  function catapult_cookie_text_settings() {
113
  }
114
  echo "<input id='catapult_cookie_more_settings' name='catapult_cookie_options[catapult_cookie_more_settings]' size='50' type='text' value='{$value}' />";
115
  }
116
+ function catapult_cookie_link_settings() {
117
+ $options = get_option('catapult_cookie_options');
118
+ $value = htmlentities ( $options['catapult_cookie_link_settings'], ENT_QUOTES );
119
+ if ( !$value ) {
120
+ $value = 'cookie-policy';
121
+ }
122
+ echo "<input id='catapult_cookie_link_settings' name='catapult_cookie_options[catapult_cookie_link_settings]' size='50' type='text' value='{$value}' />";
123
+ }
124
 
125
  function catapult_cookie_options_validate($input) {
126
  $options = get_option( 'catapult_cookie_options' );
127
  $options['catapult_cookie_text_settings'] = trim($input['catapult_cookie_text_settings']);
128
  $options['catapult_cookie_accept_settings'] = trim($input['catapult_cookie_accept_settings']);
129
  $options['catapult_cookie_more_settings'] = trim($input['catapult_cookie_more_settings']);
130
+ $options['catapult_cookie_link_settings'] = trim($input['catapult_cookie_link_settings']);
131
  return $options;
132
  }
133
 
219
  } else {
220
  $more_text = "Find out more";
221
  }
222
+ if ( $options['catapult_cookie_link_settings'] ) {
223
+ $link_text = strtolower ( $options['catapult_cookie_link_settings'] );
224
+ } else {
225
+ $link_text = "cookie-policy";
226
+ }
227
+ echo '<div id="catapult-cookie-bar">' . htmlspecialchars ( $current_text ) . '<button id="catapultCookie" onclick="catapultAcceptCookies()">' . htmlspecialchars ( $accept_text ) . '</button><a href="' . get_bloginfo ( 'url' ) . '/' . $link_text . '/">' . htmlspecialchars ( $more_text ) . '</a></div>';
228
  }
229
  }
230
  add_action ( 'wp_footer', 'catapult_add_cookie_bar', 1000 );