Skip to content

fix: customer site lists stop at 100 sites (BerlinDB default number) #2136

Closed

Description

@superdav42

What

A customer with more than 100 sites cannot see or select the ones beyond the first 100 in the frontend account widgets. Customer::get_sites() passes no number, so BerlinDB applies its default of 100.

Evidence

The SQL the default call runs, captured with a query filter against the plugin's locked BerlinDB:

Call SQL limit
$customer->get_sites() LIMIT 100
$customer->get_sites(['number' => 0]) no LIMIT clause
$customer->get_sites(['number' => false]) no LIMIT clause
$customer->get_sites(['number' => -1]) LIMIT 1

vendor/berlindb/core/src/Database/Query.php:476 sets 'number' => 100.

Do not copy the 'number' => -1 convention used elsewhere in the plugin (for example inc/functions/customer.php:68) for this query. With Site::query() it returns a single site.

Callers that use the default:

  • inc/ui/class-account-summary-element.php:319: the site selector shown when no site is chosen. Sites past 100 cannot be selected.
  • inc/ui/class-my-sites-element.php:345: the My Sites list. Sites past 100 are not listed.
  • inc/ui/class-magic-link-url-element.php:354: picks the best candidate site; the cap matters less here.

This is not new. It was raised by a review bot on #2133, and My Sites has the same cap on main.

Files Scope

  • inc/ui/class-account-summary-element.php
  • inc/ui/class-my-sites-element.php
  • inc/models/class-customer.php

Decision to make

Rendering every site is fine for a selector but could be heavy for a very large customer. Either lift the limit for the selector only ('number' => 0), or paginate both lists. Keep the behaviour of customers with up to 100 sites unchanged.

Reference pattern

inc/models/class-customer.php:666 builds the query from $query_args, so get_sites(['number' => 0]) already works without changing the model.

Verification

  • Create 101 or more customer-owned sites for one customer (a short wp eval loop creating blogs and assigning them with wu_get_site()->set_customer_id()), then open the account page without a site selected and confirm all of them are selectable.
  • Log the SQL for the call and confirm there is no LIMIT 100.
  • With fewer than 100 sites, output is unchanged.

Tier

tier:standard. Files and evidence are known, but the all-versus-paginate choice is a design decision.


aidevops.sh v3.39.189 plugin for OpenCode

Activity

  1. locked as resolved and limited conversation to collaborators on Nov 21, 2026
  2. added
    bug
    status:available
    origin:interactive
    tier:standard
    on Nov 21, 2026
  3. superdav42 commented on Nov 21, 2026

    @superdav42
    CollaboratorAuthor

    DISPATCH_CLAIM nonce=da71170d68fc859528e2a9a2f9cd7412 runner=superdav42 ts=2026-11-21T18:40:14Z max_age_s=1800 version=3.39.189 opencode_version=1.18.31 lease_token=da71170d68fc859528e2a9a2f9cd7412 device=device-1783824528-2609248-26808 session=issue-2136 phase=prelaunch expires_at=1795286536

  4. superdav42 commented on Nov 21, 2026

    @superdav42
    CollaboratorAuthor

    DISPATCH_LEASE phase=prelaunch lease_token=da71170d68fc859528e2a9a2f9cd7412 device=device-1783824528-2609248-26808 session=issue-2136 expires_at=1795286882 ts=2026-11-21T18:40:32Z attempt_id=attempt:967c8ae4-c5b6-42fa-a1be-b8c37ecdc5a9

  5. added
    status:queued
    status:in-progress
    and removed
    status:available
    status:queued
    on Nov 21, 2026
  6. superdav42 commented on Nov 21, 2026

    @superdav42
    CollaboratorAuthor

    Dispatching worker (deterministic).

  7. superdav42 commented on Nov 21, 2026

    @superdav42
    CollaboratorAuthor

    DISPATCH_LEASE phase=ready lease_token=da71170d68fc859528e2a9a2f9cd7412 device=device-1783824528-2609248-26808 session=issue-2136 expires_at=1795293692 ts=2026-11-21T18:41:32Z attempt_id=attempt:967c8ae4-c5b6-42fa-a1be-b8c37ecdc5a9


    aidevops.sh v3.39.189 automated scan.

  8. added
    status:in-review
    and removed
    status:in-progress
    on Nov 21, 2026
  9. superdav42 commented on Nov 21, 2026

    @superdav42
    CollaboratorAuthor

    CLAIM_RELEASED reason=worker_complete runner=superdav42 ts=2026-11-21T18:44:09Z aidevops_version=3.39.189 opencode_version=1.18.31 claim_id=7067425033 nonce=da71170d68fc859528e2a9a2f9cd7412 lease_token=da71170d68fc859528e2a9a2f9cd7412 device=device-1783824528-2609248-26808 session=issue-2136


    aidevops.sh v3.39.189 plugin for OpenCode v1.18.31

  10. superdav42 commented on Nov 22, 2026

    @superdav42
    CollaboratorAuthor

    Completion Summary

    • What: Pass number=0 to Customer::get_sites() in account summary selector and My Sites list so customers with >100 sites see all of them; <=100 unchanged.
    • Issue: fix: customer site lists stop at 100 sites (BerlinDB default number) #2136
    • Files changed: inc/ui/class-account-summary-element.php, inc/ui/class-my-sites-element.php
    • Testing: phpcs/phpstan pre-commit hooks; no test added
    • Key decisions: none

    aidevops.sh v3.39.189 plugin for OpenCode v1.19.5 with claude-sonnet-5-5 spent 1m and 1,666 tokens on this as a headless worker.


    Merged via PR #2139 to main.
    Merged by deterministic merge pass (pulse-wrapper.sh).

    Routing feedback

    • Route: standard; 1 attempt, 12 LLM requests, 0 capability escalations, 0 same-tier fallbacks.
    • Population: headless; 0 objective outcomes.
    • Usage: 741,741 tokens; $0.2533 estimated cost.
    • Recommendation: No routing change is recommended from this sample.
  11. added
    solved:worker
    and removed
    status:in-review
    on Nov 22, 2026
  12. unlocked this conversation on Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugorigin:interactivesolved:workerstatus:donetier:standard

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions