Skip to content

Commit 2761566

Browse files
committed
2.2.4
1 parent 57cb76b commit 2761566

File tree

13 files changed

+150
-227
lines changed

13 files changed

+150
-227
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Changelog ##
22

3-
*** 2.2.3 ***
3+
*** 2.2.4 ***
44

55
* New: WordPress Security release
66

export-user-data.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Plugin Name: Export User Data
1313
* Plugin URI: http://qstudio.us/releases/export-user-data
1414
* Description: Export User data and metadata.
15-
* Version: 2.2.3
15+
* Version: 2.2.4
1616
* Author: Q Studio
1717
* Author URI: https://qstudio.us
1818
* License: GPL-2.0+
@@ -50,10 +50,10 @@
5050
require_once __DIR__ . '/vendor/PHP_XLSXWriter/xlsxwriter.class.php';
5151

5252
// get plugin instance ##
53-
$plugin = plugin::get_instance();
53+
$_plugin = plugin::get_instance();
5454

5555
// validate instance ##
56-
if( ! ( $plugin instanceof \q\eud\plugin ) ) {
56+
if( ! ( $_plugin instanceof \q\eud\plugin ) ) {
5757

5858
error_log( 'Error in Export User Data plugin instance' );
5959

@@ -63,51 +63,51 @@
6363
}
6464

6565
// fire hooks - build log, helper and config objects and translations ##
66-
\add_action( 'init', function() use( $plugin ){
66+
\add_action( 'init', function() use( $_plugin ){
6767

6868
// set text domain on init hook ##
69-
\add_action( 'init', [ $plugin, 'load_plugin_textdomain' ], 1 );
69+
\add_action( 'init', [ $_plugin, 'load_plugin_textdomain' ], 1 );
7070

7171
// check debug settings ##
72-
\add_action( 'plugins_loaded', [ $plugin, 'debug' ], 11 );
72+
\add_action( 'plugins_loaded', [ $_plugin, 'debug' ], 11 );
7373

7474
}, 0 );
7575

7676
// build export object ##
77-
$export = new eud\core\export( $plugin );
77+
$_export = new eud\core\export( $_plugin );
7878

7979
// build filters object ##
80-
$filters = new eud\core\filters( $plugin );
80+
$_filters = new eud\core\filters( $_plugin );
8181

8282
// build user object ##
83-
$user = new eud\core\user( $plugin );
83+
$_user = new eud\core\user( $_plugin );
8484

8585
// build admin object ##
86-
$admin = new eud\admin\render( $plugin, $user );
86+
$_admin = new eud\admin\render( $_plugin, $_user );
8787

8888
// build buddypress object ##
89-
// $buddypress = new eud\core\buddypress();
89+
// $_buddypress = new eud\core\buddypress( $_plugin );
9090

9191
if ( \is_admin() ){
9292

9393
// run export ##
94-
\add_action( 'admin_init', [ $export, 'render' ], 1000003 );
94+
\add_action( 'admin_init', [ $_export, 'render' ], 1000003 );
9595

9696
// load BP ##
97-
// \add_action( 'admin_init', [ $buddypress, 'load' ], 1000001 );
97+
// \add_action( 'admin_init', [ $_buddypress, 'load' ], 1000001 );
9898

9999
// EUD - filter key shown ##
100-
\add_filter( 'q/eud/admin/display_key', [ $filters, 'display_key' ], 1, 1 );
100+
\add_filter( 'q/eud/admin/display_key', [ $_filters, 'display_key' ], 1, 1 );
101101

102102
// user option ##
103-
\add_action( 'admin_init', [ $user, 'load' ], 1000002 );
103+
\add_action( 'admin_init', [ $_user, 'load' ], 1000002 );
104104

105105
// add export menu inside admin ##
106-
\add_action( 'admin_menu', [ $admin, 'add_menu' ] );
106+
\add_action( 'admin_menu', [ $_admin, 'add_menu' ] );
107107

108108
// UI style and functionality ##
109-
\add_action( 'admin_enqueue_scripts', [ $admin, 'admin_enqueue_scripts' ], 1 );
110-
\add_action( 'admin_footer', [ $admin, 'jquery' ], 100000 );
111-
\add_action( 'admin_footer', [ $admin, 'css' ], 100000 );
109+
\add_action( 'admin_enqueue_scripts', [ $_admin, 'admin_enqueue_scripts' ], 1 );
110+
\add_action( 'admin_footer', [ $_admin, 'jquery' ], 100000 );
111+
\add_action( 'admin_footer', [ $_admin, 'css' ], 100000 );
112112

113113
}

library/admin/render.php

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class render {
1414

1515
private $plugin, $user;
1616

17-
function __construct( \q\eud\plugin $plugin, \q\eud\core\user $user ){
17+
public function __construct( \q\eud\plugin $plugin, \q\eud\core\user $user ){
1818

1919
$this->plugin = $plugin;
2020

@@ -27,7 +27,8 @@ function __construct( \q\eud\plugin $plugin, \q\eud\core\user $user ){
2727
*
2828
* @since 0.1
2929
**/
30-
public function add_menu(){
30+
public function add_menu():void
31+
{
3132

3233
\add_users_page (
3334
\__( 'Export User Data', 'q-export-user-data' ),
@@ -49,7 +50,7 @@ public function admin_page(){
4950
// quick security check ##
5051
if ( ! \current_user_can( \apply_filters( 'q/eud/admin_capability', 'list_users' ) ) ) {
5152

52-
\wp_die( __( 'You do not have sufficient permissions to access this page.', 'q-export-user-data' ) );
53+
\wp_die( \__( 'You do not have sufficient permissions to access this page.', 'q-export-user-data' ) );
5354

5455
}
5556

@@ -229,16 +230,19 @@ public function admin_page(){
229230
global $wpdb;
230231

231232
// filterable SQL ##
232-
$meta_keys = \apply_filters(
233+
$meta_keys_sql = \apply_filters(
233234
'q/eud/admin/sql',
234-
$wpdb->get_results( "SELECT distinct(meta_key) FROM $wpdb->usermeta" )
235+
"SELECT distinct(meta_key) FROM $wpdb->usermeta"
235236
);
236237

238+
// run Query ##
239+
$meta_keys = $wpdb->get_results( $meta_keys_sql );
240+
237241
// filterable sort ##
238-
\apply_filters(
239-
'q/eud/admin/sort',
240-
asort( $meta_keys )
241-
);
242+
// \apply_filters(
243+
// 'q/eud/admin/sort',
244+
asort( $meta_keys );
245+
// );
242246

243247
// get meta_key value from object ##
244248
$meta_keys = \wp_list_pluck( $meta_keys, 'meta_key' );
@@ -415,7 +419,7 @@ public function admin_page(){
415419

416420
printf(
417421
\__( 'Include Standard user profile fields, such as user_login. <a href="%s" target="_blank">%s</a>', 'q-export-user-data' )
418-
, \esc_html('https://codex.wordpress.org/Database_Description#Table:_wp_users')
422+
, \esc_url('https://codex.wordpress.org/Database_Description#Table:_wp_users')
419423
, 'Codex'
420424
);
421425

@@ -491,8 +495,8 @@ public function admin_page(){
491495
<tr valign="top" class="toggleable">
492496
<th scope="row"><label><?php \_e( 'Limit Range', 'q-export-user-data' ); ?></label></th>
493497
<td>
494-
<input name="limit_offset" type="text" id="q_eud_users_limit_offset" value="<?php \esc_attr_e( $_limit_offset ); ?>" class="regular-text code numeric" style="width: 136px;" placeholder="<?php _e( 'Offset', 'q-export-user-data' ); ?>">
495-
<input name="limit_total" type="text" id="q_eud_users_limit_total" value="<?php \esc_attr_e ( $_limit_total ); ?>" class="regular-text code numeric" style="width: 136px;" placeholder="<?php _e( 'Total', 'q-export-user-data' ); ?>">
498+
<input name="limit_offset" type="text" id="q_eud_users_limit_offset" value="<?php \esc_attr_e( $_limit_offset ); ?>" class="regular-text code numeric" style="width: 136px;" placeholder="<?php \_e( 'Offset', 'q-export-user-data' ); ?>">
499+
<input name="limit_total" type="text" id="q_eud_users_limit_total" value="<?php \esc_attr_e ( $_limit_total ); ?>" class="regular-text code numeric" style="width: 136px;" placeholder="<?php \_e( 'Total', 'q-export-user-data' ); ?>">
496500
<p class="description"><?php
497501
printf(
498502
\__( 'Enter an offset start number and a total number of users to export. <a href="%s" target="_blank">%s</a>', 'q-export-user-data' )
@@ -875,15 +879,15 @@ public function jquery(){
875879
*
876880
* @since 0.8.2
877881
*/
878-
function css(){
882+
public function css(){
879883

880884
// load the scripts on only the plugin admin page
881885
if (
882886
! isset( $_GET['page'] )
883887
|| $_GET['page'] != 'q-export-user-data'
884888
) {
885889

886-
return false;
890+
return;
887891

888892
}
889893

library/api/admin.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ function render( $array = null ){
7272
}
7373

7474
?>
75-
<tr valign="top" class="<?php echo $toggleable; ?>">
76-
<th scope="row"><label for="q_eud_<?php echo $array['label']; ?>"><?php echo $array['title']; ?></label></th>
75+
<tr valign="top" class="<?php \esc_attr_e( $toggleable ); ?>">
76+
<th scope="row"><label for="q_eud_<?php \esc_attr_e( $array['label'] ); ?>"><?php \esc_attr_e( $array['title'] ); ?></label></th>
7777
<td>
7878
<?php
7979

@@ -84,7 +84,7 @@ function render( $array = null ){
8484
if ( isset( $array['description'] ) ) {
8585

8686
?>
87-
<p class="description"><?php echo $array['description']; ?></p>
87+
<p class="description"><?php \esc_attr_e( $array['description'] ); ?></p>
8888
<?php
8989

9090
}
@@ -175,11 +175,11 @@ public static function field_select( $array = null ){
175175
$multiselect = isset( $array['multiselect'] ) ? ' multiple="multiple"' : '' ;
176176

177177
?>
178-
<select <?php echo $multiselect; ?> name="<?php echo $array['label']; ?>" id="q_eud_<?php echo $array['label']; ?>">
179-
<?php
178+
<select <?php \esc_attr_e( $multiselect ); ?> name="<?php \esc_attr_e( $array['label'] ); ?>" id="q_eud_<?php \esc_attr_e( $array['label'] ); ?>">
179+
<?php
180180

181181
// label ##
182-
echo '<option value="">'.$array['label_select'].'</option>';
182+
echo '<option value="">'.\esc_attr( $array['label_select'] ).'</option>';
183183

184184
// loop over all options ##
185185
foreach ( $array['options'] as $item ) {
@@ -201,7 +201,7 @@ public static function field_select( $array = null ){
201201
}
202202

203203
?>
204-
<option value='<?php echo \esc_attr( $id ); ?>'><?php echo $title; ?></option>
204+
<option value='<?php \esc_attr_e( $id ); ?>'><?php esc_attr_e( $title ); ?></option>
205205
<?php
206206

207207
}

library/api/function.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function export_user_data(){
1414

1515
// sanity ##
1616
if(
17-
! class_exists( '\export_user_data\plugin' )
17+
! class_exists( 'q\eud\plugin' )
1818
){
1919

2020
error_log( 'e:>Export User Data is not available to '.__FUNCTION__ );

library/core/config.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ public static function load(){
2929
// load api admin fields ##
3030
self::get_admin_fields();
3131

32-
// kick it back ##
33-
return true;
34-
3532
}
3633

3734
/**

0 commit comments

Comments
 (0)