Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

fix: resolve effective limitations in non-primary networks and isolate caches

Aperta
#1,879 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
php, wordpress

Direzione di ricerca

Start with inc/objects/class-limitations.php:461-502 and trace the canonical network-aware metadata table resolver before changing the early lookup or cache keys. Then inspect inc/models/traits/trait-limitable.php and the invalidation paths, including remove_limitations(). Extend tests/WP_Ultimo/Objects/Limitations_Test.php with synthetic two-network fixtures; done means network-specific reads, cache isolation, invalidation, inheritance, and bootstrap behavior all pass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

origin:interactive status:in-review type:bug

Goal

Resolve product/membership effective limitations from the correct network metadata
tables and isolate limitation caches between networks. This is required before
relying on product limits during native trial-site provisioning.

Observed behaviour

With Ultimate Multisite 2.16.1 and the Multi-Network addon active, read-only checks
on a non-primary network found two products where
count((array) $product->get_meta('wu_limitations', [])) was 11 but
count($product->get_limitations()->to_array()) was 0. Another product resolved
11 modules. No product settings or customer records were modified for the check.
The reason for that third product's differing result has not been established.

Upstream main was inspected and retains the same relevant code:

  • inc/objects/class-limitations.php:461-502, early_get_limitations(), builds
    the table directly as {$wpdb->base_prefix}{$wu_prefix}{$slug}meta.
  • Its static cache key is only sprintf('%s-%s', $slug, $id).
  • inc/models/traits/trait-limitable.php:73-76 switches from the model's normal
    metadata API to this early lookup after muplugins_loaded.

This suggests a mismatch between the early lookup and the active network's model
metadata routing, with a separate risk of cache collisions for overlapping IDs.
Verify the routing contract before choosing a fix; do not assume missing limits
are simply a product configuration error.

Implementation scope

  • Audit and fix the early metadata lookup in inc/objects/class-limitations.php.
    Use the canonical network-aware table resolver; do not hard-code an addon table
    prefix. The appropriate resolver must be identified during implementation.
  • Include effective network/table identity in static cache keys and audit the
    corresponding invalidation paths, including remove_limitations().
  • Preserve the special handling of native site/blog metadata and early bootstrap
    when the full model layer or addon hooks are not available.
  • Inspect inc/models/traits/trait-limitable.php for related per-object cache
    isolation requirements. Do not weaken or bypass limits as a workaround.
  • If the routing contract belongs to the Multi-Network addon, coordinate that
    fix there instead of adding an incompatible core-only naming assumption.

Verification

Extend the existing tests/WP_Ultimo/Objects/Limitations_Test.php and applicable
limitation tests; no new test framework is needed. Create fixture products in two
networks with distinct site/disk limits and overlapping IDs when the storage
model permits that. Verify:

  1. Normal model metadata and effective limitation results agree in each network.
  2. Switching networks and restoring the original network in one request does not
    reuse another network's cached result.
  3. Updating/removing limits invalidates only the intended cached data.
  4. Membership/site inheritance enforces the correct product limits.
  5. Primary-network, site/blog metadata and early-bootstrap behaviour remain valid.

Use synthetic fixtures only. Do not reproduce by altering live customer records.


aidevops.sh v3.34.13 plugin for OpenCode v1.18.31 with gpt-6-astra

Lingua principale
PHP
Stelle
215
Fork
86
Merge medio
10h 34m
PR unite (30g)
61

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Ultimate-Multisite/ultimate-multisite

Tutte le issue di Ultimate-Multisite/ultimate-multisite

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.