CTX Feed – WooCommerce Product Feed Manager Plugin - Version 4.3.101

Version Description

(2021-06-16) = * Tweak: Added filter for schema description. * Fixed: Upgrade compatibility for identifier issue fixed.

Download this release

Release Info

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

Code changes from version 4.3.100 to 4.3.101

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.3.100
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -460,7 +460,7 @@ e.g.
460
  == Frequently Asked Questions ==
461
 
462
  <blockquote>
463
- <h4>Read <a target="_blank" href="http://webappick.helpscoutdocs.com/article/17-woocommerce-product-feed">Documentation and FAQ</a></h4>
464
  <br/>
465
  <h4>For Support Email to support@webappick.com</h4>
466
  <br/>
@@ -501,6 +501,10 @@ Using pro version:
501
 
502
  == Changelog ==
503
 
 
 
 
 
504
  = 4.3.100 (2021-06-14) =
505
  * Fixed: Condition attribute default value missing for Google and Facebook template has been fixed.
506
  * Fixed: Variation input broken design fixed.
5
  Requires at least: 3.6
6
  Tested Up To: 5.7
7
  Requires PHP: 5.6
8
+ Stable tag: 4.3.101
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
460
  == Frequently Asked Questions ==
461
 
462
  <blockquote>
463
+ <h4>Read <a target="_blank" href="https://webappick.com/docs/woo-feed/">Documentation and FAQ</a></h4>
464
  <br/>
465
  <h4>For Support Email to support@webappick.com</h4>
466
  <br/>
501
 
502
  == Changelog ==
503
 
504
+ = 4.3.101 (2021-06-16) =
505
+ * Tweak: Added filter for schema description.
506
+ * Fixed: Upgrade compatibility for identifier issue fixed.
507
+
508
  = 4.3.100 (2021-06-14) =
509
  * Fixed: Condition attribute default value missing for Google and Facebook template has been fixed.
510
  * Fixed: Variation input broken design fixed.
includes/classes/class-woo-feed-products-v3.php CHANGED
@@ -1433,7 +1433,8 @@ 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 ) ) {
 
1437
  $output = $this->getCustomField( $product, $attribute );
1438
  } elseif ( false !== strpos($attribute, self::PRODUCT_ATTRIBUTE_PREFIX) ) {
1439
  $attribute = str_replace(self::PRODUCT_ATTRIBUTE_PREFIX, '', $attribute);
@@ -3197,10 +3198,14 @@ class Woo_Feed_Products_v3
3197
  if ( $product->is_type( 'variation' ) ) {
3198
  $meta = $field.'_var';
3199
  }
3200
-
3201
  $meta = apply_filters('woo_feed_custom_field_meta', $meta, $product, $field);
3202
 
3203
- return $this->getProductMeta( $product, $meta );
 
 
 
 
 
3204
  }
3205
 
