CTX Feed – WooCommerce Product Feed Manager Plugin - Version 3.0.31

Version Description

Download this release

Release Info

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

Code changes from version 3.0.30 to 3.0.31

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.2
7
- Stable tag: 3.0.30
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -303,6 +303,9 @@ Using pro version:
303
 
304
  == Changelog ==
305
 
 
 
 
306
  = 3.0.30(2019-05-08) =
307
  * Added: tax_country,tax_region,tax_rate,tax_ship attribute added.
308
  * Tweak: tax attribute deleted.
4
  Tags:woocommerce,google product feed,facebook product feed,woocommerce product feed,woocommerce,
5
  Requires at least: 3.6
6
  Tested Up To: 5.2
7
+ Stable tag: 3.0.31
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
303
 
304
  == Changelog ==
305
 
306
+ = 3.0.31(2019-05-13) =
307
+ * Added: billiger.de template added
308
+
309
  = 3.0.30(2019-05-08) =
310
  * Added: tax_country,tax_region,tax_rate,tax_ship attribute added.
311
  * Tweak: tax attribute deleted.
admin/js/woo-feed-admin.js CHANGED
@@ -387,6 +387,17 @@
387
  });
388
  });
389
 
 
 
 
 
 
 
 
 
 
 
 
390
  });
391
 
392
  })(jQuery);
387
  });
388
  });
389
 
390
+ // Added by: zakaria
391
+ // Adding for Copy-to-Clipboard functionality in the settings page
392
+ $("#woo_feed_settings_error_copy_clipboard_button").on('click', function()
393
+ {
394
+ $('#woo_feed_settings_error_report').select();
395
+ document.execCommand('copy');
396
+ if (window.getSelection) {window.getSelection().removeAllRanges();}
397
+ else if (document.selection) {document.selection.empty();}
398
+ });
399
+ // End
400
+
401
  });
402
 
403
  })(jQuery);
admin/partials/templates/billiger.de_add-feed.php CHANGED
@@ -387,9 +387,8 @@
387
  </select>
388
  </td>
389
  <td>
390
- <select name="attributes[]" required="required"
391
- class="wf_validate_attr wf_attr wf_attributes">
392
- <?php echo $product->attributeDropdown(); ?>
393
  </select>
394
  <input type="text" name="default[]" autocomplete="off" class="wf_default wf_attributes"
395
  style=" display: none;"/>
387
  </select>
388
  </td>
389
  <td>
390
+ <select name="attributes[]" required="required" class="wf_validate_attr wf_attr wf_attributes">
391
+ <?php echo $product->attributeDropdown('sku'); ?>
 
392
  </select>
393
  <input type="text" name="default[]" autocomplete="off" class="wf_default wf_attributes"
394
  style=" display: none;"/>
admin/partials/woo-feed-config.php CHANGED
@@ -27,6 +27,13 @@
27
  <input type="text" name="limit" value="<?php echo (get_option('woo_feed_per_batch')?get_option('woo_feed_per_batch'):"200"); ?>">
28
  <br><span><i>Don't change the value if you are not sure about this. Plugin may fail to make feed. </i></span>
29
  </td>
 
 
 
 
 
 
 
30
  </tr>
31
  <tr>
32
  <td></td>
@@ -35,4 +42,6 @@
35
  </tbody>
36
  </table>
37
  </form>
38
- </div>
 
 
27
  <input type="text" name="limit" value="<?php echo (get_option('woo_feed_per_batch')?get_option('woo_feed_per_batch'):"200"); ?>">
28
  <br><span><i>Don't change the value if you are not sure about this. Plugin may fail to make feed. </i></span>
29
  </td>
30
+ </tr>
31
+ <tr>
32
+ <td>Enable Error Debugging?</td>
33
+ <td>
34
+ <input type="checkbox" name="enable_error_debugging" value="on" <?php
35
+ echo (get_option('woo_feed_enable_error_debugging') == 'on' ? "checked" :""); ?> >
36
+ </td>
37
  </tr>
38
  <tr>
39
  <td></td>
42
  </tbody>
43
  </table>
44
  </form>
45
+
46
+
47
+
includes/class-woo-feed.php CHANGED
@@ -70,7 +70,7 @@ class Woo_Feed
70
  public function __construct()
