{"id":50938524,"url":"https://github.com/uuki/yui-preview-token","last_synced_at":"2026-06-17T11:32:32.552Z","repository":{"id":362936571,"uuid":"1258806773","full_name":"uuki/yui-preview-token","owner":"uuki","description":"WordPress plugin for sharing draft previews in headless setups via time-limited tokens.","archived":false,"fork":false,"pushed_at":"2026-06-15T12:44:26.000Z","size":1519,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-15T14:22:08.926Z","etag":null,"topics":["plugin","preview","token","wordpress"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uuki.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-04T00:02:29.000Z","updated_at":"2026-06-15T12:44:30.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/uuki/yui-preview-token","commit_stats":null,"previous_names":["uuki/preview-token","uuki/draft-preview-token","uuki/yui-preview-token"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/uuki/yui-preview-token","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uuki%2Fyui-preview-token","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uuki%2Fyui-preview-token/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uuki%2Fyui-preview-token/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uuki%2Fyui-preview-token/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uuki","download_url":"https://codeload.github.com/uuki/yui-preview-token/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uuki%2Fyui-preview-token/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34447264,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["plugin","preview","token","wordpress"],"created_at":"2026-06-17T11:32:31.723Z","updated_at":"2026-06-17T11:32:32.547Z","avatar_url":"https://github.com/uuki.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YUI Preview Token\n\n\u003cimg src=\"assets/banner-1544x500.png\" width=\"100%\" alt=\"YUI Preview Token\"\u003e\n\nA WordPress plugin that issues time-limited preview tokens for headless setups. External frontends (Astro, Next.js, Nuxt, SvelteKit, etc.) can fetch draft content via the REST API without storing long-lived credentials.\n\n## How it works\n\n1. An editor generates a token from the Gutenberg sidebar, Quick Edit panel, or Classic Editor meta box.\n2. The plugin embeds the token in a preview URL pointing to the configured frontend.\n3. The frontend calls `/wp-json/yui-preview-token/v1/preview?token=…` to fetch the draft post.\n4. The token expires automatically.\n\nTokens are generated with `bin2hex(random_bytes(32))` (256-bit CSPRNG). The `wp_options` lookup key is the SHA-256 hash of the raw token — a database leak does not expose usable tokens.\n\n## Requirements\n\n- PHP 7.4+\n- WordPress 5.9+\n\n## Installation\n\nSearch for **\"YUI Preview Token\"** in **Plugins → Add New**, or install directly from the [WordPress.org plugin page](https://wordpress.org/plugins/yui-preview-token/).\n\nAlternatively, download the latest zip from [Releases](https://github.com/uuki/yui-preview-token/releases) and install via **Plugins → Add New → Upload Plugin**, or extract to `wp-content/plugins/yui-preview-token/`.\n\n## Repository structure\n\n```\n.\n├── .github/                    # CI/CD — GitHub Actions workflows\n├── .husky/                     # Git hooks (commitlint on commit-msg, PHPUnit on pre-commit)\n├── assets/                     # WP.org listing assets → synced to SVN assets/ (not installed)\n│   ├── banner-*.png\n│   ├── icon-*.png\n│   └── screenshot-*.png\n├── bin/\n│   ├── bump-version.sh             # Version string updater called by semantic-release\n│   ├── publish.sh                  # Builds and packages the distribution zip\n│   └── validate-svn-structure.sh   # Validates readme.txt/assets against WP.org SVN conventions\n├── docs/\n│   ├── readme-ja.txt           # Japanese readme (non-standard, not required by WP.org)\n│   ├── guide.*.md              # Developer guides (en/ja)\n│   └── playground.*.md         # Local dev environment guides (en/ja)\n├── playground/                 # Local dev environment — WP Playground + Playwright E2E\n│   ├── blueprint.json          # WP Playground setup (plugin activation, option fixtures)\n│   ├── e2e/                    # Playwright test specs\n│   └── index.html              # Vite preview frontend for manual token testing\n├── plugin/                     # WordPress plugin source → synced to SVN trunk/ on release\n│   ├── assets/js/              # Compiled IIFE bundles (gitignored — build artifact)\n│   ├── languages/              # i18n .po / .mo / .pot (ja, zh_CN)\n│   ├── src/\n│   │   ├── assets/js/          # TypeScript source files\n│   │   ├── WordPress/          # Core plugin PHP classes\n│   │   ├── Token/              # Token issuance and validation\n│   │   └── Support/            # Response pipeline and filters\n│   ├── tests/                  # PHPUnit unit tests\n│   ├── vendor/                 # Composer dependencies (gitignored)\n│   ├── yui-preview-token.php   # Plugin entry point and header\n│   ├── readme.txt              # WP.org plugin page (en) — part of trunk\n│   ├── composer.json\n│   ├── package.json            # JS build deps: tsdown, @wordpress/*\n│   └── tsdown.config.ts        # TypeScript → IIFE bundle config\n├── .releaserc.json             # semantic-release config (analyzes commits, bumps version)\n├── commitlint.config.js        # Conventional Commits rule set\n└── package.json                # Root tooling only: husky, commitlint, semantic-release\n```\n\n`assets/` (root) maps to SVN `assets/` — WP.org marketplace display only, never installed.\n`plugin/` maps to SVN `trunk/` — the actual plugin files delivered to users.\n\n## Development\n\n### Prerequisites\n\n- Node.js v24.10+, pnpm\n- PHP 7.4+, Composer\n\n### Setup\n\n```bash\ngit clone https://github.com/uuki/yui-preview-token.git\ncd yui-preview-token\npnpm install        # root tooling: husky, commitlint, semantic-release\n\ncd plugin\ncomposer install\npnpm install\ncd ..\n```\n\n### Build JavaScript bundles\n\n```bash\ncd plugin\npnpm run build\n```\n\nTypeScript sources are in `plugin/src/assets/js/`. Compiled bundles go to `plugin/assets/js/`.\n\n### Local development environment\n\n```bash\ncd playground\npnpm install\npnpm run dev\n```\n\nStarts WP Playground (`http://127.0.0.1:9400`) and a Vite preview frontend (`http://localhost:5173`) concurrently. See [docs/playground.en.md](docs/playground.en.md) for details.\n\n### Tests\n\n```bash\n# PHP unit tests\ncd plugin \u0026\u0026 composer test\n\n# End-to-end tests (requires dev servers running)\ncd playground \u0026\u0026 pnpm run test\n```\n\n### Production zip\n\n```bash\npnpm run publish:zip   # → dist/yui-preview-token.zip\n```\n\n## Documentation\n\n- [Developer guide](docs/guide.en.md)\n- [Playground setup](docs/playground.en.md)\n- [開発者ガイド（日本語）](docs/guide.ja.md)\n- [Playground（日本語）](docs/playground.ja.md)\n\n## About the name\n\n\"YUI\" comes from the Japanese word *yui* (結), meaning \"to connect\" or \"to bind together.\" It's used as a shared series name for this author's WordPress plugins.\n\n## License\n\nGPL-2.0-or-later — see the [WordPress.org plugin page](https://wordpress.org/plugins/yui-preview-token/) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuuki%2Fyui-preview-token","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuuki%2Fyui-preview-token","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuuki%2Fyui-preview-token/lists"}