Facebook for WooCommerce - Version 2.6.28

Version Description

  • 2022-10-25 =
  • Fix - Ensure bundles are not treated as virtual products on product_sync.
  • Fix - Ensure google-product-category-fields-loads.js loads only on the product category screens.
  • Fix - Server side sending of pixel events blocks generating pages .
Download this release

Release Info

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

Code changes from version 2.6.27 to 2.6.28

changelog.txt CHANGED
@@ -1,5 +1,10 @@
1
  *** Facebook for WooCommerce Changelog ***
2
 
 
 
 
 
 
3
  = 2.6.27 - 2022-10-14 =
4
  * Fix - Revert "Switch to Jetpack autoloader. (#1996 PR refresh)".
5
 
1
  *** Facebook for WooCommerce Changelog ***
2
 
3
+ = 2.6.28 - 2022-10-25 =
4
+ * Fix - Ensure bundles are not treated as virtual products on product_sync.
5
+ * Fix - Ensure google-product-category-fields-loads.js loads only on the product category screens.
6
+ * Fix - Server side sending of pixel events blocks generating pages .
7
+
8
  = 2.6.27 - 2022-10-14 =
9
  * Fix - Revert "Switch to Jetpack autoloader. (#1996 PR refresh)".
10
 
facebook-commerce-events-tracker.php CHANGED
@@ -43,6 +43,9 @@ if ( ! class_exists( 'WC_Facebookcommerce_EventsTracker' ) ) :
43
  /** @var array with events tracked */
44
  private $tracked_events;
45
 
 
 
 
46
  /** @var AAMSettings aam settings instance, used to filter advanced matching fields*/
47
  private $aam_settings;
48
 
@@ -141,9 +144,11 @@ if ( ! class_exists( 'WC_Facebookcommerce_EventsTracker' ) ) :
141
  add_action( '__experimental_woocommerce_blocks_checkout_update_order_meta', array( $this, 'inject_order_meta_event_for_checkout_block_flow' ), 10, 1 );
142
  }
143
 
144
-
145
  // TODO move this in some 3rd party plugin integrations handler at some point {FN 2020-03-20}
146
  add_action( 'wpcf7_contact_form', array( $this, 'inject_lead_event_hook' ), 11 );
 
 
 
147
  }
148
 
149
 
@@ -248,7 +253,7 @@ if ( ! class_exists( 'WC_Facebookcommerce_EventsTracker' ) ) :
248
 
249
  $event = new Event( $event_data );
250
 
251
- $this->send_api_event( $event );
252
 
253
  $event_data['event_id'] = $event->get_id();
254
 
@@ -554,7 +559,7 @@ if ( ! class_exists( 'WC_Facebookcommerce_EventsTracker' ) ) :
554
 
555
  $event = new Event( $event_data );
556
 
557
- $this->send_api_event( $event );
558
 
559
  $event_data['event_id'] = $event->get_id();
560
 
@@ -608,7 +613,7 @@ if ( ! class_exists( 'WC_Facebookcommerce_EventsTracker' ) ) :
608
 
609
  $event = new SkyVerge\WooCommerce\Facebook\Events\Event( $event_data );
610
 
611
- $this->send_api_event( $event );
612
 
613
  // send the event ID to prevent duplication
614
  $event_data['event_id'] = $event->get_id();
@@ -881,7 +886,7 @@ if ( ! class_exists( 'WC_Facebookcommerce_EventsTracker' ) ) :
881
 
882
  $event = new Event( $event_data );
883
 
884
- $this->send_api_event( $event );
885
 
886
  $event_data['event_id'] = $event->get_id();
887
 
@@ -1086,25 +1091,29 @@ if ( ! class_exists( 'WC_Facebookcommerce_EventsTracker' ) ) :
1086
  * @since 2.0.0
1087
  *
1088
  * @param Event $event event object
1089
- * @return bool
1090
  */
1091
- protected function send_api_event( Event $event ) {
1092
  $this->tracked_events[] = $event;
1093
 
1094
- try {
 
 
1095
 
1096
- facebook_for_woocommerce()->get_api()->send_pixel_events( facebook_for_woocommerce()->get_integration()->get_facebook_pixel_id(), array( $event ) );
1097
 
1098
- $success = true;
 
 
 
1099
 
1100
- } catch ( Framework\SV_WC_API_Exception $exception ) {
1101
 
1102
- $success = false;
1103
 
1104
- facebook_for_woocommerce()->log( 'Could not send Pixel event: ' . $exception->getMessage() );
1105
  }
1106
 
1107
- return $success;
1108
  }
1109
 
1110
 
@@ -1258,6 +1267,32 @@ if ( ! class_exists( 'WC_Facebookcommerce_EventsTracker' ) ) :
1258
  return $this->tracked_events;
1259
  }
1260
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1261
  }
1262
 
1263
  endif;
43
  /** @var array with events tracked */
44
  private $tracked_events;
45
 
46
+ /** @var array array with epnding events */
47
+ private $pending_events = [];
48
+
49
  /** @var AAMSettings aam settings instance, used to filter advanced matching fields*/
50
  private $aam_settings;
51
 
144
  add_action( '__experimental_woocommerce_blocks_checkout_update_order_meta', array( $this, 'inject_order_meta_event_for_checkout_block_flow' ), 10, 1 );
145
  }
146
 
 
147
  // TODO move this in some 3rd party plugin integrations handler at some point {FN 2020-03-20}
148
  add_action( 'wpcf7_contact_form', array( $this, 'inject_lead_event_hook' ), 11 );
149
+
150
+ add_action( 'shutdown', array( $this, 'send_pending_events' ) );
151
+
152
  }
153
 
154
 
