Product Feed PRO for WooCommerce - Version 11.0.6

Version Description

Added htaccess files to the feed directories so they no longer will be cached (thanks @Anders!) Fixed an issue where disabled product variations still made it into the size attribute Fixed an array merge warning that showed when a new feed was being created and no previous feed was present Added downloadable and virtual attribute data so those can be added to feeds and filtered on

Download this release

Release Info

Developer jorisverwater
Plugin Icon 128x128 Product Feed PRO for WooCommerce
Version 11.0.6
Comparing to
See all releases

Code changes from version 11.0.5 to 11.0.6

classes/class-attributes.php CHANGED
@@ -282,6 +282,8 @@ public function get_mapping_attributes_dropdown() {
282
  "region_id" => "Region Id",
283
  "stock_status" => "Stock Status WooCommerce",
284
  "quantity" => "Quantity [Stock]",
 
 
285
  "product_type" => "Product Type",
286
  "content_type" => "Content Type",
287
  "exclude_from_catalog" => "Excluded from catalog",
@@ -483,7 +485,9 @@ public function get_mapping_attributes_dropdown() {
483
  "region_id" => "Region Id",
484
  "stock_status" => "Stock Status WooCommerce",
485
  "quantity" => "Quantity [Stock]",
486
- "price" => "Price",
 
 
487
  "regular_price" => "Regular price",
488
  "sale_price" => "Sale price",
489
  "net_price" => "Price excl. VAT",
282
  "region_id" => "Region Id",
283
  "stock_status" => "Stock Status WooCommerce",
284
  "quantity" => "Quantity [Stock]",
285
+ "virtual" => "Virtual",
286
+ "downloadable" => "Downloadable",
287
  "product_type" => "Product Type",
288
  "content_type" => "Content Type",
289
  "exclude_from_catalog" => "Excluded from catalog",
485
  "region_id" => "Region Id",
486
  "stock_status" => "Stock Status WooCommerce",
487
  "quantity" => "Quantity [Stock]",
488
+ "virtual" => "Virtual",
489
+ "downloadable" => "Downloadable",
490
+ "price" => "Price",
491
  "regular_price" => "Regular price",
492
  "sale_price" => "Sale price",
493
  "net_price" => "Price excl. VAT",
classes/class-get-products.php CHANGED
@@ -1198,6 +1198,24 @@ class WooSEA_Get_Products {
1198
  wp_mkdir_p( $path );
1199
  }
1200
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1201
  // Check if file exists, if it does: delete it first so we can create a new updated one
1202
  if ( (file_exists( $file )) AND ($header == "true") AND ($feed_config['nr_products_processed'] == 0) || !file_exists( $file ) ) {
1203
  unlink ( $file );
@@ -1947,7 +1965,7 @@ class WooSEA_Get_Products {
1947
  $base = $upload_dir['basedir'];
1948
  $path = $base . "/woo-product-feed-pro/" . $feed_config['fileformat'];
1949
  $file = $path . "/" . sanitize_file_name($feed_config['filename']) . "_tmp." . $feed_config['fileformat'];
1950
-
1951
  // External location for downloading the file
1952
  $external_base = $upload_dir['baseurl'];
1953
  $external_path = $external_base . "/woo-product-feed-pro/" . $feed_config['fileformat'];
@@ -1958,6 +1976,24 @@ class WooSEA_Get_Products {
1958
  wp_mkdir_p( $path );
1959
  }
1960
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1961
  // Check if file exists, if it does: delete it first so we can create a new updated one
1962
  if ( (file_exists( $file )) AND ($feed_config['nr_products_processed'] == 0) AND ($header == "true") ) {
1963
  @unlink ( $file );
@@ -2618,6 +2654,18 @@ class WooSEA_Get_Products {
2618
  $product_data['author'] = get_the_author();
2619
  $product_data['quantity'] = $this->clean_quantity( $this->childID, "_stock" );
2620
  $product_data['visibility'] = $product->get_catalog_visibility();
 
 
 
 
 
 
 
 
 
 
 
 
2621
  $product_data['menu_order'] = get_post_field( 'menu_order', $product_data['id'] );
2622
  $product_data['currency'] = get_woocommerce_currency();
2623
  if(isset($project_config['WCML'])){
@@ -4187,6 +4235,7 @@ class WooSEA_Get_Products {
4187
  //$clr_variation = get_post_meta( $var_id, "attribute_".$clr_attribute, true );
4188
  $size_variation = get_post_meta( $var_id, "attribute_".$sz_attribute, true );
4189
  $stock_variation = get_post_meta( $var_id, "_stock_status", true );
 
4190
  if($stock_variation == "outofstock"){
4191
  // Remove this size as it is not on stock
4192
  if(array_key_exists($sz_attribute, $product_data)){
@@ -4199,6 +4248,57 @@ class WooSEA_Get_Products {
4199
  }
4200
  }
4201
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4202
  }
4203
  }
4204
  }
1198
  wp_mkdir_p( $path );
1199
  }
1200
 
1201
+ // Check if htaccess exists, if not create one
1202
+ $htaccess_file = $path . "/" . ".htaccess";
1203
+ if ( ! file_exists( $htaccess_file ) ) {
1204
+ $line_ht = "# BEGIN NoCache for woo-product-feed-pro".PHP_EOL;
1205
+ $line_ht .= "<FilesMatch \"\.(".$feed_config['fileformat'].")$\">".PHP_EOL;
1206
+ $line_ht .= " Header Set Pragma \"no-cache\"".PHP_EOL;
1207
+ $line_ht .= " Header Set Expires \"Thu, 1 Jan 1970 00:00:00 GMT\"".PHP_EOL;
1208
+ $line_ht .= " Header Set Cache-Control \"max-age=0, no-store, no-cache, must-revalidate\"".PHP_EOL;
1209
+ $line_ht .= " Header Unset ETag".PHP_EOL;
1210
+ $line_ht .= " FileETag None".PHP_EOL;
1211
+ $line_ht .= "</FilesMatch>".PHP_EOL;
1212
+ $line_ht .= "# END NoCache for woo-product-feed-pro XML".PHP_EOL;
1213
+
1214
+ $fp = fopen($htaccess_file, 'a+');
1215
+ fwrite($fp, $line_ht);
1216
+ fclose($fp);
1217
+ }
1218
+
1219
  // Check if file exists, if it does: delete it first so we can create a new updated one
1220
  if ( (file_exists( $file )) AND ($header == "true") AND ($feed_config['nr_products_processed'] == 0) || !file_exists( $file ) ) {
1221
  unlink ( $file );
1965
  $base = $upload_dir['basedir'];
1966
  $path = $base . "/woo-product-feed-pro/" . $feed_config['fileformat'];
1967
  $file = $path . "/" . sanitize_file_name($feed_config['filename']) . "_tmp." . $feed_config['fileformat'];
1968
+
1969
  // External location for downloading the file
1970
  $external_base = $upload_dir['baseurl'];
1971
  $external_path = $external_base . "/woo-product-feed-pro/" . $feed_config['fileformat'];
1976
  wp_mkdir_p( $path );
1977
  }
1978
 
1979
+ // Check if htaccess exists, if not create one
1980
+ $htaccess_file = $path . "/" . ".htaccess";
1981
+ if ( ! file_exists( $htaccess_file ) ) {
1982
+ $line_ht = "# BEGIN NoCache for woo-product-feed-pro".PHP_EOL;
1983
+ $line_ht .= "<FilesMatch \"\.(".$feed_config['fileformat'].")$\">".PHP_EOL;
1984
+ $line_ht .= " Header Set Pragma \"no-cache\"".PHP_EOL;
1985
+ $line_ht .= " Header Set Expires \"Thu, 1 Jan 1970 00:00:00 GMT\"".PHP_EOL;
1986
+ $line_ht .= " Header Set Cache-Control \"max-age=0, no-store, no-cache, must-revalidate\"".PHP_EOL;
1987
+ $line_ht .= " Header Unset ETag".PHP_EOL;
1988
+ $line_ht .= " FileETag None".PHP_EOL;
1989
+ $line_ht .= "</FilesMatch>".PHP_EOL;
1990
+ $line_ht .= "# END NoCache for woo-product-feed-pro XML".PHP_EOL;
1991
+
1992
+ $fp = fopen($htaccess_file, 'a+');
1993
+ fwrite($fp, $line_ht);
1994
+ fclose($fp);
1995
+ }
1996
+
1997
  // Check if file exists, if it does: delete it first so we can create a new updated one
1998
  if ( (file_exists( $file )) AND ($feed_config['nr_products_processed'] == 0) AND ($header == "true") ) {
1999
  @unlink ( $file );
2654
  $product_data['author'] = get_the_author();
2655
  $product_data['quantity'] = $this->clean_quantity( $this->childID, "_stock" );
2656
  $product_data['visibility'] = $product->get_catalog_visibility();
2657
+ $download = $product->is_downloadable();
2658
+ if($download == 1){
2659
+ $product_data['downloadable'] = "yes";
2660
+ } else {
2661
+ $product_data['downloadable'] = "no";
2662
+ }
2663
+ $virtual = $product->is_virtual();
2664
+ if($virtual == 1){
2665
+ $product_data['virtual'] = "yes";
2666
+ } else {
2667
+ $product_data['virtual'] = "no";
2668
+ }
2669
  $product_data['menu_order'] = get_post_field( 'menu_order', $product_data['id'] );
2670
  $product_data['currency'] = get_woocommerce_currency();
2671
  if(isset($project_config['WCML'])){
4235
  //$clr_variation = get_post_meta( $var_id, "attribute_".$clr_attribute, true );
4236
  $size_variation = get_post_meta( $var_id, "attribute_".$sz_attribute, true );
4237
  $stock_variation = get_post_meta( $var_id, "_stock_status", true );
4238
+
4239
  if($stock_variation == "outofstock"){
4240
  // Remove this size as it is not on stock
4241
  if(array_key_exists($sz_attribute, $product_data)){
4248
  }
4249
  }
4250
  }
4251
+ } else {
4252
+ if($product_data['product_type'] == "variable"){
4253
+ $product_skroutz = wc_get_product($product_data['id']);
4254
+ $variations = $product_skroutz->get_available_variations();
4255
+ $variations_id = wp_list_pluck( $variations, 'variation_id' );
4256
+
4257
+ $size_array_raw = explode(",", $product_data[$sz_attribute]);
4258
+ $size_array = array_map('trim', $size_array_raw);
4259
+ $enabled_sizes = array();
4260
+ foreach($variations_id as $var_id){
4261
+ $size_variation = strtoupper(get_post_meta( $var_id, "attribute_".$sz_attribute, true ));
4262
+ $enabled_sizes[] = $size_variation;
4263
+ }
4264
+
4265
+ $new_size = "";
4266
+ foreach($enabled_sizes as $siz){
4267
+ $siz = trim($siz, " ");
4268
+ $size_variation = trim($size_variation, " ");
4269
+ $new_size .= " ".$siz.",";
4270
+ }
4271
+
4272
+ $product_data[$sz_attribute] = $new_size;
4273
+ $product_data[$sz_attribute] = str_replace(", , ",",",$product_data[$sz_attribute]);
4274
+ $product_data[$sz_attribute] = rtrim($product_data[$sz_attribute], " ");
4275
+ $product_data[$sz_attribute] = rtrim($product_data[$sz_attribute], ",");
4276
+ $product_data[$sz_attribute] = ltrim($product_data[$sz_attribute], ",");
4277
+
4278
+ foreach($variations_id as $var_id){
4279
+ $size_variation = get_post_meta( $var_id, "attribute_".$sz_attribute, true );
4280
+ $product_excluded = ucfirst( get_post_meta( $var_id, '_woosea_exclude_product', true ) );
4281
+
4282
+ if( $product_excluded == "Yes"){
4283
+ // Remove this size as it is has been set to be excluded from feeds
4284
+ if(array_key_exists($sz_attribute, $product_data)){
4285
+ $new_size = "";
4286
+ foreach($enabled_sizes as $siz){
4287
+ $siz = trim($siz, " ");
4288
+ $size_variation = trim($size_variation, " ");
4289
+ if($siz <> strtoupper($size_variation)){
4290
+ $new_size .= " ".$siz.",";
4291
+ }
4292
+ }
4293
+ $product_data[$sz_attribute] = $new_size;
4294
+ $product_data[$sz_attribute] = str_replace(", , ",",",$product_data[$sz_attribute]);
4295
+ $product_data[$sz_attribute] = rtrim($product_data[$sz_attribute], " ");
4296
+ $product_data[$sz_attribute] = rtrim($product_data[$sz_attribute], ",");
4297
+ $product_data[$sz_attribute] = ltrim($product_data[$sz_attribute], ",");
4298
+ }
4299
+ }
4300
+ }
4301
+ }
4302
  }
4303
  }
4304
  }
classes/class-update-channel.php CHANGED
@@ -118,10 +118,13 @@ class WooSEA_Update_Project {
118
  }
119
  update_option( 'channel_project',$project_fill,'' );
120
  } else {
121
- $project_temp = get_option( 'channel_project' );
122
- $project_fill = array_merge($project_temp, $project_data);
123
-
124
- update_option( 'channel_project',$project_fill,'' );
 
 
 
125
  }
126
  return $project_fill;
127
  }
118
  }
