Version Description
- New hooks to filter username and password of every users being imported
Download this release
Release Info
Developer | carazo |
Plugin | Import users from CSV with meta |
Version | 1.19.1.6 |
Comparing to | |
See all releases |
Code changes from version 1.19.1.5 to 1.19.1.6
- classes/helper.php +1 -1
- classes/import-filters.php +19 -0
- classes/import.php +9 -5
- import-users-from-csv-with-meta.php +3 -2
- readme.txt +4 -1
classes/helper.php
CHANGED
@@ -326,7 +326,7 @@ class ACUI_Helper{
|
|
326 |
$element = $element_string;
|
327 |
}
|
328 |
|
329 |
-
$element =
|
330 |
echo "<td>$element</td>";
|
331 |
}
|
332 |
|
326 |
$element = $element_string;
|
327 |
}
|
328 |
|
329 |
+
$element = wp_kses_post( $element );
|
330 |
echo "<td>$element</td>";
|
331 |
}
|
332 |
|
classes/import-filters.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
3 |
+
|
4 |
+
class ACUI_Import_Filters{
|
5 |
+
function __construct(){
|
6 |
+
}
|
7 |
+
|
8 |
+
function hooks(){
|
9 |
+
add_filter( 'pre_acui_import_single_user_username', array( $this, 'pre_import_single_user_username' ) );
|
10 |
+
}
|
11 |
+
|
12 |
+
function pre_import_single_user_username( $username ){
|
13 |
+
$acui_helper = new ACUI_Helper();
|
14 |
+
return empty( $username ) ? $acui_helper->get_random_unique_username( 'user_' ) : $username;
|
15 |
+
}
|
16 |
+
}
|
17 |
+
|
18 |
+
$acui_import_filters = new ACUI_Import_Filters();
|
19 |
+
$acui_import_filters->hooks();
|
classes/import.php
CHANGED
@@ -319,7 +319,7 @@ class ACUI_Import{
|
|
319 |
$data = apply_filters( 'pre_acui_import_header', $data );
|
320 |
|
321 |
// check min columns username - email
|
322 |
-
if(count( $data ) < 2){
|
323 |
echo "<div id='message' class='error'>" . __( 'File must contain at least 2 columns: username and email', 'import-users-from-csv-with-meta' ) . "</div>";
|
324 |
break;
|
325 |
}
|
@@ -359,11 +359,15 @@ class ACUI_Import{
|
|
359 |
continue;
|
360 |
endif;
|
361 |
|
362 |
-
do_action('pre_acui_import_single_user', $headers, $data );
|
363 |
-
|
|
|
364 |
|
365 |
-
$username =
|
366 |
-
$
|
|
|
|
|
|
|
367 |
$user_id = 0;
|
368 |
$password_position = $positions["password"];
|
369 |
$password_changed = false;
|
319 |
$data = apply_filters( 'pre_acui_import_header', $data );
|
320 |
|
321 |
// check min columns username - email
|
322 |
+
if( count( $data ) < 2 ){
|
323 |
echo "<div id='message' class='error'>" . __( 'File must contain at least 2 columns: username and email', 'import-users-from-csv-with-meta' ) . "</div>";
|
324 |
break;
|
325 |
}
|
359 |
continue;
|
360 |
endif;
|
361 |
|
362 |
+
do_action( 'pre_acui_import_single_user', $headers, $data );
|
363 |
+
|
364 |
+
$data = apply_filters( 'pre_acui_import_single_user_data', $data, $headers );
|
365 |
|
366 |
+
$username = apply_filters( 'pre_acui_import_single_user_username', $data[0] );
|
367 |
+
$data[0] = ( $username == $data[0] ) ? $username : sprintf( __( '<em>Converted to: %s</em>', 'import-users-from-csv-with-meta' ), $username );
|
368 |
+
$email = apply_filters( 'pre_acui_import_single_user_email', $data[1] );
|
369 |
+
$data[1] = ( $email == $data[1] ) ? $email : sprintf( __( '<em>Converted to: %s</em>', 'import-users-from-csv-with-meta' ), $email );
|
370 |
+
|
371 |
$user_id = 0;
|
372 |
$password_position = $positions["password"];
|
373 |
$password_changed = false;
|
import-users-from-csv-with-meta.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Import and export users and customers
|
4 |
Plugin URI: https://www.codection.com
|
5 |
Description: Using this plugin you will be able to import and export users or customers choosing many options and interacting with lots of other plugins
|
6 |
-
Version: 1.19.1.
|
7 |
Author: codection
|
8 |
Author URI: https://codection.com
|
9 |
License: GPL2
|
@@ -11,10 +11,11 @@ License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
|
11 |
Text Domain: import-users-from-csv-with-meta
|
12 |
Domain Path: /languages
|
13 |
*/
|
|
|
14 |
if ( ! defined( 'ABSPATH' ) )
|
15 |
exit;
|
16 |
|
17 |
-
define( 'ACUI_VERSION', '1.19.1.
|
18 |
|
19 |
class ImportExportUsersCustomers{
|
20 |
var $file;
|
3 |
Plugin Name: Import and export users and customers
|
4 |
Plugin URI: https://www.codection.com
|
5 |
Description: Using this plugin you will be able to import and export users or customers choosing many options and interacting with lots of other plugins
|
6 |
+
Version: 1.19.1.6
|
7 |
Author: codection
|
8 |
Author URI: https://codection.com
|
9 |
License: GPL2
|
11 |
Text Domain: import-users-from-csv-with-meta
|
12 |
Domain Path: /languages
|
13 |
*/
|
14 |
+
|
15 |
if ( ! defined( 'ABSPATH' ) )
|
16 |
exit;
|
17 |
|
18 |
+
define( 'ACUI_VERSION', '1.19.1.6' );
|
19 |
|
20 |
class ImportExportUsersCustomers{
|
21 |
var $file;
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://codection.com/go/donate-import-users-from-csv-with-meta/
|
|
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: 5.9
|
7 |
-
Stable tag: 1.19.1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -105,6 +105,9 @@ Plugin will automatically detect:
|
|
105 |
|
106 |
== Changelog ==
|
107 |
|
|
|
|
|
|
|
108 |
= 1.19.1.5 =
|
109 |
* Improved BuddyBoss compatibility, now when we include class-bp-xprofile-group.php, we check if BuddyPress is the plugin active or BuddyBoss
|
110 |
|
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: 5.9
|
7 |
+
Stable tag: 1.19.1.6
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
105 |
|
106 |
== Changelog ==
|
107 |
|
108 |
+
= 1.19.1.6 =
|
109 |
+
* New hooks to filter username and password of every users being imported
|
110 |
+
|
111 |
= 1.19.1.5 =
|
112 |
* Improved BuddyBoss compatibility, now when we include class-bp-xprofile-group.php, we check if BuddyPress is the plugin active or BuddyBoss
|
113 |
|