=== AIM Blog Publisher ===
Contributors: hekmalabs
Tags: aim, blog, publishing, webhook
Requires at least: 5.9
Tested up to: 6.6
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Receives articles from AIM and saves them as posts on your site.

== Description ==

AIM writes articles for your blog. This plugin gives your WordPress site an address that AIM sends each finished article to, checks that the request really comes from your AIM workspace, and saves the article as a post.

* Each article becomes a draft, a pending post, or a published post. You choose.
* The title, text, excerpt, search title and description, category, and cover image are filled in.
* If Yoast SEO or Rank Math is active, their title, description, and focus keyword fields are filled in too.
* An article that is sent twice updates the same post. It is never published twice.

== Installation ==

1. In WordPress, go to Plugins, Add New, Upload Plugin, and upload the zip file. Activate it.
2. Go to Settings, AIM Blog Publisher. Copy the address shown there.
3. In AIM, open Integrations, then Website blog. Paste the address as the webhook address.
4. In AIM, generate a key, and create a signing secret. Copy both before you save: AIM shows them once.
5. Back in WordPress, paste the key and the signing secret, choose how articles are saved, and save.
6. In AIM, select "Save and send a test". The test is accepted and no post is created.

== How requests are checked ==

* Your site must use HTTPS.
* Every request must carry your key. Until a key is saved, every request is refused.
* When a signing secret is saved, every request must also be signed with it and be less than five minutes old.
* An address that is refused many times in a row has to wait before it can try again.
* The key and the secret are never shown again after you save them, and are removed when you delete the plugin.
* Article text is cleaned with WordPress's own rules for post content before it is saved.

== Frequently Asked Questions ==

= AIM says my site refused the key =

The key in WordPress and the key in AIM are different. Generate a new key in AIM, copy it, and paste it under Settings, AIM Blog Publisher.

= AIM says there is no page at the address =

Open Settings, Permalinks in WordPress and select Save, then copy the address from the plugin's settings page again.

= Can I edit a post after it arrives? =

Yes. If AIM sends the same article again, its text is replaced with the new version, and its status, address, and author are left as you set them.

== Changelog ==

= 1.0.0 =
* First version.
