SiloNectra 1.0.2 — SQL and cache maintenance notes
Copyright (c) Digitaltcab. GPLv2 or later.

The SQL query templates and clause builders are private plugin code. Client
search text, URLs, IDs and filters must never be used as SQL templates.

PREPARATION AND EXECUTION
All index query preparation uses prepare_index_sql() in
includes/trait-silonectra-data-access.php. It checks the exact number of %d, %s,
%f and %i bindings, rejects nested/non-scalar values and restricts %i bindings
to the known WordPress and plugin-owned tables. It then calls wpdb::prepare().
The scalar, array and variadic forms are normalized before these checks.

The reader accepts only a prepared SELECT whose fingerprint was registered by
that preparer in this instance. Raw SQL and non-SELECT statements are rejected.
The single execution point uses the existing WordPress database connection.
Database read failures are not cached or presented as valid empty reports.

The multi-category silo membership query now passes a flat category ID list.
Non-numeric searches use an impossible article ID instead of matching target
ID zero (the index's unresolved-URL marker).

CACHE BEHAVIOUR
Successful raw SELECT results, including empty arrays and zero counts, use
WordPress object caching for 30 seconds. Keys include the prepared SQL, plugin
version, blog ID, index generation and WordPress posts/terms last-change values.
WordPress placeholder-escape markers are removed only for the cache fingerprint;
the registered prepared query is passed unchanged to wpdb for execution.

Index writes rotate a UUID generation and invalidate derived overview/graph
transients. Title-only saves, relevant Elementor/pillar metadata, taxonomy
assignment and term changes also invalidate derived report caches. No global
object-cache flush is used. Returned raw rows are formatted for the current
user after reading the cached data; edit permissions are not cached across users.

Export cursor pages, rollback records, URL-check records, replacement previews
and index write preconditions explicitly bypass the report cache. Export does
not populate thousands of one-use cursor cache entries.

INDEXES AND AUDIT HISTORY
The existing custom tables and data are retained. Additional source/target,
target/source, source/URL-hash and anchor-prefix/URL-hash indexes support common
lookup, duplicate and aggregate predicates. The anchor prefix remains bounded.
Audit inserts use explicit integer/string field formats. Legacy bulk linking
captures the inserted history ID before reindexing can change wpdb insert_id,
so the returned Undo ID identifies the actual content snapshot.

INTENTIONAL CODING-STANDARD EXCEPTIONS
The release does not ship a ruleset that excludes security/caching checks and
does not disable any Plugin Check category. Its default static results include
the source's narrow inline PHPCS exceptions, as normal PHPCS processing does.

The central preparation/execution statements document why a private validated
template/prepared variable is safe even though a static checker cannot follow
the runtime binding checks and prepared-query registry.

Custom index/audit writes have no equivalent WordPress core object API; those
individual writes document their wpdb formats and generation invalidation.
Single-article exclusion and category/pillar WP_Query filters are intentional
features, bounded/paginated and use WordPress core query caching. Their specific
advisory performance sniffs are documented next to the affected arguments.

These are reviewed exceptions, not proof that every query is cheap on every
production database. A WordPress.org reviewer can assess each rationale. The
0-error/0-warning result must be described with these exceptions disclosed.
