=== ContentsOps – AI Humanizer & Content Writer ===
Contributors: voxinity
Tags: ai, content writer, humanizer, blog, seo
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.6
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Publish AI-written, human-sounding long-form blog posts from ContentsOps to this site, with inline images and SEO meta.

== Description ==

ContentsOps is an AI content platform that writes human-sounding, long-form articles. This companion plugin lets ContentsOps publish those posts (with inline and featured images and SEO meta) to this site over a private REST API authenticated with a site key.

It exposes three endpoints under `/wp-json/contaihu/v1/`:

* `GET /verify` — pairing probe returning the site identity.
* `POST /media` — upload one image binary, returns its attachment id + URL.
* `POST /posts` — create a post with inline/featured images and SEO meta.

All endpoints require `Authorization: Bearer <site key>`. The site key is verified with a hashed copy (`wp_check_password`), so the plaintext key is only ever shown on the Settings → ContentsOps screen.

SEO meta is written for Yoast SEO, Rank Math, and a native fallback so whatever is active picks it up.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` (or upload the zip via Plugins → Add New → Upload Plugin).
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Go to **Settings → ContentsOps**.
4. Copy the **Site URL** and **Site Key** and paste them into ContentsOps to pair the site.

== Frequently Asked Questions ==

= How do I rotate the site key? =
Go to Settings → ContentsOps → Regenerate key. The previous key stops working immediately; reconnect ContentsOps with the new key.

= Who is credited as the author of published posts? =
The user selected under "Author user". Defaults to the first user who can edit posts.

= Which category are posts published to? =
The category selected under "Default category" in Settings → ContentsOps. If none is selected, the WordPress default category is used. A category sent explicitly by ContentsOps takes precedence.

== Changelog ==

= 1.0.6 =
* Add a "Default category" setting: pick the category ContentsOps posts are filed under. An explicit category list in the publish request takes precedence; with nothing configured the WordPress default category applies as before.

= 1.0.5 =
* Rename all functions, classes, constants, options, script handles, post meta keys and the settings page slug to the unique `contaihu` prefix per the WordPress.org prefixing guidelines. Options stored under the old names are migrated automatically, so paired sites keep working.
* Move the REST API to the `contaihu/v1` namespace; the previous namespace keeps working as a deprecated alias for already-paired sites.
* Load `wp-admin/includes/image.php` only right before generating attachment metadata and stop loading `wp-admin/includes/file.php`, which was not needed.
* Update the Contributors list to the plugin owner account.

= 1.0.4 =
* Declare compatibility with WordPress 7.0 (Tested up to).
* Match the text domain to the wordpress.org plugin slug (contentsops-ai-humanizer-content-writer).
* Restore real PHP 7.4 compatibility by removing PHP 8-only union type declarations.
* Reject non-raster image uploads (e.g. SVG) on the media endpoint.
* Sanitize incoming Authorization header and admin query flags.
* Make the Reveal/Hide/Copied button labels translatable.

= 1.0.3 =
* Fix WordPress.org plugin review rejection: Author URI pointed to the same URL as Plugin URI. Author URI now points to https://www.voxinity.io/.

= 1.0.2 =
* Fix featured image not appearing in blog lists: detect the real image type from the binary and store it with the correct extension/MIME so the thumbnail renders and image sub-sizes are generated.
* Fall back to the first inline image as the featured image when no featured media id is supplied.

= 1.0.0 =
* Initial release: site-key auth, verify/media/posts endpoints, SEO meta (Yoast, Rank Math, native), Settings screen.
