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

Version Description

Download this release

Release Info

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

Code changes from version 7.1.9 to 7.1.10

dist/scripts/admin.js CHANGED
@@ -7,6 +7,11 @@ jQuery( document ).ready(function($) {
7
 
8
  updateFDPValue(this);
9
  });
 
 
 
 
 
10
 
11
 
12
  function updateFDPValue(input) {
@@ -21,5 +26,15 @@ jQuery( document ).ready(function($) {
21
  $("#pys_facebook_fdp_purchase_event_fire_css").hide()
22
  }
23
  }
 
 
 
 
 
 
 
 
 
 
24
  });
25
 
7
 
8
  updateFDPValue(this);
9
  });
10
+ updatePostEventFields();
11
+ $("#pys_event_trigger_type").change(function(){
12
+ updatePostEventFields();
13
+ });
14
+
15
 
16
 
17
  function updateFDPValue(input) {
26
  $("#pys_facebook_fdp_purchase_event_fire_css").hide()
27
  }
28
  }
29
+
30
+ function updatePostEventFields() {
31
+ if($("#pys_event_trigger_type").val() == "post_type") {
32
+ $(".event-delay").css("visibility","visible");
33
+ $(".triger_post_type").show();
34
+ $("#url_filter_panel").hide();
35
+ } else {
36
+ $(".triger_post_type").hide();
37
+ }
38
+ }
39
  });
40
 
facebook-pixel-master.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: PixelYourSite
5
  * Plugin URI: http://www.pixelyoursite.com/
6
  * Description: No codding <strong>Facebook Pixel</strong> and <strong>Google Analytics</strong> install. Track key actions with our Global Events, or configure your own events. WooCommerce and EDD fully supported, with Facebook Dynamic Ads Pixel set-up and Google Analytics Enhanced Ecommerce. Insert any custom script with our Head & Footer option. Add the <strong>Pinterest Tag</strong> with our free add-on. The PRO version adds support for the Google Ads tag plus a lot of extra stuff.
7
- * Version: 7.1.9
8
  * Author: PixelYourSite
9
  * Author URI: http://www.pixelyoursite.com
10
  * License: GPLv3
@@ -13,7 +13,7 @@
13
  * Tested up to: 5.4
14
  *
15
  * WC requires at least: 2.6.0
16
- * WC tested up to: 4.2
17
  *
18
  * Text Domain: pys
19
  */
4
  * Plugin Name: PixelYourSite
5
  * Plugin URI: http://www.pixelyoursite.com/
6
  * Description: No codding <strong>Facebook Pixel</strong> and <strong>Google Analytics</strong> install. Track key actions with our Global Events, or configure your own events. WooCommerce and EDD fully supported, with Facebook Dynamic Ads Pixel set-up and Google Analytics Enhanced Ecommerce. Insert any custom script with our Head & Footer option. Add the <strong>Pinterest Tag</strong> with our free add-on. The PRO version adds support for the Google Ads tag plus a lot of extra stuff.
7
+ * Version: 7.1.10
8
  * Author: PixelYourSite
9
  * Author URI: http://www.pixelyoursite.com
10
  * License: GPLv3
13
  * Tested up to: 5.4
14
  *
15
  * WC requires at least: 2.6.0
16
+ * WC tested up to: 4.3
17
  *
18
  * Text Domain: pys
19
  */
includes/functions-common.php CHANGED
@@ -160,6 +160,20 @@ function isSmartOpenGraphActive() {
160
 
161
  }
162
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  /**
164
  * Clean variables using sanitize_text_field. Arrays are cleaned recursively.
165
  * Non-scalar values are ignored.
160
 
161
  }
162
 
163
+ /**
164
+ * Check if WPML plugin installed and activated.
165
+ *
166
+ * @return bool
167
+ */
168
+ function isWPMLActive() {
169
+
170
+ if ( ! function_exists( 'is_plugin_active' ) ) {
171
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
172
+ }
173
+
174
+ return is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' );
175
+ }
176
+
177
  /**
178
  * Clean variables using sanitize_text_field. Arrays are cleaned recursively.
179
  * Non-scalar values are ignored.
includes/functions-custom-event.php CHANGED
@@ -165,14 +165,27 @@ function renderTriggerTypeInput( &$event, $key ) {
165
  'css_click' => 'Click on CSS selector - PRO',
166
  'css_mouseover' => 'Mouse over CSS selector - PRO',
167
  'scroll_pos' => 'Page Scroll - PRO',
 
168
  );
169
 
170
  renderSelectInput( $event, $key, $options );
171
 
172
  }
 
 
 
 
173
 
 
 
174
 
 
 
 
 
175
 
 
 
176
  /**
177
  * @param CustomEvent $event
178
  * @param string $key
165
  'css_click' => 'Click on CSS selector - PRO',
166
  'css_mouseover' => 'Mouse over CSS selector - PRO',
167
  'scroll_pos' => 'Page Scroll - PRO',
168
+ 'post_type' => 'Post type - PRO',
169
  );
170
 
171
  renderSelectInput( $event, $key, $options );
172
 
173
  }
174
+ /**
175
+ * @param CustomEvent $event
176
+ * @param string $key
177
+ */
178
 
