=== Jeet Sanwal Product Size Guide ===
Contributors: jeetsanwal
Tags: woocommerce, size guide, size chart, products, measurements
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Reuse small merchant-written size tables on selected WooCommerce products. Deliberate guide and product switches, a classic product tab, and a shortcode fallback.

== Description ==

A medium shirt should not come with mystery measurements.

Jeet Sanwal Product Size Guide gives a store a reusable text measurement table without turning it into a fitting service. Create a guide once, enter your own units and measurements, and assign its ID to the products that use it. A later guide edit updates the source shared by those products; purge relevant page caches after changes.

Included features:
* Reusable guides with two to six labeled columns and up to 20 measurement rows.
* Plain-text title, column labels, cells, and optional measurement note.
* Separate guide publication and per-product public-display switches.
* Classic WooCommerce Size guide tab plus [jeet_size_guide] shortcode.
* Semantic column and row headers, a table caption, and a keyboard-focusable horizontal-scroll area.
* Dedicated product assignment forms and a read-only link in the native product editor.
* Small guide-list candidate batches, permission-aware local title filtering, and Next/Previous navigation.
* Nonces, stale-form checks, and ownership-checked save claims for this plugin's own forms.

No fitting recommendations, automatic measurements, unit conversion, popups, variation-specific overrides, product imports, or external services are included. The table shows what the merchant entered. It does not check whether a size or measurement is appropriate for a customer.

Created by Jeet Sanwal — https://jeetsanwal.in

== Installation ==

1. Make a normal site backup. On staging, install this individual ZIP using Plugins > Add New > Upload Plugin and activate it.
2. Keep WooCommerce 8.0 or later active. Open WooCommerce > Size guides.
3. Choose Create a size guide. Give the table a public title, fill two to six consecutive column labels with units, and enter the rows you need. Leave unused trailing columns and rows empty.
4. Choose Published for enabled products and save when the measurements are ready. Publishing requires native product-publishing access.
5. Enter a saved parent product ID in Open assignment, or follow the Product size guide link in the native product editor. Enter the guide ID, enable product display, and save the assignment.
6. Check an eligible published product page. The theme must call classic WooCommerce product tabs for automatic output. Otherwise place [jeet_size_guide] in that product context, or [jeet_size_guide id="123"] using the product ID, not the guide ID.

The guide and its product assignment must both be enabled. Draft, private, password-protected, disabled, missing, or invalid sources do not render. Disable one assignment to stop that product's output; disable the reusable guide to stop output for all its assignments. Cached public copies still need your usual cache handling.

== Scope and limits ==

Requires WordPress 6.5+, PHP 7.4+, and active WooCommerce 8.0+. Native integration is reviewed in the local WordPress 7.1.3 / WooCommerce 11.2.1 environment on PHP 8.3; PHP 7.4 checks cover syntax and isolated behavior, not the current WordPress/WooCommerce versions' own requirements.

Each guide has two to six consecutive column labels, at most 20 rows, a title up to 120 characters, column labels up to 40 characters, cells up to 80 characters, and an optional note up to 500 characters. Each used row needs a first-column label. Blank cells are allowed when a measurement does not apply. Filled cells without a column label are rejected instead of discarded. Units and ranges are plain text and are not converted or calculated.

Supported products are native simple, variable-parent, grouped, and external products. Variations do not store separate assignments or overrides. A guide assigned to a variable parent describes that parent; it does not switch measurement tables when a variation is selected.

The guide index examines 25 candidate IDs plus one lookahead ID per batch, up to 10,000 selectable batches. Native edit access is checked before title matching. Title filtering is literal and local to that candidate batch; there is no global matching count. Continue through Next when the current batch has no permitted matches. Product assignments use an exact typed product ID, not a search over other products' private fields.

The guide title, table, and note are intended for public display. Do not enter confidential measurements, credentials, customer data, or internal staff notes there. Guide records use a non-public, non-queryable custom post type without a REST collection or public archive. The supported public output exposes only a normalized enabled table through an eligible product; it is not a protected-document service.

