sorich87 / import-users-from-csv Goto Github PK
View Code? Open in Web Editor NEWWordPress plugin - Import users from a CSV file into WordPress
Home Page: http://profiles.wordpress.org/users/sorich87/
WordPress plugin - Import users from a CSV file into WordPress
Home Page: http://profiles.wordpress.org/users/sorich87/
=== Import Users from CSV === Contributors: sorich87 Tags: user, users, csv, batch, import, importer, admin Requires at least: 3.1 Tested up to: 3.6 Stable tag: 1.0.0 Import users from a CSV file into WordPress == Description == I needed to batch import users into WordPress but I didn't find any plugin which would import all the user data fields as well as user meta. This plugin allows you to import users from an uploaded CSV file. It will add users with basic information as well as meta fields and user role. You can also choose to send a notification to the new users and to display password nag on user login. [Check out my other free plugins.](http://profiles.wordpress.org/users/sorich87/) = Features = * Imports all users fields * Imports user meta * Update existing users by specifying ID field * Allows setting user role * Sends new user notification (if the option is selected) * Shows password nag on user login (if the option is selected) For feature request and bug reports, [please use the forums](http://wordpress.org/tags/import-users-from-csv?forum_id=10#postform). Code contributions are welcome [on Github](https://github.com/sorich87/Import-Users-from-CSV). == Installation == For an automatic installation through WordPress: 1. Go to the 'Add New' plugins screen in your WordPress admin area 1. Search for 'Import Users from CSV' 1. Click 'Install Now' and activate the plugin 1. Upload your CSV file in the 'Users' menu, under 'Import From CSV' Or use a nifty tool by WordPress lead developer Mark Jaquith: 1. Visit [this link](http://coveredwebservices.com/wp-plugin-install/?plugin=import-users-from-csv) and follow the instructions. For a manual installation via FTP: 1. Upload the `import-users-from-csv` directory to the `/wp-content/plugins/` directory 1. Activate the plugin through the 'Plugins' screen in your WordPress admin area 1. Upload your CSV file in the 'Users' menu, under 'Import From CSV' To upload the plugin through WordPress, instead of FTP: 1. Upload the downloaded zip file on the 'Add New' plugins screen (see the 'Upload' tab) in your WordPress admin area and activate. 1. Upload your CSV file in the 'Users' menu, under 'Import From CSV' == Frequently Asked Questions == = How to use? = Click on the 'Import From CSV' link in the 'Users' menu, choose your CSV file, choose if you want to send a notification email to new users and if you want the password nag to be displayed when they login, then click 'Import'. Each row in your CSV file should represent a user; each column identifies user data or meta data. If a column name matches a field in the user table, data from this column is imported in that field; if not, data is imported in a user meta field with the name of the column. Look at the example.csv file in the plugin directory to have a better understanding of how the your CSV file should be organized. You can try importing that file and look at the result. == Screenshots == 1. User import screen == Changelog == = 1.0.0 = * Fixed bug where importing fields with "0" value doesn't work * Added option to update existing users by username or email = 0.5.1 = * Removed example plugin file to avoid invalid header error on installation = 0.5 = * Changed code to allow running import from another plugin = 0.4 = * Switched to RFC 4180 compliant library for CSV parsing * Introduced IS_IU_CSV_DELIMITER constant to allow changing the CSV delimiter * Improved memory usage by reading the CSV file line by line * Fixed bug where any serialized CSV column content is serialized again on import = 0.3.2 = * Fixed php notice when importing = 0.3.1 = * Don't process empty columns in the csv file = 0.3 = * Fixed bug where password field was overwritten for existing users * Use fgetcsv instead of str_getcsv * Don't run insert or update user function when only user ID was provided (performance improvement) * Internationalization * Added display name to example csv file = 0.2.2 = * Added role to example file * Fixed bug with users not imported when no user meta is set = 0.2.1 = * Added missing example file * Fixed bug with redirection after csv processing * Fixed error logging * Fixed typos in documentation * Other bug fixes = 0.2 = * First public release. * Code cleanup. * Added readme.txt. = 0.1 = * First release. == Upgrade Notice == = 0.5.1 = * Installation error fix. = 0.5 = * Code improvement for easier integration with another plugin. = 0.4 = * RFC 4180 compliance, performance improvement and bug fix. = 0.3 = Bug fix, performance improvement and internationalization. = 0.2.2 = Fix bug with users import when no user meta is set. = 0.2.1 = Various bug fixes and documentation improvements. = 0.2 = Code cleanup. Added readme.txt. = 0.1 = First release.
A blank email address should not overwrite another blank email address when importing a CSV. Otherwise it is impossible to import more than one user in a single file without email addresses (which is actually allowed by the WordPress API).
The fix is pretty simple, replace this line...
if ( ! $user && isset( $userdata['user_email'] ) )
with this...
if ( ! $user && isset( $userdata['user_email'] ) && $userdata['user_email'] )
I hope this can be fixed in a future version. Thanks!
When formatting .csv files in excel on a mac, the plugin doesn't work, but doesn't log an error. I finally figured out what the problem was, and solved by a manual treatment in vi in the terminal.
I did all your treatments and data formatting on the list, saved in excel and closed, then opened with vi in terminal and run the
following:
:%s/\r/\r/g
This will replace line break errors with proper line breaks.
I get the following error when trying to install the plugin via composer using wpackagist-plugin/import-users-from-csv
(which is listed in composer search
results) โ anything you can do?
[Composer\Downloader\TransportException]
The "http://wpackagist.org/p/wpackagist-plugin/import-users-from-csv$64cef4b5df99777368626d210b31baae98d828e21c9191417d6cfef4c391ec93.json" file could not be downloaded (HTTP/1.1 404 Not Found)
Hey Ulrich,
I would like to know if you would be keen to transfer ownership of this plugin? I see it hasn't been updated in a while and I'd like to simply maintain compatibility of it with new PHP and WordPress versions.
I've tried to reach out on all mediums :)
Thanks!
When importing via CSV file it takes averagely more than 2 minutes to upload one user. So if list of 10 users would become 2o minutes. Is there any particular reason? I'm using a pmpro plugin also with these
I want to keep my own user ID, Is it possible?
Would be great if you made the page process differently, by ajax or whatever, because I am getting page timeouts on large files and have to split manually into smaller chunks. Otherwise, it's a great, simple, useful plugin.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.