πŸ”₯ Black Friday Sale: Get 65% OFF Any PageForge Pro Plan! Use code BF65 Claim Offer β†’
Account Get it free
YUI Preview Token icon
Maintained Tested up to 7.0.9 #43 in draft

YUI Preview Token

Issue time-limited preview tokens for headless WordPress setups. Open drafts directly in your frontend URL without long-lived credentials.

Active installs<10New
Downloads Β· 30d72β–² +18% vs prev. 30d
Ratingβ€”0 reviews
Health score49/100Fair
All-time downloads317Since Jun 2026
Support resolvedβ€”No recent threads
RequiresWP 5.9PHP 7.4+
Downloads Β· 7d17β–Ό -26.1% week over week
Our verdict

Use with caution

YUI Preview Token works, but test it on a staging site before relying on it in 2026. Was last updated 6 months ago, and scores 49/100 on our health check.

  • Small user base (<10 active installs)
  • Very few reviews so far

How does it stack up?

Side-by-side on installs, updates, ratings & support

Daily downloads

246Sep 4Oct 18Dec 2
Yesterday6
Daily average (1y)2
Peak day31Jun 15, 2026
Last 12 months322

Download spikes usually follow a new release β€” each site that auto-updates counts as a download.

Rankings

Where YUI Preview Token stands today

WordPress.org search rankings

Live position in the plugin search, top 100
KeywordPositionCompeting pluginsCategory
draft >100 5,305 Best draft plugins β†’
headless >100 610 Best headless plugins β†’
preview >100 10,000 Best preview plugins β†’
rest-api >100 10,000 Best rest-api plugins β†’
token >100 9,692 Best token plugins β†’

About YUI Preview Token

From the official readme Β· v1.1.2

Description

YUI Preview Token solves the authentication problem in decoupled (headless) WordPress architectures. Application Passwords are a great built-in WordPress feature for this purpose, but they require managing long-lived secrets on the frontend side. This plugin instead issues per-post tokens that grant read access for a configurable period β€” no persistent secrets required.

The frontend (Astro, Next.js, Nuxt, etc.) receives a preview URL and can fetch the draft content directly via the REST API.

How it works

  1. An authorized WordPress user generates a token from the Gutenberg sidebar, Quick Edit panel, or Classic Editor meta box.
  2. The token is embedded in a preview URL pointing to your external frontend.
  3. The frontend calls /wp-json/yui-preview-token/v1/preview?token=… to retrieve the draft content.
  4. The token expires automatically; no manual cleanup needed.

Key Features

Token Management

  • Generate tokens with expiry presets: 1 hour, 24 hours, 30 days, custom date/time, or no expiry.
  • One token per post β€” issuing a new token invalidates the previous one.
  • Tokens are generated with bin2hex(random_bytes(32)) (256-bit CSPRNG). The lookup key stored in wp_options is the SHA-256 hash of the raw token, not the token itself β€” so a database leak does not expose usable tokens directly.
  • Automatic cleanup of expired tokens via WP Cron (daily).

Editor Integration

  • Gutenberg: dedicated panel in the Document Settings sidebar.
  • Quick Edit: token controls directly in the post list.
  • Classic Editor: meta box in the editor sidebar.
  • Copy preview URL to clipboard with one click.
  • Update expiry without invalidating the current token.

