Italy Cookie Choices (for EU Cookie Law) - Version 2.5.1

Version Description

Release Date: Dicember 4th, 2016

Dev time: 4h

  • Fixed server error 500 on php7 if advanced-cache.php doesn't exist.
Download this release

Release Info

Developer overclokk
Plugin Icon Italy Cookie Choices (for EU Cookie Law)
Version 2.5.1
Comparing to
See all releases

Code changes from version 2.5.0 to 2.5.1

Files changed (3) hide show
  1. core/Cookie_Choices.php +38 -11
  2. italy-cookie-choices.php +1 -1
  3. readme.txt +8 -1
core/Cookie_Choices.php CHANGED
@@ -117,13 +117,9 @@ class Cookie_Choices{
117
  add_shortcode( 'accept_button', array( $this, 'accept_button' ) );
118
  add_shortcode( 'delete_cookie', array( $this, '_delete_cookie' ) );
119
 
120
- if ( !isset( $_COOKIE[ $this->options['cookie_name'] ] ) && !$secondView ){
121
 
122
- // W3TC Disable Caching
123
- if ( !defined( 'DONOTCACHEPAGE' ) )
124
- define('DONOTCACHEPAGE', true);
125
- if ( !defined( 'SID' ) )
126
- define('SID', true);
127
 
128
  /**
129
  * Background color for banner
@@ -199,13 +195,21 @@ class Cookie_Choices{
199
  * Replacement for regex
200
  * @var string
201
  */
202
- $this->valore = '<div class="el"><div style="padding:10px;margin-bottom: 18px;color:' . esc_attr( $banner_text_color ) . ';background-color:' . esc_attr( $banner_bg ) . ';text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);">' . $content_message_text . '&nbsp;&nbsp;<button onclick="cookieChoices.removeCookieConsent()" style="color: ' . esc_attr( $banner_text_color ) . ';padding: 3px;font-size: 12px;line-height: 12px;text-decoration: none;text-transform: uppercase;margin:0;display: inline-block;font-weight: normal; text-align: center; vertical-align: middle; cursor: pointer; border: 1px solid ' . esc_attr( $banner_text_color ) . ';background: rgba(255, 255, 255, 0.03);">' . $content_message_button_text . '</button></div><cookie></div>';
203
-
204
- if ($block)
205
- add_filter( 'the_content', array( $this, 'AutoErase' ), 11);
 
 
 
 
 
 
 
206
 
207
- if ( $widget_block )
208
  add_filter( 'widget_display_callback', array( $this, 'WidgetErase' ), 11, 3 );
 
209
 
210
  if ( $all_block ) {
211
  //add_action('wp_footer', array( $this, 'catchBody' ), -1000000);
@@ -234,6 +238,29 @@ class Cookie_Choices{
234
 
235
  }//__construct
236
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
 
238
  /**
239
  * Get the current page url
117
  add_shortcode( 'accept_button', array( $this, 'accept_button' ) );
118
  add_shortcode( 'delete_cookie', array( $this, '_delete_cookie' ) );
119
 
120
+ if ( ! isset( $_COOKIE[ $this->options['cookie_name'] ] ) && ! $secondView ){
121
 
122
+ $this->disable_w3tc_page_cache();
 
 
 
 
123
 
124
  /**
125
  * Background color for banner
195
  * Replacement for regex
196
  * @var string
197
  */
198
+ $this->valore = sprintf(
199
+ '<div class="el"><div style="padding:10px;margin-bottom: 18px;color:%1$s;background-color:%2$s;text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);">%3$s&nbsp;&nbsp;<button onclick="cookieChoices.removeCookieConsent()" style="color:%1$s;padding: 3px;font-size: 12px;line-height: 12px;text-decoration: none;text-transform: uppercase;margin:0;display: inline-block;font-weight: normal; text-align: center; vertical-align: middle; cursor: pointer; border: 1px solid %1$s;background: rgba(255, 255, 255, 0.03);">%4$s</button></div><cookie></div>',
200
+ esc_attr( $banner_text_color ),
201
+ esc_attr( $banner_bg ),
202
+ $content_message_text,
203
+ $content_message_button_text
204
+ );
205
+
206
+ if ( $block ) {
207
+ add_filter( 'the_content', array( $this, 'AutoErase' ), 11 );
208
+ }
209
 
210
+ if ( $widget_block ) {
211
  add_filter( 'widget_display_callback', array( $this, 'WidgetErase' ), 11, 3 );
212
+ }
213
 
214
  if ( $all_block ) {
215
  //add_action('wp_footer', array( $this, 'catchBody' ), -1000000);
238
 
239
  }//__construct
240
 
241
+ /**
242
+ * Disable W3TC Page Cache.
243
+ */
244
+ public function disable_w3tc_page_cache() {
245
+
246
+ /**
247
+ * This fix server error 500 on php7.
248
+ * You do not need to difine those constant if advanced-cache doesn't exist.
249
+ */
250
+ if ( ! file_exists( WP_CONTENT_DIR . '/advanced-cache.php' ) ) {
251
+ return false;
252
+ }
253
+
254
+ // W3TC Disable Caching
255
+ if ( ! defined( 'DONOTCACHEPAGE' ) ) {
256
+ define( 'DONOTCACHEPAGE', true );
257
+ }
258
+ if ( ! defined( 'SID' ) ){
259
+ define('SID', true);
260
+ }
261
+
262
+ }
263
+
264
 
265
  /**
266
  * Get the current page url
italy-cookie-choices.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Italy Cookie Choices (for EU Cookie Law)
4
  * Plugin URI: https://github.com/ItalyCookieChoices/italy-cookie-choices
5
  * Description: Italy Cookie Choices allows you to easily comply with the european cookie law and block third part cookie in your page.
6
- * Version: 2.5.0
7
  * Author: Enea Overclokk, Andrea Pernici, Andrea Cardinale
8
  * Author URI: https://github.com/ItalyCookieChoices/italy-cookie-choices
9
  * Text Domain: italy-cookie-choices
3
  * Plugin Name: Italy Cookie Choices (for EU Cookie Law)
4
  * Plugin URI: https://github.com/ItalyCookieChoices/italy-cookie-choices
5
  * Description: Italy Cookie Choices allows you to easily comply with the european cookie law and block third part cookie in your page.
6
+ * Version: 2.5.1
7
  * Author: Enea Overclokk, Andrea Pernici, Andrea Cardinale
8
  * Author URI: https://github.com/ItalyCookieChoices/italy-cookie-choices
9
  * Text Domain: italy-cookie-choices
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:
4
  Tags: compliance, cookie law, cookies, eu cookie law, eu law, eu privacy directive, privacy, privacy directive, notification, privacy law, cookie law banner, implied consent, third party script, third party cookie
5
  Requires at least: 3.5
6
  Tested up to: 4.7
7
- Stable tag: 2.5.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -115,6 +115,13 @@ if it doesn't work activate standard theme and try
115
 
116
  == Changelog ==
117
 
 
 
 
 
 
 
 
118
  = 2.5.0 =
119
  Release Date: November 13th, 2016
120
 
4
  Tags: compliance, cookie law, cookies, eu cookie law, eu law, eu privacy directive, privacy, privacy directive, notification, privacy law, cookie law banner, implied consent, third party script, third party cookie
5
  Requires at least: 3.5
6
  Tested up to: 4.7
7
+ Stable tag: 2.5.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
115
 
116
  == Changelog ==
117
 
118
+ = 2.5.1 =
119
+ Release Date: Dicember 4th, 2016
120
+
121
+ Dev time: 4h
122
+
123
+ * Fixed server error 500 on php7 if advanced-cache.php doesn't exist.
124
+
125
  = 2.5.0 =
126
  Release Date: November 13th, 2016
127