CTX Feed – WooCommerce Product Feed Manager Plugin - Version 4.0.9

Version Description

(2020-10-22) = * Fix: Helper functions error solved. * Tweak: Performance enhancement.

Download this release

Release Info

Developer wahid0003
Plugin Icon 128x128 CTX Feed – WooCommerce Product Feed Manager Plugin
Version 4.0.9
Comparing to
See all releases

Code changes from version 4.0.8 to 4.0.9

Files changed (3) hide show
  1. README.txt +5 -1
  2. includes/helper.php +18 -18
  3. woo-feed.php +2 -2
README.txt CHANGED
@@ -5,7 +5,7 @@ Tags:product feed,woocommerce product feed,google shopping feed,google shopping,
5
  Requires at least: 3.6
6
  Tested Up To: 5.5
7
  Requires PHP: 5.6
8
- Stable tag: 4.0.8
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -308,6 +308,10 @@ Using pro version:
308
 
309
  == Changelog ==
310
 
 
 
 
 
311
  = 4.0.8 (2020-10-21) =
312
  * Fix: Bing shipping default value from shipping class.
313
 
5
  Requires at least: 3.6
6
  Tested Up To: 5.5
7
  Requires PHP: 5.6
8
+ Stable tag: 4.0.9
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
308
 
309
  == Changelog ==
310
 
311
+ = 4.0.9 (2020-10-22) =
312
+ * Fix: Helper functions error solved.
313
+ * Tweak: Performance enhancement.
314
+
315
  = 4.0.8 (2020-10-21) =
316
  * Fix: Bing shipping default value from shipping class.
317
 
