=== Jeet Sanwal Product Manuals ===
Contributors: jeetsanwal
Tags: woocommerce, product manuals, pdf, variations, documents
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 1.0.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Give each WooCommerce model the right PDF manual. Product defaults, variation overrides and a paginated document coverage report.

== Description ==

A 110V tool and its 230V version should not have to share the same installation manual. Jeet Sanwal Product Manuals adds named PDF links to products and lets each variation inherit those links, use its own set, or hide documents.

* Choose up to 20 PDFs per product or variation from the WordPress Media Library.
* Give each link a clear label: installation manual, specifications, care guide, and so on.
* Standard WooCommerce variation selections update the displayed documents. Reset restores the product defaults.
* The independent "Manuals for" selector also works without the standard variation form. It loads models only when requested, in batches of 50.
* Review saved document coverage under WooCommerce → Manual coverage. Products and variations are paginated, 20 per page; inherited documents and deleted attachments are checked.
* Use the Product Manuals block or [jeet_product_manuals] shortcode where a template does not call the standard product-summary hook.
* With optional installation reports off, no ads, upgrades, signup, telemetry, remote services, frontend credits or order data access.

Only PDFs registered as application/pdf attachments are accepted. The plugin stores attachment IDs and labels rather than arbitrary URLs or filesystem paths. Document links are escaped before output. Published products must be visible and have no password. Draft, private, hidden and password-protected products, and their models, are excluded from the public interface.

**Public documents only:** Media Library PDF URLs are public WordPress uploads. This plugin does not protect files or provide paid/private downloads. Never put customer, identity, payment or other private files here.

The plugin uses WooCommerce product CRUD for saved metadata and does not read or write orders. HPOS compatibility is declared because no order storage APIs are used. No files are uploaded or deleted by the plugin itself; the standard Media Library handles uploads.

== Installation ==

1. Install and activate WooCommerce. Use a WordPress and PHP version supported by your WooCommerce version. For example, WooCommerce 11.2 requires WordPress 7.0 or newer even though this plugin's minimum is WordPress 6.5.
2. Upload the jeet-product-manuals folder, or install the plugin ZIP through Plugins → Add New → Upload Plugin.
3. Edit a WooCommerce product in its standard product editor. Open Product data → Manuals.
4. Add a PDF, choose it from Media Library, enter a link label and update the product.
5. For a variable product, expand a variation and choose Inherit product documents, Use these documents, or Hide documents. Save the variation changes.
6. Open the storefront and select a model. Check WooCommerce → Manual coverage for missing documents.

== Frequently Asked Questions ==

= Does each variation get its own documents? =

Yes. Inherit uses the current parent documents; Custom uses only that variation's documents; Hide shows none. A Custom variation with no valid PDF has no documents; it does not fall back to the parent. Choosing Hide keeps saved custom rows so switching back does not discard them.

= Which frontend templates work? =

Automatic placement uses woocommerce_single_product_summary. Standard WooCommerce variation forms synchronize through found_variation and reset_data events, including their AJAX variation lookup. Block templates that do not call that hook can use the Product Manuals block or shortcode. The independent Manuals for selector works there as well. It controls documents only; it does not change the cart's selected variation. Synchronization with every third-party or newer block-specific add-to-cart selector is not claimed.

= Which product editor works? =

Manage PDFs in the standard WooCommerce Product data panel and variation panels. The block is for displaying manuals in page and site templates; it is not a replacement product editor. Alternative product editors must expose the standard WooCommerce product-data hooks to show these fields.

= Can I put a particular product's documents on another page? =

Use [jeet_product_manuals product_id="123"] or enter that product ID in the Product Manuals block. Only public, visible, published products without a password are accepted. Duplicate displays of the same product are suppressed within one page request.

= Can I use external URLs, private PDFs or Word files? =

With optional installation reports off, no. This version deliberately accepts public PDF attachments from Media Library. It does not accept typed external links, private attachments, file paths, protected downloads or other formats. A WordPress-managed attachment URL may be served through your existing media/CDN configuration; the plugin itself makes no remote requests.

= Why does Manual coverage say Missing manual? =

The product or variation currently has no valid PDF in its effective document set. A deleted attachment, changed MIME type, private attachment or invalid URL is skipped. Hidden by choice is listed separately. The report checks saved configuration, not whether the product is currently public, and does not check the remote HTTP availability or contents of each PDF. Each batch considers 20 unfiltered candidate IDs, up to 10,000 batches. The literal name filter runs only after edit access is checked; Next follows candidates rather than global matches. A blank batch does not rule out accessible products elsewhere.

= Will it slow down all my pages? =

With optional installation reports off, frontend assets load only when manuals render. Simple products do not load the frontend script. Model lists are requested on demand, 50 at a time; the coverage report checks only 20 products or variations per page. There are no background scans or scheduled tasks.

= What happens when WooCommerce is inactive? =

The integration does not initialize, and an administrator sees a dependency notice. Your saved document metadata and PDFs remain in place.

= What happens on uninstall? =

Product document assignments and uploaded media are retained to prevent accidental data loss. Remove assignments in the product editor if you want to clear them before uninstalling. The plugin creates no separate tables, scheduled tasks, options or user data.

== Privacy ==

With optional installation reports off, no analytics, telemetry, advertising, external service requests, cookies or personal-data storage are added. The public read-only model endpoint returns only published visible product models and their public PDF labels/links. Standard WordPress and WooCommerce services operate independently of this plugin.

== Updating an existing installation ==

Download this plugin's individual ZIP from https://jeetsanwal.in/tools/jeet-product-manuals . 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.5, 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

Text preservation fix: newly saved supported records now retain literal backslashes and quotes. Previously altered text cannot be reconstructed automatically; reopen and correct it from your original source when needed. Existing metadata formats are unchanged.

== 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.5 =
* Updated the product display name to Jeet Sanwal Product Manuals 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.4 =
* Preserved literal backslashes and quotes in newly saved PDF link labels without flushing unrelated pending product metadata.

= 1.0.3 =
* Added a complete US English installation and update guide; kept documented permissions, limits and manual rollback steps.


= 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 =
* Check product and parent edit access before filtering manual-coverage names; use bounded candidate batches without global search counts.
* Keep coverage controls within narrow screens and make the table scroll in its own keyboard-accessible region.

= 1.0.0 =
* First release: product PDF sets, inherit/custom/hide per variation, frontend model switching, block/shortcode display and paginated coverage report.
