Version Description
Download this release
Release Info
Developer | qlstudio |
Plugin | Export User Data |
Version | 2.0.3 |
Comparing to | |
See all releases |
Code changes from version 2.0.2 to 2.0.3
- CHANGELOG.md +6 -0
- export-user-data.php +9 -9
- library/admin/admin.php +113 -71
- library/api/admin.php +1 -1
- library/core/buddypress.php +1 -1
- library/core/config.php +1 -1
- library/core/core.php +1 -1
- library/core/export.php +1 -1
- library/core/filters.php +1 -1
- library/core/helper.php +1 -1
- library/core/user.php +1 -1
- library/core/xml.php +1 -1
- readme.md +1 -1
- readme.txt +1 -1
CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1 |
## Changelog ##
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
*** 2.0.2 ***
|
4 |
|
5 |
* Cleanup and tagging for WP Repo
|
1 |
## Changelog ##
|
2 |
|
3 |
+
*** 2.0.3 ***
|
4 |
+
|
5 |
+
* Removed remote call to jQuery UI CSS
|
6 |
+
* Added extra sanitization to $_POST data
|
7 |
+
* Made main class name "more" unique
|
8 |
+
|
9 |
*** 2.0.2 ***
|
10 |
|
11 |
* Cleanup and tagging for WP Repo
|
export-user-data.php
CHANGED
@@ -3,13 +3,13 @@
|
|
3 |
/*
|
4 |
* Plugin Name: Export User Date
|
5 |
* Description: Export User data and metadata.
|
6 |
-
* Version: 2.0.
|
7 |
* Author: Q Studio
|
8 |
* Author URI: http://qstudio.us/
|
9 |
* License: GPL2
|
10 |
-
* Class:
|
11 |
-
* Text Domain: q-
|
12 |
-
* GitHub Plugin URI: qstudio/q-
|
13 |
*/
|
14 |
|
15 |
/*
|
@@ -23,20 +23,20 @@ Exports will print to the screen first - and then have a "Download" button to ex
|
|
23 |
|
24 |
defined( 'ABSPATH' ) OR exit;
|
25 |
|
26 |
-
if ( ! class_exists( '
|
27 |
|
28 |
// instatiate plugin via WP plugins_loaded - init is too late for CPT ##
|
29 |
-
add_action( 'init', array ( '
|
30 |
|
31 |
-
class
|
32 |
|
33 |
// Refers to a single instance of this class. ##
|
34 |
private static $instance = null;
|
35 |
|
36 |
// Plugin Settings
|
37 |
-
const version = '2.0.
|
38 |
static $debug = true;
|
39 |
-
const text_domain = 'q-
|
40 |
|
41 |
/* properties */
|
42 |
public static $q_report_exports = ''; // export settings ##
|
3 |
/*
|
4 |
* Plugin Name: Export User Date
|
5 |
* Description: Export User data and metadata.
|
6 |
+
* Version: 2.0.3
|
7 |
* Author: Q Studio
|
8 |
* Author URI: http://qstudio.us/
|
9 |
* License: GPL2
|
10 |
+
* Class: q_export_user_data
|
11 |
+
* Text Domain: q-export-user-data
|
12 |
+
* GitHub Plugin URI: qstudio/q-export-user-data
|
13 |
*/
|
14 |
|
15 |
/*
|
23 |
|
24 |
defined( 'ABSPATH' ) OR exit;
|
25 |
|
26 |
+
if ( ! class_exists( 'q_export_user_data' ) ) {
|
27 |
|
28 |
// instatiate plugin via WP plugins_loaded - init is too late for CPT ##
|
29 |
+
add_action( 'init', array ( 'q_export_user_data', 'get_instance' ), 1000000 );
|
30 |
|
31 |
+
class q_export_user_data {
|
32 |
|
33 |
// Refers to a single instance of this class. ##
|
34 |
private static $instance = null;
|
35 |
|
36 |
// Plugin Settings
|
37 |
+
const version = '2.0.3';
|
38 |
static $debug = true;
|
39 |
+
const text_domain = 'q-export-user-data'; // for translation ##
|
40 |
|
41 |
/* properties */
|
42 |
public static $q_report_exports = ''; // export settings ##
|
library/admin/admin.php
CHANGED
@@ -11,7 +11,7 @@ use q\report\api\admin as api_admin;
|
|
11 |
// load it up ##
|
12 |
\q\report\admin\admin::run();
|
13 |
|
14 |
-
class admin extends \
|
15 |
|
16 |
public static function run()
|
17 |
{
|
@@ -43,10 +43,10 @@ class admin extends \q_report {
|
|
43 |
{
|
44 |
|
45 |
add_users_page (
|
46 |
-
__( 'Export User Data', 'q-
|
47 |
-
__( 'Export User Data', 'q-
|
48 |
\apply_filters( 'q/report/admin_capability', 'list_users' ),
|
49 |
-
'q-
|
50 |
array(
|
51 |
get_class(),
|
52 |
'admin_page'
|
@@ -67,7 +67,7 @@ class admin extends \q_report {
|
|
67 |
// quick security check ##
|
68 |
if ( ! \current_user_can( \apply_filters( 'q/report/admin_capability', 'list_users' ) ) ) {
|
69 |
|
70 |
-
\wp_die( __( 'You do not have sufficient permissions to access this page.', 'q-
|
71 |
|
72 |
}
|
73 |
|
@@ -98,20 +98,62 @@ class admin extends \q_report {
|
|
98 |
if ( isset( $save_export ) ) {
|
99 |
|
100 |
// prepare all array values ##
|
101 |
-
$usermeta =
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
$
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
$
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
$
|
114 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
|
116 |
// assign all values to an array ##
|
117 |
$save_array = array (
|
@@ -166,12 +208,12 @@ class admin extends \q_report {
|
|
166 |
|
167 |
?>
|
168 |
<div class="wrap">
|
169 |
-
<h2><?php \_e( 'Export User Data', 'q-
|
170 |
<?php
|
171 |
|
172 |
// nothing happening? ##
|
173 |
if ( isset( $_GET['error'] ) ) {
|
174 |
-
echo '<div class="updated"><p><strong>' . \__( 'No users found.', 'q-
|
175 |
}
|
176 |
|
177 |
?>
|
@@ -211,12 +253,12 @@ class admin extends \q_report {
|
|
211 |
?>
|
212 |
<tr valign="top">
|
213 |
<th scope="row">
|
214 |
-
<label for="q_report_usermeta"><?php \_e( 'User Meta Fields', 'q-
|
215 |
<p class="filter" style="margin: 10px 0 0;">
|
216 |
-
<?php \_e('Filter', 'q-
|
217 |
</p>
|
218 |
<p class="filter" style="margin: 10px 0 0;">
|
219 |
-
<?php \_e('Select', 'q-
|
220 |
</p>
|
221 |
</th>
|
222 |
<td>
|
@@ -261,7 +303,7 @@ class admin extends \q_report {
|
|
261 |
</select>
|
262 |
<p class="description"><?php
|
263 |
printf(
|
264 |
-
\__( 'Select the user meta keys to export, use the filters to simplify the list.', 'q-
|
265 |
);
|
266 |
?></p>
|
267 |
</td>
|
@@ -279,9 +321,9 @@ class admin extends \q_report {
|
|
279 |
?>
|
280 |
<tr valign="top">
|
281 |
<th scope="row">
|
282 |
-
<label for="q_report_xprofile"><?php \_e( 'BP xProfile Fields', 'q-
|
283 |
<p class="filter" style="margin: 10px 0 0;">
|
284 |
-
<?php \_e('Select', 'q-
|
285 |
</p>
|
286 |
</th>
|
287 |
<td>
|
@@ -299,7 +341,7 @@ class admin extends \q_report {
|
|
299 |
</select>
|
300 |
<p class="description"><?php
|
301 |
printf(
|
302 |
-
\__( 'Select the BuddyPress XProfile keys to export', 'q-
|
303 |
);
|
304 |
?></p>
|
305 |
</td>
|
@@ -311,9 +353,9 @@ class admin extends \q_report {
|
|
311 |
?>
|
312 |
<tr valign="top" class="toggleable">
|
313 |
<th scope="row">
|
314 |
-
<label for="q_report_xprofile"><?php \_e( 'BP xProfile Fields Update Time', 'q-
|
315 |
<p class="filter" style="margin: 10px 0 0;">
|
316 |
-
<?php \_e('Select', 'q-
|
317 |
</p>
|
318 |
</th>
|
319 |
<td>
|
@@ -330,19 +372,19 @@ class admin extends \q_report {
|
|
330 |
</select>
|
331 |
<p class="description"><?php
|
332 |
printf(
|
333 |
-
\__( 'Select the BuddyPress XProfile keys updated dates to export', 'q-
|
334 |
);
|
335 |
?></p>
|
336 |
</td>
|
337 |
</tr>
|
338 |
|
339 |
<tr valign="top" class="toggleable">
|
340 |
-
<th scope="row"><label for="groups"><?php \_e( 'BP User Groups', 'q-
|
341 |
<td>
|
342 |
<input id='groups' type='checkbox' name='groups' value='1' <?php \checked( isset ( self::$groups ) ? intval ( self::$groups ) : '', 1 ); ?> />
|
343 |
<p class="description"><?php
|
344 |
printf(
|
345 |
-
\__( 'Include BuddyPress Group Data. <a href="%s" target="_blank">%s</a>', 'q-
|
346 |
, \esc_html('https://codex.buddypress.org/buddypress-components-and-features/groups/')
|
347 |
, 'Codex'
|
348 |
);
|
@@ -355,7 +397,7 @@ class admin extends \q_report {
|
|
355 |
|
356 |
?>
|
357 |
<tr valign="top" class="toggleable">
|
358 |
-
<th scope="row"><label for="user_fields"><?php \_e( 'Standard User Fields', 'q-
|
359 |
<td>
|
360 |
<input id='user_fields' type='checkbox' name='user_fields' value='1' <?php \checked( isset ( self::$user_fields ) ? intval ( self::$user_fields ) : '', 1 ); ?> />
|
361 |
<p class="description"><?php
|
@@ -364,7 +406,7 @@ class admin extends \q_report {
|
|
364 |
#echo 'user_fields: '. self::$user_fields;
|
365 |
|
366 |
printf(
|
367 |
-
\__( 'Include Standard user profile fields, such as user_login. <a href="%s" target="_blank">%s</a>', 'q-
|
368 |
, \esc_html('https://codex.wordpress.org/Database_Description#Table:_wp_users')
|
369 |
, 'Codex'
|
370 |
);
|
@@ -374,12 +416,12 @@ class admin extends \q_report {
|
|
374 |
</tr>
|
375 |
|
376 |
<tr valign="top" class="toggleable">
|
377 |
-
<th scope="row"><label for="q_report_users_role"><?php \_e( 'Role', 'q-
|
378 |
<td>
|
379 |
<select name="role" id="q_report_users_role">
|
380 |
<?php
|
381 |
|
382 |
-
echo '<option value="">' . \__( 'All Roles', 'q-
|
383 |
|
384 |
global $wp_roles;
|
385 |
|
@@ -401,7 +443,7 @@ class admin extends \q_report {
|
|
401 |
</select>
|
402 |
<p class="description"><?php
|
403 |
printf(
|
404 |
-
\__( 'Filter the exported users by a WordPress Role. <a href="%s" target="_blank">%s</a>', 'q-
|
405 |
, \esc_html('http://codex.wordpress.org/Roles_and_Capabilities')
|
406 |
, 'Codex'
|
407 |
);
|
@@ -410,12 +452,12 @@ class admin extends \q_report {
|
|
410 |
</tr>
|
411 |
|
412 |
<tr valign="top" class="toggleable">
|
413 |
-
<th scope="row"><label for="roles"><?php \_e( 'User Roles', 'q-
|
414 |
<td>
|
415 |
<input id='roles' type='checkbox' name='roles' value='1' <?php \checked( isset ( self::$roles ) ? intval ( self::$roles ) : '', 1 ); ?> />
|
416 |
<p class="description"><?php
|
417 |
printf(
|
418 |
-
\__( 'Include all of the users <a href="%s" target="_blank">%s</a>', 'q-
|
419 |
, \esc_html('http://codex.wordpress.org/Roles_and_Capabilities')
|
420 |
, 'Roles'
|
421 |
);
|
@@ -424,26 +466,26 @@ class admin extends \q_report {
|
|
424 |
</tr>
|
425 |
|
426 |
<tr valign="top" class="toggleable">
|
427 |
-
<th scope="row"><label><?php \_e( 'Registered', 'q-
|
428 |
<td>
|
429 |
<input type="text" id="q_report_users_start_date" name="start_date" value="<?php echo self::$start_date; ?>" class="start-datepicker" />
|
430 |
<input type="text" id="q_report_users_end_date" name="end_date" value="<?php echo self::$end_date; ?>" class="end-datepicker" />
|
431 |
<p class="description"><?php
|
432 |
printf(
|
433 |
-
\__( 'Pick a start and end user registration date to limit the results.', 'q-
|
434 |
);
|
435 |
?></p>
|
436 |
</td>
|
437 |
</tr>
|
438 |
|
439 |
<tr valign="top" class="toggleable">
|
440 |
-
<th scope="row"><label><?php \_e( 'Limit Range', 'q-
|
441 |
<td>
|
442 |
-
<input name="limit_offset" type="text" id="q_report_users_limit_offset" value="<?php echo( self::$limit_offset ); ?>" class="regular-text code numeric" style="width: 136px;" placeholder="<?php _e( 'Offset', 'q-
|
443 |
-
<input name="limit_total" type="text" id="q_report_users_limit_total" value="<?php echo ( self::$limit_total ); ?>" class="regular-text code numeric" style="width: 136px;" placeholder="<?php _e( 'Total', 'q-
|
444 |
<p class="description"><?php
|
445 |
printf(
|
446 |
-
\__( 'Enter an offset start number and a total number of users to export. <a href="%s" target="_blank">%s</a>', 'q-
|
447 |
, \esc_html('http://codex.wordpress.org/Function_Reference/get_users#Parameters')
|
448 |
, 'Codex'
|
449 |
);
|
@@ -457,7 +499,7 @@ class admin extends \q_report {
|
|
457 |
|
458 |
?>
|
459 |
<tr valign="top" class="toggleable">
|
460 |
-
<th scope="row"><label><?php \_e( 'Updated Since', 'q-
|
461 |
<td>
|
462 |
<input type="text" id="q_report_updated_since_date" name="updated_since_date" value="<?php echo self::$updated_since_date; ?>" class="updated-datepicker" />
|
463 |
<select id="bp_field_updated_since" name="bp_field_updated_since">
|
@@ -482,7 +524,7 @@ class admin extends \q_report {
|
|
482 |
|
483 |
<p class="description"><?php
|
484 |
printf(
|
485 |
-
\__( 'Limit the results to users who have updated this extended profile field after this date.', 'q-
|
486 |
);
|
487 |
?></p>
|
488 |
</td>
|
@@ -504,46 +546,46 @@ class admin extends \q_report {
|
|
504 |
|
505 |
?>
|
506 |
<tr valign="top">
|
507 |
-
<th scope="row"><label for="q_report_users_format"><?php \_e( 'Format', 'q-
|
508 |
<td>
|
509 |
<select name="format" id="q_report_users_format">
|
510 |
<?php
|
511 |
if ( isset ( self::$format ) && ( self::$format == 'excel' ) ) {
|
512 |
|
513 |
-
echo '<option selected value="excel">' . __( 'Excel', 'q-
|
514 |
|
515 |
} else {
|
516 |
|
517 |
-
echo '<option value="excel">' . __( 'Excel', 'q-
|
518 |
|
519 |
}
|
520 |
|
521 |
if ( isset ( self::$format ) && ( self::$format == 'csv' ) ) {
|
522 |
|
523 |
-
echo '<option selected value="csv">' . __( 'CSV', 'q-
|
524 |
|
525 |
} else {
|
526 |
|
527 |
-
echo '<option value="csv">' . __( 'CSV', 'q-
|
528 |
|
529 |
}
|
530 |
?>
|
531 |
</select>
|
532 |
<p class="description"><?php
|
533 |
printf(
|
534 |
-
\__( 'Select the format for the export file.', 'q-
|
535 |
);
|
536 |
?></p>
|
537 |
</td>
|
538 |
</tr>
|
539 |
|
540 |
<tr valign="top" class="remember">
|
541 |
-
<th scope="row"><label for="q_report_save_options"><?php \_e( 'Stored Options', 'q-
|
542 |
<td>
|
543 |
|
544 |
<div class="row">
|
545 |
-
<input type="text" class="regular-text" name="save_new_export_name" id="q_report_save_options_new_export" placeholder="<?php \_e( 'Export Name', 'q-
|
546 |
-
<input type="submit" id="save_export" class="button-primary" name="save_export" value="<?php \_e( 'Save', 'q-
|
547 |
</div>
|
548 |
<?php
|
549 |
|
@@ -562,7 +604,7 @@ class admin extends \q_report {
|
|
562 |
if (
|
563 |
isset( $_POST['load_export'] )
|
564 |
&& isset( $_POST['export_name'] )
|
565 |
-
&& ( $_POST['export_name'] == $export )
|
566 |
) {
|
567 |
|
568 |
echo "<option selected value='$export'>".$export."</option>";
|
@@ -579,26 +621,26 @@ class admin extends \q_report {
|
|
579 |
?>
|
580 |
</select>
|
581 |
|
582 |
-
<input type="submit" id="load_export" class="button-primary" name="load_export" value="<?php _e( 'Load', 'q-
|
583 |
-
<input type="submit" id="delete_export" class="button-primary" name="delete_export" value="<?php _e( 'Delete', 'q-
|
584 |
<?php
|
585 |
|
586 |
}
|
587 |
|
588 |
?>
|
589 |
</div>
|
590 |
-
<p class="description"><?php \_e( 'Save, load or delete your stored export options.', 'q-
|
591 |
|
592 |
</td>
|
593 |
</tr>
|
594 |
|
595 |
<tr valign="top">
|
596 |
<th scope="row">
|
597 |
-
<label for="q_report_xprofile"><?php \_e( 'Advanced Options', 'q-
|
598 |
</th>
|
599 |
<td>
|
600 |
<div class="toggle">
|
601 |
-
<a href="#"><?php \_e( 'Show', 'q-
|
602 |
</div>
|
603 |
</td>
|
604 |
</tr>
|
@@ -606,7 +648,7 @@ class admin extends \q_report {
|
|
606 |
</table>
|
607 |
<p class="submit">
|
608 |
<input type="hidden" name="_wp_http_referer" value="<?php echo \esc_url( $_SERVER['REQUEST_URI'] ); ?>" />
|
609 |
-
<input type="submit" class="button-primary" value="<?php \_e( 'Run Export', 'q-
|
610 |
</p>
|
611 |
</form>
|
612 |
</div>
|
@@ -625,7 +667,7 @@ class admin extends \q_report {
|
|
625 |
// load the scripts on only the plugin admin page ##
|
626 |
if (
|
627 |
! isset( $_GET['page'] )
|
628 |
-
|| $_GET['page'] != 'q-
|
629 |
|
630 |
) {
|
631 |
|
@@ -641,8 +683,8 @@ class admin extends \q_report {
|
|
641 |
\wp_enqueue_script('jquery-ui-datepicker');
|
642 |
|
643 |
// add style ##
|
644 |
-
\wp_enqueue_style( 'jquery-ui-datepicker' );
|
645 |
-
\wp_enqueue_style('jquery-ui-css', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css');
|
646 |
|
647 |
}
|
648 |
|
@@ -659,7 +701,7 @@ class admin extends \q_report {
|
|
659 |
// load the scripts on only the plugin admin page
|
660 |
if (
|
661 |
! isset( $_GET['page'] )
|
662 |
-
|| $_GET['page'] != 'q-
|
663 |
) {
|
664 |
|
665 |
return false;
|
@@ -732,9 +774,9 @@ class admin extends \q_report {
|
|
732 |
$toggleable = jQuery("tr.toggleable");
|
733 |
$toggleable.toggle();
|
734 |
if ( $toggleable.is(":visible") ) {
|
735 |
-
jQuery(this).text("<?php _e( 'Hide', 'q-
|
736 |
} else {
|
737 |
-
jQuery(this).text("<?php _e( 'Show', 'q-
|
738 |
}
|
739 |
});
|
740 |
|
@@ -819,7 +861,7 @@ class admin extends \q_report {
|
|
819 |
// load the scripts on only the plugin admin page
|
820 |
if (
|
821 |
! isset( $_GET['page'] )
|
822 |
-
|| $_GET['page'] != 'q-
|
823 |
) {
|
824 |
|
825 |
return false;
|
11 |
// load it up ##
|
12 |
\q\report\admin\admin::run();
|
13 |
|
14 |
+
class admin extends \q_export_user_data {
|
15 |
|
16 |
public static function run()
|
17 |
{
|
43 |
{
|
44 |
|
45 |
add_users_page (
|
46 |
+
__( 'Export User Data', 'q-export-user-data' ),
|
47 |
+
__( 'Export User Data', 'q-export-user-data' ),
|
48 |
\apply_filters( 'q/report/admin_capability', 'list_users' ),
|
49 |
+
'q-export-user-data',
|
50 |
array(
|
51 |
get_class(),
|
52 |
'admin_page'
|
67 |
// quick security check ##
|
68 |
if ( ! \current_user_can( \apply_filters( 'q/report/admin_capability', 'list_users' ) ) ) {
|
69 |
|
70 |
+
\wp_die( __( 'You do not have sufficient permissions to access this page.', 'q-export-user-data' ) );
|
71 |
|
72 |
}
|
73 |
|
98 |
if ( isset( $save_export ) ) {
|
99 |
|
100 |
// prepare all array values ##
|
101 |
+
$usermeta =
|
102 |
+
isset( $_POST['usermeta'] ) ?
|
103 |
+
\sanitize_text_field( $_POST['usermeta'] ):
|
104 |
+
'' ;
|
105 |
+
$bp_fields =
|
106 |
+
isset( $_POST['bp_fields'] ) ?
|
107 |
+
array_map( 'sanitize_text_field', $_POST['bp_fields'] ) :
|
108 |
+
'' ;
|
109 |
+
$bp_fields_update =
|
110 |
+
isset( $_POST['bp_fields_update_time'] ) ?
|
111 |
+
array_map( 'sanitize_text_field', $_POST['bp_fields_update_time'] ) :
|
112 |
+
'' ;
|
113 |
+
$format =
|
114 |
+
isset( $_POST['format'] ) ?
|
115 |
+
\sanitize_text_field( $_POST['format'] ) :
|
116 |
+
'' ;
|
117 |
+
$role =
|
118 |
+
isset( $_POST['role'] ) ?
|
119 |
+
\sanitize_text_field( $_POST['role'] ) :
|
120 |
+
'' ;
|
121 |
+
$roles =
|
122 |
+
isset( $_POST['roles'] ) ?
|
123 |
+
\sanitize_text_field( $_POST['roles'] ) :
|
124 |
+
'' ;
|
125 |
+
$user_fields =
|
126 |
+
isset( $_POST['user_fields'] ) ?
|
127 |
+
array_map( 'sanitize_text_field', $_POST['user_fields'] ) :
|
128 |
+
'0' ;
|
129 |
+
$groups =
|
130 |
+
isset( $_POST['groups'] ) ?
|
131 |
+
\sanitize_text_field( $_POST['groups'] ) :
|
132 |
+
'0' ;
|
133 |
+
$start_date =
|
134 |
+
isset( $_POST['start_date'] ) ?
|
135 |
+
\sanitize_text_field( $_POST['start_date'] ) :
|
136 |
+
'' ;
|
137 |
+
$end_date =
|
138 |
+
isset( $_POST['end_date'] ) ?
|
139 |
+
\sanitize_text_field( $_POST['end_date'] ) :
|
140 |
+
'' ;
|
141 |
+
$limit_offset =
|
142 |
+
isset( $_POST['limit_offset'] ) ?
|
143 |
+
\sanitize_text_field( $_POST['limit_offset'] ) :
|
144 |
+
'' ;
|
145 |
+
$limit_total =
|
146 |
+
isset( $_POST['limit_total'] ) ?
|
147 |
+
\sanitize_text_field( $_POST['limit_total'] ) :
|
148 |
+
'' ;
|
149 |
+
$updated_since_date =
|
150 |
+
isset( $_POST['updated_since_date'] ) ?
|
151 |
+
\sanitize_text_field( $_POST['updated_since_date'] ) :
|
152 |
+
'' ;
|
153 |
+
$field_updated_since =
|
154 |
+
isset( $_POST['bp_field_updated_since'] ) ?
|
155 |
+
array_map( 'sanitize_text_field', $_POST['bp_field_updated_since'] ) :
|
156 |
+
'';
|
157 |
|
158 |
// assign all values to an array ##
|
159 |
$save_array = array (
|
208 |
|
209 |
?>
|
210 |
<div class="wrap">
|
211 |
+
<h2><?php \_e( 'Export User Data', 'q-export-user-data' ); ?></h2>
|
212 |
<?php
|
213 |
|
214 |
// nothing happening? ##
|
215 |
if ( isset( $_GET['error'] ) ) {
|
216 |
+
echo '<div class="updated"><p><strong>' . \__( 'No users found.', 'q-export-user-data' ) . '</strong></p></div>';
|
217 |
}
|
218 |
|
219 |
?>
|
253 |
?>
|
254 |
<tr valign="top">
|
255 |
<th scope="row">
|
256 |
+
<label for="q_report_usermeta"><?php \_e( 'User Meta Fields', 'q-export-user-data' ); ?></label>
|
257 |
<p class="filter" style="margin: 10px 0 0;">
|
258 |
+
<?php \_e('Filter', 'q-export-user-data'); ?>: <a href="#" class="usermeta-all"><?php \_e('All', 'q-export-user-data'); ?></a> | <a href="#" class="usermeta-common"><?php \_e('Common', 'q-export-user-data'); ?></a>
|
259 |
</p>
|
260 |
<p class="filter" style="margin: 10px 0 0;">
|
261 |
+
<?php \_e('Select', 'q-export-user-data'); ?>: <a href="#" class="select-all"><?php \_e('All', 'q-export-user-data'); ?></a> | <a href="#" class="select-none"><?php \_e('None', 'q-export-user-data'); ?></a>
|
262 |
</p>
|
263 |
</th>
|
264 |
<td>
|
303 |
</select>
|
304 |
<p class="description"><?php
|
305 |
printf(
|
306 |
+
\__( 'Select the user meta keys to export, use the filters to simplify the list.', 'q-export-user-data' )
|
307 |
);
|
308 |
?></p>
|
309 |
</td>
|
321 |
?>
|
322 |
<tr valign="top">
|
323 |
<th scope="row">
|
324 |
+
<label for="q_report_xprofile"><?php \_e( 'BP xProfile Fields', 'q-export-user-data' ); ?></label>
|
325 |
<p class="filter" style="margin: 10px 0 0;">
|
326 |
+
<?php \_e('Select', 'q-export-user-data'); ?>: <a href="#" class="select-all"><?php \_e('All', 'q-export-user-data'); ?></a> | <a href="#" class="select-none"><?php \_e('None', 'q-export-user-data'); ?></a>
|
327 |
</p>
|
328 |
</th>
|
329 |
<td>
|
341 |
</select>
|
342 |
<p class="description"><?php
|
343 |
printf(
|
344 |
+
\__( 'Select the BuddyPress XProfile keys to export', 'q-export-user-data' )
|
345 |
);
|
346 |
?></p>
|
347 |
</td>
|
353 |
?>
|
354 |
<tr valign="top" class="toggleable">
|
355 |
<th scope="row">
|
356 |
+
<label for="q_report_xprofile"><?php \_e( 'BP xProfile Fields Update Time', 'q-export-user-data' ); ?></label>
|
357 |
<p class="filter" style="margin: 10px 0 0;">
|
358 |
+
<?php \_e('Select', 'q-export-user-data'); ?>: <a href="#" class="select-all"><?php \_e('All', 'q-export-user-data'); ?></a> | <a href="#" class="select-none"><?php _e('None', 'q-export-user-data'); ?></a>
|
359 |
</p>
|
360 |
</th>
|
361 |
<td>
|
372 |
</select>
|
373 |
<p class="description"><?php
|
374 |
printf(
|
375 |
+
\__( 'Select the BuddyPress XProfile keys updated dates to export', 'q-export-user-data' )
|
376 |
);
|
377 |
?></p>
|
378 |
</td>
|
379 |
</tr>
|
380 |
|
381 |
<tr valign="top" class="toggleable">
|
382 |
+
<th scope="row"><label for="groups"><?php \_e( 'BP User Groups', 'q-export-user-data' ); ?></label></th>
|
383 |
<td>
|
384 |
<input id='groups' type='checkbox' name='groups' value='1' <?php \checked( isset ( self::$groups ) ? intval ( self::$groups ) : '', 1 ); ?> />
|
385 |
<p class="description"><?php
|
386 |
printf(
|
387 |
+
\__( 'Include BuddyPress Group Data. <a href="%s" target="_blank">%s</a>', 'q-export-user-data' )
|
388 |
, \esc_html('https://codex.buddypress.org/buddypress-components-and-features/groups/')
|
389 |
, 'Codex'
|
390 |
);
|
397 |
|
398 |
?>
|
399 |
<tr valign="top" class="toggleable">
|
400 |
+
<th scope="row"><label for="user_fields"><?php \_e( 'Standard User Fields', 'q-export-user-data' ); ?></label></th>
|
401 |
<td>
|
402 |
<input id='user_fields' type='checkbox' name='user_fields' value='1' <?php \checked( isset ( self::$user_fields ) ? intval ( self::$user_fields ) : '', 1 ); ?> />
|
403 |
<p class="description"><?php
|
406 |
#echo 'user_fields: '. self::$user_fields;
|
407 |
|
408 |
printf(
|
409 |
+
\__( 'Include Standard user profile fields, such as user_login. <a href="%s" target="_blank">%s</a>', 'q-export-user-data' )
|
410 |
, \esc_html('https://codex.wordpress.org/Database_Description#Table:_wp_users')
|
411 |
, 'Codex'
|
412 |
);
|
416 |
</tr>
|
417 |
|
418 |
<tr valign="top" class="toggleable">
|
419 |
+
<th scope="row"><label for="q_report_users_role"><?php \_e( 'Role', 'q-export-user-data' ); ?></label></th>
|
420 |
<td>
|
421 |
<select name="role" id="q_report_users_role">
|
422 |
<?php
|
423 |
|
424 |
+
echo '<option value="">' . \__( 'All Roles', 'q-export-user-data' ) . '</option>';
|
425 |
|
426 |
global $wp_roles;
|
427 |
|
443 |
</select>
|
444 |
<p class="description"><?php
|
445 |
printf(
|
446 |
+
\__( 'Filter the exported users by a WordPress Role. <a href="%s" target="_blank">%s</a>', 'q-export-user-data' )
|
447 |
, \esc_html('http://codex.wordpress.org/Roles_and_Capabilities')
|
448 |
, 'Codex'
|
449 |
);
|
452 |
</tr>
|
453 |
|
454 |
<tr valign="top" class="toggleable">
|
455 |
+
<th scope="row"><label for="roles"><?php \_e( 'User Roles', 'q-export-user-data' ); ?></label></th>
|
456 |
<td>
|
457 |
<input id='roles' type='checkbox' name='roles' value='1' <?php \checked( isset ( self::$roles ) ? intval ( self::$roles ) : '', 1 ); ?> />
|
458 |
<p class="description"><?php
|
459 |
printf(
|
460 |
+
\__( 'Include all of the users <a href="%s" target="_blank">%s</a>', 'q-export-user-data' )
|
461 |
, \esc_html('http://codex.wordpress.org/Roles_and_Capabilities')
|
462 |
, 'Roles'
|
463 |
);
|
466 |
</tr>
|
467 |
|
468 |
<tr valign="top" class="toggleable">
|
469 |
+
<th scope="row"><label><?php \_e( 'Registered', 'q-export-user-data' ); ?></label></th>
|
470 |
<td>
|
471 |
<input type="text" id="q_report_users_start_date" name="start_date" value="<?php echo self::$start_date; ?>" class="start-datepicker" />
|
472 |
<input type="text" id="q_report_users_end_date" name="end_date" value="<?php echo self::$end_date; ?>" class="end-datepicker" />
|
473 |
<p class="description"><?php
|
474 |
printf(
|
475 |
+
\__( 'Pick a start and end user registration date to limit the results.', 'q-export-user-data' )
|
476 |
);
|
477 |
?></p>
|
478 |
</td>
|
479 |
</tr>
|
480 |
|
481 |
<tr valign="top" class="toggleable">
|
482 |
+
<th scope="row"><label><?php \_e( 'Limit Range', 'q-export-user-data' ); ?></label></th>
|
483 |
<td>
|
484 |
+
<input name="limit_offset" type="text" id="q_report_users_limit_offset" value="<?php echo( self::$limit_offset ); ?>" class="regular-text code numeric" style="width: 136px;" placeholder="<?php _e( 'Offset', 'q-export-user-data' ); ?>">
|
485 |
+
<input name="limit_total" type="text" id="q_report_users_limit_total" value="<?php echo ( self::$limit_total ); ?>" class="regular-text code numeric" style="width: 136px;" placeholder="<?php _e( 'Total', 'q-export-user-data' ); ?>">
|
486 |
<p class="description"><?php
|
487 |
printf(
|
488 |
+
\__( 'Enter an offset start number and a total number of users to export. <a href="%s" target="_blank">%s</a>', 'q-export-user-data' )
|
489 |
, \esc_html('http://codex.wordpress.org/Function_Reference/get_users#Parameters')
|
490 |
, 'Codex'
|
491 |
);
|
499 |
|
500 |
?>
|
501 |
<tr valign="top" class="toggleable">
|
502 |
+
<th scope="row"><label><?php \_e( 'Updated Since', 'q-export-user-data' ); ?></label></th>
|
503 |
<td>
|
504 |
<input type="text" id="q_report_updated_since_date" name="updated_since_date" value="<?php echo self::$updated_since_date; ?>" class="updated-datepicker" />
|
505 |
<select id="bp_field_updated_since" name="bp_field_updated_since">
|
524 |
|
525 |
<p class="description"><?php
|
526 |
printf(
|
527 |
+
\__( 'Limit the results to users who have updated this extended profile field after this date.', 'q-export-user-data' )
|
528 |
);
|
529 |
?></p>
|
530 |
</td>
|
546 |
|
547 |
?>
|
548 |
<tr valign="top">
|
549 |
+
<th scope="row"><label for="q_report_users_format"><?php \_e( 'Format', 'q-export-user-data' ); ?></label></th>
|
550 |
<td>
|
551 |
<select name="format" id="q_report_users_format">
|
552 |
<?php
|
553 |
if ( isset ( self::$format ) && ( self::$format == 'excel' ) ) {
|
554 |
|
555 |
+
echo '<option selected value="excel">' . __( 'Excel', 'q-export-user-data' ) . '</option>';
|
556 |
|
557 |
} else {
|
558 |
|
559 |
+
echo '<option value="excel">' . __( 'Excel', 'q-export-user-data' ) . '</option>';
|
560 |
|
561 |
}
|
562 |
|
563 |
if ( isset ( self::$format ) && ( self::$format == 'csv' ) ) {
|
564 |
|
565 |
+
echo '<option selected value="csv">' . __( 'CSV', 'q-export-user-data' ) . '</option>';
|
566 |
|
567 |
} else {
|
568 |
|
569 |
+
echo '<option value="csv">' . __( 'CSV', 'q-export-user-data' ) . '</option>';
|
570 |
|
571 |
}
|
572 |
?>
|
573 |
</select>
|
574 |
<p class="description"><?php
|
575 |
printf(
|
576 |
+
\__( 'Select the format for the export file.', 'q-export-user-data' )
|
577 |
);
|
578 |
?></p>
|
579 |
</td>
|
580 |
</tr>
|
581 |
|
582 |
<tr valign="top" class="remember">
|
583 |
+
<th scope="row"><label for="q_report_save_options"><?php \_e( 'Stored Options', 'q-export-user-data' ); ?></label></th>
|
584 |
<td>
|
585 |
|
586 |
<div class="row">
|
587 |
+
<input type="text" class="regular-text" name="save_new_export_name" id="q_report_save_options_new_export" placeholder="<?php \_e( 'Export Name', 'q-export-user-data' ); ?>" value="<?php echo isset( $_POST['export_name'] ) ? \sanitize_text_field( $_POST['export_name'] ) : '' ; ?>">
|
588 |
+
<input type="submit" id="save_export" class="button-primary" name="save_export" value="<?php \_e( 'Save', 'q-export-user-data' ); ?>" />
|
589 |
</div>
|
590 |
<?php
|
591 |
|
604 |
if (
|
605 |
isset( $_POST['load_export'] )
|
606 |
&& isset( $_POST['export_name'] )
|
607 |
+
&& ( \sanitize_text_field( $_POST['export_name'] ) == $export )
|
608 |
) {
|
609 |
|
610 |
echo "<option selected value='$export'>".$export."</option>";
|
621 |
?>
|
622 |
</select>
|
623 |
|
624 |
+
<input type="submit" id="load_export" class="button-primary" name="load_export" value="<?php _e( 'Load', 'q-export-user-data' ); ?>" />
|
625 |
+
<input type="submit" id="delete_export" class="button-primary" name="delete_export" value="<?php _e( 'Delete', 'q-export-user-data' ); ?>" />
|
626 |
<?php
|
627 |
|
628 |
}
|
629 |
|
630 |
?>
|
631 |
</div>
|
632 |
+
<p class="description"><?php \_e( 'Save, load or delete your stored export options.', 'q-export-user-data' ); ?></p>
|
633 |
|
634 |
</td>
|
635 |
</tr>
|
636 |
|
637 |
<tr valign="top">
|
638 |
<th scope="row">
|
639 |
+
<label for="q_report_xprofile"><?php \_e( 'Advanced Options', 'q-export-user-data' ); ?></label>
|
640 |
</th>
|
641 |
<td>
|
642 |
<div class="toggle">
|
643 |
+
<a href="#"><?php \_e( 'Show', 'q-export-user-data' ); ?></a>
|
644 |
</div>
|
645 |
</td>
|
646 |
</tr>
|
648 |
</table>
|
649 |
<p class="submit">
|
650 |
<input type="hidden" name="_wp_http_referer" value="<?php echo \esc_url( $_SERVER['REQUEST_URI'] ); ?>" />
|
651 |
+
<input type="submit" class="button-primary" value="<?php \_e( 'Run Export', 'q-export-user-data' ); ?>" />
|
652 |
</p>
|
653 |
</form>
|
654 |
</div>
|
667 |
// load the scripts on only the plugin admin page ##
|
668 |
if (
|
669 |
! isset( $_GET['page'] )
|
670 |
+
|| $_GET['page'] != 'q-export-user-data'
|
671 |
|
672 |
) {
|
673 |
|
683 |
\wp_enqueue_script('jquery-ui-datepicker');
|
684 |
|
685 |
// add style ##
|
686 |
+
// \wp_enqueue_style( 'jquery-ui-datepicker' );
|
687 |
+
// \wp_enqueue_style('jquery-ui-css', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css');
|
688 |
|
689 |
}
|
690 |
|
701 |
// load the scripts on only the plugin admin page
|
702 |
if (
|
703 |
! isset( $_GET['page'] )
|
704 |
+
|| $_GET['page'] != 'q-export-user-data'
|
705 |
) {
|
706 |
|
707 |
return false;
|
774 |
$toggleable = jQuery("tr.toggleable");
|
775 |
$toggleable.toggle();
|
776 |
if ( $toggleable.is(":visible") ) {
|
777 |
+
jQuery(this).text("<?php _e( 'Hide', 'q-export-user-data' ); ?>");
|
778 |
} else {
|
779 |
+
jQuery(this).text("<?php _e( 'Show', 'q-export-user-data' ); ?>");
|
780 |
}
|
781 |
});
|
782 |
|
861 |
// load the scripts on only the plugin admin page
|
862 |
if (
|
863 |
! isset( $_GET['page'] )
|
864 |
+
|| $_GET['page'] != 'q-export-user-data'
|
865 |
) {
|
866 |
|
867 |
return false;
|
library/api/admin.php
CHANGED
@@ -8,7 +8,7 @@ use q\report\core\helper as helper;
|
|
8 |
// load it up ##
|
9 |
#\q\report\api\admin::run();
|
10 |
|
11 |
-
class admin extends \
|
12 |
|
13 |
public static function run()
|
14 |
{
|
8 |
// load it up ##
|
9 |
#\q\report\api\admin::run();
|
10 |
|
11 |
+
class admin extends \q_export_user_data {
|
12 |
|
13 |
public static function run()
|
14 |
{
|
library/core/buddypress.php
CHANGED
@@ -8,7 +8,7 @@ use q\report\core\helper as helper;
|
|
8 |
// load it up ##
|
9 |
\q\report\core\buddypress::run();
|
10 |
|
11 |
-
class buddypress extends \
|
12 |
|
13 |
public static function run()
|
14 |
{
|
8 |
// load it up ##
|
9 |
\q\report\core\buddypress::run();
|
10 |
|
11 |
+
class buddypress extends \q_export_user_data {
|
12 |
|
13 |
public static function run()
|
14 |
{
|
library/core/config.php
CHANGED
@@ -8,7 +8,7 @@ use q\report\core\helper as helper;
|
|
8 |
// load it up ##
|
9 |
// \q\report\core\config::run();
|
10 |
|
11 |
-
class config extends \
|
12 |
|
13 |
public static function run()
|
14 |
{
|
8 |
// load it up ##
|
9 |
// \q\report\core\config::run();
|
10 |
|
11 |
+
class config extends \q_export_user_data {
|
12 |
|
13 |
public static function run()
|
14 |
{
|
library/core/core.php
CHANGED
@@ -8,7 +8,7 @@ use q\report\core\helper as helper;
|
|
8 |
// load it up ##
|
9 |
#\q\report\core\core::run();
|
10 |
|
11 |
-
class core extends \
|
12 |
|
13 |
public static function run()
|
14 |
{
|
8 |
// load it up ##
|
9 |
#\q\report\core\core::run();
|
10 |
|
11 |
+
class core extends \q_export_user_data {
|
12 |
|
13 |
public static function run()
|
14 |
{
|
library/core/export.php
CHANGED
@@ -9,7 +9,7 @@ use q\report\core\xml as xml;
|
|
9 |
// load it up ##
|
10 |
\q\report\core\export::run();
|
11 |
|
12 |
-
class export extends \
|
13 |
|
14 |
public static function run()
|
15 |
{
|
9 |
// load it up ##
|
10 |
\q\report\core\export::run();
|
11 |
|
12 |
+
class export extends \q_export_user_data {
|
13 |
|
14 |
public static function run()
|
15 |
{
|
library/core/filters.php
CHANGED
@@ -8,7 +8,7 @@ use q\report\core\helper as helper;
|
|
8 |
// load it up ##
|
9 |
\q\report\core\filters::run();
|
10 |
|
11 |
-
class filters extends \
|
12 |
|
13 |
public static function run()
|
14 |
{
|
8 |
// load it up ##
|
9 |
\q\report\core\filters::run();
|
10 |
|
11 |
+
class filters extends \q_export_user_data {
|
12 |
|
13 |
public static function run()
|
14 |
{
|
library/core/helper.php
CHANGED
@@ -10,7 +10,7 @@ use q\core\helper as q_helper;
|
|
10 |
* helper Class
|
11 |
* @package q_report\core
|
12 |
*/
|
13 |
-
class helper extends \
|
14 |
|
15 |
|
16 |
/**
|
10 |
* helper Class
|
11 |
* @package q_report\core
|
12 |
*/
|
13 |
+
class helper extends \q_export_user_data {
|
14 |
|
15 |
|
16 |
/**
|
library/core/user.php
CHANGED
@@ -8,7 +8,7 @@ use q\report\core\helper as helper;
|
|
8 |
// load it up ##
|
9 |
\q\report\core\user::run();
|
10 |
|
11 |
-
class user extends \
|
12 |
|
13 |
public static function run()
|
14 |
{
|
8 |
// load it up ##
|
9 |
\q\report\core\user::run();
|
10 |
|
11 |
+
class user extends \q_export_user_data {
|
12 |
|
13 |
public static function run()
|
14 |
{
|
library/core/xml.php
CHANGED
@@ -14,7 +14,7 @@ use q\report\core\helper as helper;
|
|
14 |
// load it up ##
|
15 |
#\q\report\core\core::run();
|
16 |
|
17 |
-
class xml extends \
|
18 |
|
19 |
public static function begin()
|
20 |
{
|
14 |
// load it up ##
|
15 |
#\q\report\core\core::run();
|
16 |
|
17 |
+
class xml extends \q_export_user_data {
|
18 |
|
19 |
public static function begin()
|
20 |
{
|
readme.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
**Tags:** user, users, xprofile, usermeta csv, excel, batch, export, save, download
|
5 |
**Requires at least:** 5.0.0
|
6 |
**Tested up to:** 5.0.0
|
7 |
-
**Stable tag:** 2.0.
|
8 |
**License:** GPLv2
|
9 |
|
10 |
Export users data and metadata to a csv or Excel file
|
4 |
**Tags:** user, users, xprofile, usermeta csv, excel, batch, export, save, download
|
5 |
**Requires at least:** 5.0.0
|
6 |
**Tested up to:** 5.0.0
|
7 |
+
**Stable tag:** 2.0.3
|
8 |
**License:** GPLv2
|
9 |
|
10 |
Export users data and metadata to a csv or Excel file
|
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: 4.8.0
|
5 |
Tested up to: 5.0.0
|
6 |
-
Stable tag: 2.0.
|
7 |
License: GPLv2
|
8 |
|
9 |
Export users data and metadata to a csv or Excel fil
|
3 |
Tags: user, users, xprofile, usermeta csv, excel, batch, export, save, download
|
4 |
Requires at least: 4.8.0
|
5 |
Tested up to: 5.0.0
|
6 |
+
Stable tag: 2.0.3
|
7 |
License: GPLv2
|
8 |
|
9 |
Export users data and metadata to a csv or Excel fil
|