71
  {
72
  $this->woo_feed = 'woo-feed';
73
- $this->version = '3.0.30';
74
 
75
  $this->load_dependencies();
76
  $this->set_locale();
70
  public function __construct()
71
  {
72
  $this->woo_feed = 'woo-feed';
73
+ $this->version = '3.0.31';
74
 
75
  $this->load_dependencies();
76
  $this->set_locale();
includes/classes/class-woo-feed-default-attributes.php CHANGED
@@ -184,7 +184,7 @@ class Woo_Feed_Default_Attributes
184
  // "vergelijk_comparer" => "Vergelijk.be & Comparer.be",
185
  // "kieskeurig.nl" => "Kieskeurig.nl",
186
  // "beslist.nl" => "Beslist.nl",
187
- // "billiger.de" => "Billiger.de",
188
  // "vertaa.fi" => "Vertaa.fi",
189
  // "cdiscount.fr" => "CDiscount.fr"
190
  // "fnac.fr" => "Fnac.fr",
184
  // "vergelijk_comparer" => "Vergelijk.be & Comparer.be",
185
  // "kieskeurig.nl" => "Kieskeurig.nl",
186
  // "beslist.nl" => "Beslist.nl",
187
+ "billiger.de" => "Billiger.de",
188
  // "vertaa.fi" => "Vertaa.fi",
189
  // "cdiscount.fr" => "CDiscount.fr"
190
  // "fnac.fr" => "Fnac.fr",
includes/classes/class-woo-feed-products.php CHANGED
@@ -142,10 +142,26 @@ class Woo_Feed_Products
142
  $query = new WC_Product_Query( $arg );
143
  $products = $query->get_products();
144
 
 
 
 
 
 
 
 
 
 
 
 
145
  $this->pi = 1; # Product Index
146
  foreach ( $products as $key => $productId ) {
147
  $prod=wc_get_product($productId);
148
 
 
 
 
 
 
149
  $id = $prod->get_id();
150
 
151
  if($getIDs){
@@ -163,9 +179,10 @@ class Woo_Feed_Products
163
 
164
  $simple = new WC_Product_Simple( $id );
165
 
166
- if($simple->get_status()!="publish"){
167
- continue;
168
- }
 
169
 
170
  $this->productsList[ $this->pi ]["id"] = $simple->get_id();
171
  $this->productsList[ $this->pi ]["title"] = $simple->get_name();
@@ -253,9 +270,10 @@ class Woo_Feed_Products
253
 
254
  $external = new WC_Product_External( $id );
255
 
256
- if($external->get_status()!="publish"){
257
- continue;
258
- }
 
259
 
260
  $this->productsList[ $this->pi ]["id"] = $external->get_id();
261
  $this->productsList[ $this->pi ]["title"] = $external->get_name();
@@ -342,9 +360,10 @@ class Woo_Feed_Products
342
 
343
  $grouped = new WC_Product_Grouped( $id );
344
 
345
- if($grouped->get_status()!="publish"){
346
- continue;
347
- }
 
348
 
349
  $this->productsList[ $this->pi ]["id"] = $grouped->get_id();
350
  $this->productsList[ $this->pi ]["title"] = $grouped->get_name();
@@ -356,7 +375,6 @@ class Woo_Feed_Products
356
  $this->productsList[ $this->pi ]['link'] = $grouped->get_permalink();
357
  $this->productsList[ $this->pi ]['ex_link'] = $grouped->get_permalink();
358
 
359
-
360
  # Featured Image
361
  if ( has_post_thumbnail( $id ) ):
362
  $image = wp_get_attachment_image_src( get_post_thumbnail_id( $id ), 'single-post-thumbnail' );
@@ -431,9 +449,10 @@ class Woo_Feed_Products
431
 
432
  $variable = new WC_Product_Variable( $id );
433
 
434
- if($variable->get_status()!="publish"){
435
- continue;
436
- }
 
437
 
438
 
439
  $this->productsList[ $this->pi ]["id"] = $variable->get_id();
@@ -538,9 +557,16 @@ class Woo_Feed_Products
538
  }
539
 
540
 
 
 
 
 
 
 
541
  $parentInfo=$variation->get_parent_data();
542
  $variationTitle= $parentInfo['title'];
543
 
 
544
  # Set Variation Description
545
  $description=$variation->get_description();
546
  if(empty($description)){
@@ -659,7 +685,14 @@ class Woo_Feed_Products
659
  }else{
660
  update_option("wf_check_duplicate",$this->idExist);
661
  }
662
-
 
 
 
 
 
 
 
663
  return $this->productsList;
664
  }
665
 
142
  $query = new WC_Product_Query( $arg );
143
  $products = $query->get_products();
144
 
145
+ // $upload_dir = wp_upload_dir();
146
+ // $error_log_path = $upload_dir['basedir'] . '/woo-feed/error_log.txt';
147
+ // $error_log_file = fopen($error_log_path, "a");
148
+ // $no_product_error_thrown = false;
149
+
150
+ // if(count($products) < 1)
151
+ // {
152
+ // fwrite($error_log_file, "[". date("Y-m-d H:i:s", time()) ."] NOTICE [8] No products found.\n");
153
+ // $no_product_error_thrown = true;
154
+ // }
155
+
156
  $this->pi = 1; # Product Index
157
  foreach ( $products as $key => $productId ) {
158
  $prod=wc_get_product($productId);
159
 
160
+ // if(!$prod && !is_object($prod)){
161
+ // fwrite($error_log_file, "[". date("Y-m-d H:i:s", time()) ."] NOTICE [8] The product is not an object. Product ID: ". $productId ."\n");
162
+ // continue;
163
+ // }
164
+
165
  $id = $prod->get_id();
166
 
167
  if($getIDs){
179
 
180
  $simple = new WC_Product_Simple( $id );
181
 
182
+ // if($simple->get_status()!="publish"){
183
+ // fwrite($error_log_file, "[". date("Y-m-d H:i:s", time()) ."] NOTICE [". E_NOTICE ."] A product was found to be unpublished. Skipping. Product id: " . $simple->get_id() . "\n");
184
+ // continue;
185
+ // }
186
 
187
  $this->productsList[ $this->pi ]["id"] = $simple->get_id();
188
  $this->productsList[ $this->pi ]["title"] = $simple->get_name();
270
 
271
  $external = new WC_Product_External( $id );
272
 
273
+ // if($external->get_status()!="publish"){
274
+ // fwrite($error_log_file, "[". date("Y-m-d H:i:s", time()) ."] NOTICE [". E_NOTICE ."] A product was found to be unpublished. Skipping. Product id: " . $external->get_id() . "\n");
275
+ // continue;
276
+ // }
277
 
278
  $this->productsList[ $this->pi ]["id"] = $external->get_id();
279
  $this->productsList[ $this->pi ]["title"] = $external->get_name();
360
 
361
  $grouped = new WC_Product_Grouped( $id );
362
 
363
+ // if($grouped->get_status()!="publish"){
364
+ // fwrite($error_log_file, "[". date("Y-m-d H:i:s", time()) ."] NOTICE [". E_NOTICE ."] A product was found to be unpublished. Skipping. Product id: " . $grouped->get_id() . "\n");
365
+ // continue;
366
+ // }
367
 
368
  $this->productsList[ $this->pi ]["id"] = $grouped->get_id();
369
  $this->productsList[ $this->pi ]["title"] = $grouped->get_name();
375
  $this->productsList[ $this->pi ]['link'] = $grouped->get_permalink();
376
  $this->productsList[ $this->pi ]['ex_link'] = $grouped->get_permalink();
377
 
 
378
  # Featured Image
379
  if ( has_post_thumbnail( $id ) ):
380
  $image = wp_get_attachment_image_src( get_post_thumbnail_id( $id ), 'single-post-thumbnail' );
449
 
450
  $variable = new WC_Product_Variable( $id );
451
 
452
+ // if($variable->get_status()!="publish"){
453
+ // fwrite($error_log_file, "[". date("Y-m-d H:i:s", time()) ."] NOTICE [". E_NOTICE ."] A product was found to be unpublished. Skipping. Product id: " . $variable->get_id() . "\n");
454
+ // continue;
455
+ // }
456
 
457
 
458
  $this->productsList[ $this->pi ]["id"] = $variable->get_id();
557
  }
558
 
559
 
560
+ // if($parent->get_status()!= "publish")
561
+ // {
562
+ // fwrite($error_log_file, "[". date("Y-m-d H:i:s", time()) ."] NOTICE [". E_NOTICE ."] A product was found to be unpublished. Skipping. Product id: " . $variation->get_id() . "\n");
563
+ // continue;
564
+ // }
565
+
566
  $parentInfo=$variation->get_parent_data();
567
  $variationTitle= $parentInfo['title'];
568
 
569
+
570
  # Set Variation Description
571
  $description=$variation->get_description();
572
  if(empty($description)){
685
  }else{
686
  update_option("wf_check_duplicate",$this->idExist);
687
  }
688
+
689
+ // if(!$no_product_error_thrown && ($this->productsList == "" || count($this->productsList) == 0))
690
+ // {
691
+ // fwrite($error_log_file, "[". date("Y-m-d H:i:s", time()) ."] NOTICE [8] No products found.\n");
692
+ // }
693
+ //
694
+ // fclose($error_log_file);
695
+
696
  return $this->productsList;
697
  }
698
 
woo-feed.php CHANGED
@@ -16,7 +16,7 @@
16
  * Plugin Name: WooCommerce Product Feed
17
  * Plugin URI: https://webappick.com/
18
  * Description: This plugin generate WooCommerce product feed for Shopping Engines like Google Shopping,Facebook Product Feed,eBay,Amazon,Idealo and many more..
19
- * Version: 3.0.30
20
  * Author: WebAppick
21
  * Author URI: https://webappick.com/
22
  * License: GPL v2
@@ -85,7 +85,74 @@ function run_woo_feed()
85
 
86
  run_woo_feed();
87
 
88
- #Custom Cron Recurrences
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  function custom_cron_job_custom_recurrence($schedules)
90
  {
91
  $interval = get_option('wf_schedule');
@@ -107,11 +174,11 @@ add_action('wp_ajax_get_feed_merchant', 'feed_merchant_view');
107
  function feed_merchant_view()
108
  {
109
  check_ajax_referer('wpf_feed_nonce');
110
- $dropDown = new Woo_Feed_Dropdown();
111
- $product = new Woo_Feed_Products();
112
- $attributes=new Woo_Feed_Default_Attributes();
113
- $merchant = sanitize_text_field($_POST['merchant']);
114
- $provider = sanitize_text_field($_POST['merchant']);
115
  if(strpos($merchant,'amazon')!==false){
116
  include plugin_dir_path(__FILE__) . "admin/partials/templates/amazon_add-feed.php";
117
  }
@@ -146,13 +213,11 @@ function woo_feed_add_update($info = "", $name = "")
146
  }
147
 
148
 
149
-
150
  $feedService = sanitize_text_field($info['provider']);
151
  $fileName = str_replace(" ", "", sanitize_text_field($info['filename']));
152
  $type = sanitize_text_field($info['feedType']);
153
 
154
  $feedRules = $info;
155
-
156
 
157
  # Get Feed info
158
  $products = new Woo_Generate_Feed($merchant, $feedRules);
@@ -165,7 +230,6 @@ function woo_feed_add_update($info = "", $name = "")
165
  }else{
166
  $string=array();
167
  }
168
-
169
  }else{
170
  $string=$getString['header'].$getString['body'].$getString['footer'];
171
  }
@@ -297,8 +361,8 @@ function woo_feed_get_product_information(){
297
  'status' => 'publish',
298
  'orderby' => 'date',
299
  'order' => 'DESC',
300
- 'type' => array('variable','variation','simple','grouped','external'),
301
- 'return' => 'ids',
302
  ));
