Skip to content

Add phone column to users list#7

Merged
gmjuhasz merged 5 commits into
trunkfrom
rsm-3028-users-phone-column
May 15, 2026
Merged

Add phone column to users list#7
gmjuhasz merged 5 commits into
trunkfrom
rsm-3028-users-phone-column

Conversation

@gmjuhasz
Copy link
Copy Markdown
Contributor

@gmjuhasz gmjuhasz commented May 15, 2026

Summary

Fixes RSM-3028

Stacked on #6.

  • Adds a Phone column to wp-admin/users.php when Telegram Auth phone collection is enabled.
  • Renders the stored billing_phone usermeta value with escaping and leaves empty cells blank.
  • Makes the column sortable via a named usermeta query clause.
  • Hides the column entirely when request_phone is disabled.

Testing

Automated checks run locally:

composer phpunit -- --filter Users_List_Columns_Test
composer phpunit
composer phpcs

Latest local result:

  • composer phpunit -- --filter Users_List_Columns_Test: 9 tests, 14 assertions, passing.
  • composer phpunit: 108 tests, 212 assertions, passing.
  • composer phpcs: passing. PHPCS prints existing ruleset deprecation notices for array properties, but no sniff failures.

Manual Testing

  1. Enable phone collection in Settings > Telegram Auth.
  2. Ensure at least one user has billing_phone usermeta set.
  3. Visit Users > All Users and confirm Phone appears after Email.
  4. Confirm users with billing_phone show the value, and users without it show a blank cell.
  5. Click the Phone header twice and confirm sorting flips direction.
  6. Disable phone collection and confirm the Phone column disappears from Users > All Users.
CleanShot 2026-05-15 at 11 10 13@2x

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

🔍 WordPress Plugin Check Report

⚠️ Status: Passed with warnings

📊 Report

🎯 Total Issues ❌ Errors ⚠️ Warnings
24 0 24

⚠️ Warnings (24)

📁 composer.json (1 warning)
📍 Line 🔖 Check 💬 Message
0 missing_composer_json_file The "/vendor" directory using composer exists, but "composer.json" file is missing.
📁 build/build.php (5 warnings)
📍 Line 🔖 Check 💬 Message
13 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$modules_file".
19 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$scripts_file".
25 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$styles_file".
31 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$routes_file".
37 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$pages_file".
📁 build/routes.php (12 warnings)
📍 Line 🔖 Check 💬 Message
14 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$routes_file".
19 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$routes".
22 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$routes_by_page".
23 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$route".
24 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$page_slug".
26 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$routes_by_page".
28 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$routes_by_page".
32 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$page_slug".
32 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$page_routes".
33 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$page_slug_underscore".
34 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$global_name".
35 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$$global_name".
📁 build/pages/telegram-auth/page-wp-admin.php (1 warning)
📍 Line 🔖 Check 💬 Message
141 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "telegram-auth-wp-admin_init".
📁 build/pages/telegram-auth/page.php (5 warnings)
📍 Line 🔖 Check 💬 Message
141 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "telegram-auth_init".
263 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "admin_head-{$hook_suffix}".
270 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "admin_head".
284 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "admin_footer".
298 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "admin_footer-{$hook_suffix}".

🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

@gmjuhasz gmjuhasz requested a review from manzoorwanijk May 15, 2026 09:09
@gmjuhasz gmjuhasz self-assigned this May 15, 2026
Base automatically changed from rsm-3027-phone-dm-scopes to trunk May 15, 2026 10:59
Copy link
Copy Markdown
Member

@manzoorwanijk manzoorwanijk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well.

*
* @return array<string,mixed>
*/
public function maybe_sort_by_phone( array $args ): array {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although it doesn't hurt but sorting by phone number may never be that useful.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep I also thought about remving it, but it supports core functionality now, maybe someone will use it to sort by area code

@gmjuhasz gmjuhasz merged commit 4efe9f8 into trunk May 15, 2026
5 checks passed
@gmjuhasz gmjuhasz deleted the rsm-3028-users-phone-column branch May 15, 2026 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants