Linux 软件免费装
Banner图

Frontend View For Headless CMS

开发者 DropTheme
Dropndot
更新时间 2026年11月20日 18:20
PHP版本: 7.2 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

React next.js headless frontend headless CMS WordPress WordPress to Next.js

下载

2.0 2.1.1 3.0.0 1.1 2.1 1.0

详情介绍:

Frontend View For Headless CMS connects your WordPress backend to the decoupled frontend that actually renders it. When WordPress is your content source and the public site is built with Next.js, Nuxt, Astro, Gatsby, React, Vue, or any other stack, the admin "View" links, preview links, and author/taxonomy URLs normally still point at WordPress. This plugin rewrites them to the paths your frontend uses, so editors land on the real, published experience every time. Everything is configured from a single, redesigned Frontend View Settings page with a clean tabbed layout: General, Slug Mapping, Diagnostics, Secure Preview, Tools, and a built-in Next.js integration guide. No code is required for the core workflow — set your frontend URL and your links just work. What it does Works with any frontend that consumes WordPress through the REST API, GraphQL, or your own data layer — as long as your frontend URLs follow the paths you configure.

安装:

  1. From your WordPress dashboard, go to Plugins → Add New.
  2. Search for Frontend View For Headless CMS and press Enter.
  3. Click Install Now, then Activate.
  4. Go to Frontend View Settings in the admin menu (or Settings on this plugin's row on the Plugins screen).
  5. On the General tab, enter your frontend site URL (no trailing slash) and save.
Manual install:
  1. Upload the frontend-view-for-headless-cms folder to /wp-content/plugins/.
  2. Activate the plugin through the Plugins menu in WordPress.
  3. Open Frontend View Settings and enter your frontend site URL.

屏幕截图:

  • Slug Mapping — set the author slug and per-taxonomy / per-CPT path overrides, with nested paths and an "Empty slug" option.
  • Mapping Conflicts — advisory, non-blocking warnings that flag ambiguous or ineffective slug mappings with suggested fixes.
  • Connection Diagnostics — an SSRF-protected reachability test reporting status, response time, TLS verification, and redirects.
  • Secure Preview — rotate the signing secret (with a grace window) and revoke all active preview sessions.
  • Import / Export (Tools) — move your configuration between sites with a reviewed, confirmation-gated import and secret-free export.
  • Next.js Preview — built-in integration documentation with copy-ready App Router route handlers.

升级注意事项:

3.0.0 Adds opt-in Secure Authenticated Preview for headless Next.js frontends (short-lived signed token exchanged for an httpOnly preview session; no permanent secret in URLs) and a redesigned, tabbed settings page. Off by default and requires the Next.js integration. Existing features and public REST output are unchanged. 2.5.0 Adds SSRF-protected Connection Diagnostics to test reachability of your configured frontend URL. Only the saved URL is tested; private/reserved addresses are blocked and local URLs are skipped. Existing settings and behavior are unchanged. 2.4.0 Adds versioned settings import/export with an import preview and confirmation step. Secrets are never exported, and failed imports never change your existing settings. Existing settings and behavior are unchanged. 2.3.0 Adds advisory URL conflict detection for slug mappings on the settings page. Warnings are informational only — your existing settings and mapping behavior are unchanged, and saving is never blocked. 2.2.1 Redirect safety fixes. Prevents redirect loops, avoids redirect chains by respecting WordPress canonical URLs, stops redirecting 404s, and supports local development frontend URLs. Recommended if you use the optional frontend redirect. 2.2.0 Adds nested path support for slug mappings, local development URL support, preview query-string preservation, block editor link rewriting, and opt-in data removal on uninstall (off by default). Existing settings are preserved. 2.1.1 Loads plugin icons from the plugin package instead of a remote CDN so the plugin passes WordPress.org Plugin Check. 2.1 Optional frontend-to-headless HTTP redirects. Enable Redirect frontend requests to headless frontend in settings if you want public WordPress page visits redirected to your headless site. Existing behavior is unchanged while the option remains off. 2.0 Major update: redesigned settings, slug mapping, admin bar "Visit Site" support, preview paths, and improved link rewriting for headless frontends. Configure your frontend URL after upgrading.

常见问题:

Can I use this plugin with any front-end application?

Yes. It only rewrites admin links to URLs you configure. Your frontend can be built with Next.js, Nuxt, Gatsby, Astro, React, Vue, or any other stack.

How do I configure the plugin?

After activation, open Frontend View Settings. On the General tab, enter your frontend site URL. Optionally enable frontend redirects, a custom preview path, and secure authenticated preview. On the Slug Mapping tab, set the author slug and map taxonomy or CPT path segments to match your frontend routing.

Can WordPress frontend page requests redirect to my headless site?

Yes. Enable Redirect frontend requests to headless frontend on the General tab. Public page requests are redirected with a 301 to the matching URL on your frontend. Admin, REST API, GraphQL, feeds, sitemaps, previews, login, and similar backend endpoints are never redirected. The option is off by default.

Does this plugin work with custom post types?

Yes. Public custom post types shown in the admin UI appear under Post type / CPT slug overrides on the Slug Mapping tab, where you can set a custom segment or enable Empty slug to drop the CPT base from links.

Can I map content to a nested frontend path?

Yes. Slug fields accept nested paths such as news/technology or blog/category/updates. Each path segment is sanitized individually, so the / separators are preserved while the value stays slug-safe. Existing single-level mappings continue to work unchanged.

Can I use a local development frontend URL?

Yes. Local URLs such as http://localhost:3000 or http://127.0.0.1:3000 are accepted for link rewriting and redirects. The plugin only builds links and browser redirects to the URL; it does not make server-side requests to it.

What happens to my settings when I delete the plugin?

By default, your settings are preserved when the plugin is deleted, so removing and reinstalling keeps your configuration. If you want deletion to also remove the saved settings, enable Delete all plugin settings when the plugin is deleted on the General tab before deleting.

How does secure authenticated preview work?

Enable secure authenticated preview on the General tab. When an authorized editor previews unpublished content, the plugin verifies their capability in wp-admin and issues a short-lived (120-second), single-use, HMAC-signed token in the preview URL. Your Next.js frontend's /api/preview route exchanges that token (server-to-server) for an opaque preview session stored in an httpOnly cookie, then fetches the draft from a token-gated WordPress endpoint. Sessions use a 20-minute sliding and 30-minute absolute expiry and can be revoked. Previewable statuses are draft, pending, private, and scheduled; published content is served normally. No permanent secret ever appears in a URL, the signing secret can be rotated, and the public REST API is not changed. The feature is off by default and requires the matching Next.js integration (documented in full on the Next.js Preview tab).

How do I test the connection to my frontend?

On the Diagnostics tab, click Run Diagnostics. It makes a single request to your saved frontend URL and reports whether it is reachable, the HTTP status, the response time, and whether TLS/SSL verified. For security it only tests the configured URL (never an arbitrary one), verifies the certificate, blocks requests to private, loopback, link-local, reserved, or cloud-metadata addresses (IPv4 and IPv6), and validates each redirect hop. Local and private-network frontend URLs (for example http://localhost:3000) are skipped with a note rather than probed, and runs are rate-limited.

Can I move my settings to another site?

Yes. On the Tools tab, use Export Settings to download your configuration as a versioned JSON file, then use Preview Import on the other site to upload it. You will see a preview of exactly what would change and must click Confirm Import before anything is applied. If the file is invalid, from a newer plugin version, or contains no recognized settings, the import is rejected and your existing settings are preserved. Secret values are never included in an export and can never be set through an import.

What are the "Mapping Conflicts" warnings on the settings page?

When you configure slug mappings, the plugin analyzes them and shows advisory warnings for configurations that may not behave the way you expect. These warnings never change your settings and never block saving. Detected issues include:

  • Duplicate source segment (High): two content types map from the same first path segment, so only one destination takes effect.
  • Empty slug vs. slug override (High): a source has both "Empty slug" enabled and a slug override; the base segment is stripped first, so the override is ignored.
  • Shadowed nested mapping (High): a nested source such as news/technology is overridden by the mapping on its first segment (news), so its intended destination is never produced. Consistent nested mappings (for example news → articles together with news/technology → articles/technology) are not flagged.
  • Unreachable nested source (Low): a nested source whose first segment has no mapping can never match, because the engine rewrites only the first path segment.
  • Duplicate destination path (Medium): several sources point at the same frontend path, which is ambiguous when mapping back to WordPress.
  • Reserved WordPress route (Medium): a mapping uses a reserved segment such as wp-admin, wp-json, feed, or sitemap.
  • Invalid destination / Normalization notice (Medium/Low): a destination is empty after sanitization, or is stored in a non-normalized form (leading, trailing, or doubled slashes).
Each warning explains the issue and suggests a fix. Review and resolve them at your discretion.

What does "Empty slug" do?

When enabled for a taxonomy or post type, the plugin removes that base path segment from generated URLs. For example, /products/my-item/ can become /my-item/ on your frontend if your routes are flat.

Is this plugin compatible with multisite?

Yes, the plugin is compatible with multisite installations. Configure the frontend URL per site as needed.

Does the plugin support HTTPS?

Yes, both HTTP and HTTPS frontend URLs are supported.

更新日志:

3.0.0 2.5.0 2.4.0 2.3.0 2.2.1 2.2.0 2.1.1 2.1 2.0 1.1 1.0