Cookie Consent - Version 2.4

Version Description

  • Adds notice about upcoming major release.
  • Disables auto-updates to this plugin since the next release will be a major change.
  • Updated broken links to catapultthemes.com to point to termly.io.
Download this release

Release Info

Developer brandondove
Plugin Icon 128x128 Cookie Consent
Version 2.4
Comparing to
See all releases

Code changes from version 2.3.13 to 2.4

admin/class-ctcc-admin.php CHANGED
@@ -788,21 +788,6 @@ if ( ! class_exists ( 'CTCC_Admin' ) ) {
788
  </form>
789
  </div><!-- .ctdb-inner-wrap -->
790
 
791
- <div class="ctdb-banners">
792
- <div class="ctdb-banner">
793
- <a href="https://catapultthemes.com/downloads/showcase/?utm_source=plugin_ad&utm_medium=wp_plugin&utm_content=cookieconsent&utm_campaign=themes"><img src="<?php echo CTCC_PLUGIN_URL . 'assets/images/showcase-banner-ad.jpg'; ?>" alt="" ></a>
794
- </div>
795
- <div class="ctdb-banner hide-dbpro">
796
- <a href="https://discussionboard.pro/?utm_source=plugin_ad&utm_medium=wp_plugin&utm_content=cookieconsent&utm_campaign=dbpro"><img src="<?php echo CTCC_PLUGIN_URL . 'assets/images/dbpro-ad-view.png'; ?>" alt="" ></a>
797
- </div>
798
- <div class="ctdb-banner">
799
- <a href="https://catapultthemes.com/downloads/sliderify-pro/?utm_source=plugin_ad&utm_medium=wp_plugin&utm_content=cookieconsent&utm_campaign=themes"><img src="<?php echo CTCC_PLUGIN_URL . 'assets/images/mgs-banner-ad.png'; ?>" alt="" ></a>
800
- </div>
801
- <div class="ctdb-banner">
802
- <a href="http://superheroslider.catapultthemes.com/?utm_source=plugin_ad&utm_medium=wp_plugin&utm_content=cookieconsent&utm_campaign=superhero"><img src="<?php echo CTCC_PLUGIN_URL . 'assets/images/superhero-ad1.png'; ?>" alt="" ></a>
803
- </div>
804
- </div>
805
-
806
  </div><!-- .ctdb-outer-wrap -->
807
  </div><!-- .wrap -->
808
  <?php
788
  </form>
789
  </div><!-- .ctdb-inner-wrap -->
790
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
791
  </div><!-- .ctdb-outer-wrap -->
792
  </div><!-- .wrap -->
793
  <?php
admin/class-ctcc-metafield.php CHANGED
@@ -15,7 +15,7 @@ if ( ! class_exists ( 'CTCC_Metafield' ) ) {
15
  public function __construct() {
16
  //
17
  }
18
-
19
  /*
20
  * Initialize the class and start calling our hooks and filters
21
  * @since 2.0.0
@@ -23,12 +23,12 @@ if ( ! class_exists ( 'CTCC_Metafield' ) ) {
23
  public function init() {
24
 
25
  add_action( 'add_meta_boxes', array ( $this, 'add_meta_box' ) );
26
- add_action( 'save_post', array ( $this, 'save_metabox_data' ) );
27
-
28
  }
29
-
30
  public function metaboxes() {
31
-
32
  $metaboxes = array (
33
  array (
34
  'ID' => 'ctcc_gallery_metabox',
@@ -48,9 +48,9 @@ if ( ! class_exists ( 'CTCC_Metafield' ) ) {
48
  ),
49
  ),
50
  );
51
-
52
  return $metaboxes;
53
-
54
  }
55
 
56
  /*
@@ -58,7 +58,7 @@ if ( ! class_exists ( 'CTCC_Metafield' ) ) {
58
  * @since 1.0.0
59
  */
60
  public function add_meta_box() {
61
-
62
  $metaboxes = $this->metaboxes();
63
 
64
  foreach ( $metaboxes as $metabox ) {
@@ -71,11 +71,11 @@ if ( ! class_exists ( 'CTCC_Metafield' ) ) {
71
  $metabox['priority'],
72
  $metabox['fields']
73
  );
74
-
75
  }
76
-
77
  }
78
-
79
  /*
80
  * Metabox callbacks
81
  * @since 1.0.0
@@ -83,39 +83,39 @@ if ( ! class_exists ( 'CTCC_Metafield' ) ) {
83
  public function meta_box_callback ( $post, $fields ) {
84
 
85
  wp_nonce_field ( 'save_metabox_data', 'ctcc_metabox_nonce' );
86
-
87
  if ( $fields['args'] ) {
88
-
89
  foreach ( $fields['args'] as $field ) {
90
-
91
  switch ( $field['type'] ) {
92
-
93
  case 'checkbox':
94
  $this -> metabox_checkbox_output ( $post, $field );
95
  break;
96
-
97
  }
98
-
99
  }
100
-
101
  }
102
 
103
  }
104
-
105
  /*
106
  * Metabox callback for checkbox
107
  * @since 1.0.0
108
  */
109
  public function metabox_checkbox_output( $post, $field ) {
110
-
111
  $field_value = 0;
112
-
113
  // First check if we're on the post-new screen
114
  global $pagenow;
115
  if ( in_array ( $pagenow, array( 'post-new.php' ) ) ) {
116
  // This is a new post screen so we can apply the default value
117
  $field_value = $field['default'];
118
- } else {
119
  $custom = get_post_custom ( $post->ID );
120
  if ( isset ( $custom[$field['ID']][0] ) ) {
121
  $field_value = $custom[$field['ID']][0];
@@ -123,7 +123,7 @@ if ( ! class_exists ( 'CTCC_Metafield' ) ) {
123
  }
124
  ?>
125
  <div class="dm-work-metafield <?php echo $field['class']; ?>">
126
-
127
  <input type="checkbox" id="<?php echo $field['name']; ?>" name="<?php echo $field['name']; ?>" value="1" <?php checked ( 1, $field_value ); ?>>
128
  <label for="<?php echo $field['name']; ?>"><?php echo $field['title']; ?></label>
129
  <?php if ( ! empty ( $field['label'] ) ) { ?>
@@ -132,7 +132,7 @@ if ( ! class_exists ( 'CTCC_Metafield' ) ) {
132
  </div>
133
  <?php
134
  }
135
-
136
  /*
137
  * Save
138
  * @since 1.0.0
@@ -143,36 +143,32 @@ if ( ! class_exists ( 'CTCC_Metafield' ) ) {
143
  if ( ! isset ( $_POST['ctcc_metabox_nonce'] ) ) {
144
  return;
145
  }
146
-
147
  // Verify the nonce
148
  if ( ! wp_verify_nonce ( $_POST['ctcc_metabox_nonce'], 'save_metabox_data' ) ) {
149
  return;
150
  }
151
-
152
  // If this is an autosave, our form has not been submitted, so we don't want to do anything.
153
  if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
154
  return;
155
  }
156
-
157
  // Check the user's permissions.
158
  if ( ! current_user_can( 'edit_post', $post_id ) ) {
159
  return;
160
  }
161
-
162
  // Save all our metaboxes
163
  $metaboxes = $this -> metaboxes();
164
  foreach ( $metaboxes as $metabox ) {
165
  if ( $metabox['fields'] ) {
166
  foreach ( $metabox['fields'] as $field ) {
167
-
168
  if ( $field['type'] != 'divider' ) {
169
-
170
  if ( isset ( $_POST[$field['name']] ) ) {
171
- if ( $field['type'] == 'wysiwyg' ) {
172
- $data = $_POST[$field['name']];
173
- } else {
174
- $data = sanitize_text_field ( $_POST[$field['name']] );
175
- }
176
  update_post_meta ( $post_id, $field['ID'], $data );
177
  } else {
178
  delete_post_meta ( $post_id, $field['ID'] );
@@ -181,9 +177,9 @@ if ( ! class_exists ( 'CTCC_Metafield' ) ) {
181
  }
182
  }
183
  }
184
-
185
  }
186
-
187
  }
188
-
189
  }
15
  public function __construct() {
16
  //
17
  }
18
+
19
  /*
20
  * Initialize the class and start calling our hooks and filters
21
  * @since 2.0.0
23
  public function init() {
24
 
25
  add_action( 'add_meta_boxes', array ( $this, 'add_meta_box' ) );
26
+ add_action( 'save_post', array ( $this, 'save_metabox_data' ) );
27
+
28
  }
29
+
30
  public function metaboxes() {
31
+
32
  $metaboxes = array (
33
  array (
34
  'ID' => 'ctcc_gallery_metabox',
48
  ),
49
  ),
50
  );
51
+
52
  return $metaboxes;
53
+
54
  }
55
 
56
  /*
58
  * @since 1.0.0
59
  */
60
  public function add_meta_box() {
61
+
62
  $metaboxes = $this->metaboxes();
63
 
64
  foreach ( $metaboxes as $metabox ) {
71
  $metabox['priority'],
72
  $metabox['fields']
73
  );
74
+
75
  }
76
+
77
  }
78
+
79
  /*
80
  * Metabox callbacks
81
  * @since 1.0.0
83
  public function meta_box_callback ( $post, $fields ) {
84
 
85
  wp_nonce_field ( 'save_metabox_data', 'ctcc_metabox_nonce' );
86
+
87
  if ( $fields['args'] ) {
88
+
89
  foreach ( $fields['args'] as $field ) {
90
+
91
  switch ( $field['type'] ) {
92
+
93
  case 'checkbox':
94
  $this -> metabox_checkbox_output ( $post, $field );
95
  break;
96
+
97
  }
98
+
99
  }
100
+
101
  }
102
 
103
  }
104
+
105
  /*
106
  * Metabox callback for checkbox
107
  * @since 1.0.0
108
  */
109
  public function metabox_checkbox_output( $post, $field ) {
110
+
111
  $field_value = 0;
112
+
113
  // First check if we're on the post-new screen
114
  global $pagenow;
115
  if ( in_array ( $pagenow, array( 'post-new.php' ) ) ) {
116
  // This is a new post screen so we can apply the default value
117
  $field_value = $field['default'];
118
+ } else {
119
  $custom = get_post_custom ( $post->ID );
120
  if ( isset ( $custom[$field['ID']][0] ) ) {
121
  $field_value = $custom[$field['ID']][0];
123
  }
124
  ?>
125
  <div class="dm-work-metafield <?php echo $field['class']; ?>">
126
+
127
  <input type="checkbox" id="<?php echo $field['name']; ?>" name="<?php echo $field['name']; ?>" value="1" <?php checked ( 1, $field_value ); ?>>
128
  <label for="<?php echo $field['name']; ?>"><?php echo $field['title']; ?></label>
129
  <?php if ( ! empty ( $field['label'] ) ) { ?>
132
  </div>
133
  <?php
134
  }
135
+
136
  /*
137
  * Save
138
  * @since 1.0.0
143
  if ( ! isset ( $_POST['ctcc_metabox_nonce'] ) ) {
144
  return;
145
  }
146
+
147
  // Verify the nonce
148
  if ( ! wp_verify_nonce ( $_POST['ctcc_metabox_nonce'], 'save_metabox_data' ) ) {
149
  return;
150
  }
151
+
152
  // If this is an autosave, our form has not been submitted, so we don't want to do anything.
153
  if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
154
  return;
155
  }
156
+
157
  // Check the user's permissions.
158
  if ( ! current_user_can( 'edit_post', $post_id ) ) {
159
  return;
160
  }
161
+
162
  // Save all our metaboxes
163
  $metaboxes = $this -> metaboxes();
164
  foreach ( $metaboxes as $metabox ) {
165
  if ( $metabox['fields'] ) {
166
  foreach ( $metabox['fields'] as $field ) {
167
+
168
  if ( $field['type'] != 'divider' ) {
169
+
170
  if ( isset ( $_POST[$field['name']] ) ) {
171
+ $data = sanitize_text_field ( $_POST[$field['name']] );
 
 
 
 
172
  update_post_meta ( $post_id, $field['ID'], $data );
173
  } else {
174
  delete_post_meta ( $post_id, $field['ID'] );
177
  }
178
  }
179
  }
180
+
181
  }
182
+
183
  }
184
+
185
  }
assets/css/admin-style.css CHANGED
@@ -38,4 +38,56 @@
38
  float: left;
39
  margin-right: 20px;
40
  }
41
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  float: left;
39
  margin-right: 20px;
40
  }
41
+ }
42
+
43
+
44
+
45
+ #uk-cookie-consent-update .updating-message .wc_plugin_upgrade_notice {
46
+ display: none;
47
+ }
48
+
49
+ #uk-cookie-consent-update .dummy {
50
+ display: none;
51
+ }
52
+
53
+ #uk-cookie-consent-update .ctcc_plugin_upgrade_notice {
54
+ font-weight: normal;
55
+ background: #fff8e5 !important;
56
+ border-left: 4px solid #ffb900;
57
+ border-top: 1px solid #ffb900;
58
+ padding: 9px 0 9px 12px !important;
59
+ margin: 0 -12px 0 -16px !important;
60
+ }
61
+
62
+ #uk-cookie-consent-update .ctcc_plugin_upgrade_notice::before {
63
+ content: "\f348";
64
+ display: inline-block;
65
+ font: 400 18px/1 dashicons;
66
+ speak: never;
67
+ margin: 0 8px 0 -2px;
68
+ vertical-align: top;
69
+ }
70
+
71
+ #uk-cookie-consent-update .ctcc_plugin_upgrade_notice.minor,
72
+ #uk-cookie-consent-update .ctcc_plugin_upgrade_notice.major {
73
+ padding: 20px 0 !important;
74
+ }
75
+
76
+ #uk-cookie-consent-update .ctcc_plugin_upgrade_notice.minor::before,
77
+ #uk-cookie-consent-update .ctcc_plugin_upgrade_notice.major::before {
78
+ display: none;
79
+ }
80
+
81
+ #uk-cookie-consent-update .ctcc_plugin_upgrade_notice.minor p,
82
+ #uk-cookie-consent-update .ctcc_plugin_upgrade_notice.major p {
83
+ padding: 0 20px;
84
+ margin: 0;
85
+ max-width: 700px;
86
+ line-height: 1.5em;
87
+ }
88
+
89
+ #uk-cookie-consent-update .ctcc_plugin_upgrade_notice.minor p::before,
90
+ #uk-cookie-consent-update .ctcc_plugin_upgrade_notice.major p::before {
91
+ content: "";
92
+ display: none;
93
+ }
readme.txt CHANGED
@@ -1,16 +1,21 @@
1
- === GDPR Cookie Consent Banner | Termly ===
2
- Contributors: termly, Catapult_Themes, husobj, jraczynski
3
  Tags: cookie law, cookie consent, gdpr, eu privacy directive, cookie banner, cookie compliance, cookie notice, eu cookie law, cookie notification, cookies, wpml, geo ip
4
  Requires at least: 4.3
5
- Tested up to: 5.0.1
6
- Stable tag: 2.3.13
 
 
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
- Termly's easy to use cookie consent plugin can assist in your GDPR and ePrivacy Directive compliance efforts.
11
 
12
  == Description ==
13
- GDPR Cookie Consent Banner by Termly is one of the simplest and most popular cookie consent plugins out there. Compliance with data privacy regulations like the GDPR and the ePrivacy Directive has never more attainable. Simply install our plugin and modify your settings, and you'll have a live cookie consent banner and cookie policy on your site that will help you comply with all of the latest data privacy regulations. GDPR Cookie Consent Banner by Termly has been actively developed and supported since 2012, and has over 100 5-star reviews.
 
 
 
14
 
15
  > <strong>New in 2.3.0:</strong><br>Geo IP support - choose which continents to display notifications (requires GeoIP Detect plugin to be installed)<br>
16
  > <strong>New in 2.2.0:</strong><br>Easily select pages or posts where the cookie notification doesn't display. You now have complete control over which pages display a notification and which don't.<br>Close on scroll - optionally choose scrolling as closure method.
@@ -43,23 +48,21 @@ One of the most popular aspects of this plugin is its ease of use - simply insta
43
  = EU ePrivacy Directive =
44
  We think this is the simplest but most effective method of dealing with the legislation.
45
 
46
- The plug-in is a straightforward approach to help you comply with 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.
47
 
48
- 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.
49
 
50
  == Installation ==
51
- 1. Simply install GDPR Cookie Consent Banner by Termly on your website from the WordPress plugin directory, or upload the `uk-cookie-consent` folder to the `/wp-content/plugins/` directory
52
  1. Activate the plugin through the 'Plugins' menu in your WordPress backend
53
  1. Navigate to the Cookie Consent page in your 'Settings' menu to configure your consent banner
54
 
55
  == Frequently Asked Questions ==
56
 
57
  = Where can I find out more about this plug-in? =
58
- You can find out more about the plug-in on [its plug-in page](http://catapultthemes.com/cookie-consent/).
59
- = Is there a demo of this plugin? =
60
- Yes, feel free to have a look at [the demo here](http://cookieconsent.catapultthemes.com/). You can reset the cookie by [going to this URL](http://cookieconsent.catapultthemes.com/?cookie=delete).
61
  = Will this plugin make me compliant with data privacy legislation like the GDPR? =
62
- The short answer is no, this plugin alone will not make you compliant. Compliance with data privacy regulations requires certain efforts on the part of the user that a single plugin cannot provide.
63
  = Where can I find out more information about the EU laws regarding the use of cookies? =
64
  You can find more details on the regulations on the [Information Commissioner's Office site](http://www.ico.gov.uk/for_organisations/privacy_and_electronic_communications/the_guide/cookies.aspx).
65
  = Can I customize this plugin? =
@@ -74,8 +77,14 @@ Yes, we offer many customization options, from the position of your banner, to t
74
 
75
  == Changelog ==
76
 
77
- = 2.3.12 =
78
- * Updated: small changes
 
 
 
 
 
 
79
 
80
  = 2.3.12 =
81
  * Updated: tested to 5.0.1
@@ -274,4 +283,6 @@ Yes, we offer many customization options, from the position of your banner, to t
274
  * Italian
275
 
276
  == Upgrade Notice ==
277
- Please note that the upgrade to version 2.x is significant. Although we've made every effort to ensure your settings are retained from previous versions, you may notice minor design differences to the notification bar.
 
 
1
+ === GDPR Cookie Consent Banner ===
2
+ Contributors: termly, brandondove, nateconley
3
  Tags: cookie law, cookie consent, gdpr, eu privacy directive, cookie banner, cookie compliance, cookie notice, eu cookie law, cookie notification, cookies, wpml, geo ip
4
  Requires at least: 4.3
5
+ Requires PHP: 5.6
6
+ Tested up to: 5.7.2
7
+ Stable tag: 2.4
8
+ Donate Link: https://termly.io
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
+ Our easy to use cookie consent plugin can assist in your GDPR and ePrivacy Directive compliance efforts.
13
 
14
  == Description ==
15
+ <strong>GDPR Cookie Consent Banner Needs Your Attention</strong>
16
+ <em>GDPR Cookie Consent Banner version 3.0 is coming soon! Now operated under [Termly](https://termly.io/), the plugin will include new features and functions to better help you comply with privacy laws like the GDPR, CCPA and other Cookie Laws like the ePrivacy Directive. Read more [here](https://termly.io/wordpress-plugin/) about the upcoming changes and what it means for you.</em>
17
+
18
+ GDPR Cookie Consent Banner is one of the simplest and most popular cookie consent plugins out there. Compliance with data privacy regulations like the GDPR and the ePrivacy Directive has never more attainable. Simply install our plugin and modify your settings, and you'll have a live cookie consent banner and cookie policy on your site that will help you comply with all of the latest data privacy regulations. GDPR Cookie Consent Banner has been actively developed and supported since 2012, and has over 100 5-star reviews.
19
 
20
  > <strong>New in 2.3.0:</strong><br>Geo IP support - choose which continents to display notifications (requires GeoIP Detect plugin to be installed)<br>
21
  > <strong>New in 2.2.0:</strong><br>Easily select pages or posts where the cookie notification doesn't display. You now have complete control over which pages display a notification and which don't.<br>Close on scroll - optionally choose scrolling as closure method.
48
  = EU ePrivacy Directive =
49
  We think this is the simplest but most effective method of dealing with the legislation.
50
 
51
+ The plug-in is a straightforward approach to help you comply with 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 edit further if you wish.
52
 
53
+ Importantly, the plug-in does not disable cookies on your site or prevent the user from continuing to browse the site.
54
 
55
  == Installation ==
56
+ 1. Simply install GDPR Cookie Consent Banner on your website from the WordPress plugin directory, or upload the `uk-cookie-consent` folder to the `/wp-content/plugins/` directory
57
  1. Activate the plugin through the 'Plugins' menu in your WordPress backend
58
  1. Navigate to the Cookie Consent page in your 'Settings' menu to configure your consent banner
59
 
60
  == Frequently Asked Questions ==
61
 
62
  = Where can I find out more about this plug-in? =
63
+ You can find out more about the plug-in on [its plug-in page](https://termly.io/wordpress-plugin/).
 
 
64
  = Will this plugin make me compliant with data privacy legislation like the GDPR? =
65
+ The short answer is no, this plugin alone will not make you compliant. Compliance with data privacy regulations requires certain efforts on the part of the user that a single plugin alone cannot provide.
66
  = Where can I find out more information about the EU laws regarding the use of cookies? =
67
  You can find more details on the regulations on the [Information Commissioner's Office site](http://www.ico.gov.uk/for_organisations/privacy_and_electronic_communications/the_guide/cookies.aspx).
68
  = Can I customize this plugin? =
77
 
78
  == Changelog ==
79
 
80
+ = 2.4 =
81
+ * Adds notice about upcoming major release.
82
+ * Disables auto-updates to this plugin since the next release will be a major change.
83
+ * Updated broken links to catapultthemes.com to point to termly.io.
84
+
85
+ = 2.3.15 =
86
+ * Updated: tested to 5.0.1
87
+ * Minor changes
88
 
89
  = 2.3.12 =
90
  * Updated: tested to 5.0.1
283
  * Italian
284
 
285
  == Upgrade Notice ==
286
+
287
+ = 3.0 =
288
+ GDPR Cookie Consent Banner version 3.0 is coming soon! Now operated under [Termly](https://termly.io), the plugin will include new features and functions to better help you comply with privacy laws like the GDPR, CCPA and other Cookie Laws like the ePrivacy Directive. Read more [here](https://termly.io/wordpress-plugin/) about the upcoming changes and what it means for you.
uk-cookie-consent.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /*
3
- Plugin Name: GDPR Cookie Consent Banner | Termly
4
- Plugin URI: https://termly.io/products/
5
- Description: Termly's easy to use cookie consent plugin can assist in your GDPR and ePrivacy Directive compliance efforts.
6
- Version: 2.3.12
7
  Author: termly
8
  Author URI: https://termly.io/
9
  Text Domain: uk-cookie-consent
@@ -13,6 +13,113 @@ Domain Path: /languages
13
  if ( ! defined( 'ABSPATH' ) ) {
14
  exit;
15
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  /**
17
  * Define constants
18
  **/
@@ -41,7 +148,7 @@ require_once dirname( __FILE__ ) . '/public/customizer.php';
41
 
42
 
43
  function ctcc_load_plugin_textdomain() {
44
- load_plugin_textdomain( 'uk-cookie-consent', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' );
45
  }
46
  add_action( 'plugins_loaded', 'ctcc_load_plugin_textdomain' );
47
 
1
  <?php
2
  /*
3
+ Plugin Name: GDPR Cookie Consent Banner
4
+ Plugin URI: https://termly.io/wordpress-plugin/
5
+ Description: Our easy to use cookie consent plugin can assist in your GDPR and ePrivacy Directive compliance efforts.
6
+ Version: 2.4
7
  Author: termly
8
  Author URI: https://termly.io/
9
  Text Domain: uk-cookie-consent
13
  if ( ! defined( 'ABSPATH' ) ) {
14
  exit;
15
  }
16
+
17
+ /**
18
+ * Disable auto updates for this plugin even if already enabled.
19
+ *
20
+ * @param boolean $update Update or not.
21
+ * @param object $item The data about the item being updated.
22
+ * @return boolean
23
+ */
24
+ function ctcc_disable_auto_update_plugins( $update, $item ) {
25
+
26
+ $plugins = array( 'uk-cookie-consent' );
27
+ if ( in_array( $item->slug, $plugins, true ) ) {
28
+
29
+ $update = false;
30
+
31
+ }
32
+
33
+ return $update;
34
+
35
+ }
36
+ add_filter( 'auto_update_plugin', 'ctcc_disable_auto_update_plugins', 10, 2 );
37
+
38
+ /**
39
+ * Disable the ability to enable auto updates once the plugin is enabled.
40
+ *
41
+ * @param array $all_plugins All plugin data.
42
+ * @return array
43
+ */
44
+ function ctcc_disable_auto_update_plugins_list( $all_plugins = [] ) {
45
+
46
+ $all_plugins['uk-cookie-consent/uk-cookie-consent.php']['update-supported'] = false;
47
+
48
+ return $all_plugins;
49
+
50
+ }
51
+ add_filter( 'all_plugins', 'ctcc_disable_auto_update_plugins_list' );
52
+
53
+ /**
54
+ * Checks the readme file on the .org repository for an update message.
55
+ *
56
+ * @param array $args An array of plugin metadata.
57
+ * @param object $response An array of metadata about the available plugin update.
58
+ * @return void
59
+ */
60
+ function ctcc_plugin_update_message( $args, $response ) {
61
+
62
+ if ( isset( $args['update'] ) && $args['update'] ) {
63
+
64
+ $transient_name = 'ctcc_upgrade_notice_' . $response->new_version;
65
+ $upgrade_notice = get_transient( $transient_name );
66
+
67
+ if ( false === $upgrade_notice ) {
68
+
69
+ $readme = wp_safe_remote_get(
70
+ 'https://plugins.svn.wordpress.org/uk-cookie-consent/trunk/readme.txt'
71
+ );
72
+
73
+ if ( ! is_wp_error( $readme ) && ! empty( $readme['body'] ) ) {
74
+
75
+ $version_parts = explode( '.', $response->new_version );
76
+ $check_for_notices = array(
77
+ $version_parts[0] . '.0', // Major.
78
+ $version_parts[0] . '.0.0', // Major.
79
+ $version_parts[0] . '.' . $version_parts[1], // Minor.
80
+ $version_parts[0] . '.' . $version_parts[1] . '.' . $version_parts[2], // Patch.
81
+ );
82
+ $notice_regexp = '~==\s*Upgrade Notice\s*==\s*=\s*(.*)\s*=(.*)(=\s*' . preg_quote( $response->new_version ) . '\s*=|$)~Uis';
83
+ $upgrade_notice = '';
84
+
85
+ foreach ( $check_for_notices as $check_version ) {
86
+ if ( version_compare( $args['Version'], $check_version, '>' ) ) {
87
+ continue;
88
+ }
89
+
90
+ $matches = null;
91
+ if ( preg_match( $notice_regexp, $readme['body'], $matches ) ) {
92
+ $notices = (array) preg_split( '~[\r\n]+~', trim( $matches[2] ) );
93
+
94
+ if ( version_compare( trim( $matches[1] ), $check_version, '=' ) ) {
95
+ $upgrade_notice .= '<p class="ctcc_plugin_upgrade_notice">';
96
+
97
+ $upgrade_notice .= sprintf(
98
+ '<strong>Version %s</strong>:<br />',
99
+ esc_html( trim( $matches[1] ) )
100
+ );
101
+
102
+ foreach ( $notices as $index => $line ) {
103
+ $upgrade_notice .= preg_replace( '~\[([^\]]*)\]\(([^\)]*)\)~', '<a href="${2}">${1}</a>', $line );
104
+ }
105
+
106
+ $upgrade_notice .= '</p>';
107
+ }
108
+ break;
109
+ }
110
+ }
111
+
112
+ set_transient( $transient_name, wp_kses_post( $upgrade_notice ), DAY_IN_SECONDS );
113
+
114
+ }
115
+
116
+ }
117
+
118
+ echo wp_kses_post( rtrim( $upgrade_notice, '</p>' ) );
119
+ }
120
+ }
121
+ add_action( 'in_plugin_update_message-uk-cookie-consent/uk-cookie-consent.php', 'ctcc_plugin_update_message', 10, 2 );
122
+
123
  /**
124
  * Define constants
125
  **/
148
 
149
 
150
  function ctcc_load_plugin_textdomain() {
151
+ load_plugin_textdomain( 'uk-cookie-consent', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' );
152
  }
153
  add_action( 'plugins_loaded', 'ctcc_load_plugin_textdomain' );
154