Cookie Consent - Version 1.25

Version Description

Minor admin update

Download this release

Release Info

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

Code changes from version 1.2 to 1.25

Files changed (3) hide show
  1. readme.txt +27 -5
  2. screenshot-2.gif +0 -0
  3. uk-cookie-consent.php +52 -42
readme.txt CHANGED
@@ -4,17 +4,19 @@ 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.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Shows an unobtrusive yet clear message to users that the site uses cookies.
12
 
13
  == Description ==
14
 
15
- 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 automatically creates a new page with pre-populated information on cookies and how to disable them, which you may further edit if you wish.
16
 
17
- Importantly, 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.
 
 
18
 
19
  == Installation ==
20
 
@@ -42,7 +44,27 @@ You will find more details of the regulations on the [Information Commissioner's
42
 
43
  == Changelog ==
44
 
45
- 1.1 Added default text to messages
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
  == Upgrade Notice ==
48
 
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
 
11
+ Shows an unobtrusive yet clear message to users that your site uses cookies.
12
 
13
  == Description ==
14
 
15
+ We think this is the simplest but most effective method of dealing with the legislation.
16
 
17
+ The plug-in is a straightforward approach to help you comply with the UK interpretation of the EU regulations regarding usage of website cookies. It 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. 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 automatically creates a new page with pre-populated information on cookies and how to disable them, which you may edit further if you wish.
18
+
19
+ Importantly, the plug-in does not disable cookies on your site or prevent the user from continuing to browse the site. Several plug-ins have adopted the "explicit consent" approach which obliges users to opt in to cookies on your site. This is likely to deter visitors.
20
 
21
  == Installation ==
22
 
44
 
45
  == Changelog ==
46
 
47
+ = 1.25 =
48
+ Minor admin update
49
+
50
+ = 1.24 =
51
+ Fixed text alignment issue with Thesis framework (thanks to cavnit for pointing this one out)
52
+
53
+ = 1.23 =
54
+ Minor admin update
55
+
56
+ = 1.22 =
57
+ Minor admin update
58
+
59
+ = 1.21 =
60
+ Added resources to Settings page
61
+
62
+ = 1.2 =
63
+ Change title of Cookies page to Cookie Policy and removed option to change title
64
+ Added trailing slash to Cookie Policy url (thanks to mikeotgaar for spotting this)
65
+
66
+ = 1.1 =
67
+ Added default text to messages
68
 
69
  == Upgrade Notice ==
70
 
screenshot-2.gif CHANGED
Binary file
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.2
8
  Author URI: http://catapultdesign.co.uk/
9
  */
10
 
@@ -21,48 +21,66 @@ function catapult_cookie_plugin_menu() {
21
 
22
  function catapult_cookie_options_page() { ?>
23
  <div class="wrap">
24
- <h2>Cookie Consent Settings</h2>
25
- <?php //Check to see if the info page has been created
26
- $options = get_option('catapult_cookie_options');
27
- $pagename = $options['catapult_cookie_link_settings'];
28
- if ( !$pagename ) $pagename = 'Cookies';
29
- $cpage = get_page_by_title ( $pagename );
30
- if ( !$cpage ) {
31
- global $user_ID;
32
- $page['post_type'] = 'page';
33
- $page['post_content'] = '<p>This site uses cookies - small text files that are placed on your machine to help the site provide a better user experience. In general, cookies are used to retain user preferences, store information for things like shopping carts, and provide anonymised tracking data to third party applications like Google Analytics.</p>
34
- <p>As a rule, cookies will make your browsing experience better. However, you may prefer to disable cookies on this site and on others. The most effective way to do this is to disable cookies in your browser. We suggest consulting the Help section of your browser or taking a look at <a href="http://www.aboutcookies.org">the About Cookies website</a> which offers guidance for all modern browsers.</p>';
35
- $page['post_parent'] = 0;
36
- $page['post_author'] = $user_ID;
37
- $page['post_status'] = 'publish';
38
- $page['post_title'] = $pagename;
39
- $pageid = wp_insert_post ( $page );
40
- if ( $pageid == 0 ) {
41
- echo '<div class="updated settings-error">Failed to create page.</div>';
42
- }
43
- } ?>
44
- <form action="options.php" method="post">
45
-
46
- <?php settings_fields('catapult_cookie_options'); ?>
47
- <?php do_settings_sections('catapult_cookie'); ?>
48
- <input name="cat_submit" type="submit" id="submit" class="button-primary" style="margin-top:30px;" value="<?php esc_attr_e('Save Changes'); ?>" />
49
- </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  </div>
51
  <?php }
52
 
53
  add_action('admin_init', 'catapult_cookie_admin_init');
54
  function catapult_cookie_admin_init(){
55
  register_setting( 'catapult_cookie_options', 'catapult_cookie_options', 'catapult_cookie_options_validate' );
56
- add_settings_section('catapult_cookie_main', 'Settings', 'catapult_cookie_section_text', 'catapult_cookie', 'catapult_cookie_main' );
57
  add_settings_field('catapult_cookie_text', 'Notification text', 'catapult_cookie_text_settings', 'catapult_cookie', 'catapult_cookie_main' );
58
  add_settings_field('catapult_cookie_accept', 'Accept text', 'catapult_cookie_accept_settings', 'catapult_cookie', 'catapult_cookie_main' );
59
- add_settings_field('catapult_cookie_more', 'More info text', 'catapult_cookie_more_settings', 'catapult_cookie', 'catapult_cookie_main' );
60
- add_settings_field('catapult_cookie_link', 'Info page name', 'catapult_cookie_link_settings', 'catapult_cookie', 'catapult_cookie_main' );
61
  }
62
 
63
  function catapult_cookie_section_text() {
64
- echo '<p>You can just use these settings as they are or update the text as you wish. We recommend keeping it brief.</p>
65
- <p>For any support queries, please post on the <a href="http://wordpress.org/extend/plugins/uk-cookie-consent/">WordPress forum</a>.</p>';
66
  }
67
 
68
  function catapult_cookie_text_settings() {
@@ -89,21 +107,12 @@ function catapult_cookie_more_settings() {
89
  }
90
  echo "<input id='catapult_cookie_more_settings' name='catapult_cookie_options[catapult_cookie_more_settings]' size='50' type='text' value='{$value}' />";
91
  }
92
- function catapult_cookie_link_settings() {
93
- $options = get_option('catapult_cookie_options');
94
- $value = htmlentities ( $options['catapult_cookie_link_settings'], ENT_QUOTES );
95
- if ( !$value ) {
96
- $value = 'Cookies';
97
- }
98
- echo "<input id='catapult_cookie_link_settings' name='catapult_cookie_options[catapult_cookie_link_settings]' size='50' type='text' value='{$value}' />";
99
- }
100
 
101
  function catapult_cookie_options_validate($input) {
102
  $options = get_option( 'catapult_cookie_options' );
103
  $options['catapult_cookie_text_settings'] = trim($input['catapult_cookie_text_settings']);
104
  $options['catapult_cookie_accept_settings'] = trim($input['catapult_cookie_accept_settings']);
105
  $options['catapult_cookie_more_settings'] = trim($input['catapult_cookie_more_settings']);
106
- $options['catapult_cookie_link_settings'] = trim($input['catapult_cookie_link_settings']);
107
  return $options;
108
  }
109
 
@@ -138,6 +147,7 @@ function catapult_add_cookie_css() {
138
  background-image: -webkit-gradient(linear,left bottom,left top,from( #373737),to(#464646));
139
  background-image: -webkit-linear-gradient(bottom, #373737, #464646 5px);
140
  background-image: linear-gradient(bottom, #373737, #464646 5px);
 
141
  }
142
  #catapult-cookie-bar a {
143
  color:#fff;
@@ -195,7 +205,7 @@ function catapult_add_cookie_bar() {
195
  $more_text = "Find out more";
196
  }
197
  $link_text = strtolower ( $options['catapult_cookie_link_settings'] );
198
- 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>';
199
  }
200
  }
201
  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.25
8
  Author URI: http://catapultdesign.co.uk/
9
  */
10
 
21
 
22
  function catapult_cookie_options_page() { ?>
23
  <div class="wrap">
24
+ <h2>UK Cookie Consent</h2>
25
+ <div id="poststuff" class="metabox-holder has-right-sidebar">
26
+ <div class="meta-box-sortabless">
27
+ <div class="postbox">
28
+ <h3 class="hndle">Your settings</h3>
29
+ <div class="inside">
30
+ <?php //Check to see if the info page has been created
31
+ $options = get_option('catapult_cookie_options');
32
+ $pagename = 'Cookie Policy';
33
+ $cpage = get_page_by_title ( $pagename );
34
+ if ( !$cpage ) {
35
+ global $user_ID;
36
+ $page['post_type'] = 'page';
37
+ $page['post_content'] = '<p>This site uses cookies - small text files that are placed on your machine to help the site provide a better user experience. In general, cookies are used to retain user preferences, store information for things like shopping carts, and provide anonymised tracking data to third party applications like Google Analytics.</p>
38
+ <p>As a rule, cookies will make your browsing experience better. However, you may prefer to disable cookies on this site and on others. The most effective way to do this is to disable cookies in your browser. We suggest consulting the Help section of your browser or taking a look at <a href="http://www.aboutcookies.org">the About Cookies website</a> which offers guidance for all modern browsers.</p>';
39
+ $page['post_parent'] = 0;
40
+ $page['post_author'] = $user_ID;
41
+ $page['post_status'] = 'publish';
42
+ $page['post_title'] = $pagename;
43
+ $pageid = wp_insert_post ( $page );
44
+ if ( $pageid == 0 ) {
45
+ echo '<div class="updated settings-error">Failed to create page.</div>';
46
+ } else {
47
+ echo '<div class="updated">Cookie Policy page successfully created.</div>';
48
+ }
49
+ } ?>
50
+ <form action="options.php" method="post">
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>
58
+ </div>
59
+ <div class="meta-box-sortabless ui-sortable" style="position:relative;">
60
+ <div class="postbox">
61
+ <h3 class="hndle">Resources</h3>
62
+ <div class="inside">
63
+ <p><a href="http://www.ico.gov.uk/for_organisations/privacy_and_electronic_communications/the_guide/cookies.aspx">Information Commissioner's Office Guidance on Cookies</a></p>
64
+ <p><a href="http://www.aboutcookies.org/default.aspx">AboutCookies.org</a></p>
65
+ <p><a href="http://catapultdesign.co.uk/uk-cookie-consent/">Our interpretation of the guidance</a></p>
66
+ </div>
67
+ </div>
68
+ </div>
69
+ </div><!-- poststuff -->
70
  </div>
71
  <?php }
72
 
73
  add_action('admin_init', 'catapult_cookie_admin_init');
74
  function catapult_cookie_admin_init(){
75
  register_setting( 'catapult_cookie_options', 'catapult_cookie_options', 'catapult_cookie_options_validate' );
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
  }
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
 
147
  background-image: -webkit-gradient(linear,left bottom,left top,from( #373737),to(#464646));
148
  background-image: -webkit-linear-gradient(bottom, #373737, #464646 5px);
149
  background-image: linear-gradient(bottom, #373737, #464646 5px);
150
+ text-align:left;
151
  }
152
  #catapult-cookie-bar a {
153
  color:#fff;
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 );