Product Import Export for WooCommerce - Version 1.9.3

Version Description

  • Bug fix:- Delete temp file after import
Download this release

Release Info

Developer webtoffee
Plugin Icon 128x128 Product Import Export for WooCommerce
Version 1.9.3
Comparing to
See all releases

Code changes from version 1.9.2 to 1.9.3

includes/importer/class-wf-prodimpexpcsv-product-import.php CHANGED
@@ -45,7 +45,6 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
45
  }
46
 
47
  $this->import_page = 'xa_woocommerce_csv';
48
- $this->file_url_import_enabled = apply_filters( 'woocommerce_csv_product_file_url_import_enabled', true );
49
  }
50
 
51
  /**
@@ -91,8 +90,6 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
91
 
92
  check_admin_referer( 'import-upload' );
93
 
94
- if(!empty($_GET['file_url']))
95
- $this->file_url = esc_attr( $_GET['file_url'] );
96
  if(!empty($_GET['file_id']))
97
  $this->id = absint($_GET['file_id']) ;
98
 
@@ -108,13 +105,9 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
108
 
109
  $this->id = absint($_POST['import_id']) ;
110
 
111
- if ( $this->file_url_import_enabled )
112
- $this->file_url = esc_attr( $_POST['import_url'] );
113
 
114
  if ( $this->id )
115
  $file = get_attached_file( $this->id );
116
- else if ( $this->file_url_import_enabled )
117
- $file = ABSPATH . $this->file_url;
118
 
119
  $file = str_replace( "\\", "/", $file );
120
 
@@ -527,8 +520,6 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
527
 
528
  if ( $this->id )
529
  $file = get_attached_file( $this->id );
530
- else if ( $this->file_url_import_enabled )
531
- $file = ABSPATH . $this->file_url;
532
  else
533
  return;
534
 
@@ -564,7 +555,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
564
  $saved_evaluation = null;
565
  if($mapping_from_db && is_array($mapping_from_db) && count($mapping_from_db) == 2 && empty($_GET['clearmapping'])){
566
  //if(count(array_intersect_key ( $mapping_from_db[0] , $row)) == count($mapping_from_db[0])){
567
- $reset_action = 'admin.php?clearmapping=1&import=' . $this->import_page . '&step=1&merge=' . $this->merge . '&file_url=' . $this->file_url . '&delimiter=' . $this->delimiter . '&merge_empty_cells=' . $this->merge_empty_cells . '&file_id=' . $this->id . '';
568
  $reset_action = esc_attr(wp_nonce_url($reset_action, 'import-upload'));
569
  echo '<h3>' . __( 'Map to fields are pre-selected based on your last import. <a href="'.$reset_action.'">Click here</a> to clear saved mapping.', 'product-import-export-for-woo' ) . '</h3>';
570
  $saved_mapping = $mapping_from_db[0];
@@ -694,36 +685,16 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
694
  */
695
  public function handle_upload() {
696
 
697
- if ( empty( $_POST['file_url'] ) ) {
698
 
699
- $file = wp_import_handle_upload();
700
-
701
- if ( isset( $file['error'] ) ) {
702
- echo '<p><strong>' . __( 'Sorry, there has been an error.', 'product-import-export-for-woo' ) . '</strong><br />';
703
- echo esc_html( $file['error'] ) . '</p>';
704
- return false;
705
- }
706
-
707
- $this->id = (int) $file['id'];
708
- return true;
709
-
710
- } else {
711
-
712
- if ( file_exists( ABSPATH . $_POST['file_url'] ) ) {
713
-
714
- $this->file_url = esc_attr( $_POST['file_url'] );
715
- return true;
716
-
717
- } else {
718
-
719
- echo '<p><strong>' . __( 'Sorry, there has been an error.', 'product-import-export-for-woo' ) . '</strong></p>';
720
- return false;
721
-
722
- }
723
-
724
- }
725
 
726
- return false;
 
727
  }
728
 
729
  public function product_exists( $title, $sku = '', $post_name = '' ) {
45
  }
46
 
47
  $this->import_page = 'xa_woocommerce_csv';
 
48
  }
49
 
