Cobar Connector

Description

Cobar is where a marketing team prepares and approves articles. This plugin lets Cobar publish an approved article to your WordPress site.

Without the plugin, Cobar publishes through WordPress’s standard REST API. That takes 10 to 15 requests per article and has no place for an SEO title, meta description or structured data, and some hosts turn away that many requests in a row.

With the plugin, Cobar checks that the plugin is installed, then sends the whole article in one request. The plugin:

  • uploads the article’s images and sets the first one as the featured image,
  • creates the post, or finishes one an interrupted attempt started, and publishes it,
  • when Yoast SEO or Rank Math is active, writes the SEO title and meta description where that plugin reads them, and puts the article’s structured data in that plugin’s own JSON-LD in place of its own article entry.

With neither SEO plugin active the article still publishes, and Cobar is told which SEO values were not sent. Sending the same article again never makes a second post.

The plugin prints nothing on your pages by itself. It has no settings screen and no external dependencies.

Security

  • Authentication is WordPress’s own: an application password for a WordPress user (Users > Profile > Application Passwords).
  • Checking the plugin’s status needs a user who can write posts. Publishing needs a user who can publish posts, upload files when the article has images, and edit the post when Cobar is finishing one it started.
  • Every input is validated and size-limited: images must be real JPEG, PNG or WebP files of at most 10 MB, and the whole request at most 48 MB (or the server’s post_max_size, if smaller). Article HTML goes through wp_kses_post and SEO text through sanitize_text_field. A value the sanitizer would change is not written; structured data containing “<” is not written.
  • Error messages never repeat what was sent.

Privacy and external services

The plugin connects to no external service. It sends no data anywhere, loads nothing from other servers, and collects no analytics.

Cobar (https://cobar.ai) calls the plugin on your site, using the application password you create for it, to publish articles you approved in Cobar. Cobar’s terms and privacy policy cover that service: https://cobar.ai/terms and https://cobar.ai/privacy.

The plugin stores on your site only what a publish needs: the posts and images it creates, their SEO fields, and on each one a Cobar delivery id so a repeated publish finds the same post.

REST API reference

Namespace cobar/v1.

GET /wp-json/cobar/v1/status returns `plugin` ("cobar-connector"), `plugin_version`, `wordpress_version`, `seo_plugin` ("yoast", "rankmath" or "none"), `can_publish`, `can_upload`, `accepts` (the SEO values the active SEO plugin can take: any of "title", "description", "schema"), `max_body_bytes` and `max_image_bytes`.

POST /wp-json/cobar/v1/publish takes `delivery_id`, `title`, `content_html`, `slug`, `status` ("publish"), `categories` and `tags` (names; a missing term is created only if the user may create terms), `images` (`position` "hero" or "section_N", `alt_text`, `mime_type`, `data_base64`, `filename`) and `seo` (`title`, `description`, `schema`, each optional). It returns `post_id`, `link`, `status`, `media` (`position`, `id`, `url`), `seo` (`written`, `not_sent`) and `terms_skipped`.

Image placement: content_html is the final article HTML with each image written as src="cobar-image:N", where N is that image’s index in images. Each image must be placed exactly once. The plugin replaces each placeholder with the uploaded image’s address. The hero image becomes the featured image.

Idempotency: delivery_id is stored on the post (_cobar_delivery_id) and on each uploaded image (with _cobar_position). The same delivery_id again returns the post it already published and writes nothing. An attempt that stopped part way (a draft, some images uploaded) is completed, reusing what exists. While one attempt is running, a second with the same delivery_id is refused with cobar_in_progress (HTTP 409).

Refusals: cobar_invalid_request and cobar_too_large (400), rest_not_logged_in (401), cobar_forbidden (403), cobar_slug_taken, cobar_post_changed and cobar_in_progress (409), cobar_too_large (413, whole request), cobar_upload_failed and cobar_write_failed (500).

Installation

  1. In WordPress, go to Plugins > Add New Plugin and search for “Cobar Connector”.
  2. Select Install Now, then Activate.
  3. Create an application password for the WordPress user Cobar should publish as (Users > Profile > Application Passwords). The user needs to be able to publish posts and upload files, for example an Editor.
  4. In Cobar, connect the site with that user name and application password. Cobar finds the plugin on its own.

FAQ

Do I need Yoast SEO or Rank Math?

No. Articles publish either way. With one of them active, Cobar also sends the SEO title, meta description and structured data. With neither, Cobar lists those as not sent.

Rank Math is active but Cobar says it accepts nothing. Why?

Rank Math prints nothing on your pages until its setup wizard is finished (connect a Rank Math account, or skip that step). Finish the wizard, then publish again.

What happens if a publish is interrupted?

Each article carries Cobar’s delivery id. Sending it again completes the same post and reuses images already uploaded; it never creates a second post.

Does the plugin change my theme or other posts?

No. It writes only the posts Cobar publishes, their images and their SEO fields, and changes structured data only on those posts.

Can I remove it?

Yes. Deactivate and delete it like any plugin. Published articles stay as they are. Without the plugin, Cobar publishes through the standard REST API again.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“Cobar Connector” is open source software. The following people have contributed to this plugin.

Contributors

Translate “Cobar Connector” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

1.0.2

  • With Rank Math, Cobar’s structured data now prints true, false, numbers and empty values exactly as approved. Rank Math printed them as text (true as “1”, 1200 as “1200”), which search engines do not read as a yes/no or a number. Strings, Rank Math’s own values and Yoast SEO output are unchanged.

1.0.1

  • Cobar’s article structured data now replaces the SEO plugin’s own article entry instead of adding a second one. It keeps that entry’s identity and the details Cobar did not send. The same goes for an FAQ or how-to. Posts Cobar did not publish are unchanged.

1.0.0

  • First release: one-request publish, Yoast SEO and Rank Math fields, idempotent on the delivery id.