PixelYourSite – Facebook Pixel (Events, WooCommerce & Easy Digital Downloads) - Version 5.3.4

Version Description

Download this release

Release Info

Developer PixelYourSite
Plugin Icon 128x128 PixelYourSite – Facebook Pixel (Events, WooCommerce & Easy Digital Downloads)
Version 5.3.4
Comparing to
See all releases

Code changes from version 5.3.3 to 5.3.4

facebook-pixel-master.php CHANGED
@@ -5,17 +5,17 @@
5
  Plugin URI: http://www.pixelyoursite.com/facebook-pixel-plugin-help
6
  Author: PixelYourSite
7
  Author URI: http://www.pixelyoursite.com
8
- Version: 5.3.3
9
  License: GPLv3
10
  WC requires at least: 2.6.0
11
- WC tested up to: 3.5.0
12
  */
13
 
14
  if ( ! defined( 'ABSPATH' ) ) {
15
  exit; // Exit if accessed directly.
16
  }
17
 
18
- define( 'PYS_FREE_VERSION', '5.3.3' );
19
 
20
  if ( ! function_exists( 'pys_is_pixelyoursite_pro_active' ) ) {
21
 
5
  Plugin URI: http://www.pixelyoursite.com/facebook-pixel-plugin-help
6
  Author: PixelYourSite
7
  Author URI: http://www.pixelyoursite.com
8
+ Version: 5.3.4
9
  License: GPLv3
10
  WC requires at least: 2.6.0
11
+ WC tested up to: 3.5.3
12
  */
13
 
14
  if ( ! defined( 'ABSPATH' ) ) {
15
  exit; // Exit if accessed directly.
16
  }
17
 
18
+ define( 'PYS_FREE_VERSION', '5.3.4' );
19
 
20
  if ( ! function_exists( 'pys_is_pixelyoursite_pro_active' ) ) {
21
 
inc/common.php CHANGED
@@ -1074,8 +1074,14 @@ if( !function_exists( 'pys_get_default_options' ) ) {
1074
  $options['edd']['purchase_add_address'] = true;
1075
  $options['edd']['purchase_add_payment_method'] = true;
1076
  $options['edd']['purchase_add_coupons'] = true;
1077
-
 
 
 
1078
  $options['gdpr']['enable_before_consent'] = true;
 
 
 
1079
 
1080
  return apply_filters( 'pys_fb_pixel_setting_defaults', $options );
1081
 
1074
  $options['edd']['purchase_add_address'] = true;
1075
  $options['edd']['purchase_add_payment_method'] = true;
1076
  $options['edd']['purchase_add_coupons'] = true;
1077
+
1078
+ /**
1079
+ * GDPR
1080
+ */
1081
  $options['gdpr']['enable_before_consent'] = true;
1082
+ $options['gdpr']['gdpr_ajax_enabled'] = true;
1083
+ $options['gdpr']['ginger_enabled'] = false;
1084
+ $options['gdpr']['cookiebot_enabled'] = false;
1085
 
1086
  return apply_filters( 'pys_fb_pixel_setting_defaults', $options );
1087
 
inc/core.php CHANGED
@@ -554,14 +554,19 @@ function pys_pixel_options() {
554
  * GDPR
555
  */
556
 
 
 
557
  $options['gdpr'] = array(
558
  'disable' => apply_filters( 'pys_disable_by_gdpr', false ),
 
559
  'enable_before_consent' => pys_get_option( 'gdpr', 'enable_before_consent' ),
560
  // 'gdpr_enabled' => pys_is_gdpr_plugin_activated() && pys_get_option( 'gdpr', 'gdpr_enabled' ),
561
  'ginger_enabled' => pys_is_ginger_plugin_activated() && pys_get_option( 'gdpr', 'ginger_enabled' ),
562
  'cookiebot_enabled' => pys_is_cookiebot_plugin_activated() && pys_get_option( 'gdpr', 'cookiebot_enabled' )
563
  );
564
 
 
 
565
  return $options;
566
 
567
  }
554
  * GDPR
555
  */
556
 
557
+ $ajax_enabled = apply_filters('pys_gdpr_ajax_enabled', pys_get_option( 'gdpr', 'gdpr_ajax_enabled', true ));
558
+
559
  $options['gdpr'] = array(
560
  'disable' => apply_filters( 'pys_disable_by_gdpr', false ),
561
+ 'ajax_enabled' => $ajax_enabled,
562
  'enable_before_consent' => pys_get_option( 'gdpr', 'enable_before_consent' ),
563
  // 'gdpr_enabled' => pys_is_gdpr_plugin_activated() && pys_get_option( 'gdpr', 'gdpr_enabled' ),
564
  'ginger_enabled' => pys_is_ginger_plugin_activated() && pys_get_option( 'gdpr', 'ginger_enabled' ),
565
  'cookiebot_enabled' => pys_is_cookiebot_plugin_activated() && pys_get_option( 'gdpr', 'cookiebot_enabled' )
566
  );
567
 
568
+ $options['ajax_url'] = admin_url( 'admin-ajax.php' );
569
+
570
  return $options;
571
 
572
  }
inc/gdpr.php CHANGED
@@ -43,3 +43,10 @@ function pys_is_cookiebot_plugin_activated() {
43
 
44
  }
45
 
 
 
 
 
 
 
 
43
 
44
  }
45
 
46
+ add_action( 'wp_ajax_pys_get_gdpr_filter_value', 'pys_get_gdpr_filter_value' );
47
+ add_action( 'wp_ajax_nopriv_pys_get_gdpr_filter_value', 'pys_get_gdpr_filter_value' );
48
+ function pys_get_gdpr_filter_value() {
49
+ wp_send_json_success( array(
50
+ 'disable' => apply_filters( 'pys_disable_by_gdpr', false ),
51
+ ) );
52
+ }
inc/general.php CHANGED
@@ -61,7 +61,13 @@ if ( ! function_exists( 'pys_admin_page_callback' ) ) {
61
  if ( ! empty( $_POST['_wpnonce'] ) && wp_verify_nonce( $_POST['_wpnonce'],
62
  'pys_update_options' ) && isset( $_POST['pys'] )
63
  ) {
64
- update_option( 'pixel_your_site', $_POST['pys'] );
 
 
 
 
 
 
65
  }
66
 
67
  ## delete standard events
61
  if ( ! empty( $_POST['_wpnonce'] ) && wp_verify_nonce( $_POST['_wpnonce'],
62
  'pys_update_options' ) && isset( $_POST['pys'] )
63
  ) {
64
+ $options = $_POST['pys'];
65
+
66
+ // allow 3rd party plugins to by-pass option value
67
+ $gdpr_ajax_enabled = isset( $options['gdpr']['gdpr_ajax_enabled'] ) ? $options['gdpr']['gdpr_ajax_enabled'] : false;
68
+ $options['gdpr']['gdpr_ajax_enabled'] = apply_filters( 'pys_gdpr_ajax_enabled', $gdpr_ajax_enabled );
69
+
70
+ update_option( 'pixel_your_site', $options );
71
  }
72
 
73
  ## delete standard events
inc/html-tab-gdpr.php CHANGED
@@ -76,6 +76,11 @@ if ( ! defined( 'ABSPATH' ) ) {
76
  tracking.</span>
77
  </td>
78
  </tr>
 
 
 
 
 
79
  </table>
80
  <button class="pys-btn pys-btn-blue pys-btn-big aligncenter">Save Settings</button>
81
  </div>
76
  tracking.</span>
77
  </td>
78
  </tr>
79
+ <tr>
80
+ <td>
81
+ <?php pys_checkbox( 'gdpr', 'gdpr_ajax_enabled' ); ?>Enable AJAX filter value update.
82
+ </td>
83
+ </tr>
84
  </table>
85
  <button class="pys-btn pys-btn-blue pys-btn-big aligncenter">Save Settings</button>
86
  </div>
js/public.js CHANGED
@@ -216,8 +216,7 @@ var runPYS = function () {
216
 
217
  jQuery(document).ready(function ($) {
218
 
219
- if (typeof pys_fb_pixel_options !== 'undefined') {
220
-
221
  // tracking in not disabled with filter by 3rd party
222
  if (!pys_fb_pixel_options.gdpr.disable) {
223
 
@@ -295,7 +294,26 @@ jQuery(document).ready(function ($) {
295
  } else {
296
  console.warn('PixelYourSite is disabled by GDPR.');
297
  }
 
298
 
299
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
300
 
 
 
 
 
301
  });
216
 
217
  jQuery(document).ready(function ($) {
218
 
219
+ var loadPixel = function () {
 
220
  // tracking in not disabled with filter by 3rd party
221
  if (!pys_fb_pixel_options.gdpr.disable) {
222
 
294
  } else {
295
  console.warn('PixelYourSite is disabled by GDPR.');
296
  }
297
+ };
298
 
299
+ if (typeof pys_fb_pixel_options !== 'undefined') {
300
+ if (pys_fb_pixel_options.gdpr.ajax_enabled) {
301
+ $.get({
302
+ url: pys_fb_pixel_options.ajax_url,
303
+ dataType: 'json',
304
+ data: {
305
+ action: 'pys_get_gdpr_filter_value'
306
+ },
307
+ success: function (res) {
308
+ if (res.success) {
309
+ pys_fb_pixel_options.gdpr.disable = res.data.disable;
310
+ }
311
+ loadPixel();
312
+ }
313
+ });
314
 
315
+ } else {
316
+ loadPixel();
317
+ }
318
+ }
319
  });
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: Facebook Pixel, New Facebook Pixel, Facebook Conversion Pixel, Facebook Pi
4
  Requires at least: 3.0.1
5
  Requires PHP: 5.3
6
  Tested up to: 5.0
7
- Stable tag: 5.3.3
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -307,6 +307,12 @@ We have an article about how to create Custom Reports:
307
 
308
  == Changelog ==
309
 
 
 
 
 
 
 
310
  = PixelYourSite 5.3.3 =
311
 
312
  * Facebook for WooCommerce compatibility fix: we modify ViewCategory content_type parameter in order to ensure product matching when Facebook for WooCommerce id logic is used.
4
  Requires at least: 3.0.1
5
  Requires PHP: 5.3
6
  Tested up to: 5.0
7
+ Stable tag: 5.3.4
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
307
 
308
  == Changelog ==
309
 
310
+ = PixelYourSite 5.3.4 =
311
+
312
+ * We've added an AJAX value update option for the GDPR filter. If plugins use our filter to control the pixel, this option must be enabled in order to work with cache. Developers can use this filter to enable it automatically: pys_gdpr_ajax_enabled
313
+
314
+ * This new option will fix an issue that appeared when the "GDPR Cookie Consent" plugin is active and a cache plugin is in use.
315
+
316
  = PixelYourSite 5.3.3 =
317
 
318
  * Facebook for WooCommerce compatibility fix: we modify ViewCategory content_type parameter in order to ensure product matching when Facebook for WooCommerce id logic is used.