=== Jeet Sanwal 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.4
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.
* With optional installation reports off, 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. The picker checks 20 fixed pattern candidates per batch, with title search applied only after editing permission is checked; search does not move inaccessible titles into a result or change pagination. Counts can change while people edit content or permissions change. 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 stores the first 250 matching rows. The displayed count is recomputed from these stored rows after checking current editing permissions for every item and reference path; additional matches are not included in that visible count. 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.

== Updating an existing installation ==

Download this plugin's individual ZIP from https://jeetsanwal.in/tools/jeet-pattern-impact-preview . Make a normal site backup and try the update on staging first. In WordPress, use Plugins > Add New > Upload Plugin and choose Replace current with uploaded when WordPress detects the existing installation. Keep the same plugin folder; do not uninstall/delete the plugin as an update step. Confirm the displayed version is 1.0.4, then reopen the plugin's normal screen and check one representative workflow described above. Clear relevant page caches if public output remains stale.

Updates are installed manually; a matching Update URI prevents unrelated directory plugins from replacing this package, but does not provide an update service. If replacement fails, check hosting upload limits and write permissions before retrying. To roll back, replace the plugin files with your saved previous ZIP; file replacement alone does not restore database records or deleted files. Use your site backup when data restoration is needed. Read this plugin's retention notes before deliberately uninstalling it.

Author and support: Jeet Sanwal — https://jeetsanwal.in/contact

== Optional installation reports ==

Installation reports are optional and OFF by default. Installing, activating, or using this product does not submit a report. Administrators can choose consent separately for each product under Settings > Jeet Sanwal Reports. All product features remain available with reporting off.

After explicit consent, the client sends the website URL, a random installation ID, product/WordPress/PHP versions, reported state, and an observed activation timestamp when available to https://jeetsanwal.in/api/v1/plugin-reports. While that product is active and consent remains enabled, a daily WordPress cron check-in can update its last-known status. WP-Cron depends on site traffic and hosting; it is not a continuous monitor.

Pause stops future reports without deleting records already shared. Forget requests deletion of the remote installation entry and history, retrying deletion if delivery fails. Records automatically expire after 90 days without a check-in. The plugin does not send page content, files, database exports, administrator email addresses, or raw IP addresses. Server rate limiting keeps a keyed IP hash for up to 24 hours; ordinary hosting access logs are governed separately by the privacy policy.

Review the fields and consent before enabling reporting. Read https://jeetsanwal.in/privacy for the reporting endpoint, retention, and deletion details. Reporting does not authorize remote control, automatic updates, or access to the website.

== Changelog ==

= 1.0.4 =
* Updated the product display name to Jeet Sanwal Pattern Impact Preview and retained the Jeet Sanwal author website.
* Added voluntary installation/status reports with per-product consent OFF by default, pause/forget controls, and documented fields and retention.
* Preserved existing identifiers, stored data, permissions, and earlier release history.


= 1.0.3 =
* Added a complete US English installation and update guide; kept documented permissions, limits and manual rollback steps. Removed a language-dependent pause message so the status remains in English.


= 1.0.2 =
* Clarified the manual replacement, verification and rollback workflow, with direct author support details.
* Rechecked package metadata, source/archive consistency and existing isolated regressions.


= 1.0.1 =
* Filter pattern title searches only after object permission checks in bounded candidate batches.
* Revalidate cached matches and reference paths; display only currently accessible stored match counts.

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