Product Import Export for WooCommerce - Version 1.1.7

Version Description

  • Enhancement: Security improvements.
Download this release

Release Info

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

Code changes from version 1.1.6 to 1.1.7

Files changed (2) hide show
  1. product-csv-import-export.php +18 -1
  2. readme.txt +5 -1
product-csv-import-export.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.xadapter.com/product/product-import-export-plugin-for-woo
5
  Description: Import and Export Products From and To your WooCommerce Store.
6
  Author: HikeForce
7
  Author URI: http://www.xadapter.com/vendor/hikeforce/
8
- Version: 1.1.6
9
  Text Domain: wf_csv_import_export
10
  */
11
 
@@ -80,8 +80,13 @@ if (in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', ge
80
  if ( ! empty( $_GET['action'] ) && ! empty( $_GET['page'] ) && $_GET['page'] == 'wf_woocommerce_csv_im_ex' ) {
81
  switch ( $_GET['action'] ) {
82
  case "export" :
 
 
83
  include_once( 'includes/exporter/class-wf-prodimpexpcsv-exporter.php' );
84
  WF_ProdImpExpCsv_Exporter::do_export( 'product' );
 
 
 
85
  break;
86
  }
87
  }
@@ -104,6 +109,18 @@ if (in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', ge
104
  public function register_importers() {
105
  register_importer( 'woocommerce_csv', 'WooCommerce Products (CSV)', __('Import <strong>products</strong> to your store via a csv file.', 'wf_csv_import_export'), 'WF_ProdImpExpCsv_Importer::product_importer' );
106
  }
 
 
 
 
 
 
 
 
 
 
 
 
107
  }
108
  endif;
109
 
5
  Description: Import and Export Products From and To your WooCommerce Store.
6
  Author: HikeForce
7
  Author URI: http://www.xadapter.com/vendor/hikeforce/
8
+ Version: 1.1.7
9
  Text Domain: wf_csv_import_export
10
  */
11
 
80
  if ( ! empty( $_GET['action'] ) && ! empty( $_GET['page'] ) && $_GET['page'] == 'wf_woocommerce_csv_im_ex' ) {
81
  switch ( $_GET['action'] ) {
82
  case "export" :
83
+ $user_ok = $this->hf_user_permission();
84
+ if ($user_ok) {
85
  include_once( 'includes/exporter/class-wf-prodimpexpcsv-exporter.php' );
86
  WF_ProdImpExpCsv_Exporter::do_export( 'product' );
87
+ } else {
88
+ wp_redirect(wp_login_url());
89
+ }
90
  break;
91
  }
92
  }
109
  public function register_importers() {
110
  register_importer( 'woocommerce_csv', 'WooCommerce Products (CSV)', __('Import <strong>products</strong> to your store via a csv file.', 'wf_csv_import_export'), 'WF_ProdImpExpCsv_Importer::product_importer' );
111
  }
112
+ private function hf_user_permission() {
113
+ // Check if user has rights to export
114
+ $current_user = wp_get_current_user();
115
+ $user_ok = false;
116
+ $wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));
117
+ if ($current_user instanceof WP_User) {
118
+ if (!empty(array_intersect($wf_roles, $current_user->roles))) {
119
+ $user_ok = true;
120
+ }
121
+ }
122
+ return $user_ok;
123
+ }
124
  }
125
  endif;
126
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:
4
  Tags: woocommerce import products, woocommerce export products, woocommerce export import products, export woocommerce products with images, woocommerce csv import variable products, woocommerce import products with attributes
5
  Requires at least: 3.0.1
6
  Tested up to: 4.6
7
- Stable tag: 1.1.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -78,6 +78,8 @@ Yes. You can import or export product images along with other details
78
  2. Product Export Screen
79
 
80
  == Changelog ==
 
 
81
  = 1.1.6 =
82
  * Enhancement: Sample CSV updated.
83
  = 1.1.5 =
@@ -118,6 +120,8 @@ Yes. You can import or export product images along with other details
118
  * Import /Export Woocommerce Products.
119
 
120
  == Upgrade Notice ==
 
 
121
  = 1.1.6 =
122
  * Enhancement: Sample CSV updated.
123
  = 1.1.5 =
4
  Tags: woocommerce import products, woocommerce export products, woocommerce export import products, export woocommerce products with images, woocommerce csv import variable products, woocommerce import products with attributes
5
  Requires at least: 3.0.1
6
  Tested up to: 4.6
7
+ Stable tag: 1.1.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
78
  2. Product Export Screen
79
 
80
  == Changelog ==
81
+ = 1.1.7 =
82
+ * Enhancement: Security improvements.
83
  = 1.1.6 =
84
  * Enhancement: Sample CSV updated.
85
  = 1.1.5 =
120
  * Import /Export Woocommerce Products.
121
 
122
  == Upgrade Notice ==
123
+ = 1.1.7 =
124
+ * Enhancement: Security improvements.
125
  = 1.1.6 =
126
  * Enhancement: Sample CSV updated.
127
  = 1.1.5 =