GymGrow Connect

外掛說明

GymGrow Connect adds a small set of secure REST API endpoints under the gymgrow/v1 namespace so an external system (for example, an AI content pipeline) can:

  • Create or update a post — title, content, excerpt, slug, categories, tags, schedule date — in a single request.
  • Set RankMath SEO fields (SEO title, meta description, focus keyword, canonical URL, robots) on the same request or on an existing post.
  • Upload an image from a multipart file or a remote URL, set its alt text, and optionally assign it as the featured image.

It replaces ad-hoc functions.php snippets with a versioned, capability-checked plugin.

Endpoints

  • POST /wp-json/gymgrow/v1/article — publish/update an article (also sets SEO and featured image).
  • POST /wp-json/gymgrow/v1/media — upload an image.
  • POST /wp-json/gymgrow/v1/seo/{id} — update RankMath SEO fields for a post.

A backward-compatible alias POST /wp-json/custom/v1/rankmath/{id} is also registered for pipelines that used the legacy route.

Authentication

Requests are authenticated with WordPress’s own user authentication — use an Application Password (Basic Auth) for a user who can publish posts. Permissions are enforced per route with capability checks (publish_posts, upload_files, edit_post). You may optionally enable a second-factor shared secret (X-GymGrow-Key header) from the settings screen.

This plugin does not call any external services and stores no personal data.

安裝方式

  1. Upload the gymgrow-connect folder to /wp-content/plugins/, or install the ZIP via Plugins Add New Upload Plugin.
  2. Activate the plugin through the Plugins screen.
  3. (Optional) Visit Settings GymGrow Connect to generate an API key, choose a default category, and set a default status.
  4. Create an Application Password for the publishing user under Users Profile, and use it as Basic Auth in your pipeline.

常見問題集

Does it require RankMath?

No. If RankMath is active the SEO fields take effect immediately. If not, the meta is still stored under the RankMath meta keys and becomes live once RankMath is installed.

How are the endpoints secured?

Every route has a capability-based permission_callback. Publishing requires publish_posts, uploads require upload_files, and SEO updates require edit_post on the target post. You can additionally require a matching X-GymGrow-Key header.

Does it send data anywhere?

No. The plugin only receives requests; it does not phone home or contact third-party services.

使用者評論

這個外掛目前沒有任何使用者評論。

參與者及開發者

以下人員參與了開源軟體〈GymGrow Connect〉的開發相關工作。

參與者

將〈GymGrow Connect〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

1.0.3

  • Security: omitting the status parameter now creates or updates a draft instead of publishing. Publishing requires explicitly passing status=publish, which remains gated by the publish_posts capability.

1.0.2

  • Security: editing an existing post that is already published, private, or scheduled (future) now requires the publish_posts capability even when the request does not change the status.

1.0.1

  • Security: the article endpoint now requires the publish_posts capability when an update changes a post to a published, private, or scheduled (future) status, not just edit_post.

1.0.0

  • Initial release: article publish endpoint, media upload endpoint, RankMath SEO endpoint, optional API key, settings screen.