├── screenshot-1.png ├── languages ├── export-users-to-csv-fr_FR.mo ├── export-users-to-csv-tr_TR.mo ├── export-users-to-csv.pot ├── export-users-to-csv-tr_TR.po └── export-users-to-csv-fr_FR.po ├── readme.txt └── export-users-to-csv.php /screenshot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sub/export-users-to-csv/master/screenshot-1.png -------------------------------------------------------------------------------- /languages/export-users-to-csv-fr_FR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sub/export-users-to-csv/master/languages/export-users-to-csv-fr_FR.mo -------------------------------------------------------------------------------- /languages/export-users-to-csv-tr_TR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sub/export-users-to-csv/master/languages/export-users-to-csv-tr_TR.mo -------------------------------------------------------------------------------- /languages/export-users-to-csv.pot: -------------------------------------------------------------------------------- 1 | # Translation of the WordPress plugin Export Users to CSV 0.3 by PubPoet. 2 | # Copyright (C) 2011 PubPoet 3 | # This file is distributed under the same license as the Export Users to CSV package. 4 | # Ulrich Sossou , 2011. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: Export Users to CSV 0.3\n" 10 | "Report-Msgid-Bugs-To: http://wordpress.org/tag/export-users-to-csv\n" 11 | "POT-Creation-Date: 2011-11-27 09:07+0100\n" 12 | "PO-Revision-Date: 2011-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: Ulrich Sossou \n" 14 | "Language-Team: Ulrich Sossou \n" 15 | "Language: \n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=utf-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | 20 | #: export-users-to-csv.php:58 21 | msgid "Export to CSV" 22 | msgstr "" 23 | 24 | #: export-users-to-csv.php:138 25 | msgid "You do not have sufficient permissions to access this page." 26 | msgstr "" 27 | 28 | #: export-users-to-csv.php:142 29 | msgid "Export users to a CSV file" 30 | msgstr "" 31 | 32 | #: export-users-to-csv.php:145 33 | msgid "No user found." 34 | msgstr "" 35 | 36 | #: export-users-to-csv.php:152 37 | msgid "Role" 38 | msgstr "" 39 | 40 | #: export-users-to-csv.php:156 41 | msgid "Every Role" 42 | msgstr "" 43 | 44 | #: export-users-to-csv.php:166 45 | msgid "Date range" 46 | msgstr "" 47 | 48 | #: export-users-to-csv.php:169 49 | msgid "Start Date" 50 | msgstr "" 51 | 52 | #: export-users-to-csv.php:173 53 | msgid "End Date" 54 | msgstr "" 55 | 56 | #: export-users-to-csv.php:181 57 | msgid "Export" 58 | msgstr "" 59 | 60 | #. Plugin Name of the plugin/theme 61 | msgid "Export Users to CSV" 62 | msgstr "" 63 | 64 | #. Plugin URI of the plugin/theme 65 | msgid "http://pubpoet.com/plugins/" 66 | msgstr "" 67 | 68 | #. Description of the plugin/theme 69 | msgid "Export Users data and metadata to a csv file." 70 | msgstr "" 71 | 72 | #. Author of the plugin/theme 73 | msgid "PubPoet" 74 | msgstr "" 75 | 76 | #. Author URI of the plugin/theme 77 | msgid "http://pubpoet.com/" 78 | msgstr "" 79 | -------------------------------------------------------------------------------- /languages/export-users-to-csv-tr_TR.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: Export to CSV\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2011-10-30 17:05+0200\n" 6 | "PO-Revision-Date: \n" 7 | "Last-Translator: Tolga Kaprol \n" 8 | "Language-Team: Tolga Kaprol \n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Poedit-Language: Turkish\n" 13 | "X-Poedit-Country: TURKEY\n" 14 | "X-Poedit-SourceCharset: iso-8859-1\n" 15 | "X-Poedit-KeywordsList: __;_e\n" 16 | "X-Poedit-Basepath: .\n" 17 | "X-Poedit-SearchPath-0: .\n" 18 | 19 | #: export-users-to-csv.php:57 20 | msgid "Export to CSV" 21 | msgstr "CSV'ye Aktar" 22 | 23 | #: export-users-to-csv.php:135 24 | msgid "You do not have sufficient permissions to access this page." 25 | msgstr "Bu sayfaya ulaşmak için yetkiniz yoktur." 26 | 27 | #: export-users-to-csv.php:139 28 | msgid "Export users to a CSV file" 29 | msgstr "Kullanıcıları CSV'ye Aktar" 30 | 31 | #: export-users-to-csv.php:142 32 | msgid "No user found." 33 | msgstr "Kullanıcı bulunamadı." 34 | 35 | #: export-users-to-csv.php:149 36 | msgid "Role" 37 | msgstr "Rol" 38 | 39 | #: export-users-to-csv.php:153 40 | msgid "Every Role" 41 | msgstr "Tüm Roller" 42 | 43 | #: export-users-to-csv.php:163 44 | msgid "Date range" 45 | msgstr "Tarih Aralığı" 46 | 47 | #: export-users-to-csv.php:166 48 | msgid "Start Date" 49 | msgstr "Başlangıç Tarihi" 50 | 51 | #: export-users-to-csv.php:170 52 | msgid "End Date" 53 | msgstr "Bitiş Tarihi" 54 | 55 | #: export-users-to-csv.php:178 56 | msgid "Export" 57 | msgstr "Dışa Aktar" 58 | 59 | #~ msgid "Do you want to continue?" 60 | #~ msgstr "Devam etmek istiyor musunuz?" 61 | 62 | #~ msgid "What it does " 63 | #~ msgstr "Ne yapar?" 64 | 65 | #~ msgid "Parameters" 66 | #~ msgstr "Parametreler" 67 | 68 | #~ msgid "Example" 69 | #~ msgstr "Örnek" 70 | 71 | #~ msgid "Popular Posts" 72 | #~ msgstr "Popüler İçerikler" 73 | 74 | #~ msgid "Success! The cache table has been cleared!" 75 | #~ msgstr "Tebrikler! Önbellek tablosu temizlendi!" 76 | 77 | #~ msgid "Wordpress Popular Posts Stats" 78 | #~ msgstr "Wordpress Popüler İçerikler İstatistikleri" 79 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | === Plugin Name === 2 | Contributors: sorich87 3 | Tags: user, users, csv, batch, export, exporter, admin 4 | Requires at least: 3.2 5 | Tested up to: 3.3 6 | Stable tag: 0.3 7 | 8 | Export users data and metadata to a csv file 9 | 10 | == Description == 11 | 12 | A plugin that export ALL user data and meta data, and that works! 13 | 14 | You can even export the users by role and registration date range. 15 | 16 | = Features = 17 | 18 | * Exports all users fields 19 | * Exports users meta 20 | * Exports users by role 21 | * Exports users by date range 22 | 23 | For feature request and bug reports, [please use the forums](http://wordpress.org/tags/export-users-to-csv?forum_id=10#postform). 24 | 25 | == Installation == 26 | 27 | For an automatic installation through WordPress: 28 | 29 | 1. Go to the 'Add New' plugins screen in your WordPress admin area 30 | 1. Search for 'Export Users to CSV' 31 | 1. Click 'Install Now' and activate the plugin 32 | 1. Go the 'Users' menu, under 'Export to CSV' 33 | 34 | 35 | Or use a nifty tool by WordPress lead developer Mark Jaquith: 36 | 37 | 1. Visit [this link](http://coveredwebservices.com/wp-plugin-install/?plugin=export-users-to-csv) and follow the instructions. 38 | 39 | 40 | For a manual installation via FTP: 41 | 42 | 1. Upload the `export-users-to-csv` directory to the `/wp-content/plugins/` directory 43 | 1. Activate the plugin through the 'Plugins' screen in your WordPress admin area 44 | 1. Go the 'Users' menu, under 'Export to CSV' 45 | 46 | 47 | To upload the plugin through WordPress, instead of FTP: 48 | 49 | 1. Upload the downloaded zip file on the 'Add New' plugins screen (see the 'Upload' tab) in your WordPress admin area and activate. 50 | 1. Go the 'Users' menu, under 'Export to CSV' 51 | 52 | == Frequently Asked Questions == 53 | 54 | = How to use? = 55 | 56 | Click on the 'Export to CSV' link in the 'Users' menu, choose the role and the date range or don't select anything if you want to export all users, then click 'Export'. That's all! 57 | 58 | == Screenshots == 59 | 60 | 1. User export screen 61 | 62 | == Changelog == 63 | 64 | = 0.2 = 65 | * First public release. 66 | * Improved memory usage. 67 | * Added date range selection. 68 | * Added readme.txt. 69 | 70 | = 0.1 = 71 | * First release. 72 | 73 | == Upgrade Notice == 74 | 75 | = 0.2 = 76 | Improved memory usage. Added date range selection. Added readme.txt. 77 | 78 | = 0.1 = 79 | First release. 80 | -------------------------------------------------------------------------------- /languages/export-users-to-csv-fr_FR.po: -------------------------------------------------------------------------------- 1 | # Translation of the WordPress plugin Export Users to CSV 0.3 by PubPoet. 2 | # Copyright (C) 2011 PubPoet 3 | # This file is distributed under the same license as the Export Users to CSV package. 4 | # Ulrich Sossou , 2011. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: Export Users to CSV 0.3\n" 9 | "Report-Msgid-Bugs-To: http://wordpress.org/tag/export-users-to-csv\n" 10 | "POT-Creation-Date: 2011-11-27 09:07+0100\n" 11 | "PO-Revision-Date: 2011-11-27 09:24+0100\n" 12 | "Last-Translator: Ulrich Sossou \n" 13 | "Language-Team: Ulrich Sossou\n" 14 | "Language: \n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "X-Poedit-Language: French\n" 19 | "X-Poedit-Country: FRANCE\n" 20 | 21 | #: export-users-to-csv.php:58 22 | msgid "Export to CSV" 23 | msgstr "Exporter en CSV" 24 | 25 | #: export-users-to-csv.php:138 26 | msgid "You do not have sufficient permissions to access this page." 27 | msgstr "Vous n'avez pas les permissions suffisantes pour accéder à cette page." 28 | 29 | #: export-users-to-csv.php:142 30 | msgid "Export users to a CSV file" 31 | msgstr "Exporter les utilisateurs vers un fichier CSV" 32 | 33 | #: export-users-to-csv.php:145 34 | msgid "No user found." 35 | msgstr "Aucun utilisateur trouvé." 36 | 37 | #: export-users-to-csv.php:152 38 | msgid "Role" 39 | msgstr "Role" 40 | 41 | #: export-users-to-csv.php:156 42 | msgid "Every Role" 43 | msgstr "Tous les Roles" 44 | 45 | #: export-users-to-csv.php:166 46 | msgid "Date range" 47 | msgstr "Date d'inscription" 48 | 49 | #: export-users-to-csv.php:169 50 | msgid "Start Date" 51 | msgstr "De" 52 | 53 | #: export-users-to-csv.php:173 54 | msgid "End Date" 55 | msgstr "A" 56 | 57 | #: export-users-to-csv.php:181 58 | msgid "Export" 59 | msgstr "Exporter" 60 | 61 | #. Plugin Name of the plugin/theme 62 | msgid "Export Users to CSV" 63 | msgstr "Export Users to CSV" 64 | 65 | #. Plugin URI of the plugin/theme 66 | msgid "http://pubpoet.com/plugins/" 67 | msgstr "http://pubpoet.com/plugins/" 68 | 69 | #. Description of the plugin/theme 70 | msgid "Export Users data and metadata to a csv file." 71 | msgstr "Exporte les données et métadonnées des utilisateurs de votre site dans un fichier csv." 72 | 73 | #. Author of the plugin/theme 74 | msgid "PubPoet" 75 | msgstr "PubPoet" 76 | 77 | #. Author URI of the plugin/theme 78 | msgid "http://pubpoet.com/" 79 | msgstr "http://pubpoet.com/" 80 | 81 | -------------------------------------------------------------------------------- /export-users-to-csv.php: -------------------------------------------------------------------------------- 1 | 'all_with_meta', 72 | 'role' => stripslashes( $_POST['role'] ) 73 | ); 74 | 75 | add_action( 'pre_user_query', array( $this, 'pre_user_query' ) ); 76 | $users = get_users( $args ); 77 | remove_action( 'pre_user_query', array( $this, 'pre_user_query' ) ); 78 | 79 | if ( ! $users ) { 80 | $referer = add_query_arg( 'error', 'empty', wp_get_referer() ); 81 | wp_redirect( $referer ); 82 | exit; 83 | } 84 | 85 | $sitename = sanitize_key( get_bloginfo( 'name' ) ); 86 | if ( ! empty( $sitename ) ) 87 | $sitename .= '.'; 88 | $filename = $sitename . 'users.' . date( 'Y-m-d-H-i-s' ) . '.csv'; 89 | 90 | header( 'Content-Description: File Transfer' ); 91 | header( 'Content-Disposition: attachment; filename=' . $filename ); 92 | header( 'Content-Type: text/csv; charset=' . get_option( 'blog_charset' ), true ); 93 | 94 | $exclude_data = apply_filters( 'pp_eu_exclude_data', array() ); 95 | 96 | global $wpdb; 97 | 98 | $data_keys = array( 99 | 'ID', 'user_login', 'user_pass', 100 | 'user_nicename', 'user_email', 'user_url', 101 | 'user_registered', 'user_activation_key', 'user_status', 102 | 'display_name' 103 | ); 104 | $meta_keys = $wpdb->get_results( "SELECT distinct(meta_key) FROM $wpdb->usermeta" ); 105 | $meta_keys = wp_list_pluck( $meta_keys, 'meta_key' ); 106 | $fields = array_merge( $data_keys, $meta_keys ); 107 | 108 | $headers = array(); 109 | foreach ( $fields as $key => $field ) { 110 | if ( in_array( $field, $exclude_data ) ) 111 | unset( $fields[$key] ); 112 | else 113 | $headers[] = '"' . $field . '"'; 114 | } 115 | echo implode( ',', $headers ) . "\n"; 116 | 117 | foreach ( $users as $user ) { 118 | $data = array(); 119 | foreach ( $fields as $field ) { 120 | $value = isset( $user->{$field} ) ? $user->{$field} : ''; 121 | $value = is_array( $value ) ? serialize( $value ) : $value; 122 | $data[] = '"' . str_replace( '"', '""', $value ) . '"'; 123 | } 124 | echo implode( ',', $data ) . "\n"; 125 | } 126 | 127 | exit; 128 | } 129 | } 130 | 131 | /** 132 | * Content of the settings page 133 | * 134 | * @since 0.1 135 | **/ 136 | public function users_page() { 137 | if ( ! current_user_can( 'list_users' ) ) 138 | wp_die( __( 'You do not have sufficient permissions to access this page.', 'export-users-to-csv' ) ); 139 | ?> 140 | 141 |
142 |

