Facebook for WooCommerce - Version 2.0.4

Version Description

Download this release

Release Info

Developer SkyVerge
Plugin Icon Facebook for WooCommerce
Version 2.0.4
Comparing to
See all releases

Code changes from version 2.0.3 to 2.0.4

changelog.txt CHANGED
@@ -1,5 +1,8 @@
1
  *** Facebook for WooCommerce Changelog ***
2
 
 
 
 
3
  2020.10.02 - version 2.0.3
4
  * Tweak - Pixel events now can include advanced matching information
5
  * Fix - Send contents parameter for ViewContent event using the correct format
1
  *** Facebook for WooCommerce Changelog ***
2
 
3
+ 2020.10.08 - version 2.0.4
4
+ * Fix - Fix SQL errors triggered while trying to remove duplicate visibility meta entries from postmeta table
5
+
6
  2020.10.02 - version 2.0.3
7
  * Tweak - Pixel events now can include advanced matching information
8
  * Fix - Send contents parameter for ViewContent event using the correct format
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.0.3';
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.0.4';
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.0.3
14
  * Text Domain: facebook-for-woocommerce
15
  * WC requires at least: 3.5.0
16
  * WC tested up to: 4.5.2
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.0.4
14
  * Text Domain: facebook-for-woocommerce
15
  * WC requires at least: 3.5.0
16
  * WC tested up to: 4.5.2
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.0.3\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://woocommerce.com/my-account/marketplace-ticket-form/\n"
8
- "POT-Creation-Date: 2020-10-02 23:23:52+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.0.4\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://woocommerce.com/my-account/marketplace-ticket-form/\n"
8
+ "POT-Creation-Date: 2020-10-08 19:31:07+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/Lifecycle.php CHANGED
@@ -41,6 +41,7 @@ class Lifecycle extends Framework\Plugin\Lifecycle {
41
  '1.11.0',
42
  '2.0.0',
43
  '2.0.3',
 
44
  ];
45
  }
46
 
@@ -318,4 +319,22 @@ class Lifecycle extends Framework\Plugin\Lifecycle {
318
  }
319
 
320
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
321
  }
41
  '1.11.0',
42
  '2.0.0',
43
  '2.0.3',
44
+ '2.0.4',
45
  ];
46
  }
47
 
319
  }
320
 
321
 
322
+ /**
323
+ * Upgrades to version 2.0.4
324
+ *
325
+ * @since 2.0.4
326
+ */
327
+ protected function upgrade_to_2_0_4() {
328
+
329
+ // if unfinished jobs are stuck, give the handlers a chance to complete them
330
+ if ( $handler = $this->get_plugin()->get_background_handle_virtual_products_variations_instance() ) {
331
+ $handler->dispatch();
332
+ }
333
+
334
+ if ( $handler = $this->get_plugin()->get_background_remove_duplicate_visibility_meta_instance() ) {
335
+ $handler->dispatch();
336
+ }
337
+ }
338
+
339
+
340
  }
includes/Utilities/Background_Handle_Virtual_Products_Variations.php CHANGED
@@ -202,12 +202,14 @@ class Background_Handle_Virtual_Products_Variations extends Framework\SV_WP_Back
202
  return 0;
203
  }
204
 
205
- $values_str = '';
206
 
207
  foreach ( $post_ids as $post_id ) {
208
- $values_str .= "('{$post_id}', 'fb_visibility', 'no')";
209
  }
210
 
 
 
211
  // we need to explicitly insert the metadata and set it to no, because not having it means it is visible
212
  $sql = "
213
  INSERT INTO {$wpdb->postmeta} (post_id, meta_key, meta_value )
202
  return 0;
203
  }
204
 
205
+ $values = [];
206
 
207
  foreach ( $post_ids as $post_id ) {
208
+ $values[] = "('{$post_id}', 'fb_visibility', 'no')";
209
  }
210
 
211
+ $values_str = implode( ',', $values );
212
+
213
  // we need to explicitly insert the metadata and set it to no, because not having it means it is visible
214
  $sql = "
215
  INSERT INTO {$wpdb->postmeta} (post_id, meta_key, meta_value )
includes/Utilities/Background_Remove_Duplicate_Visibility_Meta.php CHANGED
@@ -138,7 +138,7 @@ class Background_Remove_Duplicate_Visibility_Meta extends Framework\SV_WP_Backgr
138
 
139
  foreach ( $results as $result ) {
140
 
141
- $sql = "DELETE FROM wp_postmeta WHERE post_id = %d AND meta_key = 'fb_visibility' AND meta_id != %d";
142
 
143
  if ( false === $wpdb->query( $wpdb->prepare( $sql, $result->post_id, $result->last_meta_id ) ) ) {
144
 
138
 
139
  foreach ( $results as $result ) {
140
 
141
+ $sql = "DELETE FROM {$wpdb->postmeta} WHERE post_id = %d AND meta_key = 'fb_visibility' AND meta_id != %d";
142
 
143
  if ( false === $wpdb->query( $wpdb->prepare( $sql, $result->post_id, $result->last_meta_id ) ) ) {
144
 
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.5.1
6
- Stable tag: 2.0.3
7
  Requires PHP: 5.6 or greater
8
  MySQL: 5.6 or greater
9
  License: GPLv2 or later
@@ -39,6 +39,9 @@ When opening a bug on GitHub, please give us as many details as possible.
39
 
40
  == Changelog ==
41
 
 
 
 
42
  = 2020.10.02 - version 2.0.3 =
43
  * Tweak - Pixel events now can include advanced matching information
44
  * Fix - Send contents parameter for ViewContent event using the correct format
3
  Tags: facebook, shop, catalog, advertise, pixel, product
4
  Requires at least: 4.4
5
  Tested up to: 5.5.1
6
+ Stable tag: 2.0.4
7
  Requires PHP: 5.6 or greater
8
  MySQL: 5.6 or greater
9
  License: GPLv2 or later
39
 
40
  == Changelog ==
41
 
42
+ = 2020.10.08 - version 2.0.4 =
43
+ * Fix - Fix SQL errors triggered while trying to remove duplicate visibility meta entries from postmeta table
44
+
45
  = 2020.10.02 - version 2.0.3 =
46
  * Tweak - Pixel events now can include advanced matching information
47
  * Fix - Send contents parameter for ViewContent event using the correct format