119
  update_option( 'channel_project',$project_fill,'' );
120
  } else {
121
+ $project_temp = get_option( 'channel_project' );
122
+ if(is_array($project_temp)){
123
+ $project_fill = array_merge($project_temp, $project_data);
124
+ } else {
125
+ $project_fill = $project_data;
126
+ }
127
+ update_option( 'channel_project',$project_fill,'' );
128
  }
129
  return $project_fill;
130
  }
js/woosea_key.js CHANGED
@@ -26,7 +26,7 @@ jQuery(document).ready(function($) {
26
  var license_key = $('#license-key').val();
27
 
28
  jQuery.ajax({
29
- url: 'https://www.adtribes.io/check/license.php?key=' + license_key + '&email=' + license_email + '&domain=' + root_domain + '&version=11.0.5',
30
  jsonp: 'callback',
31
  dataType: 'jsonp',
32
  type: 'GET',
26
  var license_key = $('#license-key').val();
27
 
28
  jQuery.ajax({
29
+ url: 'https://www.adtribes.io/check/license.php?key=' + license_key + '&email=' + license_email + '&domain=' + root_domain + '&version=11.0.6',
30
  jsonp: 'callback',
31
  dataType: 'jsonp',
32
  type: 'GET',
pages/admin/woosea-manage-settings.php CHANGED
@@ -346,7 +346,7 @@ if(isset($_GET["tab"])) {
346
  </tr>
347
  <tr>
348
  <td>
349
- <span><?php _e( 'Enable logging (Enable only on advice of our support-team):', 'woo-product-feed-pro');?></span>
350
  </td>
351
  <td>
352
  <label class="woo-product-feed-pro-switch">
@@ -385,7 +385,7 @@ if(isset($_GET["tab"])) {
385
 
386
  <tr id="facebook_pixel">
387
  <td>
388
- <span><?php _e( 'Add Facebook Pixel:', 'woo-product-feed-pro');?> (<a href="https://adtribes.io/facebook-pixel-feature/" target="_blank"><?php _e( 'Read more about this', 'woo-product-feed-pro' );?>)</a></span>
389
  </td>
390
  <td>
391
  <label class="woo-product-feed-pro-switch">
@@ -404,7 +404,7 @@ if(isset($_GET["tab"])) {
404
  <?php
405
  if($add_facebook_pixel == "yes"){
406
  $facebook_pixel_id = get_option('woosea_facebook_pixel_id');
407
- print "<tr id=\"facebook_pixel_id\"><td colspan=\"2\"><span>Insert your Facebook Pixel ID:</span>&nbsp;<input type=\"hidden\" name=\"nonce_facebook_pixel_id\" id=\"nonce_facebook_pixel_id\" value=\"$nonce\"><input type=\"text\" class=\"input-field-medium\" id=\"fb_pixel_id\" name=\"fb_pixel_id\" value=\"$facebook_pixel_id\">&nbsp;<input type=\"button\" id=\"save_facebook_pixel_id\" value=\"Save\"></td></tr>";
408
  }
409
  ?>
410
 
@@ -415,7 +415,7 @@ if(isset($_GET["tab"])) {
415
 
416
  <tr id="content_ids">
417
  <td colspan="2">
418
- <span><?php _e( 'Content IDS variable products Facebook Pixel:', 'woo-product-feed-pro');?></span>
419
  <select id="woosea_content_ids" name="woosea_content_ids" class="select-field">
420
  <?php
421
  if($content_ids == "variation"){
@@ -487,7 +487,7 @@ if(isset($_GET["tab"])) {
487
 
488
  <tr id="batch">
489
  <td>
490
- <span><?php _e( 'Change products per batch number (Enable only on advice of our support-team):', 'woo-product-feed-pro');?> (<a href="https://adtribes.io/batch-size-configuration-product-feed/?utm_source=<?php print "$host";?>&utm_medium=manage-settings&utm_content=batch size" target="_blank"><?php _e( 'Read more about this', 'woo-product-feed-pro' );?>)</a></span>
491
  </td>
492
  <td>
493
  <label class="woo-product-feed-pro-switch">
346
  </tr>
347
  <tr>
348
  <td>
349
+ <span><?php _e( 'Enable logging', 'woo-product-feed-pro');?></span>
350
  </td>
351
  <td>
352
  <label class="woo-product-feed-pro-switch">
385
 
386
  <tr id="facebook_pixel">
387
  <td>
388
+ <span><?php _e( 'Add Facebook Pixel', 'woo-product-feed-pro');?> (<a href="https://adtribes.io/facebook-pixel-feature/" target="_blank"><?php _e( 'Read more about this', 'woo-product-feed-pro' );?>)</a></span>
389
  </td>
390
  <td>
391
  <label class="woo-product-feed-pro-switch">
404
  <?php
405
  if($add_facebook_pixel == "yes"){
406
  $facebook_pixel_id = get_option('woosea_facebook_pixel_id');
407
+ print "<tr id=\"facebook_pixel_id\"><td colspan=\"2\"><span>Insert your Facebook Pixel ID</span>&nbsp;<input type=\"hidden\" name=\"nonce_facebook_pixel_id\" id=\"nonce_facebook_pixel_id\" value=\"$nonce\"><input type=\"text\" class=\"input-field-medium\" id=\"fb_pixel_id\" name=\"fb_pixel_id\" value=\"$facebook_pixel_id\">&nbsp;<input type=\"button\" id=\"save_facebook_pixel_id\" value=\"Save\"></td></tr>";
408
  }
409
  ?>
410
 
415
 
416
  <tr id="content_ids">
417
  <td colspan="2">
418
+ <span><?php _e( 'Content IDS variable products Facebook Pixel', 'woo-product-feed-pro');?></span>
419
  <select id="woosea_content_ids" name="woosea_content_ids" class="select-field">
420
  <?php
421
  if($content_ids == "variation"){
487
 
488
  <tr id="batch">
489
  <td>
490
+ <span><?php _e( 'Change products per batch number', 'woo-product-feed-pro');?> (<a href="https://adtribes.io/batch-size-configuration-product-feed/?utm_source=<?php print "$host";?>&utm_medium=manage-settings&utm_content=batch size" target="_blank"><?php _e( 'Read more about this', 'woo-product-feed-pro' );?>)</a></span>
491
  </td>
492
  <td>
493
  <label class="woo-product-feed-pro-switch">
readme.txt CHANGED
@@ -5,7 +5,7 @@ License URI: http://www.gnu.org/licenses/gpl.html
5
  Tags: Google Shopping Feed, WooCommerce Product Feed, Facebook Product Feed, Bing Shopping Feed, Bing Product Feed, Google Merchant Feed, Skroutz, Google Product Feed, Pinterest, Idealo, Facebook Pixel, Facebook Conversion API
6
  Requires at least: 4.5
7
  Tested up to: 5.8
8
- Stable tag: 11.0.5
9
 
10
  == Description ==
11
 
@@ -339,6 +339,12 @@ Questions left or unanswered? Please do not hesitate to contact us at support@ad
339
 
340
  === Changelog ===
341
 
 
 
 
 
 
 
342
  = 11.0.5 (2021-12-20) =
343
  * Fixed an issue where shipping formula's were not translated to shipping costs properly
344
 
@@ -3530,6 +3536,12 @@ Questions left or unanswered? Please do not hesitate to contact us at support@ad
3530
 
3531
  == Upgrade Notice ==
3532
 
 
 
 
 
 
 
3533
  = 11.0.5 =
3534
  Fixed an issue where shipping formula's were not translated to shipping costs properly
3535
 
5
  Tags: Google Shopping Feed, WooCommerce Product Feed, Facebook Product Feed, Bing Shopping Feed, Bing Product Feed, Google Merchant Feed, Skroutz, Google Product Feed, Pinterest, Idealo, Facebook Pixel, Facebook Conversion API
6
  Requires at least: 4.5
7
  Tested up to: 5.8
8
+ Stable tag: 11.0.6
9
 
10
  == Description ==
11
 
339
 
340
  === Changelog ===
341
 
342
+ = 11.0.6 (2021-12-22) =
343
+ * Added htaccess files to the feed directories so they no longer will be cached (thanks @Anders!)
344
+ * Added downloadable and virtual attribute data so those can be added to feeds and filtered on
345
+ * Fixed an issue where disabled product variations still made it into the size attribute
346
+ * Fixed an array merge warning that showed when a new feed was being created and no previous feed was present
347
+
348
  = 11.0.5 (2021-12-20) =
349
  * Fixed an issue where shipping formula's were not translated to shipping costs properly
350
 
3536
 
3537
  == Upgrade Notice ==
3538
 
3539
+ = 11.0.6 =
3540
+ Added htaccess files to the feed directories so they no longer will be cached (thanks @Anders!)
3541
+ Fixed an issue where disabled product variations still made it into the size attribute
3542
+ Fixed an array merge warning that showed when a new feed was being created and no previous feed was present
3543
+ Added downloadable and virtual attribute data so those can be added to feeds and filtered on
3544
+
3545
  = 11.0.5 =
3546
  Fixed an issue where shipping formula's were not translated to shipping costs properly
3547
 
woocommerce-sea.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Plugin Name: Product Feed PRO for WooCommerce
4
- * Version: 11.0.5
5
  * Plugin URI: https://www.adtribes.io/support/?utm_source=wpadmin&utm_medium=plugin&utm_campaign=woosea_product_feed_pro
6
  * Description: Configure and maintain your WooCommerce product feeds for Google Shopping, Facebook, Remarketing, Bing, Yandex, Comparison shopping websites and over a 100 channels more.
7
  * Author: AdTribes.io
@@ -48,7 +48,7 @@ if (!defined('ABSPATH')) {
48
  * Plugin versionnumber, please do not override.
49
  * Define some constants
50
  */
51
- define( 'WOOCOMMERCESEA_PLUGIN_VERSION', '11.0.5' );
52
  define( 'WOOCOMMERCESEA_PLUGIN_NAME', 'woocommerce-product-feed-pro' );
53
  define( 'WOOCOMMERCESEA_PLUGIN_NAME_SHORT', 'woo-product-feed-pro' );
54
 
1
  <?php
2
  /**
3
  * Plugin Name: Product Feed PRO for WooCommerce
4
+ * Version: 11.0.6
5
  * Plugin URI: https://www.adtribes.io/support/?utm_source=wpadmin&utm_medium=plugin&utm_campaign=woosea_product_feed_pro
6
  * Description: Configure and maintain your WooCommerce product feeds for Google Shopping, Facebook, Remarketing, Bing, Yandex, Comparison shopping websites and over a 100 channels more.
7
  * Author: AdTribes.io
48
  * Plugin versionnumber, please do not override.
49
  * Define some constants
50
  */
51
+ define( 'WOOCOMMERCESEA_PLUGIN_VERSION', '11.0.6' );
52
  define( 'WOOCOMMERCESEA_PLUGIN_NAME', 'woocommerce-product-feed-pro' );
53
  define( 'WOOCOMMERCESEA_PLUGIN_NAME_SHORT', 'woo-product-feed-pro' );
54