143 |

' . __( 'No user found.', 'export-users-to-csv' ) . '

'; 146 | } 147 | ?> 148 |
149 | 150 | 151 | 152 | 153 | 164 | 165 | 166 | 167 | 177 | 178 |
154 | 163 |
168 | 172 | 176 |
179 |

180 | 181 | 182 |

183 |
184 | prepare( " AND $wpdb->users.user_registered >= %s", date( 'Y-m-d', strtotime( $_POST['start_date'] ) ) ); 200 | 201 | if ( ! empty( $_POST['end_date'] ) ) 202 | $where .= $wpdb->prepare( " AND $wpdb->users.user_registered < %s", date( 'Y-m-d', strtotime( '+1 month', strtotime( $_POST['end_date'] ) ) ) ); 203 | 204 | if ( ! empty( $where ) ) 205 | $user_search->query_where = str_replace( 'WHERE 1=1', "WHERE 1=1$where", $user_search->query_where ); 206 | 207 | return $user_search; 208 | } 209 | 210 | private function export_date_options() { 211 | global $wpdb, $wp_locale; 212 | 213 | $months = $wpdb->get_results( " 214 | SELECT DISTINCT YEAR( user_registered ) AS year, MONTH( user_registered ) AS month 215 | FROM $wpdb->users 216 | ORDER BY user_registered DESC 217 | " ); 218 | 219 | $month_count = count( $months ); 220 | if ( !$month_count || ( 1 == $month_count && 0 == $months[0]->month ) ) 221 | return; 222 | 223 | foreach ( $months as $date ) { 224 | if ( 0 == $date->year ) 225 | continue; 226 | 227 | $month = zeroise( $date->month, 2 ); 228 | echo ''; 229 | } 230 | } 231 | } 232 | 233 | new PP_EU_Export_Users; 234 | --------------------------------------------------------------------------------