Support » Plugin: Import and export users and customers » Requested Update to Fix Excel Import Problem

  • Hello Javier,

    I have a suggested update to classes/import.php to fix a problem with the way the Excel converts spreadsheets having cells that may be formatted for other than the default, but the cells do not contain data. The built in Excel CSV convertor creates rows having blank fields with a comma delimiter. The blank email field is the one that causes the problem. Unfortunately if someone imports the CSV file with these rows phantom users are created without email addresses.

    Here is a fix that I verified works correctly:
    at line 470 search for
    $user_id = wp_create_user( $username, $password, $email );
    and replace with
    if( !empty( $email ) && ( ( sanitize_email( $email ) == '' ) ) ) $user_id = wp_create_user( $username, $password, $email ); // prevent insertion of blank or invalid email

  • You must be logged in to reply to this topic.