CTX Feed – WooCommerce Product Feed Manager Plugin - Version 4.4.22

Version Description

(2021-09-02) = * Fixed: Title limit added for google, facebook, pinterest, bing template. * Fixed: Description limit added for google, facebook, pinterest, bing template.

Download this release

Release Info

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

Code changes from version 4.4.21 to 4.4.22

Files changed (5) hide show
  1. README.txt +5 -1
  2. includes/helper.php +62 -0
  3. includes/hooks.php +9 -0
  4. wahid_phpcs.xml +97 -0
  5. woo-feed.php +2 -2
README.txt CHANGED
@@ -5,7 +5,7 @@ Tags: Product Feed, WooCommerce, Google Shopping, Google Merchant, Facebook Cata
5
  Requires at least: 4.4
6
  Tested Up To: 5.8
7
  Requires PHP: 5.6
8
- Stable tag: 4.4.21
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -516,6 +516,10 @@ Using pro version:
516
 
517
  == Changelog ==
518
 
 
 
 
 
519
  = 4.4.21 (2021-08-29) =
520
  * Added: Support for ecommerce.it added.
521
  * Added: New file type(JSON) added.
5
  Requires at least: 4.4
6
  Tested Up To: 5.8
7
  Requires PHP: 5.6
8
+ Stable tag: 4.4.22
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
516
 
517
  == Changelog ==
518
 
519
+ = 4.4.22 (2021-09-02) =
520
+ * Fixed: Title limit added for google, facebook, pinterest, bing template.
521
+ * Fixed: Description limit added for google, facebook, pinterest, bing template.
522
+
523
  = 4.4.21 (2021-08-29) =
524
  * Added: Support for ecommerce.it added.
525
  * Added: New file type(JSON) added.
includes/helper.php CHANGED
@@ -5609,6 +5609,68 @@ if ( ! function_exists( 'woo_feed_duplicate_feed' ) ) {
5609
  }
5610
  }
5611
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5612
  #==== MERCHANT TEMPLATE OVERRIDE END ================#
5613
 
5614
  // Including pluggable functions file
5609
  }
5610
  }
5611
 
5612
+ if( ! function_exists('woo_feed_is_google_group_merchant') ) {
5613
+ /**
5614
+ * Check if the given merchant is a google group merchant (google, facebook, pinterest, bing)
5615
+ *
5616
+ * @param string $provider Feed Merchant
5617
+ *
5618
+ * @author Nazrul Islam Nayan
5619
+ * @since 4.4.22
5620
+ * @return boolean
5621
+ */
5622
+ function woo_feed_is_google_group_merchant($provider) {
5623
+ return in_array($provider, ['google', 'facebook', 'pinterest', 'bing']);
5624
+ }
5625
+ }
5626
+
5627
+ if( ! function_exists('woo_feed_filter_product_description_callback') ) {
5628
+ /**
5629
+ * @param string $description Product Description
5630
+ * @param WC_Product $product Product Object
5631
+ * @param array $configFeed Feed Config
5632
+ *
5633
+ * @return mixed
5634
+ */
5635
+ function woo_feed_filter_product_description_callback( $description, $product, $config ) {
5636
+ if( empty($description) ) {
5637
+ return $description;
5638
+ }
5639
+
5640
+ if( isset($config['provider']) && woo_feed_is_google_group_merchant($config['provider']) ) {
5641
+ if( strlen($description) > 5000 ) {
5642
+ $description = substr($description, 0, 4999);
5643
+ }
5644
+ }
5645
+
5646
+ return $description;
5647
+ }
5648
+ }
5649
+
5650
+ if( ! function_exists( 'woo_feed_filter_product_title' ) ) {
5651
+ /**
5652
+ * @param string $title Product Title
5653
+ * @param WC_Product $product
5654
+ * @param array $config Feed config
5655
+ *
5656
+ * @return string
5657
+ */
5658
+ function woo_feed_filter_product_title($title, $product, $config) {
5659
+
5660
+ if( empty($title) ) {
5661
+ return $title;
5662
+ }
5663
+
5664
+ if( isset($config['provider']) && in_array($config['provider'], ['google', 'facebook', 'pinterest', 'bing']) ) {
5665
+ if( strlen($title) > 150 ) {
5666
+ $title = substr($title, 0, 149);
5667
+ }
5668
+ }
5669
+
5670
+ return $title;
5671
+ }
5672
+ }
5673
+
5674
  #==== MERCHANT TEMPLATE OVERRIDE END ================#
