Linux 软件免费装
Banner图

Static JSON Export with CORS

开发者 aritrhk
更新时间 2026年8月2日 12:14
捐献地址: 去捐款
PHP版本: 7.4 及以上
WordPress版本: 7.0
版权: GPLv2 or later
版权网址: 版权信息

标签

cors rest api jamstack headless wordpress static json

下载

1.0.0 1.1.0 1.1.1

详情介绍:

Static JSON Export with CORS is a lightweight, secure WordPress plugin designed to export your published posts, pages, or custom post types into highly-optimized static JSON files. Feeds are generated automatically when content changes and served cleanly through a WordPress REST API endpoint (GET /wp-json/sjec/v1/feed?name=YOUR_FEED_NAME) with a customizable CORS origins whitelist. Key Features PRO Features Available Unlock even more capabilities:

安装:

  1. Upload the static-json-export-cors folder to the /wp-content/plugins/ directory, or upload the ZIP file directly via the WordPress admin area.
  2. Activate the plugin through the 'Plugins' menu in WordPress.
  3. Navigate to JSON Export CORS in the WordPress admin menu to configure your CORS origins and feed structures.

升级注意事项:

1.1.1 Adds review request notice for active users and bundled translations for Spanish, German, and French. 1.1.0 Features full Headless CMS support with static pagination chunks, detailed individual post JSON endpoints, and dynamic featured image sizes (PRO). 1.0.0 Initial stable release with full CORS support and REST API endpoint.

常见问题:

How are feeds served via REST API?

The plugin registers a custom WordPress REST API endpoint (GET /wp-json/sjec/v1/feed?name=YOUR_FEED_NAME) that serves the generated static JSON content with configured CORS headers attached.

Can I use it on local environments?

Yes. You can add local URLs (like http://localhost:3000) into the CORS Whitelist setting to debug integrations.

How do I fix CORS errors (Access-Control-Allow-Origin)?

If you see a browser error log like: Access to fetch at 'https://example.com/wp-json/sjec/v1/feed?name=default' from origin 'https://yourfrontend.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. You can resolve this by whitelisting your frontend domain:

  1. Go to the WordPress Admin dashboard and navigate to JSON Export CORS.
  2. Locate the CORS Settings section.
  3. Add your frontend origin (e.g., https://yourfrontend.com) to the CORS Whitelist text area.
  4. Save the settings. The plugin will automatically attach the Access-Control-Allow-Origin: https://yourfrontend.com header to all API requests coming from that domain.

更新日志:

1.1.1 1.1.0 1.0.0