Admin Settings

  • Set the external frontend URL (clicking “Open external preview” navigates directly to this URL).
  • Configure allowed CORS origins (multiple, with wildcard support β€” https://*.example.com).
  • Choose the minimum WordPress role required to issue tokens (Subscriber β†’ Administrator).
  • Tune rate limiting (requests per time window).
  • Optionally permit no-expiry tokens.

Issued Tokens List

  • View all active and expired tokens with post title, status, expiry, and issuer.
  • Revoke individual tokens or bulk-delete expired ones β€” all from the Settings screen.

Security

  • HTTPS required for the preview endpoint (overridable for local development).
  • Per-IP rate limiting with configurable thresholds (default: 30 req / 60 s).
  • Role-based access control for token issuance.
  • CORS headers only sent for explicitly configured origins; WP core’s permissive echo-back is suppressed.
  • Referrer-Policy: no-referrer prevents token leakage via referer headers.
  • Tokens are only valid for draft, pending, and future post statuses.
  • Admin-only settings page with defence-in-depth capability checks.
  • CSRF protection on all admin actions (nonce verification).

Audit Logging

  • Logs token issuance and usage events (post ID, user ID, client IP).
  • Logs security events: invalid token attempts, rate-limit violations, capability denials.
  • Output goes to WP_DEBUG_LOG by default; point to a dedicated file with PVT_LOG_FILE.

Internationalisation

  • Ships with Japanese (ja) and Simplified Chinese (zh_CN) translations.
  • All admin UI strings are translation-ready.

Developer Hooks

Filter

  • yuipt_preview_response_data β€” Modify the REST API response data before it is sent.

Actions

  • yuipt_token_issued( int $post_id, int $user_id ) β€” Fires after a token is issued.
  • yuipt_token_used( int $post_id, int $user_id ) β€” Fires when a token is used successfully.
  • yuipt_invalid_token( string $ip ) β€” Fires on an invalid/expired token attempt.
  • yuipt_rate_limit_exceeded( string $ip, string $endpoint ) β€” Fires when rate limit is hit.
  • yuipt_capability_denied( int $user_id, int $post_id ) β€” Fires on a capability denial.

Constants (wp-config.php)

  • PVT_SKIP_HTTPS_CHECK β€” Set to true to disable the HTTPS requirement (development only).
  • PVT_LOG_FILE β€” Absolute path to a dedicated audit log file.

Use Case

This plugin is designed for headless WordPress setups where a decoupled frontend (e.g. Astro, Next.js, Nuxt, SvelteKit) renders content from the WordPress REST API. It gives content editors a simple, secure way to share draft previews with stakeholders without granting them WordPress accounts or exposing long-lived API credentials.

Installation

  1. Upload the yui-preview-token folder to /wp-content/plugins/.
  2. Activate the plugin through the Plugins menu in WordPress.
  3. Go to Settings β†’ YUI Preview Token and set your External Preview URL (the base URL of your frontend).
  4. Add the allowed CORS origin(s) for your frontend domain.
  5. Generate tokens from the Gutenberg sidebar, Quick Edit panel, or Classic Editor meta box.

JavaScript Source Code

The files in assets/js/ are compiled and minified bundles. Per WordPress.org guidelines, the human-readable TypeScript source files are available at:

https://github.com/uuki/yui-preview-token/tree/main/plugin/src/assets/js

Build from Source

To rebuild the JavaScript bundles from the TypeScript sources:

  1. Clone the repository: git clone https://github.com/uuki/yui-preview-token.git
  2. Install Node.js dependencies: cd plugin && pnpm install
  3. Compile: pnpm run build

The build configuration is defined in plugin/tsdown.config.ts. Each bundle in assets/js/ corresponds to one entry point in plugin/src/assets/js/.

Minimum Requirements

  • WordPress 5.9 or later
  • PHP 7.4 or later
  • A decoupled frontend that can consume the WordPress REST API

Changelog

1.0.4

  • Added “Allow External Token Issuance” setting (disabled by default). When enabled, authenticated users with the required role can issue tokens via the REST API from outside the WordPress admin β€” designed for CI/CD pipelines and automated workflows.

1.0.3

  • Gutenberg: automatically saves the draft before opening the external preview so the frontend always receives the latest content. Classic Editor: added a note prompting users to save before previewing, since unsaved changes are not reflected in the external frontend.

1.0.1

  • Preview URL now includes p=<post_id>&pt=<post_type>&preview=true alongside token= so the frontend can identify the target post and content type directly from the URL.

1.0.0

  • Initial release.

Full changelog on WordPress.org β†’

Screenshots

Gutenberg sidebar β€” Token generation panel before a token is issued. Select an expiry and click "Generate token".
Gutenberg sidebar β€” Token generation panel before a token is issued. Select an expiry and…
Gutenberg sidebar β€” Active token: expiry info, open preview in the designated frontend URL, and copy-to-clipboard.
Gutenberg sidebar β€” Active token: expiry info, open preview in the designated frontend…
Classic Editor β€” Token panel in the meta box sidebar, before a token is issued.
Classic Editor β€” Token panel in the meta box sidebar, before a token is issued.
Classic Editor β€” Active token with "Open external preview" button and change-expiry / delete actions.
Classic Editor β€” Active token with "Open external preview" button and change-expiry /…
Settings page β€” Configure the frontend URL, CORS origins, minimum role, and rate limits.
Settings page β€” Configure the frontend URL, CORS origins, minimum role, and rate limits.
Issued Tokens tab β€” Review all issued tokens with post, status, expiry, and issuer. Revoke or bulk-delete expired ones.
Issued Tokens tab β€” Review all issued tokens with post, status, expiry, and issuer…
Quick Edit panel β€” Token management directly from the post list screen, without opening the editor.
Quick Edit panel β€” Token management directly from the post list screen, without opening…

For developers

Is this your plugin? Show off the numbers.

Add a live badge to your site, docs or GitHub README. It updates on its own β€” no account needed.

Active installs badge Rating badge Health score badge

Best YUI Preview Token alternatives

All draft plugins β†’
Alternatives
Rank Plugin Active installs Rating Updated Health
1 Share a Draft Share a Draft Create a secure, time-limited link to a draft, so a reviewer without a WordPress account… by Automattic 3K+ β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜… 3.7 (11) 1 month ago 74
2 AMS Post And Page Duplicator AMS Post And Page Duplicator For creating copy of posts and pages. by Manoj 500+ β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜… No reviews 5 years ago 27
3 Publish View Publish View Adds a button so you can save Publish or save Draft and view in one step. by launchinteractive 500+ β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜… 5 (3) 10 years ago 34
4 Quick Drafts Access Quick Drafts Access Adds links to 'All Drafts' and 'My Drafts' under Posts, Pages, and other custom post type… by Scott Reilly 400+ β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜… 5 (7) 2 years ago 48
5 Public Preview URL Manager Public Preview URL Manager Secure, time-sensitive public preview links for drafts/scheduled posts. Fully compatible… by Sudip Debnath 300+ β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜… 5 (1) 3 months ago 61
6 Bulk Post Status Update Bulk Post Status Update Automatically change the status of WordPress posts and custom post types to Draft or… by Chetan Vaghela 200+ β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜… No reviews 5 months ago 54
7 Simple Preview Simple Preview Let anonymous users preview a post before it is published! by Nagmay 200+ β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜… 5 (1) 8 years ago 33
8 Draft Notifier Draft Notifier Draft Notifier sends a notification email to your blog's admin address when a post written… by Michael Adams (mdawaffe) 100+ β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜… 5 (1) 17 years ago 32
9 Postora Export for DOCX Postora Export for DOCX Download WordPress posts and drafts as properly formatted Microsoft Word DOCX files. by abdulrehmanseo 100+ β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜… 5 (1) 4 days ago 70
10 Wp-autosave Wp-autosave "Wp-autosave" plugin is for automatically saving posts being written in the Classic Editor by wpautosave 100+ β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜… 3.7 (3) 7 years ago 28

FAQ

YUI Preview Token: quick answers

Straight answers, pulled from live WordPress.org data.

Source: WordPress.org

Is YUI Preview Token free?

Yes. YUI Preview Token is free to download and use from the official WordPress.org plugin directory.

Is YUI Preview Token safe to use in 2026?

YUI Preview Token works, but test it on a staging site before relying on it in 2026. Was last updated 6 months ago, and scores 49/100 on our health check.

How many websites use YUI Preview Token?

YUI Preview Token is active on <10 WordPress websites and has been downloaded 317 times since it launched in June 2026. It was downloaded 72 times in the last 30 days.

Does YUI Preview Token work with WordPress 7.1?

YUI Preview Token is officially tested up to WordPress 7.0.9, while the latest release is 7.1.5. It may still work, but try it on a staging site first.

What PHP version does YUI Preview Token need?

YUI Preview Token requires PHP 7.4 or higher. Most hosts run PHP 8.x today, so it works on any modern WordPress hosting.

When was YUI Preview Token last updated?

The latest version, 1.1.2, was released on June 15, 2026 (6 months ago).

Who makes YUI Preview Token?

YUI Preview Token is developed and maintained by uukidev.

What are the best alternatives to YUI Preview Token?

The most popular alternatives to YUI Preview Token are Share a Draft (3K+ installs), AMS Post And Page Duplicator (500+ installs) and Publish View (500+ installs).

Powered by PageForge

One template and a spreadsheet. A real page for every search.

PageForge turns each row of a CSV into a WordPress page with its own title, URL, SEO fields and schema, built on the layout you already designed. Free on WordPress.org.

  • CSV and XLSX, plus Google Sheets on Professional and Enterprise
  • Its own title, URL, SEO fields and schema for every page
  • Works with the block editor, Elementor, Divi and Avada
  • Free on WordPress.org, no credit card

↑↓ to move↡ to open