3206
  /**
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) ) {
1440
  $attribute = str_replace(self::PRODUCT_ATTRIBUTE_PREFIX, '', $attribute);
3198
  if ( $product->is_type( 'variation' ) ) {
3199
  $meta = $field.'_var';
3200
  }
 
3201
  $meta = apply_filters('woo_feed_custom_field_meta', $meta, $product, $field);
3202
 
3203
+ // Backward compatibility for <= 4.3.93
3204
+ return
3205
+ ! empty( $this->getProductMeta( $product, $meta ) )
3206
+ ? $this->getProductMeta( $product, $meta )
3207
+ : $this->getProductMeta( $product, str_replace( '_identifier', '', $meta ) );
3208
+
3209
  }
3210
 
3211
  /**
includes/helper.php CHANGED
@@ -2712,10 +2712,10 @@ if ( ! function_exists('woo_feed_add_custom_identifier') ) {
2712
  foreach ( $custom_identifier as $key => $value ) {
2713
 
2714
  //identifier meta value for old and new version users
2715
- if ( metadata_exists( 'post', get_the_ID(), 'woo_feed_'.strtolower( $key ) ) ) {
2716
- $custom_field_key = sprintf( 'woo_feed_%s', strtolower( $key ) );
2717
- } else {
2718
  $custom_field_key = sprintf( 'woo_feed_identifier_%s', strtolower( $key ) );
 
 
2719
  }
2720
 
2721
  $custom_field_id = esc_attr( wp_unslash( "woo_feed_identifier_{$key}" ) );
@@ -3387,6 +3387,7 @@ if ( ! function_exists( 'woo_feed_product_structured_data' ) ) {
3387
  $shop_url = home_url();
3388
  $currency = get_woocommerce_currency();
3389
  $permalink = get_permalink( $product->get_id() );
 
3390
  $image = wp_get_attachment_url( $product->get_image_id() );
3391
  $mpn = $product->get_meta( 'woo_feed_mpn' );
3392
  $settings = woo_feed_get_options( 'all' );
@@ -3396,7 +3397,6 @@ if ( ! function_exists( 'woo_feed_product_structured_data' ) ) {
3396
  $brand_term = wp_get_post_terms( $post->ID, 'woo-feed-brand', array( 'fields' => 'names' ) );
3397
  }
3398
 
3399
-
3400
  $markup = array(
3401
  '@context' => 'https://schema.org',
3402
  '@type' => 'Product',
@@ -3404,7 +3404,7 @@ if ( ! function_exists( 'woo_feed_product_structured_data' ) ) {
3404
  // Append '#product' to differentiate between this @id and the @id generated for the Breadcrumblist.
3405
  'name' => $product->get_name(),
3406
  'url' => $permalink,
3407
- 'description' => wp_strip_all_tags( do_shortcode( $product->get_short_description() ? $product->get_short_description() : $product->get_description() ) ),
3408
  );
3409
  if ( $image ) {
3410
  $markup['image'] = $image;
@@ -4629,5 +4629,63 @@ 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
 
4633
  // End of file helper.php.
2712
  foreach ( $custom_identifier as $key => $value ) {
2713
 
2714
  //identifier meta value for old and new version users
2715
+ if ( metadata_exists( 'post', get_the_ID(), sprintf( 'woo_feed_identifier_%s', strtolower( $key ) ) ) ) {
 
 
2716
  $custom_field_key = sprintf( 'woo_feed_identifier_%s', strtolower( $key ) );
2717
+ } else {
2718
+ $custom_field_key = sprintf( 'woo_feed_%s', strtolower( $key ) );
2719
  }
2720
 
2721
  $custom_field_id = esc_attr( wp_unslash( "woo_feed_identifier_{$key}" ) );
3387
  $shop_url = home_url();
3388
  $currency = get_woocommerce_currency();
3389
  $permalink = get_permalink( $product->get_id() );
3390
+ $description = apply_filters('woo_feed_schema_description', wp_strip_all_tags( $product->get_short_description() ? $product->get_short_description() : $product->get_description() ), $product);
3391
  $image = wp_get_attachment_url( $product->get_image_id() );
3392
  $mpn = $product->get_meta( 'woo_feed_mpn' );
3393
  $settings = woo_feed_get_options( 'all' );
3397
  $brand_term = wp_get_post_terms( $post->ID, 'woo-feed-brand', array( 'fields' => 'names' ) );
3398
  }
3399
 
 
3400
  $markup = array(
3401
  '@context' => 'https://schema.org',
3402
  '@type' => 'Product',
3404
  // Append '#product' to differentiate between this @id and the @id generated for the Breadcrumblist.
3405
  'name' => $product->get_name(),
3406
  'url' => $permalink,
3407
+ 'description' => $description,
3408
  );
3409
  if ( $image ) {
3410
  $markup['image'] = $image;
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
4636
+ *
4637
+ * @param $niddles array
4638
+ * @param $haystack string
4639
+ *
4640
+ * @since 4.3.100
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
+ }
4655
+
4656
+ return false;
4657
+
4658
+ }
4659
+
4660
+ }
4661
+
4662
+ if( ! function_exists('woo_feed_schema_description_filter') ) {
4663
+ /**
4664
+ * Filter schema description
4665
+ *
4666
+ * @param $description mixed default product description
4667
+ * @param $product mixed product object
4668
+ *
4669
+ * @return mixed
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 );
4677
+ $description = preg_replace( '/\[\/?vc_.*?\]/', '', $description );
4678
+ $description = strip_shortcodes( $description );
4679
+ $description = preg_replace('~[\r\n]+~', '', $description);
4680
+
4681
+ //strip tags and spacial characters
4682
+ $strip_description = wp_strip_all_tags(wp_specialchars_decode($description));
4683
+
4684
+ $description = ! empty(strlen($strip_description)) && 0 < strlen($strip_description) ? $strip_description : $description;
4685
+
4686
+ return $description;
4687
+ }
4688
+ add_filter('woo_feed_schema_description', 'woo_feed_schema_description_filter', 10, 2);
4689
+ }
4690
 
4691
  // End of file helper.php.
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.3.100
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.3.100' );
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.3.101
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.3.101' );
43
  }
44
 
45
  if ( ! defined( 'WOO_FEED_FREE_FILE' ) ) {