=== Jeet Pattern Impact Preview ===
Contributors: jeetsanwal
Tags: synced patterns, reusable blocks, content audit, block editor
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Check saved posts, pages and nested synced patterns before changing a shared pattern. Free, minimal and read-only.

== Description ==

Changing a synced pattern can affect content in several places. Tools → Pattern impact lets an administrator choose an editable synced pattern and check the site's saved block content before editing it.

* Direct references and indirect uses through nested synced patterns.
* A representative reference path for each matching post, page, public custom content item or containing pattern.
* Current edit links, plus view links only for published public items without a password.
* Automatic small batches, a pause button and manual continuation when JavaScript is off.
* Permission checks, coverage warnings and reports that expire after one hour.
* No content changes, frontend scripts, account, ads, upgrade prompts, tracking or external requests.

This is a saved-content dependency report, not a visual preview or a guarantee of every live use. Only structural core/block ref attributes in post_content are inspected. Shortcodes, block render callbacks and content filters are not executed. Theme templates, template parts, widgets, custom fields, page-builder databases, dynamically injected content, pattern overrides and external sites are outside scope. Unsynced pattern copies have no continuing link to their original and cannot be identified as dependencies.

Administrators need manage_options and edit_post access to both the selected pattern and inspected content. Restricted patterns/content are skipped; skipped, oversized, unresolved or capped scans are marked incomplete. Counts can change while people edit content. Restart the scan after making changes.

Each request processes at most 20 records or relationship checks. The scan is bounded to 2,000 total saved records including up to 1,000 pattern records, 10,000 graph references, 250 references per record, 180,000 bytes per content field, 3,000 parsed blocks per record and a 20-pattern traversal depth. It counts matches beyond the first 250 displayed rows. Duplicate reference paths are condensed to one representative path per item. Cycles are guarded; a cycle with no path to the selected pattern is not a match.

Public post types are checked across published, scheduled, draft, pending and private saved records; attachments, revisions, trash and auto-drafts are excluded. Privately titled rows and pattern paths are shown only when the current administrator can edit each item. Reports are per user/site, stored temporarily in WordPress transients, contain IDs/paths rather than copied content and expire one hour after the latest batch. The tool never edits a post or pattern.

== Installation ==

1. Upload the jeet-pattern-impact-preview folder or install the plugin ZIP through Plugins → Add New → Upload Plugin.
2. Activate the plugin.
3. Open Tools → Pattern impact. Search for a synced pattern and click Check impact.
4. Let the batches finish, inspect coverage warnings, then use Edit to open affected content when needed.

No configuration or WooCommerce dependency is required.

== Frequently Asked Questions ==

= Does it edit, replace or detach patterns? =
No. It only reads saved block markup and stores a temporary report.

= Does it scan my live pages? =
No. It does not request frontend URLs or render blocks. It checks saved post_content, so theme, builder, metadata and runtime uses may not appear.

= Does it find a pattern nested inside another synced pattern? =
Yes. It follows structural core/block references through editable saved patterns and shows a representative chain. Missing/restricted references or traversal limits are reported as incomplete coverage.

= Can editors or visitors read reports? =
No. The screen requires manage_options and reports are scoped to the current administrator. Each content item and every pattern path also require edit_post access.

= What does zero matches mean? =
No uses were found in the checked accessible saved content. It never proves a pattern is unused everywhere. Always consider the stated exclusions and any incomplete-coverage warning before deleting or changing a pattern.

= Where is my report stored? =
In a per-user WordPress transient for one hour after the last batch. Clear this report removes it immediately. Uninstall removes matching database transients for the current site; external object-cache entries expire naturally. No content, settings or external service are created.

= How do I update? =
Download an updated ZIP from the plugin page and replace the installed version using WordPress. The plugin does not include an automatic updater.

== Changelog ==

= 1.0.0 =
* Initial release: bounded saved-content scans, nested reference paths, private reports and coverage warnings.
