# TechDex Client Post Preview

Preview saved unpublished WordPress content in a published-like front-end view, then share secure preview links with clients or teammates when outside review is needed.

## What it does

- Generates secure preview links from the editor sidebar for posts, pages, and supported custom post types
- Lets publishers, editors, and authors preview unpublished content as if it were live on the site
- Supports logged-out client and teammate review without requiring WordPress accounts
- Includes a tabbed plugin dashboard with Dashboard, Preview Links, Getting Started, Readme, License, Changelog, Support, and Agency Details sections
- Tracks preview slots by post while allowing multiple preview links per post by plan
- Stores preview tokens encrypted at rest and supports revocation, renewal, regeneration, never-expire, and auto-revoke workflows by tier
- Supports per-link expiration control, labels, passcodes, access logs, and view tracking on paid tiers
- Includes in-plugin licensing with TechDex activation, refresh, and site deactivation controls
- Sends `noindex` and `nocache` headers for preview requests

## Install

1. Upload the `techdex-client-post-preview` folder or install `techdex-client-post-preview.zip`.
2. Activate the plugin in WordPress.
3. Edit any post, page, or supported custom post type.
4. Use the `Client Preview Link` box in the editor sidebar to generate a link.
5. Review, open, revoke, or manage any generated link under `TechDex Client Post Preview > Preview Links`.
6. Activate a paid license from the `License` tab to unlock Pro or Agency features.
7. Adjust the default expiration and log retention from the `Dashboard` tab.
8. Use the `Support` tab to send a support request from the WordPress back end.

## Test flow

1. Create or open a draft post, page, or supported custom post type entry.
2. Save the draft.
3. Generate a preview link.
4. Open the link in a private browser window while logged out.
5. Update the draft, save again, and refresh the preview page to confirm the latest saved version appears.
6. On paid tiers, manage expiration, labels, passcodes, and workflows from the `Preview Links` dashboard.

## How it works

The plugin stores preview-link metadata in post meta with tokens encrypted at rest, validates incoming requests, and then exposes the matching unpublished post, page, or supported custom post type item to the main WordPress query in a published-like front-end view. Paid tiers add licensing-aware feature unlocks, multiple links per post, and richer link management from the plugin dashboard.

## Editor status flow

- Green status during the first 4 days
- Orange status during days 5 and 6
- Red status on the last day or after expiration
- The status card links back to the plugin admin area for that post

## Plugin dashboard tabs

- Dashboard: product summary, plan comparison, default expiration, and log-retention controls
- Preview Links: active links, expiration status, per-link management, and post management
- Getting Started: usage and workflow instructions
- Readme: plugin reference documentation
- License: TechDex license save, activation, refresh, and deactivation controls
- Changelog: in-plugin release summary
- Support: back-end support request form
- Details: Agency-only totals and per-link summary dashboard

## Current limitations

- The preview reflects the latest saved content, not unsaved editor changes
- Free allows 1 preview link per post, Pro allows 2, and Agency allows 3
- The free version supports up to 3 preview-enabled posts, while Pro supports 12 and Agency is unlimited
- Access logs and Agency details reporting are not available on the Free plan
- Published posts pause preview-link availability until they return to an unpublished status, but their saved preview links still occupy a slot until revoked
- The preview reflects the latest saved content, not unsaved editor changes