179
+ function renderPostTypeSelect(&$event, $key) {
180
+ $types = get_post_types(null,"objects ");
181
 
182
+ $options = array();
183
+ foreach ($types as $type) {
184
+ $options[$type->name]=$type->label;
185
+ }
186
 
187
+ renderSelectInput( $event, $key, $options );
188
+ }
189
  /**
190
  * @param CustomEvent $event
191
  * @param string $key
includes/views/html-main-events-edit.php CHANGED
@@ -63,7 +63,9 @@ if(isset( $_REQUEST['id'] )) {
63
  <div class="col form-inline">
64
  <label>Fire event when</label>
65
  <?php Events\renderTriggerTypeInput( $event, 'trigger_type' ); ?>
66
-
 
 
67
  <div class="event-delay form-inline">
68
  <label>with delay</label>
69
  <?php Events\renderNumberInput( $event, 'delay', '0' ); ?>
@@ -82,6 +84,7 @@ if(isset( $_REQUEST['id'] )) {
82
  </div>
83
  </div>
84
 
 
85
  <div id="page_visit_panel" class="event_triggers_panel" data-trigger_type="page_visit" style="display: none;">
86
  <div class="row mt-3 event_trigger" data-trigger_id="0" style="display: none;">
87
  <div class="col">
63
  <div class="col form-inline">
64
  <label>Fire event when</label>
65
  <?php Events\renderTriggerTypeInput( $event, 'trigger_type' ); ?>
66
+ <div class="triger_post_type form-inline" style="display: none">
67
+ <?php Events\renderPostTypeSelect( $event, 'post_type_value' ); ?>
68
+ </div>
69
  <div class="event-delay form-inline">
70
  <label>with delay</label>
71
  <?php Events\renderNumberInput( $event, 'delay', '0' ); ?>
84
  </div>
85
  </div>
86
 
87
+
88
  <div id="page_visit_panel" class="event_triggers_panel" data-trigger_type="page_visit" style="display: none;">
89
  <div class="row mt-3 event_trigger" data-trigger_id="0" style="display: none;">
90
  <div class="col">
includes/views/html-main-general.php CHANGED
@@ -61,6 +61,14 @@ if ( ! defined( 'ABSPATH' ) ) {
61
  </div>
62
  </div>
63
  <?php endif; ?>
 
 
 
 
 
 
 
 
64
  <hr>
65
 
66
  <?php endif; ?>
@@ -82,6 +90,14 @@ if ( ! defined( 'ABSPATH' ) ) {
82
  target="_blank">pro version</a>.</p>
83
  </div>
84
  </div>
 
 
 
 
 
 
 
 
85
  <hr>
86
 
87
  <?php endif; ?>
61
  </div>
62
  </div>
63
  <?php endif; ?>
64
+ <?php if(isWPMLActive()) : ?>
65
+ <div class="row mb-3">
66
+ <div class="col-3"></div>
67
+ <div class="col-7">
68
+ <strong>WPML Detected. </strong> With the <a target="_blank" href="https://www.pixelyoursite.com/plugins/pixelyoursite-professional?utm_medium=plugin&utm_campaign=multilingual">Advanced and Agency</a> licenses, you can fire a different pixel for each language.
69
+ </div>
70
+ </div>
71
+ <?php endif; ?>
72
  <hr>
73
 
74
  <?php endif; ?>
90
  target="_blank">pro version</a>.</p>
91
  </div>
92
  </div>
93
+ <?php if(isWPMLActive()) : ?>
94
+ <div class="row mb-3">
95
+ <div class="col-3"></div>
96
+ <div class="col-7">
97
+ <strong>WPML Detected. </strong> With the <a target="_blank" href="https://www.pixelyoursite.com/plugins/pixelyoursite-professional?utm_medium=plugin&utm_campaign=multilingual">Advanced and Agency</a> licenses, you can fire a different pixel for each language.
98
+ </div>
99
+ </div>
100
+ <?php endif; ?>
101
  <hr>
102
 
103
  <?php endif; ?>
includes/views/html-main-woo.php CHANGED
@@ -435,7 +435,23 @@ e&utm_campaign=pro-feature' ); ?>
435
  <?php renderPopoverButton( 'woo_purchase_on_transaction' ); ?>
436
  </div>
437
  </div>
438
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
439
  <?php if ( Facebook()->enabled() ) : ?>
440
  <div class="row">
441
  <div class="col">
435
  <?php renderPopoverButton( 'woo_purchase_on_transaction' ); ?>
436
  </div>
437
  </div>
438
+
439
+ <div class="row mb-1">
440
+ <div class="col">
441
+ <label>Fire the Purchase Event for the following order status: <?php renderProBadge('https://www.pixelyoursite.com/google-ads-tag/?utm_source=pys-free-plugin&utm_medium=pro-badge&utm_campaign=pro-feature'); ?></label>
442
+ <div class="custom-controls-stacked ml-2">
443
+ <?php
444
+ $statuses = wc_get_order_statuses();
445
+ foreach ( $statuses as $status => $status_name) {
446
+ PYS()->render_checkbox_input( 'woo_order_purchase_status_'.esc_attr( $status ), esc_html( $status_name ),true);
447
+ }
448
+ ?>
449
+ </div>
450
+ <label>The Purchase event fires when the client makes a transaction on your website. It won't fire on when the order status is modified afterwards.</label>
451
+
452
+ </div>
453
+ </div>
454
+
455
  <?php if ( Facebook()->enabled() ) : ?>
456
  <div class="row">
457
  <div class="col">
modules/facebook/function-helpers.php CHANGED
@@ -205,16 +205,9 @@ function getFacebookWooProductContentId( $product_id ) {
205
  return $value;
206
  }
207
 
208
- // Call $product->get_id() instead of ->id to account for Variable
209
- // products, which have their own variant_ids.
210
- $retailer_id = $product->get_sku()
211
- ? $product->get_sku() . '_' . $product->get_id()
212
- : false;
213
-
214
- $ids = array(
215
- $product->get_sku(),
216
- 'wc_post_id_' . $product->get_id(),
217
- $retailer_id
218
  );
219
 
220
  $value = array_values( array_filter( $ids ) );
@@ -224,7 +217,15 @@ function getFacebookWooProductContentId( $product_id ) {
224
  return $value;
225
 
226
  }
227
-
 
 
 
 
 
 
 
 
228
  function getFacebookWooCartItemId( $item ) {
229
 
230
  if ( ! PixelYourSite\Facebook()->getOption( 'woo_variable_as_simple' ) && isset( $item['variation_id'] ) && $item['variation_id'] !== 0 ) {
205
  return $value;
206
  }
207
 
208
+
209
+ $ids = array(
210
+ get_fb_plugin_retailer_id($product)
 
 
 
 
 
 
 
211
  );
212
 
213
  $value = array_values( array_filter( $ids ) );
217
  return $value;
218
 
219
  }
220
+ function get_fb_plugin_retailer_id( $woo_product ) {
221
+ if(!$woo_product) return "";
222
+ $woo_id = $woo_product->get_id();
223
+
224
+ // Call $woo_product->get_id() instead of ->id to account for Variable
225
+ // products, which have their own variant_ids.
226
+ return $woo_product->get_sku() ? $woo_product->get_sku() . '_' .
227
+ $woo_id : 'wc_post_id_'. $woo_id;
228
+ }
229
  function getFacebookWooCartItemId( $item ) {
230
 
231
  if ( ! PixelYourSite\Facebook()->getOption( 'woo_variable_as_simple' ) && isset( $item['variation_id'] ) && $item['variation_id'] !== 0 ) {
pixelyoursite.php CHANGED
@@ -4,7 +4,7 @@ if ( ! defined( 'ABSPATH' ) ) {
4
  exit; // Exit if accessed directly.
5
  }
6
 
7
- define( 'PYS_FREE_VERSION', '7.1.9' );
8
  define( 'PYS_FREE_PINTEREST_MIN_VERSION', '2.0.6' );
9
  define( 'PYS_FREE_BING_MIN_VERSION', '1.0.0' );
10
  define( 'PYS_FREE_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
4
  exit; // Exit if accessed directly.
5
  }
6
 
7
+ define( 'PYS_FREE_VERSION', '7.1.10' );
8
  define( 'PYS_FREE_PINTEREST_MIN_VERSION', '2.0.6' );
9
  define( 'PYS_FREE_BING_MIN_VERSION', '1.0.0' );
10
  define( 'PYS_FREE_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
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.4
6
  Tested up to: 5.4
7
- Stable tag: 7.1.9
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -390,6 +390,16 @@ NO, absolutely not! We don't track any type of data about your website. We simpl
390
 
391
  == Changelog ==
392
 
 
 
 
 
 
 
 
 
 
 
393
  = PixelYourSite 7.1.9 =
394
 
395
  * Fix for a potential issue where AddToCart value was NaN
4
  Requires at least: 3.0.1
5
  Requires PHP: 5.4
6
  Tested up to: 5.4
7
+ Stable tag: 7.1.10
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
390
 
391
  == Changelog ==
392
 
393
+
394
+ = PixelYourSite 7.1.10 =
395
+
396
+ * Small improvements related to "Facebook for WooCommerce" ID logic.
397
+
398
+ * Small UI update to reflect a new option from the PRO version (Events by post_type).
399
+
400
+ * WooCommerce 4.3 compatibility.
401
+
402
+
403
  = PixelYourSite 7.1.9 =
404
 
405
  * Fix for a potential issue where AddToCart value was NaN