CTX Feed – WooCommerce Product Feed Manager Plugin - Version 4.4.1

Version Description

(2021-06-17) = * Fixed: Code enhancement and junk cleaned. * Fixed: Performance improved.

Download this release

Release Info

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

Code changes from version 4.4.0 to 4.4.1

README.txt CHANGED
@@ -5,7 +5,7 @@ Tags: Product Feed, WooCommerce, Google Shopping, Google Merchant, Facebook Cata
5
  Requires at least: 3.6
6
  Tested Up To: 5.7
7
  Requires PHP: 5.6
8
- Stable tag: 4.4.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -501,6 +501,10 @@ Using pro version:
501
 
502
  == Changelog ==
503
 
 
 
 
 
504
  = 4.4.0 (2021-06-16) =
505
  * Added: Google installment attributes added.
506
  * Added: Unit price attributes added.
5
  Requires at least: 3.6
6
  Tested Up To: 5.7
7
  Requires PHP: 5.6
8
+ Stable tag: 4.4.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
501
 
502
  == Changelog ==
503
 
504
+ = 4.4.1 (2021-06-17) =
505
+ * Fixed: Code enhancement and junk cleaned.
506
+ * Fixed: Performance improved.
507
+
508
  = 4.4.0 (2021-06-16) =
509
  * Added: Google installment attributes added.
510
  * Added: Unit price attributes added.
includes/classes/class-woo-feed-dropdown.php CHANGED
@@ -569,11 +569,11 @@ class Woo_Feed_Dropdown {
569
  if ( class_exists( 'WC_Subscriptions' ) ) {
570
  $attributes = array_merge( $attributes,
571
  [
572
- 'subscription_period' => esc_html__( 'Subscription Period', 'woo-feed' ),
573
- 'subscription_period_interval' => esc_html__( 'Subscription Period Interval', 'woo-feed' ),
574
- 'subscription_amount' => esc_html__( 'Subscription Amount', 'woo-feed' ),
575
- 'installment_months' => esc_html__( 'Installment Months', 'woo-feed' ),
576
- 'installment_amount' => esc_html__( 'Installment Amount', 'woo-feed' ),
577
  ] );
578
  }
579
 
569
  if ( class_exists( 'WC_Subscriptions' ) ) {
570
  $attributes = array_merge( $attributes,
571
  [
572
+ 'subscription_period' => esc_html__( 'Subscription Period', 'woo-feed' ),
573
+ 'subscription_period_interval' => esc_html__( 'Subscription Period Interval', 'woo-feed' ),
574
+ 'subscription_amount' => esc_html__( 'Subscription Amount', 'woo-feed' ),
575
+ 'installment_months' => esc_html__( 'Installment Months', 'woo-feed' ),
576
+ 'installment_amount' => esc_html__( 'Installment Amount', 'woo-feed' ),
577
  ] );
578
  }
579
 
includes/classes/class-woo-feed-products-v3.php CHANGED
@@ -1433,7 +1433,7 @@ class Woo_Feed_Products_v3
1433
 
1434
  if ( method_exists($this, $attribute) ) {
1435
  $output = call_user_func_array(array( $this, $attribute ), array( $product ));
1436
- } elseif ( false !== strpos( $attribute, self::PRODUCT_CUSTOM_IDENTIFIER ) || woo_feed_strpos_array(array('gtin', 'ean', 'mpn'), $attribute) ) {
1437
 
1438
  $output = $this->getCustomField( $product, $attribute );
1439
  } elseif ( false !== strpos($attribute, self::PRODUCT_ATTRIBUTE_PREFIX) ) {
@@ -3317,7 +3317,7 @@ class Woo_Feed_Products_v3
3317
 
3318
  $term_list = get_the_term_list($id, $taxonomy, '', $separator, '');
3319
 
3320
- if (get_class( $term_list ) === 'WP_Error'){
3321
  $term_list = '';
3322
  }
3323
 
1433
 
1434
  if ( method_exists($this, $attribute) ) {
1435
  $output = call_user_func_array(array( $this, $attribute ), array( $product ));
1436
+ } elseif ( false !== strpos( $attribute, self::PRODUCT_CUSTOM_IDENTIFIER ) || woo_feed_strpos_array(array( 'gtin', 'ean', 'mpn' ), $attribute) ) {
1437
 
1438
  $output = $this->getCustomField( $product, $attribute );
1439
  } elseif ( false !== strpos($attribute, self::PRODUCT_ATTRIBUTE_PREFIX) ) {
3317
 
3318
  $term_list = get_the_term_list($id, $taxonomy, '', $separator, '');
3319
 
3320
+ if ( get_class( $term_list ) === 'WP_Error' ) {
3321
  $term_list = '';
3322
  }
3323
 
includes/feeds/class-woo-feed-review.php CHANGED
@@ -101,7 +101,7 @@ class Woo_Feed_Review {
101
 
102
  foreach ( $product_names as $product_name ) {
103
  $product_by_title = get_page_by_title($product_name, OBJECT, 'product');
104
- if( is_object( $product_by_title) ){
105
  $product_ids[] = $product_by_title->ID;
106
  }
107
  }
101
 
102
  foreach ( $product_names as $product_name ) {
103
  $product_by_title = get_page_by_title($product_name, OBJECT, 'product');
104
+ if ( is_object( $product_by_title) ) {
105
  $product_ids[] = $product_by_title->ID;
106
  }
107
  }
includes/helper.php CHANGED
@@ -2820,9 +2820,8 @@ if ( ! function_exists('woo_feed_add_custom_identifier_for_variation') ) {
2820
  );
2821
  }
2822
  echo '</div></div>';
2823
- }
2824
-
2825
- }
2826
  }
