Product Feed PRO for WooCommerce - Version 9.1.8

Version Description

Fixed an issue where table rate shipping costs did not make it to custom feeds.

Download this release

Release Info

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

Code changes from version 9.1.7 to 9.1.8

classes/class-get-products.php CHANGED
@@ -762,10 +762,17 @@ class WooSEA_Get_Products {
762
  // Add product to cart
763
  if (isset($product_id)){
764
  $quantity = 1;
765
-
766
  if(!empty($code_from_config)){
767
- if (null !== (WC()->cart)){
768
- WC()->customer->set_shipping_country( $code_from_config );
 
 
 
 
 
 
 
 
769
 
770
  if(isset($zone_details['region'])){
771
  WC()->customer->set_shipping_state(wc_clean( $zone_details['region'] ));
@@ -778,7 +785,7 @@ class WooSEA_Get_Products {
778
  WC()->cart->add_to_cart( $product_id, $quantity );
779
 
780
  // Read cart and get schipping costs
781
- foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
782
  $total_cost = WC()->cart->get_total();
783
  $shipping_cost = WC()->cart->get_shipping_total();
784
  $shipping_cost = wc_format_localized_price($shipping_cost);
@@ -786,7 +793,7 @@ class WooSEA_Get_Products {
786
  }
787
  // Make sure to empty the cart again
788
  WC()->cart->empty_cart();
789
- }
790
  }
791
  }
792
  }
@@ -936,20 +943,22 @@ class WooSEA_Get_Products {
936
  }
937
  }
938
  }
939
-
940
- if(strlen($shipping_cost) > 0){
941
- if($project_config['ship_suffix'] == "false"){
942
- $zone_details['price'] = trim($currency." ".$shipping_cost);
 
 
 
 
943
  } else {
944
- $zone_details['price'] = trim($shipping_cost);
945
- }
946
- } else {
947
- // $shipping_cost = 0;
948
- if(isset($shipping_cost)){
949
- $zone_details['price'] = trim($currency." ".$shipping_cost);
950
  }
951
- //unset($zone_details);
952
- //unset($shipping_cost);
953
  }
954
  }
955
 
@@ -3945,12 +3954,15 @@ class WooSEA_Get_Products {
3945
  } else {
3946
  unlink($tmp_file);
3947
  }
3948
- // END
3949
 
3950
  $batch_project = "batch_project_".$feed_config[$key]['project_hash'];
3951
  delete_option( $batch_project );
3952
  delete_option('woosea_allow_update');
3953
 
 
 
 
 
3954
  // In 2 minutes from now check the amount of products in the feed and update the history count
3955
  wp_schedule_single_event( time() + 120, 'woosea_update_project_stats', array($val['project_hash']) );
3956
  } else {
@@ -3991,7 +4003,11 @@ class WooSEA_Get_Products {
3991
  $batch_project = "batch_project_".$feed_config[$key]['project_hash'];
3992
  delete_option( $batch_project );
3993
  delete_option('woosea_allow_update');
3994
-
 
 
 
 
3995
  // In 2 minutes from now check the amount of products in the feed and update the history count
3996
  wp_schedule_single_event( time() + 120, 'woosea_update_project_stats', array($val['project_hash']) );
3997
  }
762
  // Add product to cart
763
  if (isset($product_id)){
764
  $quantity = 1;
 
765
  if(!empty($code_from_config)){
766
+ defined( 'WC_ABSPATH' ) || exit;
767
+
768
+ // Load cart functions which are loaded only on the front-end.
769
+ include_once WC_ABSPATH . 'includes/wc-cart-functions.php';
770
+ include_once WC_ABSPATH . 'includes/class-wc-cart.php';
771
+
772
+ // if ( is_null( WC()->cart ) ) {
773
+ wc_load_cart();
774
+
775
+ WC()->customer->set_shipping_country( $code_from_config );
776
 
777
  if(isset($zone_details['region'])){
778
  WC()->customer->set_shipping_state(wc_clean( $zone_details['region'] ));
785
  WC()->cart->add_to_cart( $product_id, $quantity );
786
 
787
  // Read cart and get schipping costs
788
+ foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
789
  $total_cost = WC()->cart->get_total();
790
  $shipping_cost = WC()->cart->get_shipping_total();
791
  $shipping_cost = wc_format_localized_price($shipping_cost);
793
  }
794
  // Make sure to empty the cart again
795
  WC()->cart->empty_cart();
796
+ // }
797
  }
798
  }
799
  }
