Skip to content

"Customer" views - #3292

Open
brianhogg wants to merge 9 commits into
devfrom
feature/customer-views
Open

brianhogg wants to merge 9 commits into
devfrom
feature/customer-views

Conversation

@brianhogg

@brianhogg brianhogg commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Description

New "Customers" view under the Orders menu.

How has this been tested?

Manually

Screenshots

CleanShot 2026-07-31 at 15 37 29@2x image CleanShot 2026-09-22 at 14 12 47@2x

Checklist:

  • This PR requires and contains at least one changelog file.
  • My code has been tested.
  • My code passes all existing automated tests.
  • My code follows the LifterLMS Coding & Documentation Standards.

Note

Medium Risk
Introduces heavy SQL aggregation and cached revenue metrics used for admin decisions; bugs could misreport LTV or segments, though access is gated and tests cover core query behavior.

Overview
Adds a Customers admin area under Orders so staff can browse purchasers with commerce metrics, segments, and per-customer detail without going through the WordPress user editor.

The list view is a searchable, sortable, exportable table backed by a new LLMS_Customer_Query that aggregates orders and transactions into LTV, AOV, subscription counts, and related fields. Segment filters (all, high spenders, active subscriptions, free only, at risk) use cached counts and an LTV percentile threshold for “high spenders.” Single-customer pages reuse reporting-style layout with Overview (widgets, recent orders, billing, enrollments) and Orders tabs.

Navigation now points buyers to the customer screen from the orders list, order metabox, and student reporting (LTV/order teaser widgets with “view customer” links). Access follows the existing lifterlms_admin_order_access capability; metrics cache invalidates when orders or transactions are saved.

Includes admin styling, help beacon and table script registration, a small fix so reporting monetary widgets only format numeric compare values, PHPUnit coverage for the query and helpers, and a changelog entry.

Reviewed by Cursor Bugbot for commit 69429a3. Bugbot is set up for automated code reviews on this repo. Configure here.

@brianhogg brianhogg moved this to Awaiting Review in Development Jul 31, 2026
@brianhogg
brianhogg marked this pull request as ready for review September 22, 2026 18:13
@brianhogg

Copy link
Copy Markdown
Contributor Author

@cursor review

@brianhogg brianhogg moved this from Awaiting Review to Review in Progress in Development Sep 22, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 69429a3. Configure here.

Comment thread includes/admin/class-llms-admin-customers.php Outdated
Comment thread includes/class-llms-customer-query.php Outdated
Comment thread includes/admin/class-llms-admin-customers.php
…nts if users are deleted. Allow search with only one character. Fix "billing" sidebar content on single customer overview.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Review in Progress

Development

Successfully merging this pull request may close these issues.

1 participant