2827
  add_action( 'woocommerce_product_after_variable_attributes', 'woo_feed_add_custom_identifier_for_variation', 10, 3 );
2828
  }
@@ -3055,7 +3054,7 @@ if ( ! function_exists( 'woo_feed_clear_cache_data' ) ) {
3055
  }
3056
  add_action( 'wp_ajax_clear_cache_data', 'woo_feed_clear_cache_data' );
3057
 
3058
- if( !function_exists('woo_feed_deep_term')){
3059
 
3060
  /**
3061
  * Get product terms list by hierarchical order.
@@ -3064,16 +3063,15 @@ if( !function_exists('woo_feed_deep_term')){
3064
  * @return string
3065
  * @since 4.3.88+
3066
  */
3067
- function woo_feed_deep_term( $term, $taxonomy ){
3068
 
3069
- if($term->parent === 0)
3070
  return $term->name;
3071
 
3072
  $parent_term = get_term_by('term_id', $term->parent, $taxonomy);
3073
 
3074
  return woo_feed_deep_term($parent_term, $taxonomy) . ' > ' . $term->name ;
3075
  }
3076
-
3077
  }
3078
 
3079
  if ( ! function_exists('woo_feed_get_terms_list_hierarchical_order') ) {
@@ -3090,15 +3088,14 @@ if ( ! function_exists('woo_feed_get_terms_list_hierarchical_order') ) {
3090
 
3091
  $terms = get_the_terms($id, $taxonomy);
3092
 
3093
- if( count($terms) ){
3094
 
3095
- if( $full_path ){
3096
- return woo_feed_deep_term($terms[count($terms) - 1], $taxonomy);
3097
- }else{
3098
- return $terms[count($terms) - 1]->name;
3099
- }
3100
-
3101
- }
3102
 
3103
  return false;
3104
  }
@@ -3258,10 +3255,10 @@ if ( ! function_exists('woo_feed_custom_taxonomy') ) {
3258
  $custom_taxonomies = iterator_to_array( $custom_taxonomies_filter );
3259
 
3260
  $feed_setting = get_option('woo_feed_settings');
3261
- if( isset($feed_setting['woo_feed_taxonomy']['brand']) ) {
3262
  $brand_option = $feed_setting['woo_feed_taxonomy']['brand'];
3263
 
3264
- if( $brand_option === 'enable' ) {
3265
  if ( ! empty( $custom_taxonomies ) ) {
3266
  foreach ( $custom_taxonomies as $key => $value ) {
3267
  $taxonomy_name = esc_html( $value[0] );
@@ -3524,8 +3521,8 @@ if ( ! function_exists( 'woo_feed_product_structured_data' ) ) {
3524
  }
3525
 
3526
  // Check if we have brand data.
3527
- if ( 'enable' === $disable_brand && !is_wp_error($brand_term) ) {
3528
- if( isset($brand_term[0]) ) {
3529
  $markup['brand'] = $brand_term[0];
3530
  }
3531
  }
@@ -4599,7 +4596,7 @@ if ( ! function_exists('woo_feed_array_splice_preserve_keys') ) {
4599
  }
4600
  }
4601
 
4602
- if( ! function_exists('woo_feed_custom_field_meta_filter') ) {
4603
  /**
4604
  * Identifier meta value filter for old and new version users
4605
  *
@@ -4610,11 +4607,11 @@ if( ! function_exists('woo_feed_custom_field_meta_filter') ) {
4610
  *
4611
  * @return string Custom Field Meta.
4612
  */
4613
- function woo_feed_custom_field_meta_filter($meta, $product, $field) {
4614
  $id = $product->get_id();
4615
 
4616
  //identifier meta value for old and new version users
4617
- if( false !== strpos($meta, 'woo_feed_identifier_') ) {
4618
 
4619
  $identifier = str_replace('woo_feed_identifier_', '', $meta);
4620
  if ( metadata_exists( 'post', $id, 'woo_feed_'.$identifier ) ) {
@@ -4629,7 +4626,7 @@ if( ! function_exists('woo_feed_custom_field_meta_filter') ) {
4629
  add_filter('woo_feed_custom_field_meta', 'woo_feed_custom_field_meta_filter', 3, 10);
4630
  }
4631
 
4632
- if(!function_exists('woo_feed_strpos_array')){
4633
 
4634
  /**
4635
  * Extension of php `strpos` function
@@ -4641,14 +4638,14 @@ if(!function_exists('woo_feed_strpos_array')){
4641
  *
4642
  * @return boolean If any string exists.
4643
  */
4644
- function woo_feed_strpos_array( $niddles, $haystack ){
4645
 
4646
- if (empty( $haystack )){
4647
  return;
4648
  }
4649
 
4650
- foreach($niddles as $niddle){
4651
- if (strpos( $haystack, $niddle ) !== false) {
4652
  return true;
4653
  }
4654
  }
@@ -4656,10 +4653,9 @@ if(!function_exists('woo_feed_strpos_array')){
4656
  return false;
4657
 
4658
  }
4659
-
4660
  }
4661
 
4662
- if( ! function_exists('woo_feed_schema_description_filter') ) {
4663
  /**
4664
  * Filter schema description
4665
  *
@@ -4670,7 +4666,7 @@ if( ! function_exists('woo_feed_schema_description_filter') ) {
4670
  * @since 4.3.101
4671
  *
4672
  */
4673
- function woo_feed_schema_description_filter($description, $product) {
4674
 
4675
  $description = do_shortcode( $description );
4676
  $description = woo_feed_stripInvalidXml( $description );
2820
  );
2821
  }
2822
  echo '</div></div>';
2823
+ }
2824
+ }
 
2825
  }
2826
  add_action( 'woocommerce_product_after_variable_attributes', 'woo_feed_add_custom_identifier_for_variation', 10, 3 );
2827
  }
3054
  }
3055
  add_action( 'wp_ajax_clear_cache_data', 'woo_feed_clear_cache_data' );
3056
 
3057
+ if ( ! function_exists('woo_feed_deep_term') ) {
3058
 
3059
  /**
3060
  * Get product terms list by hierarchical order.
3063
  * @return string
3064
  * @since 4.3.88+
3065
  */
3066
+ function woo_feed_deep_term( $term, $taxonomy ) {
3067
 
3068
+ if ($term->parent === 0)
3069
  return $term->name;
3070
 
3071
  $parent_term = get_term_by('term_id', $term->parent, $taxonomy);
3072
 
3073
  return woo_feed_deep_term($parent_term, $taxonomy) . ' > ' . $term->name ;
3074
  }
 
3075
  }
3076
 
3077
  if ( ! function_exists('woo_feed_get_terms_list_hierarchical_order') ) {
3088
 
3089
  $terms = get_the_terms($id, $taxonomy);
3090
 
3091
+ if ( count($terms) ) {
3092
 
3093
+ if ( $full_path ) {
3094
+ return woo_feed_deep_term($terms[ count($terms) - 1 ], $taxonomy);
3095
+ }else {
3096
+ return $terms[ count($terms) - 1 ]->name;
3097
+ }
3098
+ }
 
3099
 
3100
  return false;
3101
  }
3255
  $custom_taxonomies = iterator_to_array( $custom_taxonomies_filter );
3256
 
3257
  $feed_setting = get_option('woo_feed_settings');
3258
+ if ( isset($feed_setting['woo_feed_taxonomy']['brand']) ) {
3259
  $brand_option = $feed_setting['woo_feed_taxonomy']['brand'];
3260
 
3261
+ if ( $brand_option === 'enable' ) {
3262
  if ( ! empty( $custom_taxonomies ) ) {
3263
  foreach ( $custom_taxonomies as $key => $value ) {
3264
  $taxonomy_name = esc_html( $value[0] );
3521
  }
3522
 
3523
  // Check if we have brand data.
3524
+ if ( 'enable' === $disable_brand && ! is_wp_error($brand_term) ) {
3525
+ if ( isset($brand_term[0]) ) {
3526
  $markup['brand'] = $brand_term[0];
3527
  }
3528
  }
4596
  }
4597
  }
4598
 
4599
+ if ( ! function_exists('woo_feed_custom_field_meta_filter') ) {
4600
  /**
4601
  * Identifier meta value filter for old and new version users
4602
  *
4607
  *
4608
  * @return string Custom Field Meta.
4609
  */
4610
+ function woo_feed_custom_field_meta_filter( $meta, $product, $field ) {
4611
  $id = $product->get_id();
4612
 
4613
  //identifier meta value for old and new version users
4614
+ if ( false !== strpos($meta, 'woo_feed_identifier_') ) {
4615
 
4616
  $identifier = str_replace('woo_feed_identifier_', '', $meta);
4617
  if ( metadata_exists( 'post', $id, 'woo_feed_'.$identifier ) ) {
4626
  add_filter('woo_feed_custom_field_meta', 'woo_feed_custom_field_meta_filter', 3, 10);
4627
  }
4628
 
4629
+ if ( ! function_exists('woo_feed_strpos_array') ) {
4630
 
4631
  /**
4632
  * Extension of php `strpos` function
4638
  *
4639
  * @return boolean If any string exists.
4640
  */
4641
+ function woo_feed_strpos_array( $niddles, $haystack ) {
4642
 
4643
+ if ( empty( $haystack ) ) {
4644
  return;
4645
  }
4646
 
4647
+ foreach ( $niddles as $niddle ) {
4648
+ if ( strpos( $haystack, $niddle ) !== false ) {
4649
  return true;
4650
  }
4651
  }
4653
  return false;
4654
 
4655
  }
 
4656
  }
4657
 
4658
+ if ( ! function_exists('woo_feed_schema_description_filter') ) {
4659
  /**
4660
  * Filter schema description
4661
  *
4666
  * @since 4.3.101
4667
  *
4668
  */
4669
+ function woo_feed_schema_description_filter( $description, $product ) {
4670
 
4671
  $description = do_shortcode( $description );
4672
  $description = woo_feed_stripInvalidXml( $description );
woo-feed.php CHANGED
@@ -10,7 +10,7 @@
10
  * Plugin Name: CTX 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.4.0
14
  * Author: WebAppick
15
  * Author URI: https://webappick.com/
16
  * License: GPL v2
@@ -39,7 +39,7 @@ if ( ! defined( 'WOO_FEED_FREE_VERSION' ) ) {
39
  * @var string
40
  * @since 3.1.6
41
  */
42
- define( 'WOO_FEED_FREE_VERSION', '4.4.0' );
43
  }
44
 
45
  if ( ! defined( 'WOO_FEED_FREE_FILE' ) ) {
10
  * Plugin Name: CTX 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.4.1
14
  * Author: WebAppick
15
  * Author URI: https://webappick.com/
16
  * License: GPL v2
39
  * @var string
40
  * @since 3.1.6
41
  */
42
+ define( 'WOO_FEED_FREE_VERSION', '4.4.1' );
43
  }
44
 
45
  if ( ! defined( 'WOO_FEED_FREE_FILE' ) ) {