| 开发者 |
goonydev
philooo |
|---|---|
| 更新时间 | 2026年9月18日 12:25 |
| PHP版本: | 8.1 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
git push./wp-json/sqheadless/v1/ (site config, homepage, archive, single, SEO head, sitemap) collapse WordPress's _embed N+1 fan-out into a handful of SQL queries, for much faster SSR on media-heavy archives. The frontend uses them automatically and falls back to standard WordPress REST when they are absent.<head> and structured data; breadcrumb schema is filled in when your SEO plugin does not emit it. No SEO plugin required.staticq-headless folder to /wp-content/plugins/, or install the plugin ZIP from Plugins → Add New → Upload Plugin.wp-config.php (above the "That's all, stop editing!" line) instead of storing them in the database. When a constant is defined it takes precedence and the matching field renders read-only.
define( 'SQHEADLESS_CF_API_TOKEN', '...' );
define( 'SQHEADLESS_CF_ACCOUNT_ID', '...' );
define( 'SQHEADLESS_CF_ZONE_ID', '...' );
define( 'SQHEADLESS_PER_URL_SECRET', '...' );
For the managed Astro deploy, a GitHub token constant is used:
define( 'SQHEADLESS_AA_GITHUB_TOKEN', 'ghp_...' );
Additional optional constants (receiver-only tokens, site-gate cookies, per-install worker/bucket suffix) are documented in the plugin's docs.
Requirements
repo and workflow scopes, for deploying and updating the Astro frontend.proc_open, or git binary is required.No. It deploys to your Cloudflare account and your GitHub repository. You own the infrastructure and the code.
No. The plugin only contacts your own Cloudflare and GitHub accounts (endpoints you configure) and the receiver URL you set. There is no telemetry and no author-operated service. See External services.
No. It is a starting point: you can replace its pages and components with your own Astro design and deploy through the same pipeline, as long as your project keeps the plugin's caching contract (the edge/R2 middleware, cache-key module, and WordPress data client the starter ships with). The built-in Tutorials cover this.
Yes, for the headless setup this plugin is built for. The fast edge + R2 delivery comes from the Cloudflare Worker and the Astro frontend, and the frontend is deployed and kept in sync through GitHub. (Internally the invalidation engine simply POSTs the changed URLs to a receiver URL, but the supported, complete experience is the Cloudflare + Astro pipeline.)
No. That is the point: the plugin computes the specific URLs a change affects and refreshes only those, so publishing costs the same whether the site has fifty pages or fifty thousand.
No. Repository creation and the starter push happen over the GitHub API. Nothing is executed on your server.
Rank Math and Yoast are detected automatically and their <head> and schema are used by the frontend. Neither is required; the plugin fills in breadcrumb structured data when the SEO plugin does not.
Use the sqheadless/object_urls, sqheadless/affected_objects, and sqheadless/static_archive_urls filters (and the sqheadless/content_change action to observe events). The Refresh Simulator on the Cache tab dry-runs your hooks and shows the exact URL list. A full reference ships with the plugin.
/wp-json/sqheadless/v1/ for fast Astro SSR, with graceful fallback to standard WP REST.content and excerpt come back empty with protected set, matching WordPress core's own REST behaviour.sqheadless/content_change, sqheadless/object_urls, sqheadless/affected_objects, sqheadless/static_archive_urls, sqheadless/impact_urls).