Cookie Law / GDPR Info - Version 2.0.8

Version Description

  • Fix - Compatibility issue with Wordpress 4.7.0 and below.
Download this release

Release Info

Developer webtoffee
Plugin Icon Cookie Law / GDPR Info
Version 2.0.8
Comparing to
See all releases

Code changes from version 2.0.7 to 2.0.8

admin/partials/cookie-law-info-admin_settings.php CHANGED
File without changes
admin/views/admin-settings-save-button.php CHANGED
File without changes
cookie-law-info.php CHANGED
@@ -16,7 +16,7 @@
16
  * Plugin Name: GDPR Cookie Consent
17
  * Plugin URI: https://www.webtoffee.com/product/gdpr-cookie-consent/
18
  * Description: A simple way to show your website complies with the EU Cookie Law / GDPR.
19
- * Version: 2.0.7
20
  * Author: WebToffee
21
  * Author URI: https://www.webtoffee.com/
22
  * License: GPLv3
@@ -25,80 +25,76 @@
25
  * Domain Path: /languages
26
  */
27
 
28
- /*
29
- Copyright 2018 WebToffee
30
 
31
- This program is free software; you can redistribute it and/or modify
32
- it under the terms of the GNU General Public License, version 2, as
33
- published by the Free Software Foundation.
34
 
35
- This program is distributed in the hope that it will be useful,
36
- but WITHOUT ANY WARRANTY; without even the implied warranty of
37
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38
- GNU General Public License for more details.
39
 
40
- You should have received a copy of the GNU General Public License
41
- along with this program; if not, write to the Free Software
42
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
43
  */
44
 
45
  // If this file is called directly, abort.
46
  if ( ! defined( 'WPINC' ) ) {
47
  die;
48
  }
49
- $wt_cli_wp_lanugage = get_option('WPLANG', 'en_US');
50
- if ( empty($wt_cli_wp_lanugage) || strlen($wt_cli_wp_lanugage) <= 1) {
51
- $wt_cli_wp_lanugage = 'en';
 
52
  }
53
- define ( 'CLI_PLUGIN_DEVELOPMENT_MODE', false );
54
- define ( 'CLI_PLUGIN_BASENAME', plugin_basename(__FILE__) );
55
- define ( 'CLI_PLUGIN_PATH', plugin_dir_path(__FILE__) );
56
- define ( 'CLI_PLUGIN_URL', plugin_dir_url(__FILE__));
57
- define ( 'CLI_DB_KEY_PREFIX', 'CookieLawInfo-' );
58
- define ( 'CLI_LATEST_VERSION_NUMBER', '0.9' );
59
- define ( 'CLI_SETTINGS_FIELD', CLI_DB_KEY_PREFIX . CLI_LATEST_VERSION_NUMBER );
60
- define ( 'CLI_MIGRATED_VERSION', CLI_DB_KEY_PREFIX . 'MigratedVersion' );
61
  // Previous version settings (depreciated from 0.9 onwards):
62
- define ( 'CLI_ADMIN_OPTIONS_NAME', 'CookieLawInfo-0.8.3' );
63
- define ( 'CLI_PLUGIN_FILENAME',__FILE__);
64
- define ( 'CLI_POST_TYPE','cookielawinfo');
65
- define ('CLI_DEFAULT_LANGUAGE', substr($wt_cli_wp_lanugage, 0, 2));
66
- define ( 'CLI_ACTIVATION_ID','wtgdprcookieconsent');
67
 
68
  /**
69
  * Currently plugin version.
70
  * Rename this for your plugin and update it as you release new versions.
71
  */
72
- define( 'CLI_VERSION', '2.0.7' );
73
-
74
- function wt_cookie_law_info_update_message( $data, $response )
75
- {
76
-
77
- if(isset( $data['upgrade_notice']))
78
- {
79
- add_action( 'admin_print_footer_scripts','wt_cookie_law_info_plugin_screen_update_js');
80
- $msg=str_replace(array('<p>','</p>'),array('<div>','</div>'),$data['upgrade_notice']);
81
- echo '<style type="text/css">
82
  #cookie-law-info-update .update-message p:last-child{ display:none;}
83
  #cookie-law-info-update ul{ list-style:disc; margin-left:30px;}
84
  .wf-update-message{ padding-left:30px;}
85
  </style>
86
- <div class="update-message wf-update-message"><div style="color: #f56e28;">' . __( 'Please make sure the cache is cleared after each plugin update especially if you have minified JS and/or CSS files.', 'cookie-law-info' ) . '</div>'. wpautop($msg).'</div>';
87
- }
88
  }
