---
title: Admin screen
url: https://lhero.org/portfolio/lh-user-insights/admin-screen/
date: 2026-10-15T03:01:01+11:00
modified: 2026-10-15T03:01:01+11:00
type: lh-portfolio-doc
---

- **Part of:** [LH User Insights](https://lhero.org/portfolio/lh-user-insights/)

The screen is at **Users &gt; 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:

- Text fields: is, is not, contains, does not contain, starts with.
- Number fields: is, less than, greater than.
- Choice fields (such as Role): is, is not.
- Multiple-choice profile fields: includes all, includes none.
- Dates: on, before, after, on or before, on or after, between, in the past, and over a number of days, weeks, months or years ago.

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.