Facebook for WooCommerce - Version 2.3.1

Version Description

Download this release

Release Info

Developer automattic
Plugin Icon Facebook for WooCommerce
Version 2.3.1
Comparing to
See all releases

Code changes from version 2.3.0 to 2.3.1

changelog.txt CHANGED
@@ -1,5 +1,9 @@
1
  *** Facebook for WooCommerce Changelog ***
2
 
 
 
 
 
3
  2021.02.16 - version 2.3.0
4
  * Feature - Add ability to create and assign products to Facebook product sets
5
  * Feature - Add support for Facebook App store flow
1
  *** Facebook for WooCommerce Changelog ***
2
 
3
+ 2021.02.23 - version 2.3.1
4
+ * Fix - Fix errors when product set is empty
5
+ * Fix - Ensure that events have an action_source
6
+
7
  2021.02.16 - version 2.3.0
8
  * Feature - Add ability to create and assign products to Facebook product sets
9
  * Feature - Add support for Facebook App store flow
class-wc-facebookcommerce.php CHANGED
@@ -22,7 +22,7 @@ if ( ! class_exists( 'WC_Facebookcommerce' ) ) :
22
 
23
 
24
  /** @var string the plugin version */
25
- const VERSION = '2.3.0';
26
 
27
  /** @var string for backwards compatibility TODO: remove this in v2.0.0 {CW 2020-02-06} */
28
  const PLUGIN_VERSION = self::VERSION;
22
 
23
 
24
  /** @var string the plugin version */
25
+ const VERSION = '2.3.1';
26
 
27
  /** @var string for backwards compatibility TODO: remove this in v2.0.0 {CW 2020-02-06} */
28
  const PLUGIN_VERSION = self::VERSION;
facebook-for-woocommerce.php CHANGED
@@ -10,7 +10,7 @@
10
  * Description: Grow your business on Facebook! Use this official plugin to help sell more of your products using Facebook. After completing the setup, you'll be ready to create ads that promote your products and you can also create a shop section on your Page where customers can browse your products on Facebook.
11
  * Author: Facebook
12
  * Author URI: https://www.facebook.com/
13
- * Version: 2.3.0
14
  * Text Domain: facebook-for-woocommerce
15
  * WC requires at least: 3.5.0
16
  * WC tested up to: 5.0.0
10
  * Description: Grow your business on Facebook! Use this official plugin to help sell more of your products using Facebook. After completing the setup, you'll be ready to create ads that promote your products and you can also create a shop section on your Page where customers can browse your products on Facebook.
11
  * Author: Facebook
12
  * Author URI: https://www.facebook.com/
13
+ * Version: 2.3.1
14
  * Text Domain: facebook-for-woocommerce
15
  * WC requires at least: 3.5.0
16
  * WC tested up to: 5.0.0
i18n/languages/facebook-for-woocommerce.pot CHANGED
@@ -2,10 +2,10 @@
2
  # This file is distributed under the same license as the Facebook for WooCommerce package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Facebook for WooCommerce 2.3.0\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://woocommerce.com/my-account/marketplace-ticket-form/\n"
8
- "POT-Creation-Date: 2021-02-16 15:58:50+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
2
  # This file is distributed under the same license as the Facebook for WooCommerce package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Facebook for WooCommerce 2.3.1\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://woocommerce.com/my-account/marketplace-ticket-form/\n"
8
+ "POT-Creation-Date: 2021-02-23 13:17:44+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
includes/Events/Event.php CHANGED
@@ -88,6 +88,7 @@ class Event {
88
  protected function prepare_data( $data ) {
89
 
90
  $this->data = wp_parse_args( $data, [
 
91
  'event_time' => time(),
92
  'event_id' => $this->generate_event_id(),
93
  'event_source_url' => $this->get_current_url(),
88
  protected function prepare_data( $data ) {
89
 
90
  $this->data = wp_parse_args( $data, [
91
+ 'action_source' => 'website',
92
  'event_time' => time(),
93
  'event_id' => $this->generate_event_id(),
94
  'event_source_url' => $this->get_current_url(),
includes/ProductSets/Sync.php CHANGED
@@ -346,10 +346,12 @@ class Sync {
346
  );
347
  $product_ids = get_posts( $products_args );
348
 
 
349
  if ( empty( $product_ids ) ) {
350
  $fb_product_set_id = get_term_meta( $product_set_id, \WC_Facebookcommerce_Integration::FB_PRODUCT_SET_ID, true );
351
  update_term_meta( $product_set_id, \WC_Facebookcommerce_Integration::FB_PRODUCT_SET_ID, '' );
352
  do_action( 'fb_wc_product_set_delete', $fb_product_set_id );
 
353
  }
354
 
355
  // gets products variations
346
  );
347
  $product_ids = get_posts( $products_args );
348
 
349
+ // Removes the Product Set if it doesn't have products.
350
  if ( empty( $product_ids ) ) {
351
  $fb_product_set_id = get_term_meta( $product_set_id, \WC_Facebookcommerce_Integration::FB_PRODUCT_SET_ID, true );
352
  update_term_meta( $product_set_id, \WC_Facebookcommerce_Integration::FB_PRODUCT_SET_ID, '' );
353
  do_action( 'fb_wc_product_set_delete', $fb_product_set_id );
354
+ return;
355
  }
356
 
357
  // gets products variations
includes/fbgraph.php CHANGED
@@ -407,7 +407,11 @@ if ( ! class_exists( 'WC_Facebookcommerce_Graph_API' ) ) :
407
  }
408
 
409
  public function delete_product_set_item( $product_set_id ) {
410
- $url = $this->build_url( $product_set_id, '', '8.0' );
 
 
 
 
411
  return self::_delete( $url );
412
  }
413
 
407
  }
408
 
409
  public function delete_product_set_item( $product_set_id ) {
410
+
411
+ $params = ( true === apply_filters( 'wc_facebook_commerce_allow_live_product_set_deletion', true, $product_set_id ) ) ? '?allow_live_product_set_deletion=true' : '';
412
+
413
+ $url = $this->build_url( $product_set_id, $params, '9.0' );
414
+
415
  return self::_delete( $url );
416
  }
417
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: facebook, automattic, woothemes
3
  Tags: facebook, shop, catalog, advertise, pixel, product
4
  Requires at least: 4.4
5
  Tested up to: 5.6
6
- Stable tag: 2.3.0
7
  Requires PHP: 5.6 or greater
8
  MySQL: 5.6 or greater
9
  License: GPLv2 or later
@@ -39,6 +39,10 @@ When opening a bug on GitHub, please give us as many details as possible.
39
 
40
  == Changelog ==
41
 
 
 
 
 
42
  = 2021.02.16 - version 2.3.0 =
43
  * Feature - Add ability to create and assign products to Facebook product sets
44
  * Feature - Add support for Facebook App store flow
3
  Tags: facebook, shop, catalog, advertise, pixel, product
4
  Requires at least: 4.4
5
  Tested up to: 5.6
6
+ Stable tag: 2.3.1
7
  Requires PHP: 5.6 or greater
8
  MySQL: 5.6 or greater
9
  License: GPLv2 or later
39
 
40
  == Changelog ==
41
 
42
+ = 2021.02.23 - version 2.3.1 =
43
+ * Fix - Fix errors when product set is empty
44
+ * Fix - Ensure that events have an action_source
45
+
46
  = 2021.02.16 - version 2.3.0 =
47
  * Feature - Add ability to create and assign products to Facebook product sets
48
  * Feature - Add support for Facebook App store flow