Version Description
Download this release
Release Info
Developer | Catapult |
Plugin | Cookie Consent |
Version | 1.2 |
Comparing to | |
See all releases |
Code changes from version 1.23 to 1.2
- readme.txt +5 -18
- screenshot-2.gif +0 -0
- uk-cookie-consent.php +42 -51
readme.txt
CHANGED
@@ -4,19 +4,17 @@ 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.
|
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
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
-
|
16 |
|
17 |
-
|
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,18 +42,7 @@ You will find more details of the regulations on the [Information Commissioner's
|
|
44 |
|
45 |
== Changelog ==
|
46 |
|
47 |
-
|
48 |
-
Minor admin update
|
49 |
-
|
50 |
-
= 1.21 =
|
51 |
-
Added resources to Settings page
|
52 |
-
|
53 |
-
= 1.2 =
|
54 |
-
Change title of Cookies page to Cookie Policy and removed option to change title
|
55 |
-
Added trailing slash to Cookie Policy url (thanks to mikeotgaar for spotting this)
|
56 |
-
|
57 |
-
= 1.1 =
|
58 |
-
Added default text to messages
|
59 |
|
60 |
== Upgrade Notice ==
|
61 |
|
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 |
|
43 |
== Changelog ==
|
44 |
|
45 |
+
1.1 Added default text to messages
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
== Upgrade Notice ==
|
48 |
|
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.
|
8 |
Author URI: http://catapultdesign.co.uk/
|
9 |
*/
|
10 |
|
@@ -21,66 +21,48 @@ function catapult_cookie_plugin_menu() {
|
|
21 |
|
22 |
function catapult_cookie_options_page() { ?>
|
23 |
<div class="wrap">
|
24 |
-
<h2>
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
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
|
|
|
84 |
}
|
85 |
|
86 |
function catapult_cookie_text_settings() {
|
@@ -107,12 +89,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,7 +195,7 @@ function catapult_add_cookie_bar() {
|
|
204 |
$more_text = "Find out more";
|
205 |
}
|
206 |
$link_text = strtolower ( $options['catapult_cookie_link_settings'] );
|
207 |
-
echo '<div id="catapult-cookie-bar">' . htmlspecialchars ( $current_text ) . '<button id="catapultCookie" onclick="catapultAcceptCookies()">' . htmlspecialchars ( $accept_text ) . '</button><a href="' . get_bloginfo ( 'url' ) . '/
|
208 |
}
|
209 |
}
|
210 |
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.2
|
8 |
Author URI: http://catapultdesign.co.uk/
|
9 |
*/
|
10 |
|
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 |
}
|
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 |
|
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 );
|