Order Export & Order Import for WooCommerce - Version 1.0.9

Version Description

  • Security related improvements.
Download this release

Release Info

Developer hikeforce
Plugin Icon 128x128 Order Export & Order Import for WooCommerce
Version 1.0.9
Comparing to
See all releases

Code changes from version 1.0.8 to 1.0.9

Files changed (2) hide show
  1. order-import-export.php +19 -1
  2. readme.txt +5 -1
order-import-export.php CHANGED
@@ -6,7 +6,7 @@ Plugin URI: http://www.xadapter.com/product/order-import-export-plugin-for-wooco
6
  Description: Export and Import Order detail including line items, From and To your WooCommerce Store.
7
  Author: HikeForce
8
  Author URI: http://www.xadapter.com/vendor/hikeforce/
9
- Version: 1.0.8
10
  Text Domain: wf_order_import_export
11
  */
12
 
@@ -83,8 +83,13 @@ if (in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', ge
83
  if ( ! empty( $_GET['action'] ) && ! empty( $_GET['page'] ) && $_GET['page'] == 'wf_woocommerce_order_im_ex' ) {
84
  switch ( $_GET['action'] ) {
85
  case "export" :
 
 
86
  include_once( 'includes/exporter/class-wf-orderimpexpcsv-exporter.php' );
87
  WF_OrderImpExpCsv_Exporter::do_export( 'shop_order' );
 
 
 
88
  break;
89
  }
90
  }
@@ -107,6 +112,19 @@ if (in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', ge
107
  public function register_importers() {
108
  register_importer( 'woocommerce_wf_order_csv', 'WooCommerce Order (CSV)', __('Import <strong>Orders</strong> to your store via a csv file.', 'wf_order_import_export'), 'WF_OrderImpExpCsv_Importer::order_importer' );
109
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  }
111
  endif;
112
 
6
  Description: Export and Import Order detail including line items, From and To your WooCommerce Store.
7
  Author: HikeForce
8
  Author URI: http://www.xadapter.com/vendor/hikeforce/
9
+ Version: 1.0.9
10
  Text Domain: wf_order_import_export
11
  */
12
 
83
  if ( ! empty( $_GET['action'] ) && ! empty( $_GET['page'] ) && $_GET['page'] == 'wf_woocommerce_order_im_ex' ) {
84
  switch ( $_GET['action'] ) {
85
  case "export" :
86
+ $user_ok = $this->hf_user_permission();
87
+ if ($user_ok) {
88
  include_once( 'includes/exporter/class-wf-orderimpexpcsv-exporter.php' );
89
  WF_OrderImpExpCsv_Exporter::do_export( 'shop_order' );
90
+ } else {
91
+ wp_redirect(wp_login_url());
92
+ }
93
  break;
94
  }
95
  }
112
  public function register_importers() {
113
  register_importer( 'woocommerce_wf_order_csv', 'WooCommerce Order (CSV)', __('Import <strong>Orders</strong> to your store via a csv file.', 'wf_order_import_export'), 'WF_OrderImpExpCsv_Importer::order_importer' );
114
  }
115
+
116
+ private function hf_user_permission() {
117
+ // Check if user has rights to export
118
+ $current_user = wp_get_current_user();
119
+ $user_ok = false;
120
+ $wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));
121
+ if ($current_user instanceof WP_User) {
122
+ if (!empty(array_intersect($wf_roles, $current_user->roles))) {
123
+ $user_ok = true;
124
+ }
125
+ }
126
+ return $user_ok;
127
+ }
128
  }
129
  endif;
130
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:
4
  Tags: woocommerce export orders, woocommerce import orders, woocommerce export import orders, export woocommerce orders with line item details
5
  Requires at least: 3.0.1
6
  Tested up to: 4.6
7
- Stable tag: 1.0.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -71,6 +71,8 @@ Yes. You can import or export order line item details.
71
  3. Exported sample order Screen
72
 
73
  == Changelog ==
 
 
74
  = 1.0.8 =
75
  * Order line items linking improvements.
76
  = 1.0.7 =
@@ -91,6 +93,8 @@ Yes. You can import or export order line item details.
91
  * Export /Import WooCommerce Orders.
92
 
93
  == Upgrade Notice ==
 
 
94
  = 1.0.8 =
95
  * Order line items linking improvements.
96
  = 1.0.7 =
4
  Tags: woocommerce export orders, woocommerce import orders, woocommerce export import orders, export woocommerce orders with line item details
5
  Requires at least: 3.0.1
6
  Tested up to: 4.6
7
+ Stable tag: 1.0.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
71
  3. Exported sample order Screen
72
 
73
  == Changelog ==
74
+ = 1.0.9 =
75
+ * Security related improvements.
76
  = 1.0.8 =
77
  * Order line items linking improvements.
78
  = 1.0.7 =
93
  * Export /Import WooCommerce Orders.
94
 
95
  == Upgrade Notice ==
96
+ = 1.0.9 =
97
+ * Security related improvements.
98
  = 1.0.8 =
99
  * Order line items linking improvements.
100
  = 1.0.7 =