Version Description
- Fix: to remove minor security loop hole
- New: Added option to remove standard wp_users data from export
- Fix: removed roles and groups columns from export when options hidden
Download this release
Release Info
Developer | qlstudio |
Plugin | Export User Data |
Version | 1.2.3 |
Comparing to | |
See all releases |
Code changes from version 1.2.2 to 1.2.3
- export-user-data.php +140 -38
- readme.md +6 -1
- readme.txt +7 -2
export-user-data.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: Export User Data
|
5 |
Plugin URI: http://qstudio.us/plugins/
|
6 |
Description: Export User data, metadata and BuddyPress X-Profile data.
|
7 |
-
Version: 1.2.
|
8 |
Author: Q Studio
|
9 |
Author URI: http://qstudio.us
|
10 |
License: GPL2
|
@@ -23,7 +23,7 @@ if ( ! class_exists( 'Q_Export_User_Data' ) )
|
|
23 |
{
|
24 |
|
25 |
// plugin version
|
26 |
-
define( 'Q_EXPORT_USER_DATA_VERSION', '1.2.
|
27 |
|
28 |
// instatiate class via hook, only if inside admin
|
29 |
if ( is_admin() ) {
|
@@ -42,7 +42,7 @@ if ( ! class_exists( 'Q_Export_User_Data' ) )
|
|
42 |
class Q_Export_User_Data {
|
43 |
|
44 |
// debug ##
|
45 |
-
const debug =
|
46 |
|
47 |
// Refers to a single instance of this class. ##
|
48 |
private static $instance = null;
|
@@ -96,7 +96,7 @@ if ( ! class_exists( 'Q_Export_User_Data' ) )
|
|
96 |
add_action( 'admin_menu', array( $this, 'add_admin_pages' ) );
|
97 |
add_action( 'init', array( $this, 'generate_data' ), 100000003 );
|
98 |
add_filter( 'q_eud_exclude_data', array( $this, 'exclude_data' ) );
|
99 |
-
add_action( 'admin_enqueue_scripts', array( $this, '
|
100 |
add_action( 'admin_footer', array( $this, 'jquery' ), 100000 );
|
101 |
add_action( 'admin_footer', array( $this, 'css' ), 100000 );
|
102 |
|
@@ -126,14 +126,21 @@ if ( ! class_exists( 'Q_Export_User_Data' ) )
|
|
126 |
* @return void
|
127 |
*/
|
128 |
public static function log( $log )
|
129 |
-
{
|
|
|
130 |
if ( true === WP_DEBUG ) {
|
|
|
131 |
if ( is_array( $log ) || is_object( $log ) ) {
|
|
|
132 |
error_log( print_r( $log, true ) );
|
|
|
133 |
} else {
|
|
|
134 |
error_log( $log );
|
|
|
135 |
}
|
136 |
}
|
|
|
137 |
}
|
138 |
|
139 |
|
@@ -153,7 +160,7 @@ if ( ! class_exists( 'Q_Export_User_Data' ) )
|
|
153 |
/**
|
154 |
* style and interaction
|
155 |
*/
|
156 |
-
public function
|
157 |
{
|
158 |
|
159 |
// load the scripts on only the plugin admin page ##
|
@@ -297,6 +304,7 @@ if ( ! class_exists( 'Q_Export_User_Data' ) )
|
|
297 |
$this->role = $this->q_eud_exports[$export]['role'];
|
298 |
$this->roles = $this->q_eud_exports[$export]['roles'];
|
299 |
$this->groups = $this->q_eud_exports[$export]['groups'];
|
|
|
300 |
$this->start_date = $this->q_eud_exports[$export]['start_date'];
|
301 |
$this->end_date = $this->q_eud_exports[$export]['end_date'];
|
302 |
$this->limit_offset = $this->q_eud_exports[$export]['limit_offset'];
|
@@ -311,6 +319,7 @@ if ( ! class_exists( 'Q_Export_User_Data' ) )
|
|
311 |
$this->updated_since_date = '';
|
312 |
$this->field_updated_since = '';
|
313 |
$this->role = '';
|
|
|
314 |
$this->roles = '1';
|
315 |
$this->groups = '1';
|
316 |
$this->start_date = '';
|
@@ -433,6 +442,7 @@ if ( ! class_exists( 'Q_Export_User_Data' ) )
|
|
433 |
* @param $user_id Integer ID of specific user
|
434 |
* @since 0.9.6
|
435 |
* @return Array User profile fields
|
|
|
436 |
*/
|
437 |
private static function get_all_for_user( $user_id = null )
|
438 |
{
|
@@ -509,7 +519,7 @@ if ( ! class_exists( 'Q_Export_User_Data' ) )
|
|
509 |
|
510 |
// build argument array ##
|
511 |
$args = array(
|
512 |
-
'fields' => 'all',
|
513 |
'role' => sanitize_text_field( $_POST['role'] )
|
514 |
);
|
515 |
|
@@ -540,7 +550,7 @@ if ( ! class_exists( 'Q_Export_User_Data' ) )
|
|
540 |
}
|
541 |
|
542 |
}
|
543 |
-
|
544 |
// pre_user query ##
|
545 |
add_action( 'pre_user_query', array( $this, 'pre_user_query' ) );
|
546 |
$users = get_users( $args );
|
@@ -689,11 +699,20 @@ if ( ! class_exists( 'Q_Export_User_Data' ) )
|
|
689 |
// global wpdb object ##
|
690 |
global $wpdb;
|
691 |
|
|
|
|
|
|
|
692 |
// compile final fields list ##
|
693 |
-
$fields = array_merge(
|
|
|
|
|
|
|
|
|
|
|
|
|
694 |
|
695 |
// test field array ##
|
696 |
-
|
697 |
|
698 |
// build the document headers ##
|
699 |
$headers = array();
|
@@ -708,6 +727,7 @@ if ( ! class_exists( 'Q_Export_User_Data' ) )
|
|
708 |
// grab fields to exclude from exports ##
|
709 |
if ( in_array( $field, $this->get_exclude_fields() ) ) {
|
710 |
|
|
|
711 |
unset( $fields[$key] );
|
712 |
|
713 |
} else {
|
@@ -761,10 +781,14 @@ if ( ! class_exists( 'Q_Export_User_Data' ) )
|
|
761 |
|
762 |
// echo headers ##
|
763 |
echo $pre . implode( $seperator, $headers ) . $breaker;
|
764 |
-
|
|
|
|
|
765 |
// build row values for each user ##
|
766 |
foreach ( $users as $user ) {
|
767 |
-
|
|
|
|
|
768 |
// check if we're hitting any Memory limits, if so flush them out ##
|
769 |
// per http://wordpress.org/support/topic/how-to-exporting-a-lot-of-data-out-of-memory-issue?replies=2
|
770 |
if ( memory_get_usage( true ) > $memory_limit ) {
|
@@ -849,7 +873,7 @@ if ( ! class_exists( 'Q_Export_User_Data' ) )
|
|
849 |
|
850 |
// include the user's role in the export ##
|
851 |
}
|
852 |
-
elseif ( isset( $_POST['roles'] ) && $_POST['roles']
|
853 |
{
|
854 |
|
855 |
// add "Role" as $value ##
|
@@ -857,7 +881,7 @@ if ( ! class_exists( 'Q_Export_User_Data' ) )
|
|
857 |
|
858 |
// include the user's BP group in the export ##
|
859 |
}
|
860 |
-
elseif ( isset( $_POST['groups'] ) && $_POST['groups']
|
861 |
{
|
862 |
|
863 |
if ( function_exists( 'groups_get_user_groups' ) ) {
|
@@ -946,12 +970,12 @@ if ( ! class_exists( 'Q_Export_User_Data' ) )
|
|
946 |
// wrap values in quotes and add to array ##
|
947 |
if ( $is_csv ) {
|
948 |
|
949 |
-
$data[] = '"' . str_replace( '"', '""', $value ) . '"';
|
950 |
|
951 |
// just add to array ##
|
952 |
} else {
|
953 |
|
954 |
-
$data[] = $value;
|
955 |
}
|
956 |
|
957 |
}
|
@@ -1018,6 +1042,7 @@ if ( ! class_exists( 'Q_Export_User_Data' ) )
|
|
1018 |
$format = isset( $_POST['format'] ) ? $_POST['format'] : '' ;
|
1019 |
$role = isset( $_POST['role'] ) ? $_POST['role'] : '' ;
|
1020 |
$roles = isset( $_POST['roles'] ) ? $_POST['roles'] : '0' ;
|
|
|
1021 |
$groups = isset( $_POST['groups'] ) ? $_POST['groups'] : '0' ;
|
1022 |
$start_date = isset( $_POST['start_date'] ) ? $_POST['start_date'] : '' ;
|
1023 |
$end_date = isset( $_POST['end_date'] ) ? $_POST['end_date'] : '' ;
|
@@ -1033,6 +1058,7 @@ if ( ! class_exists( 'Q_Export_User_Data' ) )
|
|
1033 |
'bp_fields_update_time_saved_fields' => $bp_fields_update,
|
1034 |
'role' => $role,
|
1035 |
'roles' => $roles,
|
|
|
1036 |
'groups' => $groups,
|
1037 |
'start_date' => $start_date,
|
1038 |
'end_date' => $end_date,
|
@@ -1075,6 +1101,9 @@ if ( ! class_exists( 'Q_Export_User_Data' ) )
|
|
1075 |
$this->delete_user_options( sanitize_text_field( $_POST['export_name'] ) );
|
1076 |
|
1077 |
}
|
|
|
|
|
|
|
1078 |
|
1079 |
?>
|
1080 |
<div class="wrap">
|
@@ -1237,7 +1266,7 @@ if ( ! class_exists( 'Q_Export_User_Data' ) )
|
|
1237 |
foreach ( $bp_fields as $key ) {
|
1238 |
|
1239 |
// tidy up key ##
|
1240 |
-
|
1241 |
|
1242 |
#echo "<label for='".esc_attr( $key_tidy )."'><input id='".esc_attr( $key_tidy )."' type='checkbox' name='bp_fields[]' value='".esc_attr( $key_tidy )."'/> $key</label><br />";
|
1243 |
|
@@ -1286,7 +1315,23 @@ if ( ! class_exists( 'Q_Export_User_Data' ) )
|
|
1286 |
?></p>
|
1287 |
</td>
|
1288 |
</tr>
|
1289 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1290 |
<tr valign="top" class="toggleable">
|
1291 |
<th scope="row"><label for="groups"><?php _e( 'BP User Groups', 'export-user-data' ); ?></label></th>
|
1292 |
<td>
|
@@ -1532,7 +1577,7 @@ if ( ! class_exists( 'Q_Export_User_Data' ) )
|
|
1532 |
|
1533 |
</table>
|
1534 |
<p class="submit">
|
1535 |
-
<input type="hidden" name="_wp_http_referer" value="<?php echo $_SERVER['REQUEST_URI'] ?>" />
|
1536 |
<input type="submit" class="button-primary" value="<?php _e( 'Run Export', 'export-user-data' ); ?>" />
|
1537 |
</p>
|
1538 |
</form>
|
@@ -1722,23 +1767,42 @@ if ( ! class_exists( 'Q_Export_User_Data' ) )
|
|
1722 |
/**
|
1723 |
* Get the array of standard WP_User fields to return
|
1724 |
*/
|
1725 |
-
public function get_user_fields()
|
1726 |
{
|
1727 |
|
1728 |
-
|
1729 |
-
|
1730 |
-
|
1731 |
-
|
1732 |
-
|
1733 |
-
|
1734 |
-
|
1735 |
-
|
1736 |
-
|
1737 |
-
|
1738 |
-
|
1739 |
-
|
1740 |
-
|
1741 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1742 |
return apply_filters( 'export_user_data_user_fields', $user_fields );
|
1743 |
|
1744 |
}
|
@@ -1747,15 +1811,30 @@ if ( ! class_exists( 'Q_Export_User_Data' ) )
|
|
1747 |
/**
|
1748 |
* Get the array of special user fields to return
|
1749 |
*/
|
1750 |
-
public function get_special_fields()
|
1751 |
{
|
1752 |
|
1753 |
// exportable user data ##
|
1754 |
$special_fields = array(
|
1755 |
-
|
1756 |
-
|
1757 |
);
|
1758 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1759 |
return apply_filters( 'export_user_data_special_fields', $special_fields );
|
1760 |
|
1761 |
}
|
@@ -2037,6 +2116,29 @@ if ( ! class_exists( 'Q_Export_User_Data' ) )
|
|
2037 |
return $value;
|
2038 |
|
2039 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2040 |
|
2041 |
|
2042 |
/**
|
4 |
Plugin Name: Export User Data
|
5 |
Plugin URI: http://qstudio.us/plugins/
|
6 |
Description: Export User data, metadata and BuddyPress X-Profile data.
|
7 |
+
Version: 1.2.3
|
8 |
Author: Q Studio
|
9 |
Author URI: http://qstudio.us
|
10 |
License: GPL2
|
23 |
{
|
24 |
|
25 |
// plugin version
|
26 |
+
define( 'Q_EXPORT_USER_DATA_VERSION', '1.2.3' ); // version ##
|
27 |
|
28 |
// instatiate class via hook, only if inside admin
|
29 |
if ( is_admin() ) {
|
42 |
class Q_Export_User_Data {
|
43 |
|
44 |
// debug ##
|
45 |
+
const debug = true;
|
46 |
|
47 |
// Refers to a single instance of this class. ##
|
48 |
private static $instance = null;
|
96 |
add_action( 'admin_menu', array( $this, 'add_admin_pages' ) );
|
97 |
add_action( 'init', array( $this, 'generate_data' ), 100000003 );
|
98 |
add_filter( 'q_eud_exclude_data', array( $this, 'exclude_data' ) );
|
99 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ), 1 );
|
100 |
add_action( 'admin_footer', array( $this, 'jquery' ), 100000 );
|
101 |
add_action( 'admin_footer', array( $this, 'css' ), 100000 );
|
102 |
|
126 |
* @return void
|
127 |
*/
|
128 |
public static function log( $log )
|
129 |
+
{
|
130 |
+
|
131 |
if ( true === WP_DEBUG ) {
|
132 |
+
|
133 |
if ( is_array( $log ) || is_object( $log ) ) {
|
134 |
+
|
135 |
error_log( print_r( $log, true ) );
|
136 |
+
|
137 |
} else {
|
138 |
+
|
139 |
error_log( $log );
|
140 |
+
|
141 |
}
|
142 |
}
|
143 |
+
|
144 |
}
|
145 |
|
146 |
|
160 |
/**
|
161 |
* style and interaction
|
162 |
*/
|
163 |
+
public function admin_enqueue_scripts( $hook )
|
164 |
{
|
165 |
|
166 |
// load the scripts on only the plugin admin page ##
|
304 |
$this->role = $this->q_eud_exports[$export]['role'];
|
305 |
$this->roles = $this->q_eud_exports[$export]['roles'];
|
306 |
$this->groups = $this->q_eud_exports[$export]['groups'];
|
307 |
+
$this->user_fields = $this->q_eud_exports[$export]['user_fields'];
|
308 |
$this->start_date = $this->q_eud_exports[$export]['start_date'];
|
309 |
$this->end_date = $this->q_eud_exports[$export]['end_date'];
|
310 |
$this->limit_offset = $this->q_eud_exports[$export]['limit_offset'];
|
319 |
$this->updated_since_date = '';
|
320 |
$this->field_updated_since = '';
|
321 |
$this->role = '';
|
322 |
+
$this->user_fields = '1';
|
323 |
$this->roles = '1';
|
324 |
$this->groups = '1';
|
325 |
$this->start_date = '';
|
442 |
* @param $user_id Integer ID of specific user
|
443 |
* @since 0.9.6
|
444 |
* @return Array User profile fields
|
445 |
+
* @deprecated since 1.2.1
|
446 |
*/
|
447 |
private static function get_all_for_user( $user_id = null )
|
448 |
{
|
519 |
|
520 |
// build argument array ##
|
521 |
$args = array(
|
522 |
+
'fields' => ( isset( $_POST['user_fields'] ) && '1' == $_POST['user_fields'] ) ? 'all' : array( 'ID' ), // exclude standard wp_users fields from get_users query ##
|
523 |
'role' => sanitize_text_field( $_POST['role'] )
|
524 |
);
|
525 |
|
550 |
}
|
551 |
|
552 |
}
|
553 |
+
|
554 |
// pre_user query ##
|
555 |
add_action( 'pre_user_query', array( $this, 'pre_user_query' ) );
|
556 |
$users = get_users( $args );
|
699 |
// global wpdb object ##
|
700 |
global $wpdb;
|
701 |
|
702 |
+
// debug ##
|
703 |
+
if ( self::debug ) self::log( 'generate_data(): merging array' );
|
704 |
+
|
705 |
// compile final fields list ##
|
706 |
+
$fields = array_merge(
|
707 |
+
self::get_user_fields() // standard wp_user fields ##
|
708 |
+
, self::get_special_fields() // 'special' fields - which are controlled via dedicated checks ##
|
709 |
+
, $usermeta_fields // wp_user_meta fields ##
|
710 |
+
, $bp_fields_passed // selected buddypress fields ##
|
711 |
+
, $bp_fields_update_passed // update date for buddypress fields ##
|
712 |
+
);
|
713 |
|
714 |
// test field array ##
|
715 |
+
#self::pr( $fields );
|
716 |
|
717 |
// build the document headers ##
|
718 |
$headers = array();
|
727 |
// grab fields to exclude from exports ##
|
728 |
if ( in_array( $field, $this->get_exclude_fields() ) ) {
|
729 |
|
730 |
+
// ditch 'em ##
|
731 |
unset( $fields[$key] );
|
732 |
|
733 |
} else {
|
781 |
|
782 |
// echo headers ##
|
783 |
echo $pre . implode( $seperator, $headers ) . $breaker;
|
784 |
+
|
785 |
+
#wp_die( self::pr( $users ) );
|
786 |
+
|
787 |
// build row values for each user ##
|
788 |
foreach ( $users as $user ) {
|
789 |
+
|
790 |
+
#wp_die( self::pr( $user ) );
|
791 |
+
|
792 |
// check if we're hitting any Memory limits, if so flush them out ##
|
793 |
// per http://wordpress.org/support/topic/how-to-exporting-a-lot-of-data-out-of-memory-issue?replies=2
|
794 |
if ( memory_get_usage( true ) > $memory_limit ) {
|
873 |
|
874 |
// include the user's role in the export ##
|
875 |
}
|
876 |
+
elseif ( isset( $_POST['roles'] ) && '1' == $_POST['roles'] && $field == 'roles' )
|
877 |
{
|
878 |
|
879 |
// add "Role" as $value ##
|
881 |
|
882 |
// include the user's BP group in the export ##
|
883 |
}
|
884 |
+
elseif ( isset( $_POST['groups'] ) && '1' == $_POST['groups'] && $field == 'groups' )
|
885 |
{
|
886 |
|
887 |
if ( function_exists( 'groups_get_user_groups' ) ) {
|
970 |
// wrap values in quotes and add to array ##
|
971 |
if ( $is_csv ) {
|
972 |
|
973 |
+
$data[] = '"' . str_replace( '"', '""', self::special_characters( $value ) ) . '"';
|
974 |
|
975 |
// just add to array ##
|
976 |
} else {
|
977 |
|
978 |
+
$data[] = self::special_characters( $value );
|
979 |
}
|
980 |
|
981 |
}
|
1042 |
$format = isset( $_POST['format'] ) ? $_POST['format'] : '' ;
|
1043 |
$role = isset( $_POST['role'] ) ? $_POST['role'] : '' ;
|
1044 |
$roles = isset( $_POST['roles'] ) ? $_POST['roles'] : '0' ;
|
1045 |
+
$user_fields = isset( $_POST['user_fields'] ) ? $_POST['user_fields'] : '0' ;
|
1046 |
$groups = isset( $_POST['groups'] ) ? $_POST['groups'] : '0' ;
|
1047 |
$start_date = isset( $_POST['start_date'] ) ? $_POST['start_date'] : '' ;
|
1048 |
$end_date = isset( $_POST['end_date'] ) ? $_POST['end_date'] : '' ;
|
1058 |
'bp_fields_update_time_saved_fields' => $bp_fields_update,
|
1059 |
'role' => $role,
|
1060 |
'roles' => $roles,
|
1061 |
+
'user_fields' => $user_fields,
|
1062 |
'groups' => $groups,
|
1063 |
'start_date' => $start_date,
|
1064 |
'end_date' => $end_date,
|
1101 |
$this->delete_user_options( sanitize_text_field( $_POST['export_name'] ) );
|
1102 |
|
1103 |
}
|
1104 |
+
|
1105 |
+
// what's in 'this' ? ##
|
1106 |
+
#self:pr( $this );
|
1107 |
|
1108 |
?>
|
1109 |
<div class="wrap">
|
1266 |
foreach ( $bp_fields as $key ) {
|
1267 |
|
1268 |
// tidy up key ##
|
1269 |
+
#$key_tidy = str_replace( ' ', '__', $key );
|
1270 |
|
1271 |
#echo "<label for='".esc_attr( $key_tidy )."'><input id='".esc_attr( $key_tidy )."' type='checkbox' name='bp_fields[]' value='".esc_attr( $key_tidy )."'/> $key</label><br />";
|
1272 |
|
1315 |
?></p>
|
1316 |
</td>
|
1317 |
</tr>
|
1318 |
+
|
1319 |
+
<tr valign="top" class="toggleable">
|
1320 |
+
<th scope="row"><label for="user_fields"><?php _e( 'Standard User Fields', 'export-user-data' ); ?></label></th>
|
1321 |
+
<td>
|
1322 |
+
<input id='user_fields' type='checkbox' name='user_fields' value='1' <?php checked( isset ( $this->user_fields ) ? intval ( $this->user_fields ) : '', 1 ); ?> />
|
1323 |
+
<p class="description"><?php
|
1324 |
+
printf(
|
1325 |
+
__( 'Include Standard user profile fields, such as user_login. <a href="%s" target="_blank">%s</a>', 'export-user-data' )
|
1326 |
+
, esc_html('https://codex.wordpress.org/Database_Description#Table:_wp_users')
|
1327 |
+
, 'Codex'
|
1328 |
+
);
|
1329 |
+
|
1330 |
+
echo 'value: '.$this->user_fields .' / Post value: '.$_POST['user_fields'];
|
1331 |
+
?></p>
|
1332 |
+
</td>
|
1333 |
+
</tr>
|
1334 |
+
|
1335 |
<tr valign="top" class="toggleable">
|
1336 |
<th scope="row"><label for="groups"><?php _e( 'BP User Groups', 'export-user-data' ); ?></label></th>
|
1337 |
<td>
|
1577 |
|
1578 |
</table>
|
1579 |
<p class="submit">
|
1580 |
+
<input type="hidden" name="_wp_http_referer" value="<?php echo esc_url( $_SERVER['REQUEST_URI'] ); ?>" />
|
1581 |
<input type="submit" class="button-primary" value="<?php _e( 'Run Export', 'export-user-data' ); ?>" />
|
1582 |
</p>
|
1583 |
</form>
|
1767 |
/**
|
1768 |
* Get the array of standard WP_User fields to return
|
1769 |
*/
|
1770 |
+
public static function get_user_fields()
|
1771 |
{
|
1772 |
|
1773 |
+
// skip addition fo standard wp_users fields ##
|
1774 |
+
if ( isset( $_POST['user_fields'] ) && '1' == $_POST['user_fields'] ) {
|
1775 |
+
|
1776 |
+
// debug ##
|
1777 |
+
if ( self::debug ) self::log( 'get_user_fields(): full' );
|
1778 |
+
|
1779 |
+
// exportable user data ##
|
1780 |
+
$user_fields = array(
|
1781 |
+
'ID'
|
1782 |
+
, 'user_login'
|
1783 |
+
#, 'user_pass'
|
1784 |
+
, 'user_nicename'
|
1785 |
+
, 'user_email'
|
1786 |
+
, 'user_url'
|
1787 |
+
, 'user_registered'
|
1788 |
+
#, 'user_activation_key'
|
1789 |
+
, 'user_status'
|
1790 |
+
, 'display_name'
|
1791 |
+
);
|
1792 |
+
|
1793 |
+
} else {
|
1794 |
+
|
1795 |
+
// debug ##
|
1796 |
+
if ( self::debug ) self::log( 'get_user_fields(): reduced' );
|
1797 |
+
|
1798 |
+
// just return the user ID
|
1799 |
+
$user_fields = array(
|
1800 |
+
'ID'
|
1801 |
+
);
|
1802 |
+
|
1803 |
+
}
|
1804 |
+
|
1805 |
+
// kick back values ##
|
1806 |
return apply_filters( 'export_user_data_user_fields', $user_fields );
|
1807 |
|
1808 |
}
|
1811 |
/**
|
1812 |
* Get the array of special user fields to return
|
1813 |
*/
|
1814 |
+
public static function get_special_fields()
|
1815 |
{
|
1816 |
|
1817 |
// exportable user data ##
|
1818 |
$special_fields = array(
|
1819 |
+
# 'roles' // list of WP Roles
|
1820 |
+
#, 'groups' // BP Groups
|
1821 |
);
|
1822 |
+
|
1823 |
+
// should we allow groups ##
|
1824 |
+
if ( isset( $_POST['groups'] ) && '1' == $_POST['groups'] ) {
|
1825 |
+
|
1826 |
+
$special_fields[] = 'groups'; // add groups ##
|
1827 |
+
|
1828 |
+
}
|
1829 |
+
|
1830 |
+
// should we allow groups ##
|
1831 |
+
if ( isset( $_POST['roles'] ) && '1' == $_POST['roles'] ) {
|
1832 |
+
|
1833 |
+
$special_fields[] = 'roles'; // add groups ##
|
1834 |
+
|
1835 |
+
}
|
1836 |
+
|
1837 |
+
// kick back the array ##
|
1838 |
return apply_filters( 'export_user_data_special_fields', $special_fields );
|
1839 |
|
1840 |
}
|
2116 |
return $value;
|
2117 |
|
2118 |
}
|
2119 |
+
|
2120 |
+
|
2121 |
+
/**
|
2122 |
+
* Encode special characters
|
2123 |
+
*
|
2124 |
+
* @param type $string
|
2125 |
+
* @return string Encoding string
|
2126 |
+
* @since 1.2.3
|
2127 |
+
*/
|
2128 |
+
public static function special_characters( $string = null )
|
2129 |
+
{
|
2130 |
+
|
2131 |
+
// sanity check ##
|
2132 |
+
if ( is_null( $string ) ) {
|
2133 |
+
|
2134 |
+
return false;
|
2135 |
+
|
2136 |
+
}
|
2137 |
+
|
2138 |
+
// kick it back in a nicer format ##
|
2139 |
+
return htmlentities( $string, ENT_COMPAT, 'UTF-8' );
|
2140 |
+
|
2141 |
+
}
|
2142 |
|
2143 |
|
2144 |
/**
|
readme.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
**Tags:** user, users, xprofile, usermeta csv, excel, batch, export, save, download
|
4 |
**Requires at least:** 3.2
|
5 |
**Tested up to:** 4.3.1
|
6 |
-
**Stable tag:** 1.2.
|
7 |
**License:** GPLv2
|
8 |
|
9 |
Export users data, metadata and buddypress xprofile data to a csv or Excel file
|
@@ -59,6 +59,11 @@ Click on the 'Export User Data' link in the 'Users' menu, choose the role and th
|
|
59 |
|
60 |
## Changelog ##
|
61 |
|
|
|
|
|
|
|
|
|
|
|
62 |
### 1.2.2 ###
|
63 |
* Minor FIxes
|
64 |
|
3 |
**Tags:** user, users, xprofile, usermeta csv, excel, batch, export, save, download
|
4 |
**Requires at least:** 3.2
|
5 |
**Tested up to:** 4.3.1
|
6 |
+
**Stable tag:** 1.2.3
|
7 |
**License:** GPLv2
|
8 |
|
9 |
Export users data, metadata and buddypress xprofile data to a csv or Excel file
|
59 |
|
60 |
## Changelog ##
|
61 |
|
62 |
+
### 1.2.3 ###
|
63 |
+
* Fix: to remove minor security loop hole
|
64 |
+
* New: Added option to remove standard wp_users data from export
|
65 |
+
* Fix: removed roles and groups columns from export when options hidden
|
66 |
+
|
67 |
### 1.2.2 ###
|
68 |
* Minor FIxes
|
69 |
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: qlstudio
|
|
3 |
Tags: user, users, xprofile, usermeta csv, excel, batch, export, save, download
|
4 |
Requires at least: 3.2
|
5 |
Tested up to: 4.3.1
|
6 |
-
Stable tag: 1.2.
|
7 |
License: GPLv2
|
8 |
|
9 |
Export users data, metadata and buddypress xprofile data to a csv or Excel file
|
@@ -58,8 +58,13 @@ Click on the 'Export User Data' link in the 'Users' menu, choose the role and th
|
|
58 |
|
59 |
== Changelog ==
|
60 |
|
|
|
|
|
|
|
|
|
|
|
61 |
= 1.2.2 =
|
62 |
-
* Minor
|
63 |
|
64 |
= 1.2.1 =
|
65 |
* Checked on WP 4.3.1
|
3 |
Tags: user, users, xprofile, usermeta csv, excel, batch, export, save, download
|
4 |
Requires at least: 3.2
|
5 |
Tested up to: 4.3.1
|
6 |
+
Stable tag: 1.2.3
|
7 |
License: GPLv2
|
8 |
|
9 |
Export users data, metadata and buddypress xprofile data to a csv or Excel file
|
58 |
|
59 |
== Changelog ==
|
60 |
|
61 |
+
= 1.2.3 =
|
62 |
+
* Fix: to remove minor security loop hole
|
63 |
+
* New: Added option to remove standard wp_users data from export
|
64 |
+
* Fix: removed roles and groups columns from export when options hidden
|
65 |
+
|
66 |
= 1.2.2 =
|
67 |
+
* Minor Fixes
|
68 |
|
69 |
= 1.2.1 =
|
70 |
* Checked on WP 4.3.1
|