89
- function wt_cookie_law_info_plugin_screen_update_js()
90
- {
91
- ?>
92
- <script>
93
- ( function( $ ){
94
- var update_dv=$( '#cookie-law-info-update ');
95
- update_dv.find('.wf-update-message').next('p').remove();
96
- update_dv.find('a.update-link:eq(0)').click(function(){
97
- $('.wf-update-message').remove();
98
- });
99
- })( jQuery );
100
- </script>
101
- <?php
102
  }
103
  add_action( 'in_plugin_update_message-cookie-law-info/cookie-law-info.php', 'wt_cookie_law_info_update_message', 10, 2 );
104
  /**
@@ -108,7 +104,7 @@ add_action( 'in_plugin_update_message-cookie-law-info/cookie-law-info.php', 'wt_
108
  require_once plugin_dir_path( __FILE__ ) . 'includes/class-cookie-law-info-activator.php';
109
  function activate_cookie_law_info() {
110
  Cookie_Law_Info_Activator::activate();
111
- register_uninstall_hook( __FILE__, 'uninstall_cookie_law_info' );
112
  }
113
 
114
  /**
@@ -123,44 +119,36 @@ register_activation_hook( __FILE__, 'activate_cookie_law_info' );
123
  register_deactivation_hook( __FILE__, 'deactivate_cookie_law_info' );
124
 
125
 
126
- function uninstall_cookie_law_info()
127
- {
128
- // Bye bye settings:
129
- delete_option( CLI_ADMIN_OPTIONS_NAME );
130
- delete_option( CLI_MIGRATED_VERSION );
131
- delete_option( CLI_SETTINGS_FIELD );
132
-
133
- // Bye bye custom meta:
134
- $args = array('post_type' => 'cookielawinfo');
135
- $posts = get_posts($args);
136
- if (!$posts)
137
- {
138
- return;
139
- }
140
- if($posts)
141
- {
142
- foreach($posts as $post)
143
- {
144
- $custom = get_post_custom( $post->ID );
145
- // Look for old values. If they exist, move them to new values then delete old values:
146
- if ( isset ( $custom["cookie_type"][0] ) )
147
- {
148
- delete_post_meta( $post->ID, "cookie_type", $custom["cookie_type"][0] );
149
- }
150
- if ( isset ( $custom["cookie_duration"][0] ) )
151
- {
152
- delete_post_meta( $post->ID, "cookie_duration", $custom["cookie_duration"][0] );
153
- }
154
- if ( isset ( $custom["_cli_cookie_type"][0] ) )
155
- {
156
- delete_post_meta( $post->ID, "_cli_cookie_type", $custom["_cli_cookie_type"][0] );
157
- }
158
- if(isset( $custom["_cli_cookie_duration"][0] ) )
159
- {
160
- delete_post_meta( $post->ID, "_cli_cookie_duration", $custom["_cli_cookie_duration"][0] );
161
- }
162
- }
163
- }
164
  }
165
 
166
 
16
  * Plugin Name: GDPR Cookie Consent
17
  * Plugin URI: https://www.webtoffee.com/product/gdpr-cookie-consent/
18
  * Description: A simple way to show your website complies with the EU Cookie Law / GDPR.
19
+ * Version: 2.0.8
20
  * Author: WebToffee
21
  * Author URI: https://www.webtoffee.com/
22
  * License: GPLv3
25
  * Domain Path: /languages
26
  */
27
 
28
+ /*
29
+ Copyright 2018 WebToffee
30
 
31
+ This program is free software; you can redistribute it and/or modify
32
+ it under the terms of the GNU General Public License, version 2, as
33
+ published by the Free Software Foundation.
34
 
35
+ This program is distributed in the hope that it will be useful,
36
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
37
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38
+ GNU General Public License for more details.
39
 
40
+ You should have received a copy of the GNU General Public License
41
+ along with this program; if not, write to the Free Software
42
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
43
  */
44
 
45
  // If this file is called directly, abort.
