=== Jeet 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.1
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 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.
* No adverts, 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.

== 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.

== Changelog ==

= 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.
