Cookie Law / GDPR Info - Version 1.7.2

Version Description

  • Tested ok with Wordpress version 5.0.2
  • Compatibility added for Pixelyoursite plugin
Download this release

Release Info

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

Code changes from version 1.7.1 to 1.7.2

admin/js/cookie-law-info-admin.js CHANGED
@@ -150,7 +150,7 @@
150
  //=====================
151
  function cli_scroll_accept_er()
152
  {
153
- if($('[name="as_popup_field"]:checked').val()=='true' && $('[name="popup_overlay_field"]:checked').val()=='true' && $('[name="scroll_close_field"]:checked').val()=='true')
154
  {
155
  $('.cli_scroll_accept_er').show();
156
  //$('label[for="scroll_close_field"]').css({'color':'red'});
@@ -161,7 +161,10 @@
161
  }
162
  }
163
  cli_scroll_accept_er();
164
- $('[name="as_popup_field"], [name="popup_overlay_field"], [name="scroll_close_field"]').click(function(){
 
 
 
165
  cli_scroll_accept_er();
166
  });
167
  //=====================
150
  //=====================
151
  function cli_scroll_accept_er()
152
  {
153
+ if($('[name="cookie_bar_as_field"] option:selected').val()=='popup' && $('[name="popup_overlay_field"]:checked').val()=='true' && $('[name="scroll_close_field"]:checked').val()=='true')
154
  {
155
  $('.cli_scroll_accept_er').show();
156
  //$('label[for="scroll_close_field"]').css({'color':'red'});
161
  }
162
  }
163
  cli_scroll_accept_er();
164
+ $('[name="cookie_bar_as_field"]').change(function(){
165
+ cli_scroll_accept_er();
166
+ });
167
+ $('[name="popup_overlay_field"], [name="scroll_close_field"]').click(function(){
168
  cli_scroll_accept_er();
169
  });
170
  //=====================
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: 1.7.1
20
  * Author: WebToffee
21
  * Author URI: http://cookielawinfo.com/
22
  * License: GPLv3
@@ -63,7 +63,7 @@ define ( 'CLI_POST_TYPE','cookielawinfo');
63
  * Currently plugin version.
64
  * Rename this for your plugin and update it as you release new versions.
65
  */
66
- define( 'CLI_VERSION', '1.7.1' );
67
 
68
 
69
  /**
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: 1.7.2
20
  * Author: WebToffee
21
  * Author URI: http://cookielawinfo.com/
22
  * License: GPLv3
63
  * Currently plugin version.
64
  * Rename this for your plugin and update it as you release new versions.
65
  */
66
+ define( 'CLI_VERSION', '1.7.2' );
67
 
68
 
69
  /**
includes/class-cookie-law-info.php CHANGED
@@ -76,7 +76,7 @@ class Cookie_Law_Info {
76
  }
77
  else
78
  {
79
- $this->version = '1.7.1';
80
  }
81
  $this->plugin_name = 'cookie-law-info';
82
 
@@ -84,6 +84,7 @@ class Cookie_Law_Info {
84
  $this->set_locale();
85
  $this->define_admin_hooks();
86
  $this->define_public_hooks();
 
87
  //$this->cli_patches();
88
  }
89
 
@@ -128,6 +129,13 @@ class Cookie_Law_Info {
128
  */
129
  require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-cookie-law-info-public.php';
130
 
 
 
 
 
 
 
 
131
  $this->loader = new Cookie_Law_Info_Loader();
132
 
133
  }
@@ -208,6 +216,21 @@ class Cookie_Law_Info {
208
  $this->loader->add_action('wp_footer',$plugin_public,'include_user_accepted_cookielawinfo_in_body');
209
  }