46
  if ( ! defined( 'WPINC' ) ) {
47
  die;
48
  }
49
+
50
+ $wt_cli_wp_lanugage = get_option( 'WPLANG', 'en_US' );
51
+ if ( empty( $wt_cli_wp_lanugage ) || strlen( $wt_cli_wp_lanugage ) <= 1 ) {
52
+ $wt_cli_wp_lanugage = 'en';
53
  }
54
+ define( 'CLI_PLUGIN_DEVELOPMENT_MODE', false );
55
+ define( 'CLI_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
56
+ define( 'CLI_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
57
+ define( 'CLI_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
58
+ define( 'CLI_DB_KEY_PREFIX', 'CookieLawInfo-' );
59
+ define( 'CLI_LATEST_VERSION_NUMBER', '0.9' );
60
+ define( 'CLI_SETTINGS_FIELD', CLI_DB_KEY_PREFIX . CLI_LATEST_VERSION_NUMBER );
61
+ define( 'CLI_MIGRATED_VERSION', CLI_DB_KEY_PREFIX . 'MigratedVersion' );
62
  // Previous version settings (depreciated from 0.9 onwards):
63
+ define( 'CLI_ADMIN_OPTIONS_NAME', 'CookieLawInfo-0.8.3' );
64
+ define( 'CLI_PLUGIN_FILENAME', __FILE__ );
65
+ define( 'CLI_POST_TYPE', 'cookielawinfo' );
66
+ define( 'CLI_DEFAULT_LANGUAGE', substr( $wt_cli_wp_lanugage, 0, 2 ) );
67
+ define( 'CLI_ACTIVATION_ID', 'wtgdprcookieconsent' );
68
 
69
  /**
70
  * Currently plugin version.
71
  * Rename this for your plugin and update it as you release new versions.
72
  */
73
+ define( 'CLI_VERSION', '2.0.8' );
74
+
75
+ function wt_cookie_law_info_update_message( $data, $response ) {
76
+ if ( isset( $data['upgrade_notice'] ) ) {
77
+ add_action( 'admin_print_footer_scripts', 'wt_cookie_law_info_plugin_screen_update_js' );
78
+ $msg = str_replace( array( '<p>', '</p>' ), array( '<div>', '</div>' ), $data['upgrade_notice'] );
79
+ echo '<style type="text/css">
 
 
 
80
  #cookie-law-info-update .update-message p:last-child{ display:none;}
81
  #cookie-law-info-update ul{ list-style:disc; margin-left:30px;}
82
  .wf-update-message{ padding-left:30px;}
83
  </style>
84
+ <div class="update-message wf-update-message"><div style="color: #f56e28;">' . __( 'Please make sure the cache is cleared after each plugin update especially if you have minified JS and/or CSS files.', 'cookie-law-info' ) . '</div>' . wpautop( $msg ) . '</div>';
85
+ }
86
  }
87
+ function wt_cookie_law_info_plugin_screen_update_js() { ?>
88
+ <script>
89
+ ( function( $ ){
90
+ var update_dv=$( '#cookie-law-info-update ');
91
+ update_dv.find('.wf-update-message').next('p').remove();
92
+ update_dv.find('a.update-link:eq(0)').click(function(){
93
+ $('.wf-update-message').remove();
94
+ });
95
+ })( jQuery );
96
+ </script>
97
+ <?php
 
 
98
  }
99
  add_action( 'in_plugin_update_message-cookie-law-info/cookie-law-info.php', 'wt_cookie_law_info_update_message', 10, 2 );
100
  /**
104
  require_once plugin_dir_path( __FILE__ ) . 'includes/class-cookie-law-info-activator.php';
105
  function activate_cookie_law_info() {
106
  Cookie_Law_Info_Activator::activate();
107
+ register_uninstall_hook( __FILE__, 'uninstall_cookie_law_info' );
108
  }
109
 
110
  /**
119
  register_deactivation_hook( __FILE__, 'deactivate_cookie_law_info' );
120
 
121
 
122
+ function uninstall_cookie_law_info() {
123
+ // Bye bye settings:
124
+ delete_option( CLI_ADMIN_OPTIONS_NAME );
125
+ delete_option( CLI_MIGRATED_VERSION );
126
+ delete_option( CLI_SETTINGS_FIELD );
127
+
128
+ // Bye bye custom meta:
129
+ $args = array( 'post_type' => 'cookielawinfo' );
130
+ $posts = get_posts( $args );
131
+ if ( ! $posts ) {
132
+ return;
133
+ }
134
+ if ( $posts ) {
135
+ foreach ( $posts as $post ) {
136
+ $custom = get_post_custom( $post->ID );
137
+ // Look for old values. If they exist, move them to new values then delete old values:
138
+ if ( isset( $custom['cookie_type'][0] ) ) {
139
+ delete_post_meta( $post->ID, 'cookie_type', $custom['cookie_type'][0] );
140
+ }
141
+ if ( isset( $custom['cookie_duration'][0] ) ) {
142
+ delete_post_meta( $post->ID, 'cookie_duration', $custom['cookie_duration'][0] );
143
+ }
144
+ if ( isset( $custom['_cli_cookie_type'][0] ) ) {
145
+ delete_post_meta( $post->ID, '_cli_cookie_type', $custom['_cli_cookie_type'][0] );
146
+ }
147
+ if ( isset( $custom['_cli_cookie_duration'][0] ) ) {
148
+ delete_post_meta( $post->ID, '_cli_cookie_duration', $custom['_cli_cookie_duration'][0] );
149
+ }
150
+ }
151
+ }
 
 
 
 
 
 
 
 
152
  }
153
 
154
 
includes/class-cookie-law-info.php CHANGED
@@ -78,7 +78,7 @@ class Cookie_Law_Info {
78
  }
79
  else
80
  {
81
- $this->version = '2.0.7';
82
  }
83
  $this->plugin_name = 'cookie-law-info';
84
 
78
  }
79
  else
80
  {
81
+ $this->version = '2.0.8';
82
  }
83
  $this->plugin_name = 'cookie-law-info';
84
 
public/js/cookie-law-info-public.js CHANGED
File without changes
public/modules/script-blocker/script-blocker.php CHANGED
@@ -78,7 +78,7 @@ if (!class_exists('Cookie_Law_Info_Script_Blocker')) {
78
 
79
  }
80
  public function init_script_blocker() {
81
- if ( wp_doing_ajax() || is_admin() ) {
82
  return;
83
  }
84
  if( $this->get_blocking_status() === true && $this->advanced_rendering_enabled() === true && $this->third_party_scripts() === true ) {
78
 
79
  }
80
  public function init_script_blocker() {
81
+ if ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || is_admin() ) {
82
  return;
83
  }
84
  if( $this->get_blocking_status() === true && $this->advanced_rendering_enabled() === true && $this->third_party_scripts() === true ) {
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: GDPR, CCPA, cookie notice, DSGVO, RGPD, LGPD, PIPEDA, POPIA, cookies , coo
5
  Requires at least: 4.4.0
6
  Tested up to: 5.8
7
  Requires PHP: 5.6
8
- Stable tag: 2.0.7
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -191,6 +191,10 @@ For every update of the plugin, you will be notified of the installed plugins pa
191
 
192
  == Changelog ==
193
 
 
 
 
 
194
  = 2.0.7 =
195
 
196
  * Fix - Conflict with W3 Total Cache plugin
@@ -537,8 +541,6 @@ For every update of the plugin, you will be notified of the installed plugins pa
537
 
538
  == Upgrade Notice ==
539
 
540
- = 2.0.7 =
541
 
542
- * Fix - Conflict with W3 Total Cache plugin
543
- * Fix - Accessibility issue ( Hidden element has a focusable content )
544
- * Fix - Opacity of the cookie banner is set to 0.1 after closing the settings popup.
5
  Requires at least: 4.4.0
6
  Tested up to: 5.8
7
  Requires PHP: 5.6
8
+ Stable tag: 2.0.8
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
191
 
192
  == Changelog ==
193
 
194
+ = 2.0.8 =
195
+
196
+ * Fix - Compatibility issue with Wordpress 4.7.0 and below.
197
+
198
  = 2.0.7 =
199
 
200
  * Fix - Conflict with W3 Total Cache plugin
541
 
542
  == Upgrade Notice ==
543
 
544
+ = 2.0.8 =
545
 
546
+ * Fix - Compatibility issue with Wordpress 4.7.0 and below.