File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -120,6 +120,11 @@ public function add_user_order_count_column( $columns ) {
120120 * @return string
121121 */
122122 public function display_user_order_count_column ( $ output , $ column_name , $ user_id ) {
123+ // Security check - only for admins with list_users capability
124+ if ( ! is_admin () || ! current_user_can ( 'list_users ' ) ) {
125+ return $ output ;
126+ }
127+
123128 if ( 'user_order_count ' === $ column_name ) {
124129 $ order_count = wc_get_customer_order_count ( absint ( $ user_id ) );
125130 return esc_html ( number_format_i18n ( $ order_count ) );
@@ -224,6 +229,11 @@ public function add_user_registration_date_column( $columns ) {
224229 * @return string
225230 */
226231 public function display_user_registration_date_column ( $ output , $ column_name , $ user_id ) {
232+ // Security check - only for admins with list_users capability
233+ if ( ! is_admin () || ! current_user_can ( 'list_users ' ) ) {
234+ return $ output ;
235+ }
236+
227237 if ( 'registration_date ' === $ column_name ) {
228238 $ registration_date = get_the_author_meta ( 'registered ' , absint ( $ user_id ) );
229239 if ( $ registration_date ) {
You can’t perform that action at this time.
0 commit comments