== Permissions, saves, and data ==

Private management requires manage_woocommerce, edit_products, and the native edit_post permission for the selected guide or product. Publishing a guide also requires publish_products. Forms require a current nonce and the record version opened in the form. A short atomic ownership claim coordinates this plugin's own simultaneous saves. Direct database changes and unrelated administrative tools are outside that coordination.

Claims expire after two minutes. An expired coordination row is reclaimed by a later save, rather than by a background cleanup job. Disabling an assignment clears a reference to a guide that is no longer available for editing, so an unavailable guide does not prevent stopping output.

If a save reports an error, reopen and inspect the latest stored guide or assignment before retrying. A multi-field save can have partially completed before confirmation failed. No database transaction, complete version history, or undo system is claimed.

The plugin changes its own guide posts and metadata and its own product-assignment metadata. It does not change product descriptions, prices, stock, orders, payment, shipping, or email. Dedicated guide records and assignments are kept after deactivation/uninstall for recovery; a normal site backup/export can contain them. No automatic data purge or permanent-delete interface is included. Normal post authorship and modification fields are maintained by WordPress.

Internal product-assignment metadata is omitted from this plugin's WooCommerce REST response handling. REST changes by its key or known metadata ID are refused in favor of the dedicated form. The guide type does not expose a REST collection, and its metadata is not registered for REST display. Trusted plugins, administrative exports, and direct database access can still inspect stored records.

With optional installation reports off, no ads, remote assets, signup, external requests, telemetry, premium tier, or visitor-facing credit link are added. Public CSS is enqueued only when an eligible guide is rendered. Page caches may retain older public output; purge affected caches after edits, visibility changes, or product reassignment.

== Updating an existing installation ==

Download this plugin's individual ZIP from https://jeetsanwal.in/tools/jeet-product-size-guide . Make a site backup and try the update on staging first. In WordPress, use Plugins > Add New > Upload Plugin and choose Replace current with uploaded when the existing installation is detected. Keep the same plugin folder and do not uninstall/delete the plugin as an update step.

Confirm the version in Plugins, reopen a guide and product assignment, and check one representative public product. Clear relevant caches if public output remains stale. Updates are manual; Update URI prevents unrelated directory replacement but does not supply an automatic update service. If replacement fails, check hosting upload limits and file permissions. A saved previous ZIP restores plugin files only; use a site backup when database restoration is needed.

== Frequently Asked Questions ==

= Can I use one guide on several products? =
Yes. Assign the same guide ID to each supported parent product and explicitly enable each assignment. Guide edits affect the shared source; cached pages may need to be purged.

= Will a variation choose its own chart? =
No. Version 1.0.1 stores a parent-product assignment only. Size tables do not switch with variation selection.

= Does it convert inches to centimeters or recommend a fit? =
No. Enter the units and measurements you want to publish. The plugin displays your plain text without conversion, measurement, or fitting advice.

= Why is the tab missing in a block-based product template? =
The automatic output uses the classic woocommerce_product_tabs hook. A theme or Product Details block may not call it. Use a deliberate shortcode placement and verify the product is published, passwordless, enabled, and assigned to an enabled published guide.

= Does hiding the guide recall cached copies? =
No. Fresh plugin output checks current eligibility, but cached pages, screenshots, exports, and previously copied information remain outside that request. Use your normal cache and copy handling.

= Is everything free? =
Yes. All included features are free and ad-free under GPL-2.0-or-later. Custom development is a separate service, not an unlock needed for this plugin.

== 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.1 =
* Updated the product display name to Jeet Sanwal Product Size Guide 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.0 =
* Added reusable bounded plain-text size tables with independent guide publication and product-display switches.
* Added dedicated permission-aware guide and assignment forms, classic product tabs, and a shortcode fallback.
* Added semantic table output, protected record handling, and manual update documentation.

Support: Jeet Sanwal — https://jeetsanwal.in/plugin-support