50
  /**
90
 
91
  check_admin_referer( 'import-upload' );
92
 
 
 
93
  if(!empty($_GET['file_id']))
94
  $this->id = absint($_GET['file_id']) ;
95
 
105
 
106
  $this->id = absint($_POST['import_id']) ;
107
 
 
 
108
 
109
  if ( $this->id )
110
  $file = get_attached_file( $this->id );
 
 
111
 
112
  $file = str_replace( "\\", "/", $file );
113
 
520
 
521
  if ( $this->id )
522
  $file = get_attached_file( $this->id );
 
 
523
  else
524
  return;
525
 
555
  $saved_evaluation = null;
556
  if($mapping_from_db && is_array($mapping_from_db) && count($mapping_from_db) == 2 && empty($_GET['clearmapping'])){
557
  //if(count(array_intersect_key ( $mapping_from_db[0] , $row)) == count($mapping_from_db[0])){
558
+ $reset_action = 'admin.php?clearmapping=1&amp;import=' . $this->import_page . '&amp;step=1&amp;merge=' . $this->merge . '&amp;delimiter=' . $this->delimiter . '&amp;merge_empty_cells=' . $this->merge_empty_cells . '&amp;file_id=' . $this->id . '';
559
  $reset_action = esc_attr(wp_nonce_url($reset_action, 'import-upload'));
560
  echo '<h3>' . __( 'Map to fields are pre-selected based on your last import. <a href="'.$reset_action.'">Click here</a> to clear saved mapping.', 'product-import-export-for-woo' ) . '</h3>';
561
  $saved_mapping = $mapping_from_db[0];
685
  */