includes/helper.php CHANGED
@@ -1462,9 +1462,9 @@ if ( ! function_exists( 'woo_feed_usort_reorder' ) ) {
1462
  */
1463
  function woo_feed_usort_reorder( $a, $b ) {
1464
  // If no sort, default to title
1465
- $orderby = ( ! empty( $_REQUEST['orderby'] ) ) ? sanitize_text_field( $_REQUEST['orderby'] ) : 'option_name'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
1466
  // If no order, default to asc
1467
- $order = ( ! empty( $_REQUEST['order'] ) ) ? sanitize_text_field( $_REQUEST['order'] ) : 'asc'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
1468
  $result = strcmp( $a[ $orderby ], $b[ $orderby ] ); // Determine sort order
1469
 
1470
  return ( 'asc' === $order ) ? $result : - $result; // Send final sort direction to usort
@@ -1510,7 +1510,7 @@ if ( ! function_exists( 'woo_feed_export_config' ) ) {
1510
  */
1511
  function woo_feed_export_config(){
1512
  if ( isset( $_REQUEST['feed'], $_REQUEST['_wpnonce'] ) && wp_verify_nonce( sanitize_text_field( $_REQUEST['_wpnonce'] ), 'wpf-export' ) ) {
1513
- $feed = sanitize_text_field( $_REQUEST['feed'] );
1514
  $feed = woo_feed_extract_feed_option_name( $feed );
1515
  if ( ! empty( $feed ) ) {
1516
  $feed = maybe_unserialize( get_option( 'wf_feed_' . $feed ) );
@@ -1570,10 +1570,10 @@ if ( ! function_exists( 'woo_feed_import_config' ) ) {
1570
  $_FILES['wpf_import_file']['name'],
1571
  $_FILES['wpf_import_file']['tmp_name']
1572
  ) &&
1573
- 'wpf' === pathinfo( $_FILES['wpf_import_file']['name'], PATHINFO_EXTENSION ) // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
1574
  ) {
1575
- $file_name = sanitize_text_field( $_FILES['wpf_import_file']['name'] );
1576
- $data = file_get_contents( sanitize_text_field( $_FILES['wpf_import_file']['tmp_name'] ) );
1577
  if ( empty( $data ) ) {
1578
  wp_die(
1579
  esc_html__( 'Empty File Uploaded. Try again.', 'woo-feed' ),
@@ -1656,7 +1656,7 @@ if ( ! function_exists( 'woo_feed_import_config' ) ) {
1656
  }
1657
 
1658
  $feed = woo_feed_parse_feed_rules( $feed );
1659
- $new_name = sanitize_text_field( $_POST['wpf_import_feed_name'] );
1660
  $new_name = trim( $new_name );
1661
  if ( ! empty( $new_name ) ) {
1662
  $opt_name = $new_name;
@@ -2399,7 +2399,7 @@ if ( ! function_exists( 'woo_feed_category_mapping' ) ) {
2399
  if ( count( $_POST ) && isset( $_POST['mappingname'] ) && isset( $_POST['edit-mapping'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
2400
  check_admin_referer( 'category-mapping' );
2401
 
2402
- $mappingOption = sanitize_text_field( $_POST['mappingname'] );
2403
  $mappingOption = 'wf_cmapping_' . sanitize_title( $mappingOption );
2404
  $mappingData = woo_feed_array_sanitize( $_POST );
2405
  $oldMapping = maybe_unserialize( get_option( $mappingOption, array() ) );
@@ -2428,7 +2428,7 @@ if ( ! function_exists( 'woo_feed_category_mapping' ) ) {
2428
  if ( count( $_POST ) && isset( $_POST['mappingname'] ) && isset( $_POST['add-mapping'] ) ) {
2429
  check_admin_referer( 'category-mapping' );
2430
 
2431
- $mappingOption = 'wf_cmapping_' . sanitize_text_field( $_POST['mappingname'] );
2432
 
2433
  # Delete product attribute drop-down cache
2434
  delete_transient( '__woo_feed_cache_woo_feed_dropdown_product_attributes');
@@ -2601,21 +2601,21 @@ if ( ! function_exists( 'woo_feed_save_identifier_fields_data' ) ) {
2601
 
2602
  //save gtin fields value
2603
  if ( isset( $_POST['woo_feed_gtin'] ) && ! empty( $_POST['woo_feed_gtin'] ) ) {
2604
- update_post_meta( $id, 'woo_feed_gtin', $_POST['woo_feed_gtin'] );
2605
  } else {
2606
  delete_post_meta( $id, 'woo_feed_gtin' );
2607
  }
2608
 
2609
  //save mpn fields value
2610
  if ( isset( $_POST['woo_feed_mpn'] ) && ! empty( $_POST['woo_feed_mpn'] ) ) {
2611
- update_post_meta( $id, 'woo_feed_mpn', $_POST['woo_feed_mpn'] );
2612
  } else {
2613
  delete_post_meta( $id, 'woo_feed_mpn' );
2614
  }
2615
 
2616
  //save ean fields value
2617
  if ( isset( $_POST['woo_feed_ean'] ) && ! empty( $_POST['woo_feed_ean'] ) ) {
2618
- update_post_meta( $id, 'woo_feed_ean', $_POST['woo_feed_ean'] );
2619
  } else {
2620
  delete_post_meta( $id, 'woo_feed_ean' );
2621
  }
@@ -2712,19 +2712,19 @@ if ( ! function_exists( 'woo_feed_save_identifier_fields_data_for_variation' ) )
2712
 
2713
  //save gtin field
2714
  if ( isset($_POST['woo_feed_gtin_var'][ $variation_id ]) ) {
2715
- $woo_feed_gtin_field = $_POST['woo_feed_gtin_var'][ $variation_id ];
2716
  if ( isset( $woo_feed_gtin_field ) ) update_post_meta( $variation_id, 'woo_feed_gtin_var', esc_attr( $woo_feed_gtin_field ) );
2717
  }
2718
 
2719
  //save mpn field
2720
  if ( isset($_POST['woo_feed_mpn_var'][ $variation_id ]) ) {
2721
- $woo_feed_mpn_field = $_POST['woo_feed_mpn_var'][ $variation_id ];
2722
  if ( isset( $woo_feed_mpn_field ) ) update_post_meta( $variation_id, 'woo_feed_mpn_var', esc_attr( $woo_feed_mpn_field ) );
2723
  }
2724
 
2725
  //save ean field
2726
  if ( isset($_POST['woo_feed_ean_var'][ $variation_id ]) ) {
2727
- $woo_feed_ean_field = $_POST['woo_feed_ean_var'][ $variation_id ];
2728
  if ( isset( $woo_feed_ean_field ) ) update_post_meta( $variation_id, 'woo_feed_ean_var', esc_attr( $woo_feed_ean_field ) );
2729
  }
2730
 
@@ -2744,7 +2744,7 @@ if ( ! function_exists( 'woo_feed_clear_cache_button' ) ) {
2744
  ?>
2745
  <div class="wf_clean_cache_wrapper">
2746
  <img class="woo-feed-cache-loader" src="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%0D%0A%3C%21--%20Generator%3A%20Adobe%20Illustrator%2019.0.0%2C%20SVG%20Export%20Plug-In%20.%20SVG%20Version%3A%206.00%20Build%200%29%20%20--%3E%0D%0A%3Csvg%20version%3D%221.1%22%20id%3D%22Capa_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%0D%0A%09%20viewBox%3D%220%200%20458.186%20458.186%22%20style%3D%22enable-background%3Anew%200%200%20458.186%20458.186%3B%22%20xml%3Aspace%3D%22preserve%22%3E%0D%0A%3Cg%3E%0D%0A%09%3Cg%3E%0D%0A%09%09%3Cpath%20d%3D%22M445.651%2C201.95c-1.485-9.308-10.235-15.649-19.543-14.164c-9.308%2C1.485-15.649%2C10.235-14.164%2C19.543%0D%0A%09%09%09c0.016%2C0.102%2C0.033%2C0.203%2C0.051%2C0.304c17.38%2C102.311-51.47%2C199.339-153.781%2C216.719c-102.311%2C17.38-199.339-51.47-216.719-153.781%0D%0A%09%09%09S92.966%2C71.232%2C195.276%2C53.852c62.919-10.688%2C126.962%2C11.29%2C170.059%2C58.361l-75.605%2C25.19%0D%0A%09%09%09c-8.944%2C2.976-13.781%2C12.638-10.806%2C21.582c0.001%2C0.002%2C0.002%2C0.005%2C0.003%2C0.007c2.976%2C8.944%2C12.638%2C13.781%2C21.582%2C10.806%0D%0A%09%09%09c0.003-0.001%2C0.005-0.002%2C0.007-0.002l102.4-34.133c6.972-2.322%2C11.675-8.847%2C11.674-16.196v-102.4%0D%0A%09%09%09C414.59%2C7.641%2C406.949%2C0%2C397.523%2C0s-17.067%2C7.641-17.067%2C17.067v62.344C292.564-4.185%2C153.545-0.702%2C69.949%2C87.19%0D%0A%09%09%09s-80.114%2C226.911%2C7.779%2C310.508s226.911%2C80.114%2C310.508-7.779C435.905%2C339.799%2C457.179%2C270.152%2C445.651%2C201.95z%22%2F%3E%0D%0A%09%3C%2Fg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3C%2Fsvg%3E%0D%0A" alt="loader">
2747
- <input type="hidden" class="woo-feed-clean-cache-nonce" value="<?php echo wp_create_nonce( 'clean_cache_nonce', 'clean_cache_nonce' ); ?>">
2748
  <button type="button"><?php esc_html_e( 'Clear Cache', 'woo-feed' ); ?></button>
2749
  </div>
2750
  <?php
@@ -2772,7 +2772,7 @@ if ( ! function_exists( 'woo_feed_clear_cache_data' ) ) {
2772
 
2773
  wp_send_json_success( $data );
2774
  }
2775
- } else {
2776
  wp_send_json_error( esc_html__( 'Invalid Request.', 'woo-feed' ) );
2777
  }
2778
  wp_die();
@@ -2792,7 +2792,7 @@ if ( ! function_exists('woo_feed_get_terms_list_hierarchical_order') ) {
2792
  $terms = get_the_terms($id, $taxonomy);
2793
  if ( $terms ) {
2794
  foreach ( $terms as $key => $term ) {
2795
- if ( $term->parent != 0 ) {
2796
  $terms[] = $term;
2797
  unset($terms[ $key ]);
2798
  }
1462
  */
1463
  function woo_feed_usort_reorder( $a, $b ) {
1464
  // If no sort, default to title
1465
+ $orderby = ( ! empty( $_REQUEST['orderby'] ) ) ? sanitize_text_field( wp_unslash($_REQUEST['orderby']) ) : 'option_name'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
1466
  // If no order, default to asc
1467
+ $order = ( ! empty( $_REQUEST['order'] ) ) ? sanitize_text_field( wp_unslash($_REQUEST['order']) ) : 'asc'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
1468
  $result = strcmp( $a[ $orderby ], $b[ $orderby ] ); // Determine sort order
1469
 
1470
  return ( 'asc' === $order ) ? $result : - $result; // Send final sort direction to usort
1510
  */
1511
  function woo_feed_export_config(){
1512
  if ( isset( $_REQUEST['feed'], $_REQUEST['_wpnonce'] ) && wp_verify_nonce( sanitize_text_field( $_REQUEST['_wpnonce'] ), 'wpf-export' ) ) {
1513
+ $feed = sanitize_text_field( wp_unslash($_REQUEST['feed']) );
1514
  $feed = woo_feed_extract_feed_option_name( $feed );
1515
  if ( ! empty( $feed ) ) {
1516
  $feed = maybe_unserialize( get_option( 'wf_feed_' . $feed ) );
1570
  $_FILES['wpf_import_file']['name'],
1571
  $_FILES['wpf_import_file']['tmp_name']
1572
  ) &&
1573
+ 'wpf' === pathinfo( wp_unslash($_FILES['wpf_import_file']['name']), PATHINFO_EXTENSION ) // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
1574
  ) {
1575
+ $file_name = sanitize_text_field( wp_unslash($_FILES['wpf_import_file']['name']) );
1576
+ $data = file_get_contents( sanitize_text_field( wp_unslash($_FILES['wpf_import_file']['tmp_name']) ) );
1577
  if ( empty( $data ) ) {
1578
  wp_die(
1579
  esc_html__( 'Empty File Uploaded. Try again.', 'woo-feed' ),
1656
  }
1657
 
1658
  $feed = woo_feed_parse_feed_rules( $feed );
1659
+ $new_name = sanitize_text_field( wp_unslash($_POST['wpf_import_feed_name']) );
1660
  $new_name = trim( $new_name );
1661
  if ( ! empty( $new_name ) ) {
1662
  $opt_name = $new_name;
2399
  if ( count( $_POST ) && isset( $_POST['mappingname'] ) && isset( $_POST['edit-mapping'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
2400
  check_admin_referer( 'category-mapping' );
2401
 
2402
+ $mappingOption = sanitize_text_field( wp_unslash($_POST['mappingname']) );
2403
  $mappingOption = 'wf_cmapping_' . sanitize_title( $mappingOption );
2404
  $mappingData = woo_feed_array_sanitize( $_POST );
2405
  $oldMapping = maybe_unserialize( get_option( $mappingOption, array() ) );
2428
  if ( count( $_POST ) && isset( $_POST['mappingname'] ) && isset( $_POST['add-mapping'] ) ) {
2429
  check_admin_referer( 'category-mapping' );
2430
 
2431
+ $mappingOption = 'wf_cmapping_' . sanitize_text_field( wp_unslash($_POST['mappingname']) );
2432
 
2433
  # Delete product attribute drop-down cache
2434
  delete_transient( '__woo_feed_cache_woo_feed_dropdown_product_attributes');
2601
 
2602
  //save gtin fields value
2603
  if ( isset( $_POST['woo_feed_gtin'] ) && ! empty( $_POST['woo_feed_gtin'] ) ) {
2604
+ update_post_meta( $id, 'woo_feed_gtin', sanitize_text_field( wp_unslash($_POST['woo_feed_gtin']) ) );
2605
  } else {
2606
  delete_post_meta( $id, 'woo_feed_gtin' );
2607
  }
2608
 
2609
  //save mpn fields value
2610
  if ( isset( $_POST['woo_feed_mpn'] ) && ! empty( $_POST['woo_feed_mpn'] ) ) {
2611
+ update_post_meta( $id, 'woo_feed_mpn', sanitize_text_field( wp_unslash($_POST['woo_feed_mpn']) ) );
2612
  } else {
2613
  delete_post_meta( $id, 'woo_feed_mpn' );
2614
  }
2615
 
2616
  //save ean fields value
2617
  if ( isset( $_POST['woo_feed_ean'] ) && ! empty( $_POST['woo_feed_ean'] ) ) {
2618
+ update_post_meta( $id, 'woo_feed_ean', sanitize_text_field( wp_unslash($_POST['woo_feed_ean']) ) );
2619
  } else {
2620
  delete_post_meta( $id, 'woo_feed_ean' );
2621
  }
2712
 
2713
  //save gtin field
2714
  if ( isset($_POST['woo_feed_gtin_var'][ $variation_id ]) ) {
2715
+ $woo_feed_gtin_field = sanitize_text_field( wp_unslash($_POST['woo_feed_gtin_var'][ $variation_id ]) );
2716
  if ( isset( $woo_feed_gtin_field ) ) update_post_meta( $variation_id, 'woo_feed_gtin_var', esc_attr( $woo_feed_gtin_field ) );
2717
  }
2718
 
2719
  //save mpn field
2720
  if ( isset($_POST['woo_feed_mpn_var'][ $variation_id ]) ) {
2721
+ $woo_feed_mpn_field = sanitize_text_field( wp_unslash($_POST['woo_feed_mpn_var'][ $variation_id ]) );
2722
  if ( isset( $woo_feed_mpn_field ) ) update_post_meta( $variation_id, 'woo_feed_mpn_var', esc_attr( $woo_feed_mpn_field ) );
2723
  }
2724
 
2725
  //save ean field
2726
  if ( isset($_POST['woo_feed_ean_var'][ $variation_id ]) ) {
2727
+ $woo_feed_ean_field = sanitize_text_field( wp_unslash($_POST['woo_feed_ean_var'][ $variation_id ]) );
2728
  if ( isset( $woo_feed_ean_field ) ) update_post_meta( $variation_id, 'woo_feed_ean_var', esc_attr( $woo_feed_ean_field ) );
2729
  }
2730
 
2744
  ?>
2745
  <div class="wf_clean_cache_wrapper">
2746
  <img class="woo-feed-cache-loader" src="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%0D%0A%3C%21--%20Generator%3A%20Adobe%20Illustrator%2019.0.0%2C%20SVG%20Export%20Plug-In%20.%20SVG%20Version%3A%206.00%20Build%200%29%20%20--%3E%0D%0A%3Csvg%20version%3D%221.1%22%20id%3D%22Capa_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%0D%0A%09%20viewBox%3D%220%200%20458.186%20458.186%22%20style%3D%22enable-background%3Anew%200%200%20458.186%20458.186%3B%22%20xml%3Aspace%3D%22preserve%22%3E%0D%0A%3Cg%3E%0D%0A%09%3Cg%3E%0D%0A%09%09%3Cpath%20d%3D%22M445.651%2C201.95c-1.485-9.308-10.235-15.649-19.543-14.164c-9.308%2C1.485-15.649%2C10.235-14.164%2C19.543%0D%0A%09%09%09c0.016%2C0.102%2C0.033%2C0.203%2C0.051%2C0.304c17.38%2C102.311-51.47%2C199.339-153.781%2C216.719c-102.311%2C17.38-199.339-51.47-216.719-153.781%0D%0A%09%09%09S92.966%2C71.232%2C195.276%2C53.852c62.919-10.688%2C126.962%2C11.29%2C170.059%2C58.361l-75.605%2C25.19%0D%0A%09%09%09c-8.944%2C2.976-13.781%2C12.638-10.806%2C21.582c0.001%2C0.002%2C0.002%2C0.005%2C0.003%2C0.007c2.976%2C8.944%2C12.638%2C13.781%2C21.582%2C10.806%0D%0A%09%09%09c0.003-0.001%2C0.005-0.002%2C0.007-0.002l102.4-34.133c6.972-2.322%2C11.675-8.847%2C11.674-16.196v-102.4%0D%0A%09%09%09C414.59%2C7.641%2C406.949%2C0%2C397.523%2C0s-17.067%2C7.641-17.067%2C17.067v62.344C292.564-4.185%2C153.545-0.702%2C69.949%2C87.19%0D%0A%09%09%09s-80.114%2C226.911%2C7.779%2C310.508s226.911%2C80.114%2C310.508-7.779C435.905%2C339.799%2C457.179%2C270.152%2C445.651%2C201.95z%22%2F%3E%0D%0A%09%3C%2Fg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cg%3E%0D%0A%3C%2Fg%3E%0D%0A%3C%2Fsvg%3E%0D%0A" alt="loader">
2747
+ <input type="hidden" class="woo-feed-clean-cache-nonce" value="<?php echo wp_create_nonce( 'clean_cache_nonce' ); ?>">
2748
  <button type="button"><?php esc_html_e( 'Clear Cache', 'woo-feed' ); ?></button>
2749
  </div>
2750
  <?php
2772
 
2773
  wp_send_json_success( $data );
2774
  }
2775
+ } else {
2776
  wp_send_json_error( esc_html__( 'Invalid Request.', 'woo-feed' ) );
2777
  }
2778
  wp_die();
2792
  $terms = get_the_terms($id, $taxonomy);
2793
  if ( $terms ) {
2794
  foreach ( $terms as $key => $term ) {
2795
+ if ( 0 !== (int) $term->parent ) {
2796
  $terms[] = $term;
2797
  unset($terms[ $key ]);
2798
  }
woo-feed.php CHANGED
@@ -10,7 +10,7 @@
10
  * Plugin Name: WooCommerce Product Feed
11
  * Plugin URI: https://webappick.com/
12
  * Description: Easily generate woocommerce product feed for any marketing channel like Google Shopping(Merchant), Facebook Remarketing, Bing, eBay & more. Support 100+ Merchants.
13
- * Version: 4.0.8
14
  * Author: WebAppick
15
  * Author URI: https://webappick.com/
16
  * License: GPL v2
@@ -38,7 +38,7 @@ if ( ! defined( 'WOO_FEED_FREE_VERSION' ) ) {
38
  * @var string
39
  * @since 3.1.6
40
  */
41
- define( 'WOO_FEED_FREE_VERSION', '4.0.8' );
42
  }
43
 
44
  if ( ! defined( 'WOO_FEED_FREE_FILE' ) ) {
10
  * Plugin Name: WooCommerce Product Feed
11
  * Plugin URI: https://webappick.com/
12
  * Description: Easily generate woocommerce product feed for any marketing channel like Google Shopping(Merchant), Facebook Remarketing, Bing, eBay & more. Support 100+ Merchants.
13
+ * Version: 4.0.9
14
  * Author: WebAppick
15
  * Author URI: https://webappick.com/
16
  * License: GPL v2
38
  * @var string
39
  * @since 3.1.6
40
  */
41
+ define( 'WOO_FEED_FREE_VERSION', '4.0.9' );
42
  }
43
 
44
  if ( ! defined( 'WOO_FEED_FREE_FILE' ) ) {