303
  $products=$query->get_products();
304
  $totalProducts=count($products);
@@ -766,19 +830,32 @@ function woo_feed_manage_feed()
766
  }
767
 
768
  $merchants=array(
769
- "custom","fruugo","twenga","pricespy","prisjakt","amazon","adwords","polyvore","bol","pricerunner","adform","bonanza","leeguide","real","crowdfox","jet","wish","google_local_inventory", "google_local", "zap.co.il", "fruugo.au", "myshopping.com.au", "smartly.io", "stylight.com", "nextad", "skinflint.co.uk", "yahoo_nfa", "pinterest"
770
- // "comparer.be",
771
- // "dooyoo",
772
- // "hintaseuranta.fi",
773
- // "incurvy",
774
- // "kijiji.ca",
775
- // "marktplaats.nl",
776
- ,"rakuten"
777
- // "shopalike.fr",
778
- // "spartoo.fi",
779
- // "webmarchand"
780
- // "fashiola"
781
- // 'vergelijk_comparer'
 
 
 
 
 
 
 
 
 
 
 
 
 
782
  ,"kieskeurig.nl",
783
  'beslist.nl',
784
  "billiger.de",
@@ -824,10 +901,26 @@ function woo_feed_pro_vs_free(){
824
  * Feed config
825
  */
826
  function woo_feed_config_feed(){
827
-
828
  if(isset($_POST['wa_woo_feed_config'])) {
829
  update_option("woo_feed_per_batch",sanitize_text_field($_POST['limit']));
 
 
 
 
 
 
 
 
830
  }
 
 
 
 
 
 
 
 
 
831
 
832
  require plugin_dir_path(__FILE__) . 'admin/partials/woo-feed-config.php';
833
  }
@@ -1168,166 +1261,16 @@ function woo_feed_save_wpml_notice() {
1168
  wp_send_json_success();
1169
  }
1170
 
1171
- // Add GTIN, MPN, UPC, EAN, Brand, Age Group custom fields in variations menu
1172
- //add_action('woocommerce_product_after_variable_attributes', 'woo_feed_add_variation_options', 10, 3);
1173
- //
1174
- //function woo_feed_add_variation_options($loop, $variation_data, $variation)
1175
- //{
1176
- // woocommerce_wp_text_input([
1177
- // "id" => 'woo_feed_gtin[' . $loop . ']',
1178
- // "class" => "short",
1179
- // "placeholder" => "GTIN",
1180
- // "label" => __('GTIN <br>', 'woo-feed'),
1181
- // "value" => get_post_meta($variation->ID, 'woo_feed_gtin', true),
1182
- // ]);
1183
- //
1184
- // woocommerce_wp_text_input([
1185
- // "id" => 'woo_feed_mpn[' . $loop . ']',
1186
- // "class" => "short",
1187
- // "placeholder" => "MPN",
1188
- // "label" => __('MPN <br>', 'woo-feed'),
1189
- // "value" => get_post_meta($variation->ID, 'woo_feed_mpn', true),
1190
- // ]);
1191
- //
1192
- // woocommerce_wp_text_input([
1193
- // "id" => 'woo_feed_upc[' . $loop . ']',
1194
- // "class" => "short",
1195
- // "placeholder" => "UPC",
1196
- // "label" => __('UPC <br>', 'woo-feed'),
1197
- // "value" => get_post_meta($variation->ID, 'woo_feed_upc', true),
1198
- // ]);
1199
- //
1200
- // woocommerce_wp_text_input([
1201
- // "id" => 'woo_feed_ean[' . $loop . ']',
1202
- // "class" => "short",
1203
- // "placeholder" => "EAN",
1204
- // "label" => __('EAN <br>', 'woo-feed'),
1205
- // "value" => get_post_meta($variation->ID, 'woo_feed_ean', true),
1206
- // ]);
1207
- //
1208
- // woocommerce_wp_text_input([
1209
- // "id" => 'woo_feed_brand[' . $loop . ']',
1210
- // "class" => "short",
1211
- // "placeholder" => "Brand",
1212
- // "label" => __('Brand <br>', 'woo-feed'),
1213
- // "value" => get_post_meta($variation->ID, 'woo_feed_brand', true),
1214
- // ]);
1215
- //
1216
- // woocommerce_wp_text_input([
1217
- // "id" => 'woo_feed_age_group[' . $loop . ']',
1218
- // "class" => "short",
1219
- // "placeholder" => "Age Group",
1220
- // "label" => __('Age Group <br>', 'woo-feed'),
1221
- // "value" => get_post_meta($variation->ID, 'woo_feed_age_group', true),
1222
- // ]);
1223
- //}
1224
- //
1225
- //add_action( 'woocommerce_save_product_variation', 'woo_feed_save_custom_field_variations', 10, 2 );
1226
- //
1227
- //function woo_feed_save_custom_field_variations( $variation_id, $i ) {
1228
- // $gtin_field = $_POST['woo_feed_gtin'][$i];
1229
- // if ( isset( $gtin_field ) ) update_post_meta( $variation_id, 'woo_feed_gtin', esc_attr( $gtin_field ) );
1230
- //
1231
- // $mpn_field = $_POST['woo_feed_mpn'][$i];
1232
- // if ( isset( $mpn_field ) ) update_post_meta( $variation_id, 'woo_feed_mpn', esc_attr( $mpn_field ) );
1233
- //
1234
- // $upc_field = $_POST['woo_feed_upc'][$i];
1235
- // if ( isset( $upc_field ) ) update_post_meta( $variation_id, 'woo_feed_upc', esc_attr( $upc_field ) );
1236
- //
1237
- // $ean_field = $_POST['woo_feed_ean'][$i];
1238
- // if ( isset( $ean_field ) ) update_post_meta( $variation_id, 'woo_feed_ean', esc_attr( $ean_field ) );
1239
- //
1240
- // $brand_field = $_POST['woo_feed_brand'][$i];
1241
- // if ( isset( $brand_field ) ) update_post_meta( $variation_id, 'woo_feed_brand', esc_attr( $brand_field ) );
1242
- //
1243
- // $age_group_field = $_POST['woo_feed_age_group'][$i];
1244
- // if ( isset( $age_group_field ) ) update_post_meta( $variation_id, 'woo_feed_age_group', esc_attr( $age_group_field ) );
1245
- //}
1246
- //
1247
- //add_filter( 'woocommerce_available_variation', 'wpp_feed_add_custom_field_variation_data' );
1248
- //
1249
- //function wpp_feed_add_custom_field_variation_data( $variations ) {
1250
- // $variations['woo_feed_gtin'] = '<div class="woocommerce_gtin_field">GTIN Field: <span>' . get_post_meta( $variations[ 'variation_id' ], 'woo_feed_gtin', true ) . '</span></div>';
1251
- // $variations['woo_feed_mpn'] = '<div class="woocommerce_mpn_field">MPN Field: <span>' . get_post_meta( $variations[ 'variation_id' ], 'woo_feed_mpn', true ) . '</span></div>';
1252
- // $variations['woo_feed_upc'] = '<div class="woocommerce_upc_field">UPC Field: <span>' . get_post_meta( $variations[ 'variation_id' ], 'woo_feed_upc', true ) . '</span></div>';
1253
- // $variations['woo_feed_ean'] = '<div class="woocommerce_ean_field">EAN Field: <span>' . get_post_meta( $variations[ 'variation_id' ], 'woo_feed_ean', true ) . '</span></div>';
1254
- // $variations['woo_feed_brand'] = '<div class="woocommerce_brand_field">Brand Field: <span>' . get_post_meta( $variations[ 'variation_id' ], 'woo_feed_brand', true ) . '</span></div>';
1255
- // $variations['woo_feed_age_group'] = '<div class="woocommerce_age_group_field">Age Group Field: <span>' . get_post_meta( $variations[ 'variation_id' ], 'woo_feed_age_group', true ) . '</span></div>';
1256
- // return $variations;
1257
- //}
1258
- //
1259
- //// Add custom fields in general menu - GTIN, MPN, UPC, EAN, Brand, Age group
1260
- //add_action('woocommerce_product_options_general_product_data', "woo_feed_add_general_custom_fields");
1261
- //
1262
- //function woo_feed_add_general_custom_fields()
1263
  //{
1264
- // woocommerce_wp_text_input([
1265
- // "id" => 'woo_feed_gtin',
1266
- // "class" => "short",
1267
- // "placeholder" => "GTIN",
1268
- // "label" => __('GTIN', 'woo-feed'),
1269
- // ]);
1270
- //
1271
- // woocommerce_wp_text_input([
1272
- // "id" => 'woo_feed_mpn',
1273
- // "class" => "short",
1274
- // "placeholder" => "MPN",
1275
- // "label" => __('MPN', 'woo-feed'),
1276
- // ]);
1277
- //
1278
- // woocommerce_wp_text_input([
1279
- // "id" => 'woo_feed_upc',
1280
- // "class" => "short",
1281
- // "placeholder" => "UPC",
1282
- // "label" => __('UPC', 'woo-feed'),
1283
- // ]);
1284
- //
1285
- // woocommerce_wp_text_input([
1286
- // "id" => 'woo_feed_ean',
1287
- // "class" => "short",
1288
- // "placeholder" => "EAN",
1289
- // "label" => __('EAN', 'woo-feed'),
1290
- // ]);
1291
- //
1292
- // woocommerce_wp_text_input([
1293
- // "id" => 'woo_feed_brand',
1294
- // "class" => "short",
1295
- // "placeholder" => "Brand",
1296
- // "label" => __('Brand', 'woo-feed'),
1297
- // ]);
1298
- //
1299
- // woocommerce_wp_text_input([
1300
- // "id" => 'woo_feed_age_group',
1301
- // "class" => "short",
1302
- // "placeholder" => "Age Group",
1303
- // "label" => __('Age Group', 'woo-feed'),
1304
- // ]);
1305
  //}
1306
- //
1307
- //// save custom fields in general menu
1308
- //add_action('woocommerce_process_product_meta', "woo_feed_save_general_custom_fields");
1309
- //
1310
- //function woo_feed_save_general_custom_fields($product_id)
1311
- //{
1312
- // $product = wc_get_product( $product_id );
1313
- //
1314
- // $gtin = (isset( $_POST['woo_feed_gtin'] ) && ($_POST['woo_feed_gtin'] != "Array" && gettype($_POST['woo_feed_gtin']) != "array")) ? $_POST['woo_feed_gtin'] : '';
1315
- // $product->update_meta_data('woo_feed_gtin', sanitize_text_field($gtin));
1316
- //
1317
- // $mpn = (isset( $_POST['woo_feed_mpn'] ) && ($_POST['woo_feed_mpn'] != "Array" && gettype($_POST['woo_feed_mpn']) != "array")) ? $_POST['woo_feed_mpn'] : '';
1318
- // $product->update_meta_data('woo_feed_mpn', sanitize_text_field($mpn));
1319
- //
1320
- // $upc = (isset( $_POST['woo_feed_upc'] ) && ($_POST['woo_feed_upc'] != "Array" && gettype($_POST['woo_feed_upc']) != "array")) ? $_POST['woo_feed_upc'] : '';
1321
- // $product->update_meta_data('woo_feed_upc', sanitize_text_field($upc));
1322
- //
1323
- // $ean = (isset( $_POST['woo_feed_ean'] ) && ($_POST['woo_feed_ean'] != "Array" && gettype($_POST['woo_feed_ean']) != "array")) ? $_POST['woo_feed_ean'] : '';
1324
- // $product->update_meta_data('woo_feed_ean', sanitize_text_field($ean));
1325
- //
1326
- // $brand = (isset( $_POST['woo_feed_brand'] ) && ($_POST['woo_feed_brand'] != "Array" && gettype($_POST['woo_feed_brand']) != "array")) ? $_POST['woo_feed_brand'] : '';
1327
- // $product->update_meta_data('woo_feed_brand', sanitize_text_field($brand));
1328
- // $product->save();
1329
- //
1330
- // $age_group = (isset( $_POST['woo_feed_age_group'] ) && ($_POST['woo_feed_age_group'] != "Array" && gettype($_POST['woo_feed_age_group']) != "array")) ? $_POST['woo_feed_age_group'] : '';
1331
- // $product->update_meta_data('woo_feed_age_group', sanitize_text_field($age_group));
1332
- // $product->save();
1333
- //}
16
  * Plugin Name: WooCommerce Product Feed
17
  * Plugin URI: https://webappick.com/
18
  * Description: This plugin generate WooCommerce product feed for Shopping Engines like Google Shopping,Facebook Product Feed,eBay,Amazon,Idealo and many more..
19
+ * Version: 3.0.31
20
  * Author: WebAppick
21
  * Author URI: https://webappick.com/
22
  * License: GPL v2
85
 
86
  run_woo_feed();
87
 
88
+ //error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
89
+ //
90
+ //// error handler function
91
+ //function woo_feed_myErrorHandler($errno, $errstr, $errfile, $errline)
92
+ //{
93
+ // if (!(error_reporting() & $errno)) {
94
+ // // This error code is not included in error_reporting, so let it fall
95
+ // // through to the standard PHP error handler
96
+ // return false;
97
+ // }
98
+ //
99
+ // $upload_dir = wp_upload_dir();
100
+ // $woo_feed_path = $upload_dir['basedir'] . '/woo-feed';
101
+ //
102
+ // if(!file_exists($woo_feed_path))
103
+ // {
104
+ // mkdir($woo_feed_path, 0777);
105
+ // }
106
+ //
107
+ // $log_file_path = $woo_feed_path . '/error_log.txt';
108
+ //
109
+ // $log_file = fopen($log_file_path, "a");
110
+ //
111
+ // switch ($errno) {
112
+ // case E_ERROR:
113
+ // fwrite($log_file, "[". date("Y-m-d H:i:s", time()) ."] FATAL ERROR [$errno] $errstr in $errfile, line no: $errline, PHP " . PHP_VERSION . " (" . PHP_OS . ")\n");
114
+ // break;
115
+ //
116
+ // case E_WARNING:
117
+ // // echo "<b>My WARNING</b> [$errno] $errstr<br />\n";
118
+ // fwrite($log_file, "[". date("Y-m-d H:i:s", time()) ."] WARNING [$errno] $errstr in $errfile, line no: $errline\n");
119
+ // break;
120
+ //
121
+ // case E_NOTICE:
122
+ // // echo "<b>My NOTICE</b> [$errno] $errstr<br />\n";
123
+ // fwrite($log_file, "[". date("Y-m-d H:i:s", time()) ."] NOTICE [$errno] $errstr in $errfile, line no: $errline\n");
124
+ // break;
125
+ //
126
+ // default:
127
+ // // echo "Unknown error type: [$errno] $errstr<br />\n";
128
+ // fwrite($log_file, "Unkown error [". date("Y-m-d H:i:s", time()) ."] type: [$errno] $errstr in $errfile, line no: $errline\n");
129
+ // break;
130
+ // }
131
+ //
132
+ // fclose($log_file);
133
+ // chmod($log_file_path, 0777);
134
+ // /* Don't execute PHP internal error handler */
135
+ // return true;
136
+ //}
137
+ //
138
+ //
139
+ //$error_debuggin_enabled = get_option('woo_feed_enable_error_debugging');
140
+ //function fatalErrorShutdownHandler()
141
+ //{
142
+ // $last_error = error_get_last();
143
+ // if ($last_error['type'] === E_ERROR) {
144
+ // // fatal error
145
+ // myErrorHandler(E_ERROR, $last_error['message'], $last_error['file'], $last_error['line']);
146
+ // }
147
+ //}
148
+ //
149
+ //if($error_debuggin_enabled == 'on')
150
+ //{
151
+ // set_error_handler("myErrorHandler");
152
+ // register_shutdown_function('fatalErrorShutdownHandler');
153
+ //}
154
+
155
+ # Custom Cron Recurrences
156
  function custom_cron_job_custom_recurrence($schedules)
157
  {
158
  $interval = get_option('wf_schedule');
174
  function feed_merchant_view()
175
  {
176
  check_ajax_referer('wpf_feed_nonce');
177
+ $dropDown = new Woo_Feed_Dropdown();
178
+ $product = new Woo_Feed_Products();
179
+ $attributes = new Woo_Feed_Default_Attributes();
180
+ $merchant = sanitize_text_field($_POST['merchant']);
181
+ $provider = sanitize_text_field($_POST['merchant']);
182
  if(strpos($merchant,'amazon')!==false){
183
  include plugin_dir_path(__FILE__) . "admin/partials/templates/amazon_add-feed.php";
184
  }
213
  }
214
 
215
 
 
216
  $feedService = sanitize_text_field($info['provider']);
217
  $fileName = str_replace(" ", "", sanitize_text_field($info['filename']));
218
  $type = sanitize_text_field($info['feedType']);
219
 
220
  $feedRules = $info;
 
221
 
222
  # Get Feed info
223
  $products = new Woo_Generate_Feed($merchant, $feedRules);
230
  }else{
231
  $string=array();
232
  }
 
233
  }else{
234
  $string=$getString['header'].$getString['body'].$getString['footer'];
235
  }
361
  'status' => 'publish',
362
  'orderby' => 'date',
363
  'order' => 'DESC',
364
+ 'type' => array('variable','variation','simple','grouped','external'),
365
+ 'return' => 'ids',
366
  ));