210
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
211
  /**
212
  * Run the loader to execute all of the hooks with WordPress.
213
  *
76
  }
77
  else
78
  {
79
+ $this->version = '1.7.2';
80
  }
81
  $this->plugin_name = 'cookie-law-info';
82
 
84
  $this->set_locale();
85
  $this->define_admin_hooks();
86
  $this->define_public_hooks();
87
+ $this->define_thrid_party_hooks();
88
  //$this->cli_patches();
89
  }
90
 
129
  */
130
  require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-cookie-law-info-public.php';
131
 
132
+
133
+ /**
134
+ * The class responsible for adding compatibility to third party plugins
135
+ *
136
+ */
137
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'third-party/class-cookie-law-info-third-party.php';
138
+
139
  $this->loader = new Cookie_Law_Info_Loader();
140
 
141
  }
216
  $this->loader->add_action('wp_footer',$plugin_public,'include_user_accepted_cookielawinfo_in_body');
217
  }
218
 
219
+
220
+ /**
221
+ * Register all of the hooks related to the Third party plugin compatibility
222
+ * of the plugin.
223
+ *
224
+ * @since 1.7.2
225
+ * @access public
226
+ */
227
+ public function define_thrid_party_hooks()
228
+ {
229
+ $plugin_third_party = new Cookie_Law_Info_Third_Party();
230
+ $plugin_third_party->register_scripts();
231
+ }
232
+
233
+
234
  /**
235
  * Run the loader to execute all of the hooks with WordPress.
236
  *
public/css/cookie-law-info-public.css CHANGED
@@ -10,6 +10,7 @@
10
  z-index: 9999;
11
  box-shadow:rgba(0,0,0,.5) 0px 5px 50px;
12
  display: none;
 
13
  }
14
  #cookie-law-info-again {
15
  font-size: 10pt;
10
  z-index: 9999;
11
  box-shadow:rgba(0,0,0,.5) 0px 5px 50px;
12
  display: none;
13
+ left:0px;
14
  }
15
  #cookie-law-info-again {
16
  font-size: 10pt;
public/js/cookie-law-info-public.js CHANGED
@@ -482,12 +482,12 @@ var CLI=
482
  if(this.settings.widget_position=='left')
483
  {
484
  cli_elm.css({
485
- 'left':'15px','bottom':'15px','top':'auto'
486
  });
487
  }else
488
  {
489
  cli_elm.css({
490
- 'right':'15px','bottom':'15px','top':'auto'
491
  });
492
  }
493
  if(a)
482
  if(this.settings.widget_position=='left')
483
  {
484
  cli_elm.css({
485
+ 'left':'15px','right':'auto','bottom':'15px','top':'auto'
486
  });
487
  }else
488
  {
489
  cli_elm.css({
490
+ 'left':'auto','right':'15px','bottom':'15px','top':'auto'
491
  });
492
  }
493
  if(a)
README.txt → readme.txt RENAMED
@@ -3,8 +3,8 @@ Contributors: webtoffee,markwt
3
  Donate link: https://www.webtoffee.com/plugins/
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.8
7
- Stable tag: 1.7.1
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -172,6 +172,12 @@ See http://cookielawinfo.com for more information on what is required.
172
 
173
  == Changelog ==
174
 
 
 
 
 
 
 
175
  = 1.7.1 =
176
 
177
  * Cookie notice as `Widget` option added
@@ -342,6 +348,7 @@ See http://cookielawinfo.com for more information on what is required.
342
 
343
  == Upgrade Notice ==
344
 
345
- = 1.7.1 =
346
 
347
- * Cookie notice as `Widget` option added
 
3
  Donate link: https://www.webtoffee.com/plugins/
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: 5.0.2
7
+ Stable tag: 1.7.2
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
172
 
173
  == Changelog ==
174
 
175
+ = 1.7.2 =
176
+
177
+ * Tested ok with Wordpress version 5.0.2
178
+ * Compatibility added for Pixelyoursite plugin
179
+
180
+
181
  = 1.7.1 =
182
 
183
  * Cookie notice as `Widget` option added
348
 
349
  == Upgrade Notice ==
350
 
351
+ = 1.7.2 =
352
 
353
+ * Tested ok with Wordpress version 5.0.2
354
+ * Compatibility added for Pixelyoursite plugin
third-party/class-cookie-law-info-third-party.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Third party plugin compatibility.
4
+ *
5
+ * @link http://cookielawinfo.com/
6
+ * @since 1.7.2
7
+ *
8
+ * @package Cookie_Law_Info
9
+ * @subpackage Cookie_Law_Info/third-party
10
+ */
11
+
12
+ /**
13
+ * Third party plugin compatibility.
14
+ *
15
+ *
16
+ * @package Cookie_Law_Info
17
+ * @subpackage Cookie_Law_Info/third-party
18
+ * @author WebToffee <info@webtoffee.com>
19
+ */
20
+ class Cookie_Law_Info_Third_Party {
21
+
22
+ /*
23
+ * scripts list, Script folder and main file must be same as that of script name
24
+ * Please check the `register_scripts` method for more details
25
+ */
26
+ private $scripts=array(
27
+ 'pixelyoursite',
28
+ );
29
+
30
+ public static $existing_scripts=array();
31
+
32
+ /**
33
+ * Initialize the class and set its properties.
34
+ *
35
+ * @since 1.7.2
36
+ */
37
+ public function __construct() {
38
+
39
+ }
40
+
41
+ /**
42
+ * Registering third party scripts
43
+ *
44
+ */
45
+ public function register_scripts()
46
+ {
47
+ foreach ($this->scripts as $script) //loop through script list and include its file
48
+ {
49
+ $script_file=plugin_dir_path( __FILE__ )."scripts/$script/$script.php";
50
+ if(file_exists($script_file))
51
+ {
52
+ self::$existing_scripts[]=$script; //this is for module_exits checking
53
+ require_once $script_file;
54
+ }
55
+ }
56
+ }
57
+ }
third-party/scripts/pixelyoursite/pixelyoursite.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Compatibility with PixelYourSite
4
+ * @link http://www.pixelyoursite.com/
5
+ * @since 1.7.2
6
+ */
7
+ if (!defined('ABSPATH')) {
8
+ exit; // Exit if accessed directly.
9
+ }
10
+ class Cookie_Law_Info_PixelYourSite
11
+ {
12
+ public function __construct()
13
+ {
14
+ if($this->is_plugin_active())
15
+ {
16
+ $this->add_main_filter();
17
+ }
18
+ }
19
+
20
+ /*
21
+ *
22
+ * Add main filter based on GDPR main cookie (accept/reject)
23
+ * @since 1.7.2
24
+ */
25
+ private function add_main_filter()
26
+ {
27
+ $viewed_cookie="viewed_cookie_policy";
28
+ $out_fn='__return_true'; //block it
29
+ $out=true;
30
+ if(isset($_COOKIE[$viewed_cookie]))
31
+ {
32
+ if($_COOKIE[$viewed_cookie]=='yes')
33
+ {
34
+ $out_fn='__return_false'; //remove blocking
35
+ $out=false;
36
+ }
37
+ }
38
+ add_filter('pys_disable_by_gdpr',$out_fn,10,2);
39
+ return $out;
40
+ }
41
+
42
+
43
+ /*
44
+ *
45
+ * Checks PixelYourSite plugin is active
46
+ * @since 1.7.2
47
+ */
48
+ private function is_plugin_active()
49
+ {
50
+ if(!function_exists('is_plugin_active'))
51
+ {
52
+ include_once(ABSPATH.'wp-admin/includes/plugin.php');
53
+ }
54
+ return is_plugin_active('pixelyoursite-pro/pixelyoursite-pro.php') || is_plugin_active('pixelyoursite/facebook-pixel-master.php');
55
+ }
56
+ }
57
+ new Cookie_Law_Info_PixelYourSite();