CTX Feed – WooCommerce Product Feed Manager Plugin - Version 3.1.43

Version Description

(2019-10-27) = * Improve Page loading performance on feed editor * FTP Module detection added in FTP/SFTP tab in feed editor * Fix 3rd Party Plugin Compatibility

Download this release

Release Info

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

Code changes from version 3.1.42 to 3.1.43

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://webappick.com
4
  Tags:woocommerce,google product feed,facebook product feed,woocommerce product feed,woocommerce,
5
  Requires at least: 3.6
6
  Tested Up To: 5.3
7
- Stable tag: 3.1.42
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -304,6 +304,11 @@ Using pro version:
304
 
305
  == Changelog ==
306
 
 
 
 
 
 
307
  = 3.1.42 (2019-10-27) =
308
  * Fix deactivation script
309
 
4
  Tags:woocommerce,google product feed,facebook product feed,woocommerce product feed,woocommerce,
5
  Requires at least: 3.6
6
  Tested Up To: 5.3
7
+ Stable tag: 3.1.43
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
304
 
305
  == Changelog ==
306
 
307
+ = 3.1.43 (2019-10-27) =
308
+ * Improve Page loading performance on feed editor
309
+ * FTP Module detection added in `FTP/SFTP` tab in feed editor
310
+ * Fix 3rd Party Plugin Compatibility
311
+
312
  = 3.1.42 (2019-10-27) =
313
  * Fix deactivation script
314
 