5675
 
5676
  // Including pluggable functions file
includes/hooks.php CHANGED
@@ -68,6 +68,15 @@ add_filter( 'woo_feed_get_availability_attribute', 'woo_feed_availability_attrib
68
  add_filter( 'woo_feed_get_type_attribute', 'woo_feed_spartoo_attribute_value_modify', 9, 3 );
69
  add_filter( 'woo_feed_get_pinterest_rss_date_created_attribute', 'woo_feed_get_pinterest_rss_date_attribute_callback', 9, 3 );
70
  add_filter( 'woo_feed_get_pinterest_rss_date_updated_attribute', 'woo_feed_get_pinterest_rss_date_attribute_callback', 9, 3 );
 
 
 
 
 
 
 
 
 
71
  #==== MERCHANT TEMPLATE OVERRIDE END ================
72
 
73
  // End of file hooks.php.
68
  add_filter( 'woo_feed_get_type_attribute', 'woo_feed_spartoo_attribute_value_modify', 9, 3 );
69
  add_filter( 'woo_feed_get_pinterest_rss_date_created_attribute', 'woo_feed_get_pinterest_rss_date_attribute_callback', 9, 3 );
70
  add_filter( 'woo_feed_get_pinterest_rss_date_updated_attribute', 'woo_feed_get_pinterest_rss_date_attribute_callback', 9, 3 );
71
+ add_filter( 'woo_feed_filter_product_description', 'woo_feed_filter_product_description_callback', 1, 3 );
72
+ add_filter( 'woo_feed_filter_product_yoast_wpseo_metadesc', 'woo_feed_filter_product_description_callback', 1, 3 );
73
+ add_filter( 'woo_feed_filter_product_rank_math_description', 'woo_feed_filter_product_description_callback', 1, 3 );
74
+ add_filter( 'woo_feed_filter_product_aioseop_description', 'woo_feed_filter_product_description_callback', 1, 3 );
75
+ add_filter( 'woo_feed_filter_product_title', 'woo_feed_filter_product_title', 1, 3 );
76
+ add_filter( 'woo_feed_filter_product_parent_title', 'woo_feed_filter_product_title', 1, 3 );
77
+ add_filter( 'woo_feed_filter_product_yoast_wpseo_title', 'woo_feed_filter_product_title', 1, 3 );
78
+ add_filter( 'woo_feed_filter_product_rank_math_title', 'woo_feed_filter_product_title', 1, 3 );
79
+ add_filter( 'woo_feed_filter_product_aioseop_title', 'woo_feed_filter_product_title', 1, 3 );
80
  #==== MERCHANT TEMPLATE OVERRIDE END ================
81
 
82
  // End of file hooks.php.
wahid_phpcs.xml ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <ruleset name="WebAppick Coding Standards">
3
+ <description>WebAppick dev PHP_CodeSniffer ruleset.</description>
4
+
5
+ <file>.</file>
6
+
7
+ <!-- Exclude paths -->
8
+ <exclude-pattern>min.js</exclude-pattern>
9
+ <exclude-pattern>js/localization/</exclude-pattern>
10
+ <exclude-pattern>js/jquery-sortable.js</exclude-pattern>
11
+ <exclude-pattern>min.css</exclude-pattern>
12
+ <exclude-pattern>libs/WebAppick/</exclude-pattern>
13
+ <exclude-pattern>tests/cli/</exclude-pattern>
14
+ <exclude-pattern>includes/wc-legacy-support.php</exclude-pattern>
15
+ <exclude-pattern>includes/classes/class-woo-feed-engine.php</exclude-pattern>
16
+ <exclude-pattern>includes/classes/class-woo-feed-list-table.php</exclude-pattern>
17
+ <exclude-pattern>*/node_modules/*</exclude-pattern>
18
+ <exclude-pattern>*/vendor/*</exclude-pattern>
19
+
20
+ <exclude-pattern>includes/feeds/merchant_infos.php</exclude-pattern>
21
+ <exclude-pattern>includes/feeds/merchant_templates.php</exclude-pattern>
22
+
23
+ <!-- Show progress, show the error codes for each message (source). -->
24
+ <arg value="ps" />
25
+
26
+ <!-- Strip the file paths in reports down to the relevant bit. -->
27
+ <arg name="basepath" value="./" />
28
+
29
+ <!-- Check up to 8 files simultaneously. -->
30
+ <!-- <arg name="parallel" value="4" />-->
31
+
32
+ <!-- Configs -->
33
+ <config name="minimum_supported_wp_version" value="5.0" /> <!-- Minimum WP Version -->
34
+ <config name="testVersion" value="5.6" /> <!-- Minimum PHP Version -->
35
+
36
+ <!-- Rules -->
37
+
38
+ <rule ref="Squiz">
39
+ <exclude name="Squiz"/>
40
+ <exclude-pattern>index.php</exclude-pattern>
41
+ </rule>
42
+ <rule ref="~/.composer/vendor/wp-coding-standards/wpcs/WordPress">
43
+ <exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
44
+ <exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
45
+ <exclude name="WordPress.NamingConventions"/>
46
+ </rule>
47
+ <rule ref="WordPress-Core" />
48
+ <rule ref="WordPress-Extra" />
49
+ <!-- <rule ref="WordPress-VIP-Go" />-->
50
+
51
+ <rule ref="WordPress.WP.I18n">
52
+ <properties>
53
+ <property name="text_domain" type="array" value="woo-feed" />
54
+ </properties>
55
+ </rule>
56
+
57
+ <rule ref="PHPCompatibility">
58
+ <exclude-pattern>tests/</exclude-pattern>
59
+ <!-- Marked some internal method with DoubleUnderscore before method name -->
60
+ <exclude name="PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.MethodDoubleUnderscore"/>
61
+ </rule>
62
+
63
+ <rule ref="WordPress.Files.FileName.InvalidClassFileName">
64
+ <exclude-pattern>includes/**/abstract-*.php</exclude-pattern>
65
+ <exclude-pattern>tests/*</exclude-pattern>
66
+ <exclude-pattern>src/*</exclude-pattern>
67
+ </rule>
68
+
69
+ <rule ref="PEAR">
70
+ <exclude-pattern>.</exclude-pattern>
71
+ <exclude name="PEAR.NamingConventions.ValidClassName.Invalid"/>
72
+ <exclude name="PEAR.Commenting.FileComment"/>
73
+ </rule>
74
+ <rule ref="PEAR.Functions.FunctionCallSignature.EmptyLine">
75
+ <exclude-pattern>tests/e2e-tests/</exclude-pattern>
76
+ </rule>
77
+
78
+ <rule ref="Generic.Commenting">
79
+ <exclude-pattern>tests/</exclude-pattern>
80
+ </rule>
81
+
82
+ <rule ref="WordPress.Files.FileName.NotHyphenatedLowercase">
83
+ <exclude-pattern>languages/</exclude-pattern>
84
+ <exclude-pattern>i18n/</exclude-pattern>
85
+ <exclude-pattern>src/</exclude-pattern>
86
+ </rule>
87
+
88
+ <rule ref="Generic">
89
+ <exclude-pattern>.</exclude-pattern>
90
+ <exclude name="Generic.Commenting.DocComment.SpacingBeforeTags"/>
91
+ <exclude name="Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed" />
92
+ <exclude name="Generic.WhiteSpace.DisallowTabIndent.NonIndentTabsUsed" />
93
+ <exclude name="Generic.WhiteSpace.DisallowTabIndent.TabsUsed" />
94
+ <exclude name="Generic.PHP.ClosingPHPTag.NotFound" />
95
+ <exclude name="Generic.Files.LineLength.TooLong" />
96
+ </rule>
97
+ </ruleset>
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.21
14
  * Author: WebAppick
15
  * Author URI: https://webappick.com/
16
  * License: GPL v2
@@ -42,7 +42,7 @@ if ( ! defined( 'WOO_FEED_FREE_VERSION' ) ) {
42
  * @var string
43
  * @since 3.1.6
44
  */
45
- define( 'WOO_FEED_FREE_VERSION', '4.4.21' );
46
  }
47
 
48
  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.22
14
  * Author: WebAppick
15
  * Author URI: https://webappick.com/
16
  * License: GPL v2
42
  * @var string
43
  * @since 3.1.6
44
  */
45
+ define( 'WOO_FEED_FREE_VERSION', '4.4.22' );
46
  }
47
 
48
  if ( ! defined( 'WOO_FEED_FREE_FILE' ) ) {