Import Export WordPress Users and WooCommerce Customers - Version 2.1.2

Version Description

  • Tested OK with WC 5.2.2.
Download this release

Release Info

Developer webtoffee
Plugin Icon 128x128 Import Export WordPress Users and WooCommerce Customers
Version 2.1.2
Comparing to
See all releases

Code changes from version 2.1.1 to 2.1.2

admin/class-wt-import-export-for-woo-admin.php CHANGED
@@ -49,7 +49,6 @@ class Wt_Import_Export_For_Woo_Admin_Basic {
49
  'history',
50
  'export',
51
  'import',
52
- // 'user',
53
  );
54
 
55
  public static $existing_modules=array();
@@ -85,7 +84,7 @@ class Wt_Import_Export_For_Woo_Admin_Basic {
85
  */
86
  public function enqueue_styles() {
87
  if(Wt_Import_Export_For_Woo_Basic_Common_Helper::wt_is_screen_allowed()){
88
- wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wt-import-export-for-woo-admin.css', array(), $this->version, 'all' );
89
  }
90
  }
91
 
@@ -227,7 +226,8 @@ class Wt_Import_Export_For_Woo_Admin_Basic {
227
  $new_advanced_settings=array();
228
  foreach($advanced_fields as $key => $value)
229
  {
230
- $field_name=(substr($value['field_name'],0,8)!=='wt_iew_' ? 'wt_iew_' : '').$value['field_name'];
 
231
  $validation_key=str_replace('wt_iew_', '', $field_name);
232
  if(isset($_POST[$field_name]))
233
  {
@@ -315,7 +315,7 @@ class Wt_Import_Export_For_Woo_Admin_Basic {
315
  $module_file=WP_CONTENT_DIR."/plugins/{$module_path}/admin/modules/$module_key/$module_key.php";
316
  if(file_exists($module_file))
317
  {
318
- self::$existing_modules[]=$module;
319
  require_once $module_file;
320
  }
321
  }
49
  'history',
50
  'export',
51
  'import',
 
52
  );
53
 
54
  public static $existing_modules=array();
84
  */
85
  public function enqueue_styles() {
86
  if(Wt_Import_Export_For_Woo_Basic_Common_Helper::wt_is_screen_allowed()){
87
+ wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wt-import-export-for-woo-admin.css', array(), $this->version, 'all' );
88
  }
89
  }
90
 
226
  $new_advanced_settings=array();
227
  foreach($advanced_fields as $key => $value)
228
  {
229
+ $form_field_name = isset($value['field_name']) ? $value['field_name'] : '';
230
+ $field_name=(substr($form_field_name,0,8)!=='wt_iew_' ? 'wt_iew_' : '').$form_field_name;
231
  $validation_key=str_replace('wt_iew_', '', $field_name);
232
  if(isset($_POST[$field_name]))
233
  {
315
  $module_file=WP_CONTENT_DIR."/plugins/{$module_path}/admin/modules/$module_key/$module_key.php";
316
  if(file_exists($module_file))
317
  {
318
+ self::$existing_modules[]=$module_key;
319
  require_once $module_file;
320
  }
321
  }
admin/css/wt-import-export-for-woo-admin.css CHANGED
@@ -149,9 +149,9 @@
149
  .wf_settings_form .button {
150
  padding:0.2rem 0.75rem; height: auto;
151
  }
152
- .wt-iew_form_help{ color:#666; font-style: italic; font-weight:400; font-size:12px; display:inline-block; width:100%; margin-top:10px; }
153
  .wt-iew_conditional_help_text{ display:none;}
154
- .wt-iew-form-table tr th:first-child{ width:40%; padding:10px 15px 10px 0; vertical-align:top; }
155
  .wt-iew-form-table tr th:first-child label{ margin-top:5px; display:inline-block; }
156
  .wt-iew-form-table tr td:nth-child(2){ width:40%; padding:10px 5px 10px 0; }
157
  .wt-iew-form-table tr td:nth-child(3){ width:35%; }
@@ -205,6 +205,7 @@
205
 
206
  .meta_mapping_box{width:100%; float:left; height:auto; margin-bottom:0px;}
207
  .meta_mapping_box_hd{min-width:720px; width:auto; display:inline-block; height:40px; line-height:40px; font-weight:bold; background:#f6f6f6; box-sizing:border-box; padding:2px 10px; box-shadow:1px 1px 1px #e0e0e0; border-bottom:solid 1px #ccc; border-top:solid 1px #fff; cursor:pointer;}
 
208
  .meta_mapping_box_hd .dashicons{ margin-top:10px; }
209
  .meta_mapping_box_selected_count_box{ float:right; margin-top:-3px; font-weight:normal; font-style:italic; }
210
  .meta_mapping_box_con{min-width:720px; width:auto; display:inline-block; height:auto; padding:0px; display:none;}
149
  .wf_settings_form .button {
150
  padding:0.2rem 0.75rem; height: auto;
151
  }
152
+ .wt-iew_form_help{ color:#666;font-weight:400; font-size:12px; display:inline-block; width:100%; margin-top:10px; }
153
  .wt-iew_conditional_help_text{ display:none;}
154
+ .wt-iew-form-table tr th:first-child{ width:40% !important; padding:10px 15px 10px 0; vertical-align:top; }
155
  .wt-iew-form-table tr th:first-child label{ margin-top:5px; display:inline-block; }
156
  .wt-iew-form-table tr td:nth-child(2){ width:40%; padding:10px 5px 10px 0; }
157
  .wt-iew-form-table tr td:nth-child(3){ width:35%; }
205
 
206
  .meta_mapping_box{width:100%; float:left; height:auto; margin-bottom:0px;}
207
  .meta_mapping_box_hd{min-width:720px; width:auto; display:inline-block; height:40px; line-height:40px; font-weight:bold; background:#f6f6f6; box-sizing:border-box; padding:2px 10px; box-shadow:1px 1px 1px #e0e0e0; border-bottom:solid 1px #ccc; border-top:solid 1px #fff; cursor:pointer;}
208
+ .meta_mapping_box_hd_nil{min-width:720px; width:auto; display:inline-block; height:40px; line-height:40px; font-weight:bold; background:#f6f6f6; box-sizing:border-box; padding:2px 10px; box-shadow:1px 1px 1px #e0e0e0; border-bottom:solid 1px #ccc; border-top:solid 1px #fff; cursor:pointer;}
209
  .meta_mapping_box_hd .dashicons{ margin-top:10px; }
210
  .meta_mapping_box_selected_count_box{ float:right; margin-top:-3px; font-weight:normal; font-style:italic; }
211
  .meta_mapping_box_con{min-width:720px; width:auto; display:inline-block; height:auto; padding:0px; display:none;}
admin/js/wt-import-export-for-woo-admin.js CHANGED
@@ -723,4 +723,5 @@ jQuery(document).ready(function(){
723
  wt_drp_menu.Set();
724
  wt_iew_file_attacher.Set();
725
  wt_iew_form_toggler.Set();
 
726
  });
723
  wt_drp_menu.Set();
724
  wt_iew_file_attacher.Set();
725
  wt_iew_form_toggler.Set();
726
+ wt_field_group.Set();
727
  });
admin/modules/export/assets/js/main.js CHANGED
@@ -249,9 +249,9 @@ var wt_iew_basic_export=(function( $ ) {
249
  this.set_ajax_page_loader();
250
  $.ajax({
251
  type: 'POST',
252
- url:wt_iew_basic_params.ajax_url,
253
- data:this.ajax_data,
254
- dataType:'json',
255
  success:function(data)
256
  {
257
  wt_iew_basic_export.remove_ajax_page_loader();
@@ -261,7 +261,8 @@ var wt_iew_basic_export=(function( $ ) {
261
  {
262
  wt_iew_basic_export.selected_template=data.id;
263
  wt_iew_basic_export.selected_template_name=data.name;
264
- wt_iew_notify_msg.success(wt_iew_basic_params.msgs.success);
 
265
 
266
  }else if(action=='export' || action=='upload' || action=='export_image')
267
  {
249
  this.set_ajax_page_loader();
250
  $.ajax({
251
  type: 'POST',
252
+ url:wt_iew_basic_params.ajax_url,
253
+ data:this.ajax_data,
254
+ dataType:'json',
255
  success:function(data)
256
  {
257
  wt_iew_basic_export.remove_ajax_page_loader();
261
  {
262
  wt_iew_basic_export.selected_template=data.id;
263
  wt_iew_basic_export.selected_template_name=data.name;
264
+ wt_iew_notify_msg.success(data.msg);
265
+ //wt_iew_notify_msg.success(wt_iew_basic_params.msgs.success);
266
 
267
  }else if(action=='export' || action=='upload' || action=='export_image')
268
  {
admin/modules/export/classes/class-export-ajax.php CHANGED
@@ -225,8 +225,8 @@ class Wt_Import_Export_For_Woo_Basic_Export_Ajax
225
 
226
  /* take template name from post data, if not then create from time stamp */
227
  $template_name=(isset($_POST['template_name']) ? sanitize_text_field($_POST['template_name']) : date('d-M-Y h:i:s A'));
228
-
229
- $out['name']=$template_name;
230
  $out['id']=0;
231
  $out['status']=1;
232
 
@@ -300,6 +300,7 @@ class Wt_Import_Export_For_Woo_Basic_Export_Ajax
300
  {
301
  $out['id']=$this->selected_template;
302
  $out['name']=$template_name;
 
303
  return $out;
304
  }
305
  }else
@@ -316,6 +317,7 @@ class Wt_Import_Export_For_Woo_Basic_Export_Ajax
316
  if($wpdb->insert($tb, $insert_data, $insert_data_type)) //success
317
  {
318
  $out['id']=$wpdb->insert_id;
 
319
  return $out;
320
  }
321
  }
225
 
226
  /* take template name from post data, if not then create from time stamp */
227
  $template_name=(isset($_POST['template_name']) ? sanitize_text_field($_POST['template_name']) : date('d-M-Y h:i:s A'));
228
+ $template_name = stripslashes($template_name);
229
+ $out['name']= $template_name;
230
  $out['id']=0;
231
  $out['status']=1;
232
 
300
  {
301
  $out['id']=$this->selected_template;
302
  $out['name']=$template_name;
303
+ $out['msg']=__('Template updated successfully');
304
  return $out;
305
  }
306
  }else
317
  if($wpdb->insert($tb, $insert_data, $insert_data_type)) //success
318
  {
319
  $out['id']=$wpdb->insert_id;
320
+ $out['msg']=__('Template saved successfully');
321
  return $out;
322
  }
323
  }
admin/modules/export/export.php CHANGED
@@ -64,7 +64,7 @@ class Wt_Import_Export_For_Woo_Basic_Export
64
  ),
65
  'advanced'=>array(
66
  'title'=>__('Advanced options/Batch export'),
67
- 'description'=>__('Use advanced options from below to decide on the batch export count. You can also save the template file for future exports.'),
68
  ),
69
  );
70
 
@@ -118,8 +118,9 @@ class Wt_Import_Export_For_Woo_Basic_Export
118
  'label'=>__("Default Export method"),
119
  'type'=>'select',
120
  'sele_vals'=>$export_methods,
121
- 'value' =>'new',
122
  'field_name'=>'default_export_method',
 
123
  'help_text'=>__('Select the default method of export.'),
124
  );
125
  $fields['default_export_batch']=array(
@@ -816,4 +817,4 @@ class Wt_Import_Export_For_Woo_Basic_Export
816
  }
817
  }
818
  }
819
- Wt_Import_Export_For_Woo_Basic::$loaded_modules['export']=new Wt_Import_Export_For_Woo_Basic_Export();
64
  ),
65
  'advanced'=>array(
66
  'title'=>__('Advanced options/Batch export'),
67
+ 'description'=>__('You can save the template file for future exports or proceed with the export.'),
68
  ),
69
  );
70
 
118
  'label'=>__("Default Export method"),
119
  'type'=>'select',
120
  'sele_vals'=>$export_methods,
121
+ 'value' =>'quick',
122
  'field_name'=>'default_export_method',
123
+ 'field_group'=>'advanced_field',
124
  'help_text'=>__('Select the default method of export.'),
125
  );
126
  $fields['default_export_batch']=array(
817
  }
818
  }
819
  }
820
+ Wt_Import_Export_For_Woo_Basic::$loaded_modules['export']=new Wt_Import_Export_For_Woo_Basic_Export();
admin/modules/export/views/_export_footer.php CHANGED
@@ -7,15 +7,22 @@ if (!defined('ABSPATH')) {
7
  <div style="float:left; padding-top:10px;" class="wt_iew_export_template_name"> </div>
8
  <div style="float:right;">
9
  <div style="float:right;">
10
- <?php
 
 
 
 
11
  foreach($this->step_btns as $btnk=>$btnv)
12
  {
13
  $css_class=(isset($btnv['class']) ? $btnv['class'] : '');
14
  $action_type=(isset($btnv['action_type']) ? $btnv['action_type'] : 'non-step');
 
 
 
15
  if($btnv['type']=='button')
16
  {
17
  ?>
18
- <button class="button button-primary wt_iew_export_action_btn <?php echo $css_class; ?>" data-action-type="<?php echo $action_type; ?>" data-action="<?php echo $btnv['key'];?>" type="submit">
19
  <?php echo $btnv['text'];?>
20
  </button>
21
  <?php
@@ -57,6 +64,7 @@ if (!defined('ABSPATH')) {
57
  <span style="line-height:40px; font-weight:bold;" class="<?php echo $css_class; ?>"><?php echo $btnv['text'];?></span>
58
  <?php
59
  }
 
60
  }
61
  ?>
62
  </div>
7
  <div style="float:left; padding-top:10px;" class="wt_iew_export_template_name"> </div>
8
  <div style="float:right;">
9
  <div style="float:right;">
10
+ <?php
11
+ $button_types = array_column(array_values($this->step_btns), 'type');
12
+ $last_button_key = array_search('button', array_reverse($button_types, true));
13
+ $count = 0;
14
+ $button_standard_class = 'media-button';
15
  foreach($this->step_btns as $btnk=>$btnv)
16
  {
17
  $css_class=(isset($btnv['class']) ? $btnv['class'] : '');
18
  $action_type=(isset($btnv['action_type']) ? $btnv['action_type'] : 'non-step');
19
+ if($count == $last_button_key){
20
+ $button_standard_class = 'button-primary';
21
+ }
22
  if($btnv['type']=='button')
23
  {
24
  ?>
25
+ <button class="button <?php echo $button_standard_class; ?> wt_iew_export_action_btn <?php echo $css_class; ?>" data-action-type="<?php echo $action_type; ?>" data-action="<?php echo $btnv['key'];?>" type="submit">
26
  <?php echo $btnv['text'];?>
27
  </button>
28
  <?php
64
  <span style="line-height:40px; font-weight:bold;" class="<?php echo $css_class; ?>"><?php echo $btnv['text'];?></span>
65
  <?php
66
  }
67
+ $count++;
68
  }
69
  ?>
70
  </div>
admin/modules/export/views/_export_mapping_page.php CHANGED
@@ -6,8 +6,7 @@ if (!defined('ABSPATH')) {
6
  <div class="wt_iew_export_main">
7
  <p><?php echo $step_info['description']; ?></p>
8
  <div class="meta_mapping_box">
9
- <div class="meta_mapping_box_hd wt_iew_noselect">
10
- <span class="dashicons dashicons-arrow-down"></span>
11
  <?php _e('Default fields');?>
12
  <span class="meta_mapping_box_selected_count_box"><span class="meta_mapping_box_selected_count_box_num">0</span> <?php _e(' columns(s) selected'); ?></span>
13
  </div>
6
  <div class="wt_iew_export_main">
7
  <p><?php echo $step_info['description']; ?></p>
8
  <div class="meta_mapping_box">
9
+ <div class="meta_mapping_box_hd_nil wt_iew_noselect">
 
10
  <?php _e('Default fields');?>
11
  <span class="meta_mapping_box_selected_count_box"><span class="meta_mapping_box_selected_count_box_num">0</span> <?php _e(' columns(s) selected'); ?></span>
12
  </div>
admin/modules/history/history.php CHANGED
@@ -47,7 +47,7 @@ class Wt_Import_Export_For_Woo_Basic_History
47
  add_filter('wt_iew_admin_menu_basic', array($this, 'add_admin_pages'), 10, 1);
48
 
49
  /* advanced plugin settings */
50
- add_filter('wt_iew_advanced_setting_fields_basic', array($this, 'advanced_setting_fields'));
51
 
52
  /* main ajax hook. The callback function will decide which action is to execute. */
53
  add_action('wp_ajax_iew_history_ajax_basic', array($this, 'ajax_main'), 11);
@@ -197,6 +197,12 @@ class Wt_Import_Export_For_Woo_Basic_History
197
  */
198
  public function advanced_setting_fields($fields)
199
  {
 
 
 
 
 
 
200
  $fields['enable_history_auto_delete']=array(
201
  'label'=>__("Auto delete history"),
202
  'type'=>'radio',
@@ -206,6 +212,7 @@ class Wt_Import_Export_For_Woo_Basic_History
206
  ),
207
  'value' =>1,
208
  'field_name'=>'enable_history_auto_delete',
 
209
  'help_text'=>__('Enable auto delete for records within the history section.'),
210
  'validation_rule'=>array('type'=>'absint'),
211
  'form_toggler'=>array(
@@ -222,6 +229,7 @@ class Wt_Import_Export_For_Woo_Basic_History
222
  'style'=>'width:30%;',
223
  ),
224
  'field_name'=>'auto_delete_history_count',
 
225
  'help_text'=>__('Indicates the maximum records to retain in history. Limit the number of records with status ‘Finished’. E.g On giving an input of 50, the system will retain(not delete) the latest 50 records with status ‘Finished’. Any other record with a different status will not be retained.'),
226
  'validation_rule'=>array('type'=>'absint'),
227
  'form_toggler'=>array(
47
  add_filter('wt_iew_admin_menu_basic', array($this, 'add_admin_pages'), 10, 1);
48
 
49
  /* advanced plugin settings */
50
+ add_filter('wt_iew_advanced_setting_fields_basic', array($this, 'advanced_setting_fields'), 11);
51
 
52
  /* main ajax hook. The callback function will decide which action is to execute. */
53
  add_action('wp_ajax_iew_history_ajax_basic', array($this, 'ajax_main'), 11);
197
  */
198
  public function advanced_setting_fields($fields)
199
  {
200
+ $fields['advanced_field_head'] =array(
201
+ 'type'=>'field_group_head', //field type
202
+ 'head'=>__('Advanced options'),
203
+ 'group_id'=>'advanced_field', //field group id
204
+ 'show_on_default'=>0,
205
+ );
206
  $fields['enable_history_auto_delete']=array(
207
  'label'=>__("Auto delete history"),
208
  'type'=>'radio',
212
  ),
213
  'value' =>1,
214
  'field_name'=>'enable_history_auto_delete',
215
+ 'field_group'=>'advanced_field',
216
  'help_text'=>__('Enable auto delete for records within the history section.'),
217
  'validation_rule'=>array('type'=>'absint'),
218
  'form_toggler'=>array(
229
  'style'=>'width:30%;',
230
  ),
231
  'field_name'=>'auto_delete_history_count',
232
+ 'field_group'=>'advanced_field',
233
  'help_text'=>__('Indicates the maximum records to retain in history. Limit the number of records with status ‘Finished’. E.g On giving an input of 50, the system will retain(not delete) the latest 50 records with status ‘Finished’. Any other record with a different status will not be retained.'),
234
  'validation_rule'=>array('type'=>'absint'),
235
  'form_toggler'=>array(
admin/modules/history/views/_history_list.php CHANGED
@@ -174,7 +174,7 @@ if ( ! defined( 'WPINC' ) ) {
174
  if(file_exists($log_file_path))
175
  {
176
  ?>
177
- | <a class="wt_iew_view_log_btn" data-history-id="<?php echo $history_item['id'];?>"><?php _e("Details");?></a>
178
  <?php
179
  }
180
  }
174
  if(file_exists($log_file_path))
175
  {
176
  ?>
177
+ | <a class="wt_iew_view_log_btn" data-history-id="<?php echo $history_item['id'];?>"><?php _e("View log");?></a>
178
  <?php
179
  }
180
  }
admin/modules/history/views/_log_table.php CHANGED
@@ -26,8 +26,12 @@ if(isset($log_list) && is_array($log_list) && count($log_list)>0)
26
  <tbody class="log_view_tb_tbody">
27
  <?php
28
  }
 
29
  foreach($log_list as $key =>$log_item)
30
  {
 
 
 
31
  ?>
32
  <tr>
33
  <td><?php echo absint($log_item['row']); ?></td>
@@ -37,7 +41,7 @@ if(isset($log_list) && is_array($log_list) && count($log_list)>0)
37
  <?php
38
  if($show_item_details)
39
  {
40
- $item_data=$item_type_module_obj->get_item_by_id($log_item['post_id']);
41
  if($item_data && isset($item_data['title']))
42
  {
43
  if(isset($item_data['edit_url']))
26
  <tbody class="log_view_tb_tbody">
27
  <?php
28
  }
29
+
30
  foreach($log_list as $key =>$log_item)
31
  {
32
+
33
+ if(!isset($log_item['row']))
34
+ continue;
35
  ?>
36
  <tr>
37
  <td><?php echo absint($log_item['row']); ?></td>
41
  <?php
42
  if($show_item_details)
43
  {
44
+ $item_data=$item_type_module_obj->get_item_by_id($log_item['post_id']);
45
  if($item_data && isset($item_data['title']))
46
  {
47
  if(isset($item_data['edit_url']))
admin/modules/import/assets/js/main.js CHANGED
@@ -265,9 +265,9 @@ var wt_iew_basic_import=(function( $ ) {
265
  }
266
  $.ajax({
267
  type: 'POST',
268
- url:wt_iew_basic_params.ajax_url,
269
- data:this.ajax_data,
270
- dataType:'json',
271
  success:function(data)
272
  {
273
  wt_iew_basic_import.remove_ajax_page_loader();
@@ -279,7 +279,8 @@ var wt_iew_basic_import=(function( $ ) {
279
  {
280
  wt_iew_basic_import.selected_template=data.id;
281
  wt_iew_basic_import.selected_template_name=data.name;
282
- wt_iew_notify_msg.success(wt_iew_basic_params.msgs.success);
 
283
 
284
  }else if(action=='import')
285
  {
@@ -778,6 +779,8 @@ var wt_iew_basic_import=(function( $ ) {
778
  this.to_import_title=$('[name="wt_iew_import_post_type"] option:selected').text();
779
  }
780
  $('.wt_iew_step_head_post_type_name').html(this.to_import_title);
 
 
781
  },
782
  page_actions:function(step)
783
  {
265
  }
266
  $.ajax({
267
  type: 'POST',
268
+ url:wt_iew_basic_params.ajax_url,
269
+ data:this.ajax_data,
270
+ dataType:'json',
271
  success:function(data)
272
  {
273
  wt_iew_basic_import.remove_ajax_page_loader();
279
  {
280
  wt_iew_basic_import.selected_template=data.id;
281
  wt_iew_basic_import.selected_template_name=data.name;
282
+ wt_iew_notify_msg.success(data.msg);
283
+ //wt_iew_notify_msg.success(wt_iew_basic_params.msgs.success);
284
 
285
  }else if(action=='import')
286
  {
779
  this.to_import_title=$('[name="wt_iew_import_post_type"] option:selected').text();
780
  }
781
  $('.wt_iew_step_head_post_type_name').html(this.to_import_title);
782
+ if(this.to_import_title.includes('User'))
783
+ $('#user-required-field-message').show();
784
  },
785
  page_actions:function(step)
786
  {
admin/modules/import/classes/class-import-ajax.php CHANGED
@@ -442,7 +442,8 @@ class Wt_Import_Export_For_Woo_Basic_Import_Ajax
442
  /* take template name from post data, if not then create from time stamp */
443
  $template_name=(isset($_POST['template_name']) ? sanitize_text_field($_POST['template_name']) : date('d-M-Y h:i:s A'));
444
 
445
- $out['name']=$template_name;
 
446
  $out['id']=0;
447
  $out['status']=1;
448
 
@@ -516,6 +517,7 @@ class Wt_Import_Export_For_Woo_Basic_Import_Ajax
516
  {
517
  $out['id']=$this->selected_template;
518
  $out['name']=$template_name;
 
519
  return $out;
520
  }
521
  }else
@@ -532,6 +534,7 @@ class Wt_Import_Export_For_Woo_Basic_Import_Ajax
532
  if($wpdb->insert($tb, $insert_data, $insert_data_type)) //success
533
  {
534
  $out['id']=$wpdb->insert_id;
 
535
  return $out;
536
  }
537
  }
@@ -541,6 +544,14 @@ class Wt_Import_Export_For_Woo_Basic_Import_Ajax
541
  }
542
 
543
 
 
 
 
 
 
 
 
 
544
  /**
545
  * Step 1 (Ajax sub function)
546
  * Built in steps, post type choosing page
@@ -840,14 +851,15 @@ class Wt_Import_Export_For_Woo_Basic_Import_Ajax
840
 
841
  protected function prepare_step_summary()
842
  {
843
- $this->step_title=$this->steps[$this->step]['title'];
 
844
  $this->step_keys=array_keys($this->steps);
845
  $this->current_step_index=array_search($this->step, $this->step_keys);
846
  $this->current_step_number=$this->current_step_index+1;
847
  $this->last_page=(!isset($this->step_keys[$this->current_step_index+1]) ? true : false);
848
  $this->total_steps=count($this->step_keys);
849
  $this->step_summary=__(sprintf("Step %d of %d", $this->current_step_number, $this->total_steps));
850
- $this->step_description=$this->steps[$this->step]['description'];
851
  }
852
 
853
  protected function prepare_step_header_html()
442
  /* take template name from post data, if not then create from time stamp */
443
  $template_name=(isset($_POST['template_name']) ? sanitize_text_field($_POST['template_name']) : date('d-M-Y h:i:s A'));
444
 
445
+ $template_name = stripslashes($template_name);
446
+ $out['name']= $template_name;
447
  $out['id']=0;
448
  $out['status']=1;
449
 
517
  {
518
  $out['id']=$this->selected_template;
519
  $out['name']=$template_name;
520
+ $out['msg']=__('Template updated successfully');
521
  return $out;
522
  }
523
  }else
534
  if($wpdb->insert($tb, $insert_data, $insert_data_type)) //success
535
  {
536
  $out['id']=$wpdb->insert_id;
537
+ $out['msg']=__('Template saved successfully');
538
  return $out;
539
  }
540
  }
544
  }
545
 
546
 
547
+ /*
548
+ * Get step information
549
+ * @param string $step
550
+ */
551
+
552
+ public function get_step_info( $step ) {
553
+ return isset( $this->steps[ $step ] ) ? $this->steps[ $step ] : array( 'title' => ' ', 'description' => ' ' );
554
+ }
555
  /**
556
  * Step 1 (Ajax sub function)
557
  * Built in steps, post type choosing page
851
 
852
  protected function prepare_step_summary()
853
  {
854
+ $step_info= $this->get_step_info($this->step);
855
+ $this->step_title=$step_info['title'];
856
  $this->step_keys=array_keys($this->steps);
857
  $this->current_step_index=array_search($this->step, $this->step_keys);
858
  $this->current_step_number=$this->current_step_index+1;
859
  $this->last_page=(!isset($this->step_keys[$this->current_step_index+1]) ? true : false);
860
  $this->total_steps=count($this->step_keys);
861
  $this->step_summary=__(sprintf("Step %d of %d", $this->current_step_number, $this->total_steps));
862
+ $this->step_description=$step_info['description'];
863
  }
864
 
865
  protected function prepare_step_header_html()
admin/modules/import/import.php CHANGED
@@ -116,6 +116,7 @@ class Wt_Import_Export_For_Woo_Basic_Import
116
  ),
117
  'value' =>1,
118
  'field_name'=>'enable_import_log',
 
119
  'help_text'=>__('Save import log as text file and make it available in the history section for debugging purposes.'),
120
  'validation_rule'=>array('type'=>'absint'),
121
  );
@@ -124,8 +125,9 @@ class Wt_Import_Export_For_Woo_Basic_Import
124
  'label'=>__("Default Import method"),
125
  'type'=>'select',
126
  'sele_vals'=>$import_methods,
127
- 'value' =>'new',
128
  'field_name'=>'default_import_method',
 
129
  'help_text'=>__('Select the default method of import.'),
130
  );
131
  $fields['default_import_batch']=array(
116
  ),
117
  'value' =>1,
118
  'field_name'=>'enable_import_log',
119
+ 'field_group'=>'advanced_field',
120
  'help_text'=>__('Save import log as text file and make it available in the history section for debugging purposes.'),
121
  'validation_rule'=>array('type'=>'absint'),
122
  );
125
  'label'=>__("Default Import method"),
126
  'type'=>'select',
127
  'sele_vals'=>$import_methods,
128
+ 'value' =>'quick',
129
  'field_name'=>'default_import_method',
130
+ 'field_group'=>'advanced_field',
131
  'help_text'=>__('Select the default method of import.'),
132
  );
133
  $fields['default_import_batch']=array(
admin/modules/import/views/_import_footer.php CHANGED
@@ -7,15 +7,22 @@ if (!defined('ABSPATH')) {
7
  <div style="float:left; padding-top:10px;" class="wt_iew_import_template_name"> </div>
8
  <div style="float:right;">
9
  <div style="float:right;">
10
- <?php
 
 
 
 
11
  foreach($this->step_btns as $btnk=>$btnv)
12
  {
13
  $css_class=(isset($btnv['class']) ? $btnv['class'] : '');
14
  $action_type=(isset($btnv['action_type']) ? $btnv['action_type'] : 'non-step');
 
 
 
15
  if($btnv['type']=='button')
16
  {
17
  ?>
18
- <button class="button button-primary wt_iew_import_action_btn <?php echo $css_class; ?>" data-action-type="<?php echo $action_type; ?>" data-action="<?php echo $btnv['key'];?>" type="submit">
19
  <?php echo $btnv['text'];?>
20
  </button>
21
  <?php
@@ -57,6 +64,7 @@ if (!defined('ABSPATH')) {
57
  <span style="line-height:40px; font-weight:bold;" class="<?php echo $css_class; ?>"><?php echo $btnv['text'];?></span>
58
  <?php
59
  }
 
60
  }
61
  ?>
62
  </div>
7
  <div style="float:left; padding-top:10px;" class="wt_iew_import_template_name"> </div>
8
  <div style="float:right;">
9
  <div style="float:right;">
10
+ <?php
11
+ $button_types = array_column(array_values($this->step_btns), 'type');
12
+ $last_button_key = array_search('button', array_reverse($button_types, true));
13
+ $count = 0;
14
+ $button_standard_class = 'media-button';
15
  foreach($this->step_btns as $btnk=>$btnv)
16
  {
17
  $css_class=(isset($btnv['class']) ? $btnv['class'] : '');
18
  $action_type=(isset($btnv['action_type']) ? $btnv['action_type'] : 'non-step');
19
+ if($count == $last_button_key){
20
+ $button_standard_class = 'button-primary';
21
+ }
22
  if($btnv['type']=='button')
23
  {
24
  ?>
25
+ <button class="button <?php echo $button_standard_class; ?> wt_iew_import_action_btn <?php echo $css_class; ?>" data-action-type="<?php echo $action_type; ?>" data-action="<?php echo $btnv['key'];?>" type="submit">
26
  <?php echo $btnv['text'];?>
27
  </button>
28
  <?php
64
  <span style="line-height:40px; font-weight:bold;" class="<?php echo $css_class; ?>"><?php echo $btnv['text'];?></span>
65
  <?php
66
  }
67
+ $count++;
68
  }
69
  ?>
70
  </div>
admin/modules/import/views/_import_mapping_page.php CHANGED
@@ -72,8 +72,7 @@ if (!defined('ABSPATH')) {
72
  </p>
73
 
74
  <div class="meta_mapping_box">
75
- <div class="meta_mapping_box_hd wt_iew_noselect">
76
- <span class="dashicons dashicons-arrow-down"></span>
77
  <?php _e('Default fields');?>
78
  <span class="meta_mapping_box_selected_count_box"><span class="meta_mapping_box_selected_count_box_num">0</span> <?php _e(' columns(s) selected'); ?></span>
79
  </div>
72
  </p>
73
 
74
  <div class="meta_mapping_box">
75
+ <div class="meta_mapping_box_hd_nil wt_iew_noselect">
 
76
  <?php _e('Default fields');?>
77
  <span class="meta_mapping_box_selected_count_box"><span class="meta_mapping_box_selected_count_box_num">0</span> <?php _e(' columns(s) selected'); ?></span>
78
  </div>
admin/modules/import/views/_import_method_import_page.php CHANGED
@@ -27,7 +27,7 @@ if (!defined('ABSPATH')) {
27
  </div>
28
  </td>
29
  </tr>
30
-
31
  <tr class="wt-iew-import-method-options wt-iew-import-method-options-template wt-iew-import-template-sele-tr" style="display:none;">
32
  <th><label><?php _e('Import template');?></label></th>
33
  <td>
27
  </div>
28
  </td>
29
  </tr>
30
+ <tr><div id="user-required-field-message" class="updated" style="margin-left:0px;display: none;background: #dceff4;"><p><?php _e('For a successful import, the uploading file must contain data for <b>at least 1 column: user_email</b>.'); ?></p></div></tr>
31
  <tr class="wt-iew-import-method-options wt-iew-import-method-options-template wt-iew-import-template-sele-tr" style="display:none;">
32
  <th><label><?php _e('Import template');?></label></th>
33
  <td>
admin/modules/user/import/import.php CHANGED
@@ -343,7 +343,7 @@ class Wt_Import_Export_For_Woo_basic_User_Import {
343
  require_once ABSPATH . 'wp-admin/includes/user.php';
344
  }
345
  $roles = get_editable_roles();
346
- $new_roles_str = str_replace(' ', '', strtolower($data['user_details']['roles']));
347
 
348
  if(empty($new_roles_str)){
349
  $new_roles_str = get_option('default_role');
343
  require_once ABSPATH . 'wp-admin/includes/user.php';
344
  }
345
  $roles = get_editable_roles();
346
+ $new_roles_str = str_replace(' ', '', strtolower(isset($data['user_details']['roles']) ? $data['user_details']['roles'] : ''));
347
 
348
  if(empty($new_roles_str)){
349
  $new_roles_str = get_option('default_role');
admin/partials/_form_field_generator.php CHANGED
@@ -136,7 +136,8 @@ foreach($form_fields as $key=>$value)
136
 
137
  if($tr_html=="")
138
  {
139
- $form_data_key=(substr($value['field_name'],0,8)!=='wt_iew_' ? 'wt_iew_' : '').$value['field_name'];
 
140
 
141
  /* checking field value exist in form data array */
142
  if(isset($form_data[$form_data_key]))
136
 
137
  if($tr_html=="")
138
  {
139
+ $form_field_name = isset($value['field_name']) ? $value['field_name'] : '';
140
+ $form_data_key=(substr($form_field_name,0,8)!=='wt_iew_' ? 'wt_iew_' : '').$form_field_name;
141
 
142
  /* checking field value exist in form data array */
143
  if(isset($form_data[$form_data_key]))
admin/views/admin-settings-help.php CHANGED
@@ -33,14 +33,9 @@ if ( ! defined( 'WPINC' ) ) {
33
  <div class="wt_iew_sub_tab_content" data-id="help-doc">
34
  <h3><?php _e( 'Help Docs' ); ?></h3>
35
  <ul class="wf-help-links">
36
- <li>
37
- <img src="<?php echo WT_U_IEW_PLUGIN_URL; ?>assets/images/sample-csv.png">
38
- <h3><?php _e( 'Sample User CSV' ); ?></h3>
39
- <p><?php _e( 'Familiarize yourself with the sample CSV.' ); ?></p>
40
- <a target="_blank" href="https://www.webtoffee.com/wp-content/uploads/2020/10/Sample_Users.csv" class="button button-primary">
41
- <?php _e( 'Get Sample CSV' ); ?>
42
- </a>
43
- </li>
44
  </ul>
45
  </div>
46
  </div>
33
  <div class="wt_iew_sub_tab_content" data-id="help-doc">
34
  <h3><?php _e( 'Help Docs' ); ?></h3>
35
  <ul class="wf-help-links">
36
+ <?php do_action( 'wt_user_addon_basic_help_content' ); ?>
37
+ <?php do_action( 'wt_order_addon_basic_help_content' ); ?>
38
+ <?php do_action( 'wt_coupon_addon_basic_help_content' ); ?>
 
 
 
 
 
39
  </ul>
40
  </div>
41
  </div>
admin/views/market.php CHANGED
@@ -97,7 +97,7 @@ if ( ! defined( 'ABSPATH' ) ) {
97
  <li style="text-align: center;"><?php echo __('30 Day Money Back Guarantee','users-customers-import-export-for-wp-woocommerce'); ?></li>
98
  <li style="text-align: center;"><?php echo __('Fast and Superior Support','users-customers-import-export-for-wp-woocommerce'); ?></li>
99
  <li style="text-align: center;">
100
- <a href="https://www.webtoffee.com/product/wordpress-users-woocommerce-customers-import-export/?utm_source=free_plugin_sidebar&utm_medium=user_imp_exp_basic&utm_campaign=User_Import_Export&utm_content=2.1.1" target="_blank" class="button button-primary button-go-pro"><?php _e('Upgrade to Premium', 'users-customers-import-export-for-wp-woocommerce'); ?></a>
101
  </li>
102
  </ul>
103
  <span>
97
  <li style="text-align: center;"><?php echo __('30 Day Money Back Guarantee','users-customers-import-export-for-wp-woocommerce'); ?></li>
98
  <li style="text-align: center;"><?php echo __('Fast and Superior Support','users-customers-import-export-for-wp-woocommerce'); ?></li>
99
  <li style="text-align: center;">
100
+ <a href="https://www.webtoffee.com/product/wordpress-users-woocommerce-customers-import-export/?utm_source=free_plugin_sidebar&utm_medium=user_imp_exp_basic&utm_campaign=User_Import_Export&utm_content=2.1.2" target="_blank" class="button button-primary button-go-pro"><?php _e('Upgrade to Premium', 'users-customers-import-export-for-wp-woocommerce'); ?></a>
101
  </li>
102
  </ul>
103
  <span>
includes/class-wt-import-export-for-woo.php CHANGED
@@ -80,7 +80,7 @@ class Wt_Import_Export_For_Woo_Basic {
80
  if ( defined( 'WT_U_IEW_VERSION' ) ) {
81
  $this->version = WT_U_IEW_VERSION;
82
  } else {
83
- $this->version = '2.1.1';
84
  }
85
  $this->plugin_name = 'wt-import-export-for-woo-basic';
86
 
@@ -276,6 +276,7 @@ class Wt_Import_Export_For_Woo_Basic {
276
  */
277
  public static function load_modules($module)
278
  {
 
279
  if(Wt_Import_Export_For_Woo_Admin_Basic::module_exists($module))
280
  {
281
  if(!isset(self::$loaded_modules[$module]))
80
  if ( defined( 'WT_U_IEW_VERSION' ) ) {
81
  $this->version = WT_U_IEW_VERSION;
82
  } else {
83
+ $this->version = '2.1.2';
84
  }
85
  $this->plugin_name = 'wt-import-export-for-woo-basic';
86
 
276
  */
277
  public static function load_modules($module)
278
  {
279
+
280
  if(Wt_Import_Export_For_Woo_Admin_Basic::module_exists($module))
281
  {
282
  if(!isset(self::$loaded_modules[$module]))
includes/class-wt-legecy-menu-moved.php CHANGED
@@ -61,7 +61,7 @@ if (!class_exists('wt_legecy_menu_moved')) {
61
  </p>
62
  <p>
63
 
64
- <a class="button button-primary" data-type="remove_legecy_menu_banner">Remove legacy menu</a>
65
  </p>
66
  </div>
67
  <?php
61
  </p>
62
  <p>
63
 
64
+ <a class="button button-primary" data-type="remove_legecy_menu_banner"><?php _e('Remove user legacy menu');?></a>
65
  </p>
66
  </div>
67
  <?php
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: user import, user export, csv, woocommerce, customers, import, export, exp
5
  Requires at least: 3.0.1
6
  Tested up to: 5.7
7
  Requires PHP: 5.6
8
- Stable tag: 2.1.1
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -29,7 +29,7 @@ WordPress User Import Export plugin allows you to import and export WordPress us
29
  &#128312; Map and Transform fields while importing customers/users
30
  &#128312; Change values (bulk modify) while importing customers/users using Evaluation Fields
31
  &#128312; Tested OK with WordPress 5.7
32
- &#128312; Tested OK with WooCommerce 5.2.0
33
  &#128312; Tested OK with PHP 7.3.5
34
 
35
  Highlights: WordPress Users Export, WordPress Users CSV Import Suite, Export WordPress Users to CSV. Pro Version supports export and import of all additional user meta like WooCommerce details.
@@ -219,6 +219,8 @@ Yes, you can update the user data with the help of this plugin. The users will b
219
 
220
  == Changelog ==
221
 
 
 
222
  = 2.1.1 =
223
  * Tested OK with WC 5.2.0.
224
  = 2.1.0 =
@@ -379,5 +381,5 @@ Yes, you can update the user data with the help of this plugin. The users will b
379
 
380
  == Upgrade Notice ==
381
 
382
- = 2.1.1 =
383
- * Tested OK with WC 5.2.0.
5
  Requires at least: 3.0.1
6
  Tested up to: 5.7
7
  Requires PHP: 5.6
8
+ Stable tag: 2.1.2
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
29
  &#128312; Map and Transform fields while importing customers/users
30
  &#128312; Change values (bulk modify) while importing customers/users using Evaluation Fields
31
  &#128312; Tested OK with WordPress 5.7
32
+ &#128312; Tested OK with WooCommerce 5.2.2
33
  &#128312; Tested OK with PHP 7.3.5
34
 
35
  Highlights: WordPress Users Export, WordPress Users CSV Import Suite, Export WordPress Users to CSV. Pro Version supports export and import of all additional user meta like WooCommerce details.
219
 
220
  == Changelog ==
221
 
222
+ = 2.1.2 =
223
+ * Tested OK with WC 5.2.2.
224
  = 2.1.1 =
225
  * Tested OK with WC 5.2.0.
226
  = 2.1.0 =
381
 
382
  == Upgrade Notice ==
383
 
384
+ = 2.1.2 =
385
+ * Tested OK with WC 5.2.2.
users-customers-import-export-for-wp-woocommerce.php CHANGED
@@ -6,8 +6,8 @@
6
  Description: Export and Import User/Customers details From and To your WordPress/WooCommerce.
7
  Author: WebToffee
8
  Author URI: https://www.webtoffee.com/product/wordpress-users-woocommerce-customers-import-export/
9
- Version: 2.1.1
10
- WC tested up to: 5.2.0
11
  Text Domain: users-customers-import-export-for-wp-woocommerce
12
  License: GPLv3
13
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -43,7 +43,7 @@ if ( ! defined( 'WT_IEW_DEBUG_BASIC' ) ) {
43
  * Start at version 1.0.0 and use SemVer - https://semver.org
44
  * Rename this for your plugin and update it as you release new versions.
45
  */
46
- define( 'WT_U_IEW_VERSION', '2.1.1' );
47
 
48
  /**
49
  * The code that runs during plugin activation.
@@ -188,3 +188,20 @@ include_once plugin_dir_path( __FILE__ ) . 'includes/class-wt-non-apache-info.ph
188
  $inform_server_secure = new wt_inform_server_secure('user');
189
  $inform_server_secure->plugin_title = "User Import Export";
190
  $inform_server_secure->banner_message = sprintf(__("The <b>%s</b> plugin uploads the imported file into <b>wp-content/webtoffee_import</b> folder. Please ensure that public access restrictions are set in your server for this folder."), $inform_server_secure->plugin_title);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  Description: Export and Import User/Customers details From and To your WordPress/WooCommerce.
7
  Author: WebToffee
8
  Author URI: https://www.webtoffee.com/product/wordpress-users-woocommerce-customers-import-export/
9
+ Version: 2.1.2
10
+ WC tested up to: 5.2.2
11
  Text Domain: users-customers-import-export-for-wp-woocommerce
12
  License: GPLv3
13
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
43
  * Start at version 1.0.0 and use SemVer - https://semver.org
44
  * Rename this for your plugin and update it as you release new versions.
45
  */
46
+ define( 'WT_U_IEW_VERSION', '2.1.2' );
47
 
48
  /**
49
  * The code that runs during plugin activation.
188
  $inform_server_secure = new wt_inform_server_secure('user');
189
  $inform_server_secure->plugin_title = "User Import Export";
190
  $inform_server_secure->banner_message = sprintf(__("The <b>%s</b> plugin uploads the imported file into <b>wp-content/webtoffee_import</b> folder. Please ensure that public access restrictions are set in your server for this folder."), $inform_server_secure->plugin_title);
191
+
192
+ add_action( 'wt_user_addon_basic_help_content', 'wt_user_import_basic_help_content' );
193
+
194
+ function wt_user_import_basic_help_content() {
195
+ if ( defined( 'WT_IEW_PLUGIN_ID_BASIC' ) ) {
196
+ ?>
197
+ <li>
198
+ <img src="<?php echo WT_U_IEW_PLUGIN_URL; ?>assets/images/sample-csv.png">
199
+ <h3><?php _e( 'Sample User CSV' ); ?></h3>
200
+ <p><?php _e( 'Familiarize yourself with the sample CSV.' ); ?></p>
201
+ <a target="_blank" href="https://www.webtoffee.com/wp-content/uploads/2020/10/Sample_Users.csv" class="button button-primary">
202
+ <?php _e( 'Get User CSV' ); ?>
203
+ </a>
204
+ </li>
205
+ <?php
206
+ }
207
+ }