253
 
254
  $event = new Event( $event_data );
255
 
256
+ $this->send_api_event( $event, false );
257
 
258
  $event_data['event_id'] = $event->get_id();
259
 
559
 
560
  $event = new Event( $event_data );
561
 
562
+ $this->send_api_event( $event, false );
563
 
564
  $event_data['event_id'] = $event->get_id();
565
 
613
 
614
  $event = new SkyVerge\WooCommerce\Facebook\Events\Event( $event_data );
615
 
616
+ $this->send_api_event( $event, false );
617
 
618
  // send the event ID to prevent duplication
619
  $event_data['event_id'] = $event->get_id();
886
 
887
  $event = new Event( $event_data );
888
 
889
+ $this->send_api_event( $event, false );
890
 
891
  $event_data['event_id'] = $event->get_id();
892
 
1091
  * @since 2.0.0
1092
  *
1093
  * @param Event $event event object
1094
+ * @param bool $send_now optional, defaults to true
1095
  */
1096
+ protected function send_api_event( Event $event, bool $send_now = true ) {
1097
  $this->tracked_events[] = $event;
1098
 
1099
+ if ( $send_now ) {
1100
+
1101
+ try {
1102
 
1103
+ facebook_for_woocommerce()->get_api()->send_pixel_events( facebook_for_woocommerce()->get_integration()->get_facebook_pixel_id(), array( $event ) );
1104
 
1105
+ } catch ( Framework\SV_WC_API_Exception $exception ) {
1106
+
1107
+ facebook_for_woocommerce()->log( 'Could not send Pixel event: ' . $exception->getMessage() );
1108
+ }
1109
 
1110
+ } else {
1111
 
1112
+ $this->pending_events[] = $event;
1113
 
 
1114
  }
1115
 
1116
+
1117
  }
1118
 
1119
 
1267
  return $this->tracked_events;
1268
  }
1269
 
1270
+ /**
1271
+ * Gets the pending events awaiting to be sent
1272
+ *
1273
+ * @return array
1274
+ */
1275
+ public function get_pending_events() {
1276
+ return $this->pending_events;
1277
+ }
1278
+
1279
+ /**
1280
+ * Send pending events.
1281
+ */
1282
+ public function send_pending_events() {
1283
+
1284
+ $pending_events = $this->get_pending_events();
1285
+
1286
+ if ( empty( $pending_events ) ) {
1287
+ return;
1288
+ }
1289
+
1290
+ foreach ( $pending_events as $event ) {
1291
+
1292
+ $this->send_api_event( $event );
1293
+ }
1294
+ }
1295
+
1296
  }
1297
 
1298
  endif;