943
  }
944
  }
945
  }
946
+
947
+ if(isset($shipping_cost)){
948
+ if(strlen($shipping_cost) > 0){
949
+ if($project_config['ship_suffix'] == "false"){
950
+ $zone_details['price'] = trim($currency." ".$shipping_cost);
951
+ } else {
952
+ $zone_details['price'] = trim($shipping_cost);
953
+ }
954
  } else {
955
+ // $shipping_cost = 0;
956
+ if(isset($shipping_cost)){
957
+ $zone_details['price'] = trim($currency." ".$shipping_cost);
958
+ }
959
+ //unset($zone_details);
960
+ //unset($shipping_cost);
961
  }
 
 
962
  }
963
  }
964
 
3954
  } else {
3955
  unlink($tmp_file);
3956
  }
 
3957
 
3958
  $batch_project = "batch_project_".$feed_config[$key]['project_hash'];
3959
  delete_option( $batch_project );
3960
  delete_option('woosea_allow_update');
3961
 
3962
+ // Make sure this option is set to no again
3963
+ // Feed should only refresh when product details have changed
3964
+ update_option('woosea_allow_update', 'no');
3965
+
3966
  // In 2 minutes from now check the amount of products in the feed and update the history count
3967
  wp_schedule_single_event( time() + 120, 'woosea_update_project_stats', array($val['project_hash']) );
3968
  } else {
4003
  $batch_project = "batch_project_".$feed_config[$key]['project_hash'];
4004
  delete_option( $batch_project );
4005
  delete_option('woosea_allow_update');
4006
+
4007
+ // Make sure this option is set to no again
4008
+ // Feed should only refresh when product details have changed
4009
+ update_option('woosea_allow_update', 'no');
4010
+
4011
  // In 2 minutes from now check the amount of products in the feed and update the history count
4012
  wp_schedule_single_event( time() + 120, 'woosea_update_project_stats', array($val['project_hash']) );
4013
  }
classes/class-update-channel.php CHANGED
@@ -221,6 +221,15 @@ class WooSEA_Update_Project {
221
  }
222
  }
223
 
 
 
 
 
 
 
 
 
 
224
  /**
225
  * Did all the filters got removed
226
  */
221
  }
222
  }
223
 
224
+ /**
225
+ * Did the option to only update the feed when products changed got disabled?
226
+ */
227
+ if(array_key_exists('fileformat', $project_data)){
228
+ if(!array_key_exists('products_changed', $project_data)) {
229
+ unset($project_config['products_changed']);
230
+ }
231
+ }
232
+
233
  /**
234
  * Did all the filters got removed
235
  */