admin/js/woo-feed-admin.js CHANGED
@@ -90,7 +90,7 @@
90
  $(function () {
91
  // noinspection ES6ConvertVarToLetConst
92
  var pageURL = $(location). attr("href");
93
- if(pageURL.indexOf('webappick-product-feed-for-woocommerce') >= 0 || pageURL.indexOf('woo_feed_manage_feed') >= 0) {
94
  // noinspection SpellCheckingInspection
95
  $('#wpbody-content').addClass('woofeed-body-content');
96
  }
90
  $(function () {
91
  // noinspection ES6ConvertVarToLetConst
92
  var pageURL = $(location). attr("href");
93
+ if( $(location). attr("href").match( /webappick.*feed/g ) != null ) {
94
  // noinspection SpellCheckingInspection
95
  $('#wpbody-content').addClass('woofeed-body-content');
96
  }
admin/partials/templates/custom_edit-feed.php CHANGED
@@ -299,6 +299,13 @@ if(!isset($feedRules['ftporsftp'])){
299
 
300
  <div id="wf-tab-content3" class="wf-tab-content">
301
  <table class="table widefat fixed mtable" width="100%">
 
 
 
 
 
 
 
302
  <tbody>
303
  <tr>
304
  <td><?php _e('Enabled', 'woo-feed'); ?></td>
@@ -350,6 +357,7 @@ if(!isset($feedRules['ftporsftp'])){
350
  </tr>
351
 
352
  </tbody>
 
353
  </table>
354
  <table class=" widefat fixed">
355
  <tr>
299
 
300
  <div id="wf-tab-content3" class="wf-tab-content">
301
  <table class="table widefat fixed mtable" width="100%">
302
+ <?php if( ! checkFTP_connection() && ! checkSFTP_connection() ) { ?>
303
+ <tbody>
304
+ <tr>
305
+ <th><?php esc_attr_e( 'FTP/SFTP module is not found in your server. Please contact your service provider or system administrator to install/enable FTP/SFTP module.', 'woo-feed' ); ?></th>
306
+ </tr>
307
+ </tbody>
308
+ <?php } else { ?>
309
  <tbody>
310
  <tr>
311
  <td><?php _e('Enabled', 'woo-feed'); ?></td>
357
  </tr>
358
 
359
  </tbody>
360
+ <?php } ?>
361
  </table>
362
  <table class=" widefat fixed">
363
  <tr>
admin/partials/templates/zap.co.il_add-feed.php CHANGED
@@ -611,6 +611,13 @@
611
 
612
  <div id="wf-tab-content4" class="wf-tab-content">
613
  <table class="table widefat fixed mtable" width="100%">
 
 
 
 
 
 
 
614
  <tbody>
615
  <tr>
616
  <td><?php _e('Enabled', 'woo-feed'); ?></td>
@@ -653,6 +660,7 @@
653
  <td><input type="text" name="ftppath"/></td>
654
  </tr>
655
  </tbody>
 
656
  </table>
657
  <table class=" widefat fixed">
658
  <tr>
611
 
612
  <div id="wf-tab-content4" class="wf-tab-content">
613
  <table class="table widefat fixed mtable" width="100%">
614
+ <?php if( ! checkFTP_connection() && ! checkSFTP_connection() ) { ?>
615
+ <tbody>
616
+ <tr>
617
+ <th><?php esc_attr_e( 'FTP/SFTP module is not found in your server. Please contact your service provider or system administrator to install/enable FTP/SFTP module.', 'woo-feed' ); ?></th>
618
+ </tr>
619
+ </tbody>
620
+ <?php } else { ?>
621
  <tbody>
622
  <tr>
623
  <td><?php _e('Enabled', 'woo-feed'); ?></td>
660
  <td><input type="text" name="ftppath"/></td>
661
  </tr>
662
  </tbody>
663
+ <?php } ?>
664
  </table>
665
  <table class=" widefat fixed">
666
  <tr>
admin/partials/woo-feed-edit-template.php CHANGED
@@ -295,6 +295,13 @@ $AttributesDropdown = $feedRules['provider'] . "AttributesDropdown";
295
 
296
  <div id="wf-tab-content3" class="wf-tab-content">
297
  <table class="table widefat fixed mtable" width="100%">
 
 
 
 
 
 
 
298
  <tbody>
299
  <tr>
300
  <td><?php _e('Enabled', 'woo-feed'); ?></td>
@@ -345,6 +352,7 @@ $AttributesDropdown = $feedRules['provider'] . "AttributesDropdown";
345
  autocomplete="off"/></td>
346
  </tr>
347
  </tbody>
 
348
  </table>
349
  <table class="widefat fixed">
350
  <tr>
295
 
296
  <div id="wf-tab-content3" class="wf-tab-content">
297
  <table class="table widefat fixed mtable" width="100%">
298
+ <?php if( ! checkFTP_connection() && ! checkSFTP_connection() ) { ?>
299
+ <tbody>
300
+ <tr>
301
+ <th><?php esc_attr_e( 'FTP/SFTP module is not found in your server. Please contact your service provider or system administrator to install/enable FTP/SFTP module.', 'woo-feed' ); ?></th>
302
+ </tr>
303
+ </tbody>
304
+ <?php } else { ?>
305
  <tbody>
306
  <tr>
307
  <td><?php _e('Enabled', 'woo-feed'); ?></td>
352
  autocomplete="off"/></td>
353
  </tr>
354
  </tbody>
355
+ <?php } ?>
356
  </table>
357
  <table class="widefat fixed">
358
  <tr>
admin/partials/woo-feed-ftp-sftp-template.php CHANGED
@@ -4,6 +4,13 @@
4
 
5
  <div id="wf-tab-content3" class="wf-tab-content">
6
  <table class="table widefat fixed mtable" width="100%">
 
 
 
 
 
 
 
7
  <tbody>
8
  <tr>
9
  <td><?php _e( 'Enabled', 'woo-feed' ); ?></td>
@@ -46,6 +53,7 @@
46
  <td><input type="text" name="ftppath"/></td>
47
  </tr>
48
  </tbody>
 
49
  </table>
50
  <table class=" widefat fixed">
51
  <tr>
4
 
5
  <div id="wf-tab-content3" class="wf-tab-content">
6
  <table class="table widefat fixed mtable" width="100%">
7
+ <?php if( ! checkFTP_connection() && ! checkSFTP_connection() ) { ?>
8
+ <tbody>
9
+ <tr>
10
+ <th><?php esc_attr_e( 'FTP/SFTP module is not found in your server. Please contact your service provider or system administrator to install/enable FTP/SFTP module.', 'woo-feed' ); ?></th>
11
+ </tr>
12
+ </tbody>
13
+ <?php } else { ?>
14
  <tbody>
15
  <tr>
16
  <td><?php _e( 'Enabled', 'woo-feed' ); ?></td>
53
  <td><input type="text" name="ftppath"/></td>
54
  </tr>
55
  </tbody>
56
+ <?php } ?>
57
  </table>
58
  <table class=" widefat fixed">
59
  <tr>
includes/classes/class-woo-feed-products.php CHANGED
@@ -1704,17 +1704,15 @@ class Woo_Feed_Products {
1704
  public function getAllAttributes() {
1705
  global $wpdb;
1706
  $info = array();
1707
- /** @noinspection SqlResolve */
1708
  //Load the main attributes
1709
- $sql = 'SELECT DISTINCT( attribute_name ) AS name, attribute_label as label FROM ' . $wpdb->prefix . 'woocommerce_attribute_taxonomies';
1710
- $data = $wpdb->get_results($sql);
1711
- if ( count( $data ) ) {
1712
- foreach ($data as $key => $value) {
1713
- $info["wf_attr_pa_" . $value->name] = $value->label;
1714
  }
1715
- return $info;
1716
  }
1717
- return false;
 
1718
  }
1719
 
1720
 
@@ -1778,106 +1776,96 @@ class Woo_Feed_Products {
1778
  * @return string
1779
  */
1780
  public function attributeDropdown( $selected = "" ) {
1781
- $attributes = array(
1782
- "id" => "Product Id",
1783
- "title" => "Product Title",
1784
- "description" => "Product Description",
1785
- "short_description" => "Product Short Description",
1786
- "product_type" => "Product Local Category",
1787
- "link" => "Product URL",
1788
- "ex_link" => "External Product URL",
1789
- "condition" => "Condition",
1790
- "item_group_id" => "Parent Id [Group Id]",
1791
- "sku" => "SKU",
1792
- "parent_sku" => "Parent SKU",
1793
- "availability" => "Availability",
1794
- "quantity" => "Quantity",
1795
- "price" => "Regular Price",
1796
- "current_price" => "Current Price",
1797
- "price_with_tax" => "Price with Tax",
1798
- "sale_price" => "Sale Price",
1799
- "sale_price_sdate" => "Sale Start Date",
1800
- "sale_price_edate" => "Sale End Date",
1801
- "weight" => "Weight",
1802
- "width" => "Width",
1803
- "height" => "Height",
1804
- "length" => "Length",
1805
- "shipping_class" => "Shipping Class",
1806
- "type" => "Product Type",
1807
- "variation_type" => "Variation Type",
1808
- "visibility" => "Visibility",
1809
- "rating_total" => "Total Rating",
1810
- "rating_average" => "Average Rating",
1811
- "tags" => "Tags",
1812
- "sale_price_effective_date" => "Sale Price Effective Date",
1813
- "is_bundle" => "Is Bundle",
1814
- "date_created" => "Date Created",
1815
- "date_updated" => "Date Updated",
1816
- );
1817
-
1818
- $images = array(
1819
- "image" => "Main Image",
1820
- "feature_image" => "Featured Image",
1821
- "images" => "Images [Comma Separated]",
1822
- "image_1" => "Additional Image 1",
1823
- "image_2" => "Additional Image 2",
1824
- "image_3" => "Additional Image 3",
1825
- "image_4" => "Additional Image 4",
1826
- "image_5" => "Additional Image 5",
1827
- "image_6" => "Additional Image 6",
1828
- "image_7" => "Additional Image 7",
1829
- "image_8" => "Additional Image 8",
1830
- "image_9" => "Additional Image 9",
1831
- "image_10" => "Additional Image 10",
1832
- );
1833
-
1834
- # Primary Attributes
1835
- $str = "<option></option>";
1836
- $is_selected = false;
1837
- $str .= "<optgroup label='Primary Attributes'>";
1838
- foreach ($attributes as $key => $value) {
1839
- /** @noinspection HtmlUnknownAttribute */
1840
- $str .= sprintf(
1841
- '<option value="%s"%s>%s</option>',
1842
- $key,
1843
- ! $is_selected ? $is_selected = selected( $selected, $key, false ) : '',
1844
- $value
1845
  );
1846
- }
1847
- $str .= "</optgroup>";
1848
-
1849
- # Additional Images
1850
- if ($images) {
1851
- $str .= "<optgroup label='Image Attributes'>";
1852
- foreach ($images as $key => $value) {
1853
- /** @noinspection HtmlUnknownAttribute */
1854
- $str .= sprintf(
1855
- '<option value="%s"%s>%s</option>',
1856
- $key,
1857
- ! $is_selected ? $is_selected = selected( $selected, $key, false ) : '',
1858
- $value
1859
- );
 
 
 
 
 
 
 
 
 
 
1860
  }
1861
- $str .= "</optgroup>";
1862
- }
1863
-
1864
- # Get All WooCommerce Attributes
1865
- $vAttributes = $this->getAllAttributes();
1866
- if ($vAttributes) {
1867
- $str .= "<optgroup label='Product Attributes'>";
1868
- foreach ($vAttributes as $key => $value) {
1869
- /** @noinspection HtmlUnknownAttribute */
1870
- $str .= sprintf(
1871
- '<option value="%s"%s>%s</option>',
1872
- $key,
1873
- ! $is_selected ? $is_selected = selected( $selected, $key, false ) : '',
1874
- $value
1875
- );
 
 
 
1876
  }
1877
- $str .= "</optgroup>";
1878
  }
1879
-
1880
- return $str;
 
 
 
1881
  }
1882
 
1883
  /**
@@ -1898,7 +1886,7 @@ class Woo_Feed_Products {
1898
  * Local Attribute List to map product value with merchant attributes
1899
  *
1900
  * @param string $selected
1901
- *
1902
  * @return string
1903
  */
1904
  public function loadAttributeDropdown($selected = "")
1704
  public function getAllAttributes() {
1705
  global $wpdb;
1706
  $info = array();
 
1707
  //Load the main attributes
1708
+ $globalAttributes = wc_get_attribute_taxonomy_labels();
1709
+ if ( count( $globalAttributes ) ) {
1710
+ foreach ( $globalAttributes as $key => $value ) {
1711
+ $info["wf_attr_pa_" . $key] = $value;
 
1712
  }
 
1713
  }
1714
+
1715
+ return $info;
1716
  }
1717
 
1718
 
1776
  * @return string
1777
  */
1778
  public function attributeDropdown( $selected = "" ) {
1779
+
1780
+ $attributeDropdown = wp_cache_get( 'woo-feed-products-attributes' );
1781
+
1782
+ if( ! $attributeDropdown ) {
1783
+ $attributes = array(
1784
+ "id" => esc_attr__( "Product Id", 'woo-feed' ),
1785
+ "title" => esc_attr__( "Product Title", 'woo-feed' ),
1786
+ "description" => esc_attr__( "Product Description", 'woo-feed' ),
1787
+ "short_description" => esc_attr__( "Product Short Description", 'woo-feed' ),
1788
+ "product_type" => esc_attr__( "Product Local Category", 'woo-feed' ),
1789
+ "link" => esc_attr__( "Product URL", 'woo-feed' ),
1790
+ "ex_link" => esc_attr__( "External Product URL", 'woo-feed' ),
1791
+ "condition" => esc_attr__( "Condition", 'woo-feed' ),
1792
+ "item_group_id" => esc_attr__( "Parent Id [Group Id]", 'woo-feed' ),
1793
+ "sku" => esc_attr__( "SKU", 'woo-feed' ),
1794
+ "parent_sku" => esc_attr__( "Parent SKU", 'woo-feed' ),
1795
+ "availability" => esc_attr__( "Availability", 'woo-feed' ),
1796
+ "quantity" => esc_attr__( "Quantity", 'woo-feed' ),
1797
+ "price" => esc_attr__( "Regular Price", 'woo-feed' ),
1798
+ "current_price" => esc_attr__( "Current Price", 'woo-feed' ),
1799
+ "price_with_tax" => esc_attr__( "Price With Tax", 'woo-feed' ),
1800
+ "sale_price" => esc_attr__( "Sale Price", 'woo-feed' ),
1801
+ "sale_price_sdate" => esc_attr__( "Sale Start Date", 'woo-feed' ),
1802
+ "sale_price_edate" => esc_attr__( "Sale End Date", 'woo-feed' ),
1803
+ "weight" => esc_attr__( "Weight", 'woo-feed' ),
1804
+ "width" => esc_attr__( "Width", 'woo-feed' ),
1805
+ "height" => esc_attr__( "Height", 'woo-feed' ),
1806
+ "length" => esc_attr__( "Length", 'woo-feed' ),
1807
+ "shipping_class" => esc_attr__( "Shipping Class", 'woo-feed' ),
1808
+ "type" => esc_attr__( "Product Type", 'woo-feed' ),
1809
+ "variation_type" => esc_attr__( "Variation Type", 'woo-feed' ),
1810
+ "visibility" => esc_attr__( "Visibility", 'woo-feed' ),
1811
+ "rating_total" => esc_attr__( "Total Rating", 'woo-feed' ),
1812
+ "rating_average" => esc_attr__( "Average Rating", 'woo-feed' ),
1813
+ "tags" => esc_attr__( "Tags", 'woo-feed' ),
1814
+ "sale_price_effective_date" => esc_attr__( "Sale Price Effective Date", 'woo-feed' ),
1815
+ "is_bundle" => esc_attr__( "Is Bundle", 'woo-feed' ),
1816
+ "date_created" => esc_attr__( "Date Created", 'woo-feed' ),
1817
+ "date_updated" => esc_attr__( "Date Updated", 'woo-feed' ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1818
  );
1819
+ $images = array(
1820
+ "image" => esc_attr__( "Main Image", 'woo-feed' ),
1821
+ "feature_image" => esc_attr__( "Featured Image", 'woo-feed' ),
1822
+ "images" => esc_attr__( "Images [Comma Separated]", 'woo-feed' ),
1823
+ "image_1" => esc_attr__( "Additional Image 1", 'woo-feed' ),
1824
+ "image_2" => esc_attr__( "Additional Image 2", 'woo-feed' ),
1825
+ "image_3" => esc_attr__( "Additional Image 3", 'woo-feed' ),
1826
+ "image_4" => esc_attr__( "Additional Image 4", 'woo-feed' ),
1827
+ "image_5" => esc_attr__( "Additional Image 5", 'woo-feed' ),
1828
+ "image_6" => esc_attr__( "Additional Image 6", 'woo-feed' ),
1829
+ "image_7" => esc_attr__( "Additional Image 7", 'woo-feed' ),
1830
+ "image_8" => esc_attr__( "Additional Image 8", 'woo-feed' ),
1831
+ "image_9" => esc_attr__( "Additional Image 9", 'woo-feed' ),
1832
+ "image_10" => esc_attr__( "Additional Image 10", 'woo-feed' ),
1833
+ );
1834
+
1835
+ # Primary Attributes
1836
+ $attributeDropdown = "<option></option>";
1837
+ if( ! empty( $attributes ) ) {
1838
+ $attributeDropdown .= sprintf( "<optgroup label=\"%s\">", esc_attr__( 'Primary Attributes', 'woo-feed' ) );
1839
+ foreach ($attributes as $key => $value) {
1840
+ $attributeDropdown .= sprintf( '<option value="%s">%s</option>', $key, $value );
1841
+ }
1842
+ $attributeDropdown .= "</optgroup>";
1843
  }
1844
+
1845
+ # Additional Images
1846
+ if ( ! empty( $images ) ) {
1847
+ $attributeDropdown .= sprintf( "<optgroup label=\"%s\">", esc_attr__( 'Image Attributes', 'woo-feed' ) );
1848
+ foreach ($images as $key => $value) {
1849
+ $attributeDropdown .= sprintf( '<option value="%s">%s</option>', $key, $value );
1850
+ }
1851
+ $attributeDropdown .= "</optgroup>";
1852
+ }
1853
+
1854
+ # Get All WooCommerce Attributes
1855
+ $vAttributes = $this->getAllAttributes();
1856
+ if ( $vAttributes && ! empty( $vAttributes ) ) {
1857
+ $attributeDropdown .= sprintf( "<optgroup label=\"%s\">", esc_attr__( 'Product Attributes', 'woo-feed' ) );
1858
+ foreach ($vAttributes as $key => $value) {
1859
+ $attributeDropdown .= sprintf( '<option value="%s">%s</option>', $key, $value );
1860
+ }
1861
+ $attributeDropdown .= "</optgroup>";
1862
  }
 
1863
  }
1864
+
1865
+ if( $selected && strpos( $attributeDropdown, 'value="'.$selected.'"' ) !== false ) {
1866
+ $attributeDropdown = str_replace( 'value="'.$selected.'"', 'value="'.$selected.'"'.' selected', $attributeDropdown );
1867
+ }
1868
+ return $attributeDropdown;
1869
  }
1870
 
1871
  /**
1886
  * Local Attribute List to map product value with merchant attributes
1887
  *
1888
  * @param string $selected
1889
+ * @deprecated since 3.1.43
1890
  * @return string
1891
  */
1892
  public function loadAttributeDropdown($selected = "")
includes/helper.php CHANGED
@@ -87,4 +87,24 @@ if( ! function_exists( 'wooFeed_Admin_Notices' ) ) {
87
  }
88
  }
89
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  // End of file helper.php
87
  }
88
  }
89
  }
90
+ if( ! function_exists( 'checkFTP_connection' ) ) {
91
+ /**
92
+ * Verify if ftp module enabled
93
+ * @TODO improve module detection
94
+ * @return bool
95
+ */
96
+ function checkFTP_connection() {
97
+ return ( extension_loaded('ftp' ) || function_exists( 'ftp_connect' ) );
98
+ }
99
+ }
100
+ if( ! function_exists( 'checkSFTP_connection' ) ) {
101
+ /**
102
+ * Verify if ssh/sftp module enabled
103
+ * @TODO improve module detection
104
+ * @return bool
105
+ */
106
+ function checkSFTP_connection() {
107
+ return ( extension_loaded('ssh2' ) || function_exists( 'ssh2_connect' ) );
108
+ }
109
+ }
110
  // End of file helper.php
woo-feed.php CHANGED
@@ -15,7 +15,7 @@
15
  * Plugin Name: WooCommerce Product Feed
16
  * Plugin URI: https://webappick.com/
17
  * Description: This plugin generate WooCommerce product feed for Shopping Engines like Google Shopping,Facebook Product Feed,eBay,Amazon,Idealo and many more..
18
- * Version: 3.1.42
19
  * Author: WebAppick
20
  * Author URI: https://webappick.com/
21
  * License: GPL v2
@@ -34,7 +34,7 @@ if( ! defined( 'WOO_FEED_VERSION' ) ) {
34
  * Plugin Version
35
  * @var string
36
  */
37
- define( 'WOO_FEED_VERSION', '3.1.42' );
38
  }
39
  if( ! defined( 'WOO_FEED_FREE_FILE') ) {
40
  /**
15
  * Plugin Name: WooCommerce Product Feed
16
  * Plugin URI: https://webappick.com/
17
  * Description: This plugin generate WooCommerce product feed for Shopping Engines like Google Shopping,Facebook Product Feed,eBay,Amazon,Idealo and many more..
18
+ * Version: 3.1.43
19
  * Author: WebAppick
20
  * Author URI: https://webappick.com/
21
  * License: GPL v2
34
  * Plugin Version
35
  * @var string
36
  */
37
+ define( 'WOO_FEED_VERSION', '3.1.43' );
38
  }
39
  if( ! defined( 'WOO_FEED_FREE_FILE') ) {
40
  /**