Import users from CSV with meta - Version 1.11.3.3

Version Description

  • Added compatibility to import levels from Indeed Ultimate Membership Pro
  • Fixed role problems when importing
Download this release

Release Info

Developer carazo
Plugin Icon 128x128 Import users from CSV with meta
Version 1.11.3.3
Comparing to
See all releases

Code changes from version 1.11.3.2 to 1.11.3.3

addons/acui-indeed-ultimate-membership-pro.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) exit;
4
+
5
+ if( is_plugin_active( 'indeed-membership-pro/indeed-membership-pro.php' ) ){
6
+ add_filter( 'acui_restricted_fields', 'acui_iump_restricted_fields', 10, 1 );
7
+ add_action( 'acui_documentation_after_plugins_activated', 'acui_iump_documentation_after_plugins_activated' );
8
+ add_action( 'post_acui_import_single_user', 'acui_iump_post_import_single_user', 10, 3 );
9
+ }
10
+
11
+ function acui_iump_fields() {
12
+ $iump_fields = array(
13
+ "level"
14
+ );
15
+
16
+ return $iump_fields;
17
+ }
18
+
19
+ function acui_iump_restricted_fields( $acui_restricted_fields ){
20
+ return array_merge( $acui_restricted_fields, acui_iump_fields() );
21
+ }
22
+
23
+ function acui_iump_documentation_after_plugins_activated(){
24
+ ?>
25
+ <tr valign="top">
26
+ <th scope="row"><?php _e( "Indeed Ultimate Membership Pro is activated", 'import-users-from-csv-with-meta' ); ?></th>
27
+ <td>
28
+ <?php _e( "You can use the columns in the CSV in order to import data from Indeed Ultimate Membership Pro.", 'import-users-from-csv-with-meta' ); ?>.
29
+ <ul style="list-style:disc outside none; margin-left:2em;">
30
+ <li>level: you have to use the level id, you can find it in "Levels" tab</li>
31
+ </ul>
32
+ </td>
33
+ </tr>
34
+ <?php
35
+ }
36
+
37
+ function acui_iump_post_import_single_user( $headers, $row, $user_id ){
38
+ global $wpdb;
39
+
40
+ $keys = acui_iump_fields();
41
+ $columns = array();
42
+
43
+ foreach ( $keys as $key ) {
44
+ $pos = array_search( $key, $headers );
45
+
46
+ if( $pos !== FALSE ){
47
+ $columns[ $key ] = $pos;
48
+ $$key = $row[ $columns[ $key ] ];
49
+ }
50
+ }
51
+
52
+ if( !empty( $level ) )
53
+ $level = ihc_do_complete_level_assign_from_ap( $user_id, $level );
54
+ }
import-users-from-csv-with-meta.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Import users from CSV with meta
4
  Plugin URI: https://www.codection.com
5
  Description: This plugins allows to import users using CSV files to WP database automatically
6
- Version: 1.11.3.2
7
  Author: codection
8
  Author URI: https://codection.com
9
  License: GPL2
3
  Plugin Name: Import users from CSV with meta
4
  Plugin URI: https://www.codection.com
5
  Description: This plugins allows to import users using CSV files to WP database automatically
6
+ Version: 1.11.3.3
7
  Author: codection
8
  Author URI: https://codection.com
9
  License: GPL2
importer.php CHANGED
@@ -309,16 +309,16 @@ function acui_import_users( $file, $form_data, $attach_id = 0, $is_cron = false,
309
  foreach ( $default_roles as $default_role ) {
310
  $user_object->remove_role( $default_role );
311
  }
312
- }
313
-
314
- if( !empty( $role ) ){
315
- if( is_array( $role ) ){
316
- foreach ($role as $single_role) {
317
- $user_object->add_role( $single_role );
318
- }
319
- }
320
- else{
321
- $user_object->add_role( $role );
322
  }
323
  }
324
  }
309
  foreach ( $default_roles as $default_role ) {
310
  $user_object->remove_role( $default_role );
311
  }
312
+
313
+ if( !empty( $role ) ){
314
+ if( is_array( $role ) ){
315
+ foreach ($role as $single_role) {
316
+ $user_object->add_role( $single_role );
317
+ }
318
+ }
319
+ else{
320
+ $user_object->add_role( $role );
321
+ }
322
  }
323
  }
324
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://paypal.me/codection
4
  Tags: csv, import, importer, meta data, meta, user, users, user meta, editor, profile, custom, fields, delimiter, update, insert
5
  Requires at least: 3.4
6
  Tested up to: 4.9.4
7
- Stable tag: 1.11.3.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -71,6 +71,10 @@ Plugin will automatically detect:
71
 
72
  == Changelog ==
73
 
 
 
 
 
74
  = 1.11.3.2 =
75
  * Patreon link included and some other improvements to make easier support this develop
76
  * Deprecated notices included about SMTP settings in this plugin
4
  Tags: csv, import, importer, meta data, meta, user, users, user meta, editor, profile, custom, fields, delimiter, update, insert
5
  Requires at least: 3.4
6
  Tested up to: 4.9.4
7
+ Stable tag: 1.11.3.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
71
 
72
  == Changelog ==
73
 
74
+ = 1.11.3.3 =
75
+ * Added compatibility to import levels from Indeed Ultimate Membership Pro
76
+ * Fixed role problems when importing
77
+
78
  = 1.11.3.2 =
79
  * Patreon link included and some other improvements to make easier support this develop
80
  * Deprecated notices included about SMTP settings in this plugin