facebook-commerce.php CHANGED
@@ -883,7 +883,7 @@ class WC_Facebookcommerce_Integration extends WC_Integration {
883
  $sync_mode = isset( $_POST['wc_facebook_sync_mode'] ) ? $_POST['wc_facebook_sync_mode'] : Admin::SYNC_MODE_SYNC_DISABLED;
884
  $sync_enabled = Admin::SYNC_MODE_SYNC_DISABLED !== $sync_mode;
885
 
886
- if ( Admin::SYNC_MODE_SYNC_AND_SHOW === $sync_mode && $product->is_virtual() ) {
887
  // force to Sync and hide
888
  $sync_mode = Admin::SYNC_MODE_SYNC_AND_HIDE;
889
  }
@@ -1526,14 +1526,14 @@ class WC_Facebookcommerce_Integration extends WC_Integration {
1526
 
1527
  $default_attributes = $woo_product->woo_product->get_default_attributes( 'edit' );
1528
  $default_variation = null;
1529
-
1530
  // Fetch variations that exist in the catalog.
1531
  $existing_catalog_variations = $this->find_variation_product_item_ids( $fb_product_group_id );
1532
  $existing_catalog_variations_retailer_ids = array_keys( $existing_catalog_variations );
1533
-
1534
  // All woocommerce variations for the product.
1535
  $product_variations = $woo_product->woo_product->get_available_variations();
1536
-
1537
  if ( ! empty( $default_attributes ) ) {
1538
 
1539
  $best_match_count = 0;
@@ -1566,7 +1566,7 @@ class WC_Facebookcommerce_Integration extends WC_Integration {
1566
 
1567
  }
1568
  }
1569
-
1570
  /**
1571
  * Filter product group default variation.
1572
  * This can be used to customize the choice of a default variation (e.g. choose one with the lowest price).
883
  $sync_mode = isset( $_POST['wc_facebook_sync_mode'] ) ? $_POST['wc_facebook_sync_mode'] : Admin::SYNC_MODE_SYNC_DISABLED;
884
  $sync_enabled = Admin::SYNC_MODE_SYNC_DISABLED !== $sync_mode;
885
 
886
+ if ( Admin::SYNC_MODE_SYNC_AND_SHOW === $sync_mode && $product->is_virtual() && 'bundle' !== $product->get_type() ) {
887
  // force to Sync and hide
888
  $sync_mode = Admin::SYNC_MODE_SYNC_AND_HIDE;
889
  }
1526
 
1527
  $default_attributes = $woo_product->woo_product->get_default_attributes( 'edit' );
1528
  $default_variation = null;
1529
+
1530
  // Fetch variations that exist in the catalog.
1531
  $existing_catalog_variations = $this->find_variation_product_item_ids( $fb_product_group_id );
1532
  $existing_catalog_variations_retailer_ids = array_keys( $existing_catalog_variations );
1533
+
1534
  // All woocommerce variations for the product.
1535
  $product_variations = $woo_product->woo_product->get_available_variations();
1536
+
1537
  if ( ! empty( $default_attributes ) ) {
1538
 
1539
  $best_match_count = 0;
1566
 
1567
  }
1568
  }
1569
+
1570
  /**
1571
  * Filter product group default variation.
1572
  * This can be used to customize the choice of a default variation (e.g. choose one with the lowest price).
facebook-for-woocommerce.php CHANGED
@@ -11,7 +11,7 @@
11
  * 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.
12
  * Author: Facebook
13
  * Author URI: https://www.facebook.com/
14
- * Version: 2.6.27
15
  * Text Domain: facebook-for-woocommerce
16
  * Tested up to: 6.0
17
  * WC requires at least: 3.5.0
@@ -33,7 +33,7 @@ class WC_Facebook_Loader {
33
  /**
34
  * @var string the plugin version. This must be in the main plugin file to be automatically bumped by Woorelease.
35
  */
36
- const PLUGIN_VERSION = '2.6.27'; // WRCS: DEFINED_VERSION.
37
 
38
  // Minimum PHP version required by this plugin.
39
  const MINIMUM_PHP_VERSION = '7.0.0';
11
  * 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.
12
  * Author: Facebook
13
  * Author URI: https://www.facebook.com/
14
+ * Version: 2.6.28
15
  * Text Domain: facebook-for-woocommerce
16
  * Tested up to: 6.0
17
  * WC requires at least: 3.5.0
33
  /**
34
  * @var string the plugin version. This must be in the main plugin file to be automatically bumped by Woorelease.
35
  */
36
+ const PLUGIN_VERSION = '2.6.28'; // WRCS: DEFINED_VERSION.
37
 
38
  // Minimum PHP version required by this plugin.
39
  const MINIMUM_PHP_VERSION = '7.0.0';
i18n/languages/facebook-for-woocommerce.pot CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the Facebook for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Facebook for WooCommerce 2.6.27\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/facebook-for-woocommerce\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2022-10-14T10:07:32+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.5.0\n"
15
  "X-Domain: facebook-for-woocommerce\n"
@@ -17,7 +17,7 @@ msgstr ""
17
  #. Plugin Name of the plugin
18
  #: class-wc-facebookcommerce.php:1082
19
  #: facebook-commerce.php:229
20
- #: includes/Admin.php:1626
21
  #: includes/Admin/Settings.php:94
22
  #: includes/Admin/Settings.php:119
23
  msgid "Facebook for WooCommerce"
@@ -32,7 +32,7 @@ msgid "Grow your business on Facebook! Use this official plugin to help sell mor
32
  msgstr ""
33
 
34
  #. Author of the plugin
35
- #: includes/Admin.php:1253
36
  #: includes/Admin/Settings.php:95
37
  #: includes/Admin/Settings.php:330
38
  msgid "Facebook"
@@ -189,176 +189,176 @@ msgstr ""
189
  msgid "%1$s requires WooCommerce version %2$s or higher. Please %3$supdate WooCommerce%4$s to the latest version, or %5$sdownload the minimum required version &raquo;%6$s"
190
  msgstr ""
191
 
192
- #: includes/Admin.php:117
193
  msgid "The name is how it appears on Facebook Catalog."
194
  msgstr ""
195
 
196
- #: includes/Admin.php:183
197
- msgid "You have selected one or more categories currently excluded from the Facebook sync. Products belonging to the excluded categories will not be added to your FB product set."
198
  msgstr ""
199
 
200
- #: includes/Admin.php:224
201
- msgid "Please enter a Google product category and at least one sub-category to sell this product on Instagram."
202
  msgstr ""
203
 
204
- #: includes/Admin.php:250
205
- msgid "Search main categories..."
206
  msgstr ""
207
 
208
- #: includes/Admin.php:251
209
- msgid "Choose a main category"
210
  msgstr ""
211
 
212
- #: includes/Admin.php:252
213
- msgid "Choose a category"
214
  msgstr ""
215
 
216
- #: includes/Admin.php:309
217
  msgid "To sell this product on Instagram, please ensure it meets the following requirements:"
218
  msgstr ""
219
 
220
- #: includes/Admin.php:312
221
  msgid "Has a price defined"
222
  msgstr ""
223
 
224
  #. translators: Placeholders: %1$s - <strong> opening HTML tag, %2$s - </strong> closing HTML tag
225
- #: includes/Admin.php:318
226
  msgid "Has %1$sManage Stock%2$s enabled on the %1$sInventory%2$s tab"
227
  msgstr ""
228
 
229
  #. translators: Placeholders: %1$s - <strong> opening HTML tag, %2$s - </strong> closing HTML tag
230
- #: includes/Admin.php:330
231
  msgid "Has the %1$sFacebook Sync%2$s setting set to \"Sync and show\" or \"Sync and hide\""
232
  msgstr ""
233
 
234
  #. translators: Placeholders: %1$s - opening <a> link tag, %2$s - closing </a> link tag
235
- #: includes/Admin.php:384
236
  msgid "You're removing a product from the Facebook sync that is currently listed in your %1$sFacebook catalog%2$s. Would you like to delete the product from the Facebook catalog as well?"
237
  msgstr ""
238
 
239
- #: includes/Admin.php:453
240
- #: includes/Admin.php:1296
241
- #: includes/Admin.php:1438
242
  msgid "Facebook sync"
243
  msgstr ""
244
 
245
- #: includes/Admin.php:480
246
- #: includes/Admin.php:511
247
  msgid "Sync and show"
248
  msgstr ""
249
 
250
- #: includes/Admin.php:482
251
- #: includes/Admin.php:512
252
  msgid "Sync and hide"
253
  msgstr ""
254
 
255
- #: includes/Admin.php:486
256
- #: includes/Admin.php:513
257
- #: includes/Admin.php:1300
258
- #: includes/Admin.php:1442
259
  msgid "Do not sync"
260
  msgstr ""
261
 
262
- #: includes/Admin.php:510
263
  msgid "Filter by Facebook sync setting"
264
  msgstr ""
265
 
266
- #: includes/Admin.php:923
267
  msgid "Include in Facebook sync"
268
  msgstr ""
269
 
270
- #: includes/Admin.php:924
271
  msgid "Exclude from Facebook sync"
272
  msgstr ""
273
 
274
  #. translators: Placeholders: %1$s - <strong> tag, %2$s - </strong> tag, %3$s - <a> tag, %4$s - <a> tag
275
- #: includes/Admin.php:1117
276
  msgid "%1$sHeads up!%2$s If this product was previously visible in Facebook, you may need to delete it from the %3$sFacebook catalog%4$s to completely hide it from customer view."
277
  msgid_plural "%1$sHeads up!%2$s If these products were previously visible in Facebook, you may need to delete them from the %3$sFacebook catalog%4$s to completely hide them from customer view."
278
  msgstr[0] ""
279
  msgstr[1] ""
280
 
281
- #: includes/Admin.php:1124
282
  msgid "Don't show this notice again"
283
  msgstr ""
284
 
285
  #. translators: Placeholders: %1$s - number of affected products, %2$s opening HTML <a> tag, %3$s - closing HTML </a> tag, %4$s - opening HTML <a> tag, %5$s - closing HTML </a> tag
286
- #: includes/Admin.php:1158
287
  msgid "%2$s%1$s product%3$s or some of its variations could not be updated to show in the Facebook catalog — %4$sFacebook Commerce Policies%5$s prohibit selling some product types (like virtual products). You may still advertise Virtual products on Facebook."
288
  msgid_plural "%2$s%1$s products%3$s or some of their variations could not be updated to show in the Facebook catalog — %4$sFacebook Commerce Policies%5$s prohibit selling some product types (like virtual products). You may still advertise Virtual products on Facebook."
289
  msgstr[0] ""
290
  msgstr[1] ""
291
 
292
  #. translators: Placeholders: %1$s - opening HTML <strong> tag, %2$s - closing HTML </strong> tag, %3$s - opening HTML <a> tag, %4$s - closing HTML </a> tag
293
- #: includes/Admin.php:1224
294
  msgid "%1$sHeads up!%2$s Facebook's %3$sCommerce Policies%4$s do not support selling virtual products, so we have hidden your synced Virtual products in your Facebook catalog. You may still advertise Virtual products on Facebook."
295
  msgstr ""
296
 
297
- #: includes/Admin.php:1298
298
- #: includes/Admin.php:1440
299
  msgid "Sync and show in catalog"
300
  msgstr ""
301
 
302
- #: includes/Admin.php:1299
303
- #: includes/Admin.php:1441
304
  msgid "Sync and hide in catalog"
305
  msgstr ""
306
 
307
- #: includes/Admin.php:1309
308
- #: includes/Admin.php:1454
309
  msgid "Facebook Description"
310
  msgstr ""
311
 
312
- #: includes/Admin.php:1311
313
- #: includes/Admin.php:1456
314
  msgid "Custom (plain-text only) description for product on Facebook. If blank, product description will be used. If product description is blank, shortname will be used."
315
  msgstr ""
316
 
317
- #: includes/Admin.php:1322
318
- #: includes/Admin.php:1469
319
  msgid "Facebook Product Image"
320
  msgstr ""
321
 
322
- #: includes/Admin.php:1324
323
- #: includes/Admin.php:1471
324
  msgid "Choose the product image that should be synced to the Facebook catalog for this product. If using a custom image, please enter an absolute URL (e.g. https://domain.com/image.jpg)."
325
  msgstr ""
326
 
327
- #: includes/Admin.php:1326
328
  msgid "Use WooCommerce image"
329
  msgstr ""
330
 
331
- #: includes/Admin.php:1327
332
- #: includes/Admin.php:1475
333
  msgid "Use custom image"
334
  msgstr ""
335
 
336
- #: includes/Admin.php:1338
337
- #: includes/Admin.php:1487
338
  msgid "Custom Image URL"
339
  msgstr ""
340
 
341
  #. translators: Placeholders %1$s - WC currency symbol
342
  #. translators: Placeholders %1$s - WC currency symbol
343
- #: includes/Admin.php:1349
344
- #: includes/Admin.php:1500
345
  msgid "Facebook Price (%1$s)"
346
  msgstr ""
347
 
348
- #: includes/Admin.php:1353
349
- #: includes/Admin.php:1504
350
  msgid "Custom price for product on Facebook. Please enter in monetary decimal (.) format without thousand separators and currency symbols. If blank, product price will be used."
351
  msgstr ""
352
 
353
- #: includes/Admin.php:1473
354
  msgid "Use variation image"
355
  msgstr ""
356
 
357
- #: includes/Admin.php:1474
358
  msgid "Use parent image"
359
  msgstr ""
360
 
361
- #: includes/Admin.php:1628
362
  msgid "Close modal panel"
363
  msgstr ""
364
 
2
  # This file is distributed under the same license as the Facebook for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Facebook for WooCommerce 2.6.28\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/facebook-for-woocommerce\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2022-10-25T13:21:10+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.5.0\n"
15
  "X-Domain: facebook-for-woocommerce\n"
17
  #. Plugin Name of the plugin
18
  #: class-wc-facebookcommerce.php:1082
19
  #: facebook-commerce.php:229
20
+ #: includes/Admin.php:1623
21
  #: includes/Admin/Settings.php:94
22
  #: includes/Admin/Settings.php:119
23
  msgid "Facebook for WooCommerce"
32
  msgstr ""
33
 
34
  #. Author of the plugin
35
+ #: includes/Admin.php:1259
36
  #: includes/Admin/Settings.php:95
37
  #: includes/Admin/Settings.php:330
38
  msgid "Facebook"
189
  msgid "%1$s requires WooCommerce version %2$s or higher. Please %3$supdate WooCommerce%4$s to the latest version, or %5$sdownload the minimum required version &raquo;%6$s"
190
  msgstr ""
191
 
192
+ #: includes/Admin.php:129
193
  msgid "The name is how it appears on Facebook Catalog."
194
  msgstr ""
195
 
196
+ #: includes/Admin.php:170
197
+ msgid "Search main categories..."
198
  msgstr ""
199
 
200
+ #: includes/Admin.php:171
201
+ msgid "Choose a main category"
202
  msgstr ""
203
 
204
+ #: includes/Admin.php:172
205
+ msgid "Choose a category"
206
  msgstr ""
207
 
208
+ #: includes/Admin.php:208
209
+ msgid "You have selected one or more categories currently excluded from the Facebook sync. Products belonging to the excluded categories will not be added to your FB product set."
210
  msgstr ""
211
 
212
+ #: includes/Admin.php:249
213
+ msgid "Please enter a Google product category and at least one sub-category to sell this product on Instagram."
214
  msgstr ""
215
 
216
+ #: includes/Admin.php:315
217
  msgid "To sell this product on Instagram, please ensure it meets the following requirements:"
218
  msgstr ""
219
 
220
+ #: includes/Admin.php:318
221
  msgid "Has a price defined"
222
  msgstr ""
223
 
224
  #. translators: Placeholders: %1$s - <strong> opening HTML tag, %2$s - </strong> closing HTML tag
225
+ #: includes/Admin.php:324
226
  msgid "Has %1$sManage Stock%2$s enabled on the %1$sInventory%2$s tab"
227
  msgstr ""
228
 
229
  #. translators: Placeholders: %1$s - <strong> opening HTML tag, %2$s - </strong> closing HTML tag
230
+ #: includes/Admin.php:336
231
  msgid "Has the %1$sFacebook Sync%2$s setting set to \"Sync and show\" or \"Sync and hide\""
232
  msgstr ""
233
 
234
  #. translators: Placeholders: %1$s - opening <a> link tag, %2$s - closing </a> link tag
235
+ #: includes/Admin.php:390
236
  msgid "You're removing a product from the Facebook sync that is currently listed in your %1$sFacebook catalog%2$s. Would you like to delete the product from the Facebook catalog as well?"
237
  msgstr ""
238
 
239
+ #: includes/Admin.php:459
240
+ #: includes/Admin.php:1302
241
+ #: includes/Admin.php:1444
242
  msgid "Facebook sync"
243
  msgstr ""
244
 
245
+ #: includes/Admin.php:486
246
+ #: includes/Admin.php:517
247
  msgid "Sync and show"
248
  msgstr ""
249
 
250
+ #: includes/Admin.php:488
251
+ #: includes/Admin.php:518
252
  msgid "Sync and hide"
253
  msgstr ""
254
 
255
+ #: includes/Admin.php:492
256
+ #: includes/Admin.php:519
257
+ #: includes/Admin.php:1306
258
+ #: includes/Admin.php:1448
259
  msgid "Do not sync"
260
  msgstr ""
261
 
262
+ #: includes/Admin.php:516
263
  msgid "Filter by Facebook sync setting"
264
  msgstr ""
265
 
266
+ #: includes/Admin.php:929
267
  msgid "Include in Facebook sync"
268
  msgstr ""
269
 
270
+ #: includes/Admin.php:930
271
  msgid "Exclude from Facebook sync"
272
  msgstr ""
273
 
274
  #. translators: Placeholders: %1$s - <strong> tag, %2$s - </strong> tag, %3$s - <a> tag, %4$s - <a> tag
275
+ #: includes/Admin.php:1123
276
  msgid "%1$sHeads up!%2$s If this product was previously visible in Facebook, you may need to delete it from the %3$sFacebook catalog%4$s to completely hide it from customer view."
277
  msgid_plural "%1$sHeads up!%2$s If these products were previously visible in Facebook, you may need to delete them from the %3$sFacebook catalog%4$s to completely hide them from customer view."
278
  msgstr[0] ""
279
  msgstr[1] ""
280
 
281
+ #: includes/Admin.php:1130
282
  msgid "Don't show this notice again"
283
  msgstr ""
284
 
285
  #. translators: Placeholders: %1$s - number of affected products, %2$s opening HTML <a> tag, %3$s - closing HTML </a> tag, %4$s - opening HTML <a> tag, %5$s - closing HTML </a> tag
286
+ #: includes/Admin.php:1164
287
  msgid "%2$s%1$s product%3$s or some of its variations could not be updated to show in the Facebook catalog — %4$sFacebook Commerce Policies%5$s prohibit selling some product types (like virtual products). You may still advertise Virtual products on Facebook."
288
  msgid_plural "%2$s%1$s products%3$s or some of their variations could not be updated to show in the Facebook catalog — %4$sFacebook Commerce Policies%5$s prohibit selling some product types (like virtual products). You may still advertise Virtual products on Facebook."
289
  msgstr[0] ""
290
  msgstr[1] ""
291
 
292
  #. translators: Placeholders: %1$s - opening HTML <strong> tag, %2$s - closing HTML </strong> tag, %3$s - opening HTML <a> tag, %4$s - closing HTML </a> tag
293
+ #: includes/Admin.php:1230
294
  msgid "%1$sHeads up!%2$s Facebook's %3$sCommerce Policies%4$s do not support selling virtual products, so we have hidden your synced Virtual products in your Facebook catalog. You may still advertise Virtual products on Facebook."
295
  msgstr ""
296
 
297
+ #: includes/Admin.php:1304
298
+ #: includes/Admin.php:1446
299
  msgid "Sync and show in catalog"
300
  msgstr ""
301
 
302
+ #: includes/Admin.php:1305
303
+ #: includes/Admin.php:1447
304
  msgid "Sync and hide in catalog"
305
  msgstr ""
306
 
307
+ #: includes/Admin.php:1315
308
+ #: includes/Admin.php:1460
309
  msgid "Facebook Description"
310
  msgstr ""
311
 
312
+ #: includes/Admin.php:1317
313
+ #: includes/Admin.php:1462
314
  msgid "Custom (plain-text only) description for product on Facebook. If blank, product description will be used. If product description is blank, shortname will be used."
315
  msgstr ""
316
 
317
+ #: includes/Admin.php:1328
318
+ #: includes/Admin.php:1475
319
  msgid "Facebook Product Image"
320
  msgstr ""
321
 
322
+ #: includes/Admin.php:1330
323
+ #: includes/Admin.php:1477
324
  msgid "Choose the product image that should be synced to the Facebook catalog for this product. If using a custom image, please enter an absolute URL (e.g. https://domain.com/image.jpg)."
325
  msgstr ""
326
 
327
+ #: includes/Admin.php:1332
328
  msgid "Use WooCommerce image"
329
  msgstr ""
330
 
331
+ #: includes/Admin.php:1333
332
+ #: includes/Admin.php:1481
333
  msgid "Use custom image"
334
  msgstr ""
335
 
336
+ #: includes/Admin.php:1344
337
+ #: includes/Admin.php:1493
338
  msgid "Custom Image URL"
339
  msgstr ""
340
 
341
  #. translators: Placeholders %1$s - WC currency symbol
342
  #. translators: Placeholders %1$s - WC currency symbol
343
+ #: includes/Admin.php:1355
344
+ #: includes/Admin.php:1506
345
  msgid "Facebook Price (%1$s)"
346
  msgstr ""
347
 
348
+ #: includes/Admin.php:1359
349
+ #: includes/Admin.php:1510
350
  msgid "Custom price for product on Facebook. Please enter in monetary decimal (.) format without thousand separators and currency symbols. If blank, product price will be used."
351
  msgstr ""
352
 
353
+ #: includes/Admin.php:1479
354
  msgid "Use variation image"
355
  msgstr ""
356
 
357
+ #: includes/Admin.php:1480
358
  msgid "Use parent image"
359
  msgstr ""
360
 
361
+ #: includes/Admin.php:1625
362
  msgid "Close modal panel"
363
  msgstr ""
364
 
includes/Admin.php CHANGED
@@ -35,6 +35,9 @@ class Admin {
35
  /** @var \Admin\Product_Categories the product category admin handler */
36
  protected $product_categories;
37
 
 
 
 
38
 
39
  /**
40
  * Admin constructor.
@@ -43,6 +46,15 @@ class Admin {
43
  */
44
  public function __construct() {
45
 
 
 
 
 
 
 
 
 
 
46
  // enqueue admin scripts
47
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
48
 
@@ -130,16 +142,9 @@ class Admin {
130
  public function enqueue_scripts() {
131
  global $current_screen;
132
 
133
- $modal_screens = array(
134
- 'product',
135
- 'edit-product',
136
- 'edit-product_cat',
137
- 'shop_order',
138
- );
139
-
140
  if ( isset( $current_screen->id ) ) {
141
 
142
- if ( in_array( $current_screen->id, $modal_screens, true ) || facebook_for_woocommerce()->is_plugin_settings() ) {
143
 
144
  // enqueue modal functions
145
  wp_enqueue_script(
@@ -148,6 +153,26 @@ class Admin {
148
  array( 'jquery', 'wc-backbone-modal', 'jquery-blockui' ),
149
  \WC_Facebookcommerce::PLUGIN_VERSION
150
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  }
152
 
153
  if ( 'edit-fb_product_set' === $current_screen->id ) {
@@ -229,30 +254,11 @@ class Admin {
229
  }//end if
230
 
231
  if ( facebook_for_woocommerce()->is_plugin_settings() ) {
232
-
233
  wp_enqueue_style( 'woocommerce_admin_styles' );
234
  wp_enqueue_script( 'wc-enhanced-select' );
235
  }
236
  }//end if
237
 
238
- wp_enqueue_script(
239
- 'wc-facebook-google-product-category-fields',
240
- facebook_for_woocommerce()->get_asset_build_dir_url() . '/admin/google-product-category-fields.js',
241
- array( 'jquery' ),
242
- \WC_Facebookcommerce::PLUGIN_VERSION
243
- );
244
-
245
- wp_localize_script(
246
- 'wc-facebook-google-product-category-fields',
247
- 'facebook_for_woocommerce_google_product_category',
248
- array(
249
- 'i18n' => array(
250
- 'top_level_dropdown_placeholder' => __( 'Search main categories...', 'facebook-for-woocommerce' ),
251
- 'second_level_empty_dropdown_placeholder' => __( 'Choose a main category', 'facebook-for-woocommerce' ),
252
- 'general_dropdown_placeholder' => __( 'Choose a category', 'facebook-for-woocommerce' ),
253
- ),
254
- )
255
- );
256
  }
257
 
258
 
@@ -1603,17 +1609,8 @@ class Admin {
1603
  public function render_modal_template() {
1604
  global $current_screen;
1605
 
1606
- $modal_screens = array(
1607
- 'product',
1608
- 'edit-product',
1609
- 'woocommerce_page_wc-facebook',
1610
- 'marketing_page_wc-facebook',
1611
- 'edit-product_cat',
1612
- 'shop_order',
1613
- );
1614
-
1615
  // bail if not on the products, product edit, or settings screen
1616
- if ( ! $current_screen || ! in_array( $current_screen->id, $modal_screens, true ) ) {
1617
  return;
1618
  }
1619
 
35
  /** @var \Admin\Product_Categories the product category admin handler */
36
  protected $product_categories;
37
 
38
+ /** @var array screens ids where to include scripts */
39
+ protected $screen_ids = [];
40
+
41
 
42
  /**
43
  * Admin constructor.
46
  */
47
  public function __construct() {
48
 
49
+ $this->screen_ids = [
50
+ 'product',
51
+ 'edit-product',
52
+ 'woocommerce_page_wc-facebook',
53
+ 'marketing_page_wc-facebook',
54
+ 'edit-product_cat',
55
+ 'shop_order',
56
+ ];
57
+
58
  // enqueue admin scripts
59
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
60
 
142
  public function enqueue_scripts() {
143
  global $current_screen;
144
 
 
 
 
 
 
 
 
145
  if ( isset( $current_screen->id ) ) {
146
 
147
+ if ( in_array( $current_screen->id, $this->screen_ids, true ) || facebook_for_woocommerce()->is_plugin_settings() ) {
148
 
149
  // enqueue modal functions
150
  wp_enqueue_script(
153
  array( 'jquery', 'wc-backbone-modal', 'jquery-blockui' ),
154
  \WC_Facebookcommerce::PLUGIN_VERSION
155
  );
156
+
157
+ // enqueue google product category select
158
+ wp_enqueue_script(
159
+ 'wc-facebook-google-product-category-fields',
160
+ facebook_for_woocommerce()->get_asset_build_dir_url() . '/admin/google-product-category-fields.js',
161
+ array( 'jquery' ),
162
+ \WC_Facebookcommerce::PLUGIN_VERSION
163
+ );
164
+
165
+ wp_localize_script(
166
+ 'wc-facebook-google-product-category-fields',
167
+ 'facebook_for_woocommerce_google_product_category',
168
+ array(
169
+ 'i18n' => array(
170
+ 'top_level_dropdown_placeholder' => __( 'Search main categories...', 'facebook-for-woocommerce' ),
171
+ 'second_level_empty_dropdown_placeholder' => __( 'Choose a main category', 'facebook-for-woocommerce' ),
172
+ 'general_dropdown_placeholder' => __( 'Choose a category', 'facebook-for-woocommerce' ),
173
+ ),
174
+ )
175
+ );
176
  }
177
 
178
  if ( 'edit-fb_product_set' === $current_screen->id ) {
254
  }//end if
255
 
256
  if ( facebook_for_woocommerce()->is_plugin_settings() ) {
 
257
  wp_enqueue_style( 'woocommerce_admin_styles' );
258
  wp_enqueue_script( 'wc-enhanced-select' );
259
  }
260
  }//end if
261
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
262
  }
263
 
264
 
1609
  public function render_modal_template() {
1610
  global $current_screen;
1611
 
 
 
 
 
 
 
 
 
 
1612
  // bail if not on the products, product edit, or settings screen
1613
+ if ( ! $current_screen || ! in_array( $current_screen->id, $this->screen_ids, true ) ) {
1614
  return;
1615
  }
1616
 
includes/fbproduct.php CHANGED
@@ -637,7 +637,9 @@ if ( ! class_exists( 'WC_Facebook_Product' ) ) :
637
 
638
  // Exclude variations that are "virtual" products from export to Facebook &&
639
  // No Visibility Option for Variations
640
- if ( true === $this->get_virtual() ) {
 
 
641
  $product_data['visibility'] = \WC_Facebookcommerce_Integration::FB_SHOP_PRODUCT_HIDDEN;
642
  }
643
 
637
 
638
  // Exclude variations that are "virtual" products from export to Facebook &&
639
  // No Visibility Option for Variations
640
+ // get_virtual() returns true for "unassembled bundles", so we exclude
641
+ // bundles from this check.
642
+ if ( true === $this->get_virtual() && 'bundle' !== $this->get_type() ) {
643
  $product_data['visibility'] = \WC_Facebookcommerce_Integration::FB_SHOP_PRODUCT_HIDDEN;
644
  }
645
 
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: 6.0
6
- Stable tag: 2.6.27
7
  Requires PHP: 5.6 or greater
8
  MySQL: 5.6 or greater
9
  License: GPLv2 or later
@@ -39,6 +39,11 @@ When opening a bug on GitHub, please give us as many details as possible.
39
 
40
  == Changelog ==
41
 
 
 
 
 
 
42
  = 2.6.27 - 2022-10-14 =
43
  * Fix - Revert "Switch to Jetpack autoloader. (#1996 PR refresh)".
44
 
3
  Tags: facebook, shop, catalog, advertise, pixel, product
4
  Requires at least: 4.4
5
  Tested up to: 6.0
6
+ Stable tag: 2.6.28
7
  Requires PHP: 5.6 or greater
8
  MySQL: 5.6 or greater
9
  License: GPLv2 or later
39
 
40
  == Changelog ==
41
 
42
+ = 2.6.28 - 2022-10-25 =
43
+ * Fix - Ensure bundles are not treated as virtual products on product_sync.
44
+ * Fix - Ensure google-product-category-fields-loads.js loads only on the product category screens.
45
+ * Fix - Server side sending of pixel events blocks generating pages .
46
+
47
  = 2.6.27 - 2022-10-14 =
48
  * Fix - Revert "Switch to Jetpack autoloader. (#1996 PR refresh)".
49
 
vendor/autoload.php CHANGED
@@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) {
9
 
10
  require_once __DIR__ . '/composer/autoload_real.php';
11
 
12
- return ComposerAutoloaderInitf1679011dcec7e6e85162030bf6d35f9::getLoader();
9
 
10
  require_once __DIR__ . '/composer/autoload_real.php';
11
 
12
+ return ComposerAutoloaderInit64fdc836ada2ede409092ba18b2883e9::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitf1679011dcec7e6e85162030bf6d35f9
6
  {
7
  private static $loader;
8
 
@@ -24,12 +24,12 @@ class ComposerAutoloaderInitf1679011dcec7e6e85162030bf6d35f9
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
- spl_autoload_register(array('ComposerAutoloaderInitf1679011dcec7e6e85162030bf6d35f9', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
29
- spl_autoload_unregister(array('ComposerAutoloaderInitf1679011dcec7e6e85162030bf6d35f9', 'loadClassLoader'));
30
 
31
  require __DIR__ . '/autoload_static.php';
32
- call_user_func(\Composer\Autoload\ComposerStaticInitf1679011dcec7e6e85162030bf6d35f9::getInitializer($loader));
33
 
34
  $loader->register(true);
35
 
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit64fdc836ada2ede409092ba18b2883e9
6
  {
7
  private static $loader;
8
 
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
+ spl_autoload_register(array('ComposerAutoloaderInit64fdc836ada2ede409092ba18b2883e9', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
29
+ spl_autoload_unregister(array('ComposerAutoloaderInit64fdc836ada2ede409092ba18b2883e9', 'loadClassLoader'));
30
 
31
  require __DIR__ . '/autoload_static.php';
32
+ call_user_func(\Composer\Autoload\ComposerStaticInit64fdc836ada2ede409092ba18b2883e9::getInitializer($loader));
33
 
34
  $loader->register(true);
35
 
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInitf1679011dcec7e6e85162030bf6d35f9
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'S' =>
@@ -243,9 +243,9 @@ class ComposerStaticInitf1679011dcec7e6e85162030bf6d35f9
243
  public static function getInitializer(ClassLoader $loader)
244
  {
245
  return \Closure::bind(function () use ($loader) {
246
- $loader->prefixLengthsPsr4 = ComposerStaticInitf1679011dcec7e6e85162030bf6d35f9::$prefixLengthsPsr4;
247
- $loader->prefixDirsPsr4 = ComposerStaticInitf1679011dcec7e6e85162030bf6d35f9::$prefixDirsPsr4;
248
- $loader->classMap = ComposerStaticInitf1679011dcec7e6e85162030bf6d35f9::$classMap;
249
 
250
  }, null, ClassLoader::class);
251
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit64fdc836ada2ede409092ba18b2883e9
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'S' =>
243
  public static function getInitializer(ClassLoader $loader)
244
  {
245
  return \Closure::bind(function () use ($loader) {
246
+ $loader->prefixLengthsPsr4 = ComposerStaticInit64fdc836ada2ede409092ba18b2883e9::$prefixLengthsPsr4;
247
+ $loader->prefixDirsPsr4 = ComposerStaticInit64fdc836ada2ede409092ba18b2883e9::$prefixDirsPsr4;
248
+ $loader->classMap = ComposerStaticInit64fdc836ada2ede409092ba18b2883e9::$classMap;
249
 
250
  }, null, ClassLoader::class);
251
  }
vendor/composer/installed.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php return array(
2
  'root' => array(
3
- 'pretty_version' => 'dev-release/2.6.27',
4
- 'version' => 'dev-release/2.6.27',
5
  'type' => 'wordpress-plugin',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
- 'reference' => '7d3e892d3c9d829e2ce696eec562030370667110',
9
  'name' => 'facebookincubator/facebook-for-woocommerce',
10
  'dev' => false,
11
  ),
@@ -20,12 +20,12 @@
20
  'dev_requirement' => false,
21
  ),
22
  'facebookincubator/facebook-for-woocommerce' => array(
23
- 'pretty_version' => 'dev-release/2.6.27',
24
- 'version' => 'dev-release/2.6.27',
25
  'type' => 'wordpress-plugin',
26
  'install_path' => __DIR__ . '/../../',
27
  'aliases' => array(),
28
- 'reference' => '7d3e892d3c9d829e2ce696eec562030370667110',
29
  'dev_requirement' => false,
30
  ),
31
  'roundcube/plugin-installer' => array(
1
  <?php return array(
2
  'root' => array(
3
+ 'pretty_version' => 'dev-release/2.6.28',
4
+ 'version' => 'dev-release/2.6.28',
5
  'type' => 'wordpress-plugin',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
+ 'reference' => 'f4171ac3f89f5a98022ad1d6efeb58aea0ee9f3d',
9
  'name' => 'facebookincubator/facebook-for-woocommerce',
10
  'dev' => false,
11
  ),
20
  'dev_requirement' => false,
21
  ),
22
  'facebookincubator/facebook-for-woocommerce' => array(
23
+ 'pretty_version' => 'dev-release/2.6.28',
24
+ 'version' => 'dev-release/2.6.28',
25
  'type' => 'wordpress-plugin',
26
  'install_path' => __DIR__ . '/../../',
27
  'aliases' => array(),
28
+ 'reference' => 'f4171ac3f89f5a98022ad1d6efeb58aea0ee9f3d',
29
  'dev_requirement' => false,
30
  ),
31
  'roundcube/plugin-installer' => array(