Cookie Law / GDPR Info - Version 1.5.9

Version Description

  • Issue with the plugin interfering with breadcrumb fixed.
Download this release

Release Info

Developer markwt
Plugin Icon Cookie Law / GDPR Info
Version 1.5.9
Comparing to
See all releases

Code changes from version 1.5.8 to 1.5.9

cookie-law-info.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://wordpress.org/plugins/cookie-law-info/
5
  Description: A simple way of to show your website complies with the EU Cookie Law / GDPR.
6
  Author: webtoffee
7
  Author URI: https://www.webtoffee.com/product/gdpr-cookie-consent/
8
- Version: 1.5.8
9
  License: GPL2
10
  Text Domain: cookie-law-info
11
  */
@@ -110,17 +110,18 @@ function cookielawinfo_uninstall_plugin() {
110
  delete_option( CLI_SETTINGS_FIELD );
111
 
112
  // Bye bye custom meta:
113
- global $post;
114
  $args = array('post_type' => 'cookielawinfo');
115
- $cookies = new WP_Query( $args );
116
 
117
- if ( !$cookies->have_posts() ) {
118
  return;
119
  }
120
 
121
- while ( $cookies->have_posts() ) : $cookies->the_post();
122
- // Get custom fields:
123
- $custom = get_post_custom( $post->ID );
 
 
124
  // Look for old values. If they exist, move them to new values then delete old values:
125
  if ( isset ( $custom["cookie_type"][0] ) ) {
126
  delete_post_meta( $post->ID, "cookie_type", $custom["cookie_type"][0] );
@@ -134,7 +135,9 @@ function cookielawinfo_uninstall_plugin() {
134
  if ( isset ( $custom["_cli_cookie_duration"][0] ) ) {
135
  delete_post_meta( $post->ID, "_cli_cookie_duration", $custom["_cli_cookie_duration"][0] );
136
  }
137
- endwhile;
 
 
138
  }
139
 
140
 
5
  Description: A simple way of to show your website complies with the EU Cookie Law / GDPR.
6
  Author: webtoffee
7
  Author URI: https://www.webtoffee.com/product/gdpr-cookie-consent/
8
+ Version: 1.5.9
9
  License: GPL2
10
  Text Domain: cookie-law-info
11
  */
110
  delete_option( CLI_SETTINGS_FIELD );
111
 
112
  // Bye bye custom meta:
 
113
  $args = array('post_type' => 'cookielawinfo');
114
+ $posts = get_posts($args);
115
 
116
+ if ( !$posts ) {
117
  return;
118
  }
119
 
120
+ if( $posts )
121
+ {
122
+ foreach( $posts as $post )
123
+ {
124
+ $custom = get_post_custom( $post->ID );
125
  // Look for old values. If they exist, move them to new values then delete old values:
126
  if ( isset ( $custom["cookie_type"][0] ) ) {
127
  delete_post_meta( $post->ID, "cookie_type", $custom["cookie_type"][0] );
135
  if ( isset ( $custom["_cli_cookie_duration"][0] ) ) {
136
  delete_post_meta( $post->ID, "_cli_cookie_duration", $custom["_cli_cookie_duration"][0] );
137
  }
138
+ }
139
+ }
140
+
141
  }
142
 
143
 
js/cookielawinfo.js CHANGED
@@ -1,5 +1,5 @@
1
  function cli_show_cookiebar(p) {
2
- /* plugin version 1.5.8 */
3
  var Cookie = {
4
  set: function(name,value,days) {
5
  if (days) {
1
  function cli_show_cookiebar(p) {
2
+ /* plugin version 1.5.9 */
3
  var Cookie = {
4
  set: function(name,value,days) {
5
  if (days) {
nbproject/private/private.properties ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ copy.src.files=false
2
+ copy.src.on.open=false
3
+ copy.src.target=
4
+ index.file=
5
+ run.as=LOCAL
6
+ url=http://localhost/cookie-law-info/
nbproject/private/private.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project-private xmlns="http://www.netbeans.org/ns/project-private/1">
3
+ <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
4
+ <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
5
+ <group>
6
+ <file>file:/C:/wamp64/www/clcheck4/wp-content/plugins/cookie-law-info/php/functions.php</file>
7
+ <file>file:/C:/wamp64/www/clcheck4/wp-content/plugins/cookie-law-info/admin/cli-admin-page.php</file>
8
+ </group>
9
+ </open-files>
10
+ </project-private>
nbproject/project.properties ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ include.path=${php.global.include.path}
2
+ php.version=PHP_56
3
+ source.encoding=UTF-8
4
+ src.dir=.
5
+ tags.asp=false
6
+ tags.short=false
7
+ web.root=.
nbproject/project.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project xmlns="http://www.netbeans.org/ns/project/1">
3
+ <type>org.netbeans.modules.php.project</type>
4
+ <configuration>
5
+ <data xmlns="http://www.netbeans.org/ns/php-project/1">
6
+ <name>cookie-law-info</name>
7
+ </data>
8
+ </configuration>
9
+ </project>
php/functions.php CHANGED
@@ -132,7 +132,7 @@ function cookielawinfo_enqueue_frontend_scripts() {
132
  /**
133
  * Force reload
134
  */
135
- $version = '1.5.4';
136
 
137
  wp_register_style( 'cookielawinfo-style', CLI_PLUGIN_URL . 'css/cli-style.css', null, $version );
138
  wp_enqueue_style( 'cookielawinfo-style' );
@@ -149,35 +149,32 @@ function cookielawinfo_enqueue_frontend_scripts() {
149
  }
150
 
151
 
152
- function get_non_necessary_cookie_ids(){
153
  global $wpdb;
154
-
155
- $args = array(
156
- 'post_type' => 'cookielawinfo',
157
- 'meta_query' => array(
158
- array(
159
- 'key' => '_cli_cookie_sensitivity',
160
- 'value' => 'non-necessary'
161
- )
162
- )
163
-
164
- );
165
- $cookies = new WP_Query( $args );
166
-
167
- if ( !$cookies->have_posts() ) {
168
- return;
169
- }
170
- $cookie_slugs = array();
171
-
172
- while($cookies->have_posts()):
173
-
174
- $cookies->the_post();
175
- global $post;
176
- $cookie_slugs[] = get_post_meta( $post->ID, "_cli_cookie_slugid", true);
177
-
178
- endwhile;
179
-
180
- return $cookie_slugs;
181
  }
182
 
183
  /**
132
  /**
133
  * Force reload
134
  */
135
+ $version = '1.5.9';
136
 
137
  wp_register_style( 'cookielawinfo-style', CLI_PLUGIN_URL . 'css/cli-style.css', null, $version );
138
  wp_enqueue_style( 'cookielawinfo-style' );
149
  }
150
 
151
 
152
+ function get_non_necessary_cookie_ids() {
153
  global $wpdb;
154
+
155
+ $args = array(
156
+ 'post_type' => 'cookielawinfo',
157
+ 'meta_query' => array(
158
+ array(
159
+ 'key' => '_cli_cookie_sensitivity',
160
+ 'value' => 'non-necessary'
161
+ )
162
+ )
163
+ );
164
+ $posts = get_posts($args);
165
+
166
+ if (!$posts) {
167
+ return;
168
+ }
169
+ $cookie_slugs = array();
170
+
171
+ if ($posts) {
172
+ foreach ($posts as $post) {
173
+ $cookie_slugs[] = get_post_meta($post->ID, "_cli_cookie_slugid", true);
174
+ }
175
+ }
176
+
177
+ return $cookie_slugs;
 
 
 
178
  }
179
 
180
  /**
php/shortcodes.php CHANGED
@@ -70,7 +70,6 @@ function cookielawinfo_table_shortcode( $atts ) {
70
  'not_shown_message' => ''
71
  ), $atts ) );
72
 
73
- global $post;
74
 
75
  $args = array(
76
  'post_type' => 'cookielawinfo',
@@ -79,7 +78,7 @@ function cookielawinfo_table_shortcode( $atts ) {
79
  'order' => 'ASC',
80
  'orderby' => 'title'
81
  );
82
- $cookies = new WP_Query( $args );
83
 
84
  $ret = '<table class="cookielawinfo-' . $style . '"><thead><tr>';
85
  $ret .= '<th class="cookielawinfo-column-1">';
@@ -96,24 +95,29 @@ function cookielawinfo_table_shortcode( $atts ) {
96
  $ret .= '</th></tr>';
97
  $ret .= '</thead><tbody>';
98
 
99
- if ( !$cookies->have_posts() ) {
100
- $ret .= '<tr class="cookielawinfo-row"><td colspan="2" class="cookielawinfo-column-empty">' . $not_shown_message . '</td></tr>';
101
  }
102
-
103
- while ( $cookies->have_posts() ) : $cookies->the_post();
104
- // Get custom fields:
 
105
  $custom = get_post_custom( $post->ID );
106
  $cookie_type = ( isset ( $custom["_cli_cookie_type"][0] ) ) ? $custom["_cli_cookie_type"][0] : '';
107
  $cookie_duration = ( isset ( $custom["_cli_cookie_duration"][0] ) ) ? $custom["_cli_cookie_duration"][0] : '';
108
  // Output HTML:
109
- $ret .= '<tr class="cookielawinfo-row"><td class="cookielawinfo-column-1">' . get_the_title() . '</td>';
110
  $ret .= '<td class="cookielawinfo-column-2">' . $cookie_type .'</td>';
111
  $ret .= '<td class="cookielawinfo-column-3">' . $cookie_duration .'</td>';
112
- $ret .= '<td class="cookielawinfo-column-4">' . get_the_content() .'</td>';
 
113
  $ret .= '</tr>';
114
- endwhile;
 
 
115
  $ret .= '</tbody></table>';
116
  return $ret;
 
117
  }
118
 
119
 
70
  'not_shown_message' => ''
71
  ), $atts ) );
72
 
 
73
 
74
  $args = array(
75
  'post_type' => 'cookielawinfo',
78
  'order' => 'ASC',
79
  'orderby' => 'title'
80
  );
81
+ $posts = get_posts($args);
82
 
83
  $ret = '<table class="cookielawinfo-' . $style . '"><thead><tr>';
84
  $ret .= '<th class="cookielawinfo-column-1">';
95
  $ret .= '</th></tr>';
96
  $ret .= '</thead><tbody>';
97
 
98
+ if ( !$posts ) {
99
+ $ret .= '<tr class="cookielawinfo-row"><td colspan="4" class="cookielawinfo-column-empty">' . $not_shown_message . '</td></tr>';
100
  }
101
+ if( $posts )
102
+ {
103
+ foreach( $posts as $post )
104
+ {
105
  $custom = get_post_custom( $post->ID );
106
  $cookie_type = ( isset ( $custom["_cli_cookie_type"][0] ) ) ? $custom["_cli_cookie_type"][0] : '';
107
  $cookie_duration = ( isset ( $custom["_cli_cookie_duration"][0] ) ) ? $custom["_cli_cookie_duration"][0] : '';
108
  // Output HTML:
109
+ $ret .= '<tr class="cookielawinfo-row"><td class="cookielawinfo-column-1">' . $post->post_title . '</td>';
110
  $ret .= '<td class="cookielawinfo-column-2">' . $cookie_type .'</td>';
111
  $ret .= '<td class="cookielawinfo-column-3">' . $cookie_duration .'</td>';
112
+ $ret .= '<td class="cookielawinfo-column-4">' . $post->post_content .'</td>';
113
+ $ret = apply_filters('cli_new_column_values_to_audit_table',$ret, $custom);
114
  $ret .= '</tr>';
115
+
116
+ }
117
+ }
118
  $ret .= '</tbody></table>';
119
  return $ret;
120
+
121
  }
122
 
123
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:
4
  Tags: eu cookie law, GDPR, cookie law, cookie consent, eu privacy directive, privacy directive, cookies, privacy, compliance
5
  Requires at least: 3.3.1
6
  Tested up to: 4.9.6
7
- Stable tag: 1.5.8
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -166,9 +166,13 @@ See http://cookielawinfo.com for more information on what is required.
166
 
167
  == Changelog ==
168
 
 
 
 
 
169
  = 1.5.8 =
170
 
171
- * Support for <u> in the message bar.
172
 
173
  = 1.5.7 =
174
  * Danish translation added
@@ -269,6 +273,8 @@ See http://cookielawinfo.com for more information on what is required.
269
 
270
  == Upgrade Notice ==
271
 
272
- = 1.5.8 =
 
 
 
273
 
274
- * Support for <u> in the message bar.
4
  Tags: eu cookie law, GDPR, cookie law, cookie consent, eu privacy directive, privacy directive, cookies, privacy, compliance
5
  Requires at least: 3.3.1
6
  Tested up to: 4.9.6
7
+ Stable tag: 1.5.9
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
166
 
167
  == Changelog ==
168
 
169
+ = 1.5.9 =
170
+
171
+ * Issue with the plugin interfering with breadcrumb fixed.
172
+
173
  = 1.5.8 =
174
 
175
+ * Support for underline tag in the message bar.
176
 
177
  = 1.5.7 =
178
  * Danish translation added
273
 
274
  == Upgrade Notice ==
275
 
276
+ = 1.5.9 =
277
+
278
+ * Issue with the plugin interfering with breadcrumb fixed.
279
+
280