Admin screen

The screen is at Users > User Insights on each site, for accounts with the plugin’s capability (install_plugins by default, filterable with lh_ui_capability). It lists the site’s users in a DataViews table: choose columns, sort, search by username, email or display name, filter, and page through. Each administrator’s columns, sort, filters, search and page size are saved in their usermeta and restored on their next visit. Usernames link to the user’s edit screen.

Filters

Only filters the query engine answers exactly are offered, and all filters must match:

The engine’s “is set”, “is not set” and “ends with” operators are available through the query-users ability but not on the screen.

Building the screen

The app lives in js/src/ and is built locally, since no build tooling runs on the server: npm install && npm run build in js/, then deploy js/build/. It pins @wordpress/dataviews 12.0.1 and @wordpress/scripts 31.5.1, and imports DataViews from the package root so wp-components comes from core rather than being bundled. The build copies DataViews’ own stylesheets into build/ as dataviews.css and dataviews-rtl.css. If the build is missing, the screen shows a notice instead of the table.

The screen reads rows from GET lh-user-insights/v1/users/query (filters, fields, search, orderby, order, number up to 100, offset) and saves its view with POST lh-user-insights/v1/view. Filters are checked by LH_UI_Filters, the same check the query-users ability uses.