686
  public function handle_upload() {
687
 
688
+ $file = wp_import_handle_upload();
689
 
690
+ if ( isset( $file['error'] ) ) {
691
+ echo '<p><strong>' . __( 'Sorry, there has been an error.', 'product-import-export-for-woo' ) . '</strong><br />';
692
+ echo esc_html( $file['error'] ) . '</p>';
693
+ return false;
694
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
695
 
696
+ $this->id = (int) $file['id'];
697
+ return true;
698
  }
699
 
700
  public function product_exists( $title, $sku = '', $post_name = '' ) {
includes/importer/views/html-wf-import-options.php CHANGED
@@ -13,9 +13,6 @@ if ( ! defined( 'ABSPATH' ) ) {
13
  <form action="<?php echo admin_url('admin.php?import=' . $this->import_page . '&step=2&merge=' . $this->merge); ?>" method="post">
14
  <?php wp_nonce_field('import-woocommerce'); ?>
15
  <input type="hidden" name="import_id" value="<?php echo $this->id; ?>" />
16
- <?php if ($this->file_url_import_enabled) : ?>
17
- <input type="hidden" name="import_url" value="<?php echo $this->file_url; ?>" />
18
- <?php endif; ?>
19
  <h3><?php _e('Step 2: Import mapping', 'product-import-export-for-woo'); ?></h3>
20
  <p><?php _e('Here you can map your imported columns to product data fields.', 'product-import-export-for-woo'); ?></p>
21
  <table class="widefat widefat_importer">
13
  <form action="<?php echo admin_url('admin.php?import=' . $this->import_page . '&step=2&merge=' . $this->merge); ?>" method="post">
14
  <?php wp_nonce_field('import-woocommerce'); ?>
15
  <input type="hidden" name="import_id" value="<?php echo $this->id; ?>" />
 
 
 
16
  <h3><?php _e('Step 2: Import mapping', 'product-import-export-for-woo'); ?></h3>
17
  <p><?php _e('Here you can map your imported columns to product data fields.', 'product-import-export-for-woo'); ?></p>
18
  <table class="widefat widefat_importer">
product-import-export-for-woo.php CHANGED
@@ -5,7 +5,7 @@
5
  Description: Import and Export Products From and To your WooCommerce Store.
6
  Author: WebToffee
7
  Author URI: https://www.webtoffee.com/product/product-import-export-woocommerce/
8
- Version: 1.9.2
9
  WC tested up to: 5.2.2
10
  License: GPLv3
11
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -18,7 +18,7 @@ if ( !defined( 'ABSPATH' ) || !is_admin() ) {
18
 
19
 
20
  if ( !defined( 'WF_PIPE_CURRENT_VERSION' ) ) {
21
- define( "WF_PIPE_CURRENT_VERSION", "1.9.2" );
22
  }
23
  if ( !defined( 'WF_PROD_IMP_EXP_ID' ) ) {
24
  define( "WF_PROD_IMP_EXP_ID", "wf_prod_imp_exp" );
@@ -250,17 +250,30 @@ if ( !class_exists( 'WF_Product_Import_Export_CSV' ) ) :
250
  /*
251
  * Displays update information for the plugin.
252
  */
253
-
254
  public function wt_product_import_export_for_woo_update_message( $data, $response ) {
255
  if ( isset( $data[ 'upgrade_notice' ] ) ) {
 
256
  printf(
257
  '<div class="update-message wt-update-message">%s</div>', $data[ 'upgrade_notice' ]
258
  );
259
  }
260
  }
261
-
 
 
 
 
 
 
 
 
 
 
 
 
 
262
  }
263
 
264
  endif;
265
 
266
- new WF_Product_Import_Export_CSV();
5
  Description: Import and Export Products From and To your WooCommerce Store.
6
  Author: WebToffee
7
  Author URI: https://www.webtoffee.com/product/product-import-export-woocommerce/
8
+ Version: 1.9.3
9
  WC tested up to: 5.2.2
10
  License: GPLv3
11
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
18
 
19
 
20
  if ( !defined( 'WF_PIPE_CURRENT_VERSION' ) ) {
21
+ define( "WF_PIPE_CURRENT_VERSION", "1.9.3" );
22
  }
23
  if ( !defined( 'WF_PROD_IMP_EXP_ID' ) ) {
24
  define( "WF_PROD_IMP_EXP_ID", "wf_prod_imp_exp" );
250
  /*
251
  * Displays update information for the plugin.
252
  */
 
253
  public function wt_product_import_export_for_woo_update_message( $data, $response ) {
254
  if ( isset( $data[ 'upgrade_notice' ] ) ) {
255
+ add_action( 'admin_print_footer_scripts', array($this,'wt_product_imex_basic_plugin_screen_update_js') );
256
  printf(
257
  '<div class="update-message wt-update-message">%s</div>', $data[ 'upgrade_notice' ]
258
  );
259
  }
260
  }
261
+
262
+ function wt_product_imex_basic_plugin_screen_update_js() {
263
+ ?>
264
+ <script>
265
+ ( function ( $ ) {
266
+ var update_dv = $( '#product-import-export-for-woo-update' );
267
+ update_dv.find( '.wt-product-update-message' ).next( 'p' ).remove();
268
+ update_dv.find( 'a.update-link:eq(0)' ).click( function () {
269
+ $( '.wt-product-update-message' ).remove();
270
+ } );
271
+ } )( jQuery );
272
+ </script>
273
+ <?php
274
+ }
275
  }
276
 
277
  endif;
278
 
279
+ new WF_Product_Import_Export_CSV();
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: woocommerce product import, woocommerce import products, woocommerce expor
5
  Requires at least: 3.0.1
6
  Tested up to: 5.7
7
  Requires PHP: 5.6
8
- Stable tag: 1.9.2
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -157,6 +157,9 @@ By default, admin and store manager are given access to export orders from your
157
 
158
  == Changelog ==
159
 
 
 
 
160
  = 1.9.2 =
161
  * Tested OK with WC 5.2.2
162
 
@@ -429,5 +432,5 @@ By default, admin and store manager are given access to export orders from your
429
 
430
  == Upgrade Notice ==
431
 
432
- = 1.9.2 =
433
- * Tested OK with WC 5.2.2
5
  Requires at least: 3.0.1
6
  Tested up to: 5.7
7
  Requires PHP: 5.6
8
+ Stable tag: 1.9.3
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
157
 
158
  == Changelog ==
159
 
160
+ = 1.9.3 =
161
+ * Bug fix:- Delete temp file after import
162
+
163
  = 1.9.2 =
164
  * Tested OK with WC 5.2.2
165
 
432
 
433
  == Upgrade Notice ==
434
 
435
+ = 1.9.3 =
436
+ * Bug fix:- Delete temp file after import