=== Jeet Sanwal PDF Version Desk ===
Contributors: jeetsanwal
Tags: pdf, document versions, downloads, stable links, documents
Requires at least: 6.5
Requires PHP: 7.4
Stable tag: 1.0.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Keep one stable public link for a prospectus, menu or policy PDF. Add versions, restore an earlier edition and show optional version history.

== Description ==

A restaurant menu, school prospectus or public policy often changes while its link is already printed in notices and QR codes. Jeet Sanwal PDF Version Desk gives each document record a permanent link that redirects to the currently selected PDF. Add a new edition or restore an earlier one without replacing or deleting the source files.

* Tools → PDF Version Desk: searchable, paginated document list and a simple editor.
* Select public PDF attachments from the standard WordPress Media Library.
* Name and date each version; add an optional private admin note.
* New versions become current. Choose an existing version and save to restore it.
* Stable ID-suffixed slugs stay unchanged when the title or current version changes.
* Draft records return 404 at their stable link. Only deliberately published records can redirect.
* Shortcode displays the current document title, version, date and download link.
* Public history requires both the record's explicit permission and history="yes" in the shortcode.
* Up to 50 versions per record; 20 records per administration page.
* Stale forms and simultaneous saves are rejected instead of silently overwriting version data.
* With optional installation reports off, no ads, paid tier, signup, telemetry, external services, update polling or frontend credit.

**Public PDFs only:** WordPress Media Library uploads have public URLs. This is document version management, not access control, protected downloads or a file manager. Drafting a record disables its stable link but cannot make uploaded files private. Old version URLs may remain accessible even when public history is disabled. The plugin never overwrites or deletes source PDFs.

Only registered application/pdf attachments with HTTP(S) URLs are accepted. Attachments must be public or inherited, without a password. They must be unattached or attached to a published, publicly viewable, unpassworded parent. A site's configured media CDN is supported; arbitrary download URLs cannot be entered. Moving or deleting a PDF in another tool can make that version unavailable.

Records are private internal post types with no public archives or REST metadata registration. Only administrators with manage_options can manage records. Notes never appear in the plugin's public shortcode or redirect. Database backups can contain notes; do not use notes for passwords or secrets.

Document lists use fixed batches of 20 candidates. Title search applies only to editable records in the current batch. Try another batch to find older documents. Adding a PDF requires permission to edit that attachment.

== Installation ==

1. Upload the jeet-pdf-version-desk folder, or install the ZIP through Plugins → Add New → Upload Plugin.
2. Activate the plugin and open Tools → PDF Version Desk.
3. Enter a document title. Choose a PDF, version label and version date. Select Published and save when the document is ready for public use.
4. Copy the permanent link for notices, navigation links or QR codes. Permalink flushing is not required.
5. Put the displayed [jeet_pdf_document id="123" history="yes"] shortcode in a Shortcode block, replacing 123 with the record's ID.
6. To publish a new edition, edit the same record and choose another PDF. To restore a previous edition, select it under Current version and save with no new PDF selected.

== Frequently Asked Questions ==

= Does it replace a PDF at its original upload URL? =

No. Share the stable document link, not a particular PDF's upload URL. The stable link issues an uncached 302 redirect to the current attachment URL. Existing PDFs remain untouched.

= Can I change the title without breaking printed links? =

Yes. The slug is assigned once when the record is created and includes the WordPress record ID for uniqueness. Title and version changes keep that slug. Changing your site domain or WordPress home URL still changes the absolute link.

= Are private notes or draft records public? =

The plugin never displays private notes publicly and rejects draft, private, trashed and password-protected records at both its route and shortcode. PDF upload URLs themselves are public. This plugin does not protect those files.

= How does public version history work? =

Enable the record's public-history checkbox and use history="yes" in the shortcode. Only PDF link labels and dates are displayed. Private notes are never included. Disabled public history does not revoke already known PDF upload URLs.

= What happens when a PDF is deleted or made unavailable? =

Its history entry remains for administration. Missing historical PDFs are omitted from public history. An unavailable current PDF makes the stable link return 404 and the shortcode output nothing; choose another available version in the editor.

= What happens at 50 versions? =

New versions are rejected, while restoring an existing version still works. Create a new record for a new document series. Versions are not silently removed.

= Does it automatically update itself? =

No. This independently distributed plugin declares its own Update URI and does not contact an update server. Back up your site and install a new ZIP from jeetsanwal.in when available.

= What happens on deactivation or deletion? =

Records, version data and PDFs are retained. Stable links stop resolving through this plugin until it is active again. Reinstalling restores the saved records. It does not delete uploads or record data during uninstall.

== Updating an existing installation ==

Download this plugin's individual ZIP from https://jeetsanwal.in/tools/jeet-pdf-version-desk . 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

== 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 PDF Version Desk 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 =
* Added a complete US English installation and update guide; kept documented permissions, limits and manual rollback steps.


= 1.0.3 =
* 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.2 =
* Recheck attachment editing permission before registering a new version; refresh stored state after claiming the save lock.
* Limit document title search to permitted records in bounded candidate batches; hide inaccessible record metadata.

= 1.0.1 =
* Make simultaneous save-lock claims atomic and preserve replacement owners during expired-lock cleanup and release.

= 1.0.0 =
* Initial release: stable public document links, bounded PDF versions, explicit restore and optional public history.

== Privacy ==

No analytics, cookies, external requests, signup or telemetry are added by this plugin. It stores document records, attachment IDs, version labels/dates and optional admin notes in the site's WordPress database. Normal WordPress Media Library behavior and any configured media CDN still apply.