js/woosea_key.js CHANGED
@@ -27,7 +27,7 @@ jQuery(document).ready(function($) {
27
  var license_key = $('#license-key').val();
28
 
29
  jQuery.ajax({
30
- url: 'https://www.adtribes.io/check/license.php?key=' + license_key + '&email=' + license_email + '&domain=' + root_domain + '&version=9.1.7',
31
  jsonp: 'callback',
32
  dataType: 'jsonp',
33
  type: 'GET',
27
  var license_key = $('#license-key').val();
28
 
29
  jQuery.ajax({
30
+ url: 'https://www.adtribes.io/check/license.php?key=' + license_key + '&email=' + license_email + '&domain=' + root_domain + '&version=9.1.8',
31
  jsonp: 'callback',
32
  dataType: 'jsonp',
33
  type: 'GET',
pages/admin/woosea-generate-feed-step-0.php CHANGED
@@ -492,6 +492,22 @@ if (array_key_exists('project_hash', $_GET)){
492
  </select>
493
  </td>
494
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
495
  <tr>
496
  <td colspan="2">
497
  <?php
492
  </select>
493
  </td>
494
  </tr>
495
+
496
+ <!--
497
+ <tr>
498
+ <td><span><?php _e( 'Refresh only when products changed','woo-product-feed-pro' );?>:</span></td>
499
+ <td>
500
+ <?php
501
+ if((isset($project)) AND (array_key_exists('products_changed',$project))){
502
+ print "<input name=\"products_changed\" type=\"checkbox\" class=\"checkbox-field\" checked>";
503
+ } else {
504
+ print "<input name=\"products_changed\" type=\"checkbox\" class=\"checkbox-field\">";
505
+ }
506
+ ?>
507
+ </td>
508
+ </tr>
509
+ -->
510
+
511
  <tr>
512
  <td colspan="2">
513
  <?php
pages/admin/woosea-manage-feed.php CHANGED
@@ -261,6 +261,10 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
261
  </form>
262
  <?php
263
  $toggle_count++;
 
 
 
 
264
  }
265
  }
266
  } else {
@@ -300,7 +304,7 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
300
 
301
  <table class="woo-product-feed-pro-table">
302
  <tr>
303
- <td><strong><?php _e( 'We’ve got you covered!','woo-product-feed-pro' );?></strong></td>
304
  </tr>
305
  <tr>
306
  <td>
261
  </form>
262
  <?php
263
  $toggle_count++;
264
+ } else {
265
+ // Removing this partly configured feed as it results in PHP warnings
266
+ unset($cron_projects[$key]);
267
+ update_option('cron_projects', $cron_projects);
268
  }
269
  }
270
  } else {
304
 
305
  <table class="woo-product-feed-pro-table">
306
  <tr>
307
+ <td><strong><?php _e( 'We have got you covered!','woo-product-feed-pro' );?></strong></td>
308
  </tr>
309
  <tr>
310
  <td>
readme.txt CHANGED
@@ -5,7 +5,7 @@ License URI: http://www.gnu.org/licenses/gpl.html
5
  Tags: Product Feed, Google Shopping, Google Shopping Feed, WooCommerce Product Feed, WooCommerce Product Feed PRO, Bing Shopping, Bing product feed, Bing remarking, Google Merchant Feed, Google DRM Feed, Google Dynamic Remarketing Feed, Facebook feed, Google feed, Bing feed, Facebook Product Feed, Facebook Dynamic remarketing, Data Feed, WooCommerce Feed, XML product feed, CSV product feed, TSV, TXT product feed, comparison shopping engines, comparison shopping websites, vergelijk.nl, vergelijk.be, vertaa.fi, beslist.nl, kieskeurig.nl, bol.com, raketten, pricerunner, pricegrabber, Buy, leGuide, Kelkoo, Twenga, Yandex, Etsy, Dealtime, Shopzilla, Billiger, Google Product Review feed
6
  Requires at least: 4.5
7
  Tested up to: 5.5
8
- Stable tag: 9.1.7
9
 
10
  == Description ==
11
 
@@ -321,6 +321,9 @@ Questions left or unanswered? Please do not hesitate to contact us at support@ad
321
 
322
  === Changelog ===
323
 
 
 
 
324
  = 9.1.7 (2020-11-19) =
325
  * Fixed an issue where SimpleXML did not return an object and caused the plugin to get stuck
326
 
@@ -2922,6 +2925,9 @@ Questions left or unanswered? Please do not hesitate to contact us at support@ad
2922
 
2923
  == Upgrade Notice ==
2924
 
 
 
 
2925
  = 9.1.7 =
2926
  Fixed an issue where SimpleXML did not return an object and caused the plugin to get stuck
2927
 
5
  Tags: Product Feed, Google Shopping, Google Shopping Feed, WooCommerce Product Feed, WooCommerce Product Feed PRO, Bing Shopping, Bing product feed, Bing remarking, Google Merchant Feed, Google DRM Feed, Google Dynamic Remarketing Feed, Facebook feed, Google feed, Bing feed, Facebook Product Feed, Facebook Dynamic remarketing, Data Feed, WooCommerce Feed, XML product feed, CSV product feed, TSV, TXT product feed, comparison shopping engines, comparison shopping websites, vergelijk.nl, vergelijk.be, vertaa.fi, beslist.nl, kieskeurig.nl, bol.com, raketten, pricerunner, pricegrabber, Buy, leGuide, Kelkoo, Twenga, Yandex, Etsy, Dealtime, Shopzilla, Billiger, Google Product Review feed
6
  Requires at least: 4.5
7
  Tested up to: 5.5
8
+ Stable tag: 9.1.8
9
 
10
  == Description ==
11
 
321
 
322
  === Changelog ===
323
 
324
+ = 9.1.8 (2020-11-25) =
325
+ * Fixed an issue where table rate shipping costs did not make it to custom feeds.
326
+
327
  = 9.1.7 (2020-11-19) =
328
  * Fixed an issue where SimpleXML did not return an object and caused the plugin to get stuck
329
 
2925
 
2926
  == Upgrade Notice ==
2927
 
2928
+ = 9.1.8 =
2929
+ Fixed an issue where table rate shipping costs did not make it to custom feeds.
2930
+
2931
  = 9.1.7 =
2932
  Fixed an issue where SimpleXML did not return an object and caused the plugin to get stuck
2933
 
woocommerce-sea.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Plugin Name: Product Feed PRO for WooCommerce
4
- * Version: 9.1.7
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', '9.1.7' );
52
  define( 'WOOCOMMERCESEA_PLUGIN_NAME', 'woocommerce-product-feed-pro' );
53
  define( 'WOOCOMMERCESEA_PLUGIN_NAME_SHORT', 'woo-product-feed-pro' );
54
 
@@ -753,8 +753,6 @@ register_activation_hook(__FILE__, 'activate_woosea_feed');
753
  * Close the get Elite notification
754
  **/
755
  function woosea_getelite_notification(){
756
- //delete_option('woosea_getelite_notification');
757
-
758
  $get_elite_notice = array(
759
  "show" => "no",
760
  "timestamp" => date( 'd-m-Y' )
@@ -768,9 +766,6 @@ add_action( 'wp_ajax_woosea_getelite_notification', 'woosea_getelite_notificatio
768
  * Close the get Elite activation notification
769
  **/
770
  function woosea_getelite_active_notification(){
771
-
772
- //delete_option('woosea_getelite_active_notification');
773
-
774
  $get_elite_notice = array(
775
  "show" => "no",
776
  "timestamp" => date( 'd-m-Y' )
@@ -798,14 +793,11 @@ function woosea_request_review(){
798
  $is_active = $current_time-$first_activation;
799
  $page = basename($_SERVER['REQUEST_URI']);
800
 
801
- // if (preg_match("/woo-product-feed-pro|woosea_manage_feed|woosea_manage_settings/i",$page)){
802
-
803
- if(($nr_projects > 0) AND ($is_active > $show_after) AND ($notification_interaction != "yes")){
804
  echo '<div class="notice notice-info review-notification">';
805
  echo '<table><tr><td></td><td><font color="green" style="font-weight:normal";><p>Hey, I noticed you have been using our plugin, <u>Product Feed PRO for WooCommerce by AdTribes.io</u>, for over a week now and have created product feed projects with it - that\'s awesome! Could you please do Eva and me a BIG favor and give it a 5-star rating on WordPress? Just to help us spread the word and boost our motivation. We would greatly appreciate if you would do so :)<br/>~ Adtribes.io support team<br><ul><li><span class="ui-icon ui-icon-caret-1-e" style="display: inline-block;"></span><a href="https://wordpress.org/support/plugin/woo-product-feed-pro/reviews?rate=5#new-post" target="_blank" class="dismiss-review-notification">Ok, you deserve it</a></li><li><span class="ui-icon ui-icon-caret-1-e" style="display: inline-block;"></span><a href="#" class="dismiss-review-notification">Nope, maybe later</a></li><li><span class="ui-icon ui-icon-caret-1-e" style="display: inline-block;"></span><a href="#" class="dismiss-review-notification">I already did</a></li></ul></p></font></td></tr></table>';
806
  echo '</div>';
807
- }
808
- // }
809
  }
810
  }
811
  add_action('admin_notices', 'woosea_request_review');
@@ -4199,34 +4191,6 @@ function woosea_generate_pages(){
4199
  }
4200
  }
4201
 
4202
-
4203
- /**
4204
- * This function copies feed configurations from another domain
4205
- * so users do not have to re-configure feeds for all their domains
4206
- * Other domain need to explicitly allow this
4207
- */
4208
- function woosea_copy_configurations(){
4209
-
4210
-
4211
- $domain = "adtribes.io";
4212
-
4213
- $curl = curl_init();
4214
- $url = "http://$domain/wp-content/uploads/woo-product-feed-pro/logs/debug.log";
4215
-
4216
- curl_setopt_array($curl, array(
4217
- CURLOPT_RETURNTRANSFER => 1,
4218
- CURLOPT_URL => $url,
4219
- CURLOPT_USERAGENT => 'AdTribes license cURL Request'
4220
- ));
4221
- $response = curl_exec( $curl );
4222
- curl_close($curl);
4223
-
4224
- error_log("RESPONSE");
4225
- error_log($respons);
4226
-
4227
- $json_return = json_decode($response, true);
4228
- }
4229
-
4230
  /**
4231
  * Function used by event scheduling to create feeds
4232
  * Feed can automatically be generated every hour, twicedaiy or once a day
@@ -4249,10 +4213,15 @@ function woosea_create_all_feeds(){
4249
 
4250
  // Determine if changes where made to products or new orders where placed
4251
  // Only update the feed(s) when such a change occured
4252
-
4253
  $products_changes = "no"; // default value
4254
  $products_changes = get_option('woosea_allow_update');
4255
 
 
 
 
 
 
 
4256
  if(!empty($feed_config)){
4257
  foreach ( $feed_config as $key => $val ) {
4258
 
@@ -4580,12 +4549,12 @@ function woosea_on_product_save( $product_id ) {
4580
  if(!$diff){
4581
  $diff['product_id'] = $product_id;
4582
  } else {
4583
- // Enable the prodyct changed flag
4584
  update_option('woosea_allow_update', 'yes');
4585
  }
4586
  delete_option('product_changes');
4587
  } else {
4588
- // Enable the prodyct changed flag
4589
  update_option('woosea_allow_update', 'yes');
4590
  }
4591
  }
1
  <?php
2
  /**
3
  * Plugin Name: Product Feed PRO for WooCommerce
4
+ * Version: 9.1.8
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', '9.1.8' );
52
  define( 'WOOCOMMERCESEA_PLUGIN_NAME', 'woocommerce-product-feed-pro' );
53
  define( 'WOOCOMMERCESEA_PLUGIN_NAME_SHORT', 'woo-product-feed-pro' );
54
 
753
  * Close the get Elite notification
754
  **/
755
  function woosea_getelite_notification(){
 
 
756
  $get_elite_notice = array(
757
  "show" => "no",
758
  "timestamp" => date( 'd-m-Y' )
766
  * Close the get Elite activation notification
767
  **/
768
  function woosea_getelite_active_notification(){
 
 
 
769
  $get_elite_notice = array(
770
  "show" => "no",
771
  "timestamp" => date( 'd-m-Y' )
793
  $is_active = $current_time-$first_activation;
794
  $page = basename($_SERVER['REQUEST_URI']);
795
 
796
+ if(($nr_projects > 0) AND ($is_active > $show_after) AND ($notification_interaction != "yes")){
 
 
797
  echo '<div class="notice notice-info review-notification">';
798
  echo '<table><tr><td></td><td><font color="green" style="font-weight:normal";><p>Hey, I noticed you have been using our plugin, <u>Product Feed PRO for WooCommerce by AdTribes.io</u>, for over a week now and have created product feed projects with it - that\'s awesome! Could you please do Eva and me a BIG favor and give it a 5-star rating on WordPress? Just to help us spread the word and boost our motivation. We would greatly appreciate if you would do so :)<br/>~ Adtribes.io support team<br><ul><li><span class="ui-icon ui-icon-caret-1-e" style="display: inline-block;"></span><a href="https://wordpress.org/support/plugin/woo-product-feed-pro/reviews?rate=5#new-post" target="_blank" class="dismiss-review-notification">Ok, you deserve it</a></li><li><span class="ui-icon ui-icon-caret-1-e" style="display: inline-block;"></span><a href="#" class="dismiss-review-notification">Nope, maybe later</a></li><li><span class="ui-icon ui-icon-caret-1-e" style="display: inline-block;"></span><a href="#" class="dismiss-review-notification">I already did</a></li></ul></p></font></td></tr></table>';
799
  echo '</div>';
800
+ }
 
801
  }
802
  }
803
  add_action('admin_notices', 'woosea_request_review');
4191
  }
4192
  }
4193
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4194
  /**
4195
  * Function used by event scheduling to create feeds
4196
  * Feed can automatically be generated every hour, twicedaiy or once a day
4213
 
4214
  // Determine if changes where made to products or new orders where placed
4215
  // Only update the feed(s) when such a change occured
 
4216
  $products_changes = "no"; // default value
4217
  $products_changes = get_option('woosea_allow_update');
4218
 
4219
+ if($products_changes == "no"){
4220
+ // error_log("No changes were made to products so no product refresh is needed");
4221
+ } else {
4222
+ // error_log("Yes, a product was changed. We need to refresh our product feeds");
4223
+ }
4224
+
4225
  if(!empty($feed_config)){
4226
  foreach ( $feed_config as $key => $val ) {
4227
 
4549
  if(!$diff){
4550
  $diff['product_id'] = $product_id;
4551
  } else {
4552
+ // Enable the product changed flag
4553
  update_option('woosea_allow_update', 'yes');
4554
  }
4555
  delete_option('product_changes');
4556
  } else {
4557
+ // Enable the product changed flag
4558
  update_option('woosea_allow_update', 'yes');
4559
  }
4560
  }