367
  $products=$query->get_products();
368
  $totalProducts=count($products);
830
  }
831
 
832
  $merchants=array(
833
+ "custom","fruugo",
834
+ "twenga","pricespy",
835
+ "prisjakt","amazon",
836
+ "adwords","polyvore",
837
+ "bol","pricerunner",
838
+ "adform","bonanza",
839
+ "leeguide","real",
840
+ "crowdfox","jet",
841
+ "wish","google_local_inventory",
842
+ "google_local", "zap.co.il",
843
+ "fruugo.au", "myshopping.com.au",
844
+ "smartly.io", "stylight.com",
845
+ "nextad", "skinflint.co.uk",
846
+ "yahoo_nfa", "pinterest",
847
+ "comparer.be",
848
+ "dooyoo",
849
+ "hintaseuranta.fi",
850
+ "incurvy",
851
+ "kijiji.ca",
852
+ "marktplaats.nl",
853
+ "rakuten",
854
+ "shopalike.fr",
855
+ "spartoo.fi",
856
+ "webmarchand",
857
+ "fashiola",
858
+ 'vergelijk_comparer'
859
  ,"kieskeurig.nl",
860
  'beslist.nl',
861
  "billiger.de",
901
  * Feed config
902
  */
903
  function woo_feed_config_feed(){
 
904
  if(isset($_POST['wa_woo_feed_config'])) {
905
  update_option("woo_feed_per_batch",sanitize_text_field($_POST['limit']));
906
+ if(isset($_POST['enable_error_debugging']))
907
+ {
908
+ update_option("woo_feed_enable_error_debugging", sanitize_text_field($_POST['enable_error_debugging']));
909
+ }
910
+ else
911
+ {
912
+ update_option("woo_feed_enable_error_debugging", "off");
913
+ }
914
  }
915
+ // $upload_dir = wp_upload_dir();
916
+ // $error_debuggin_enabled = get_option('woo_feed_enable_error_debugging');
917
+
918
+ // $error_file_path = $upload_dir['basedir'] . '/woo-feed/error_log.txt';
919
+ // $errors = '';
920
+ // if($error_debuggin_enabled == 'on' && file_exists($error_file_path))
921
+ // {
922
+ // $errors = file_get_contents($error_file_path);
923
+ // }
924
 
925
  require plugin_dir_path(__FILE__) . 'admin/partials/woo-feed-config.php';
926
  }
1261
  wp_send_json_success();
1262
  }
1263
 
1264
+
1265
+
1266
+ //$error_handler = set_error_handler("woo_feed_myErrorHandler");
1267
+ //register_shutdown_function('woo_feed_fatalErrorShutdownHandler');
1268
+ //function woo_feed_fatalErrorShutdownHandler()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1269
  //{
1270
+ // $last_error = error_get_last();
1271
+ // if ($last_error['type'] === E_ERROR) {
1272
+ // // fatal error
1273
+ // woo_feed_myErrorHandler(E_ERROR,$last_error['message'],$last_error['file'],$last_error['line']);
1274
+ // }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1275
  //}
1276
+