=== Aranx Connector: AI Blog Writer & SEO Autoblogging ===
Contributors: aranx
Tags: ai writer, autoblog, ai content, blog automation, ai visibility
Requires at least: 5.0
Tested up to: 7.1
Stable tag: 1.8.2
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI blog writer for WordPress. Aranx finds keywords, writes SEO articles with images, publishes them, and tracks visits from ChatGPT and AI search.

== Description ==

Aranx is an AI-native SEO and GEO agency. In WordPress, it works as your AI blog writer: it finds the keywords your customers search for, writes SEO articles with images, and publishes them to your site on the schedule you set.

This plugin connects your site to Aranx. Articles arrive as normal WordPress posts, in the category and under the author you pick. You can edit them in WordPress like any other post. Aranx does not overwrite a post that you changed.

The plugin also counts the pages that ChatGPT, Claude, and Perplexity read, and the visitors that AI apps send to your site.

= What it does =

* **Keyword research to publishing in one step** - Aranx researches, writes, and publishes. Articles appear as WordPress posts automatically
* **Two-way sync** - Post status changes in WordPress are reflected in Aranx
* **SEO meta tags** - Outputs the title and meta description when no SEO plugin is active
* **Built-in image creation** - Each article includes AI-generated images, uploaded to your media library
* **AI bot visits** - Counts the pages that ChatGPT, Claude, and Perplexity bots read, for Aranx AI Visibility
* **Visitors from AI apps** - Counts the people who open your site from a link in ChatGPT, Perplexity, Gemini, Claude, or Copilot, for Aranx AI Visibility. Pages that a page cache or a CDN serves count too
* **IndexNow** - Aranx tells Bing and other IndexNow search engines when an article is published, changed, or removed
* **Connection monitoring** - Automatic health checks and reconnection if anything drops
* **Activity logging** - See exactly what's been synced and when

= How it works =

1. Install and activate the plugin
2. Click "Connect to Aranx" and approve the secure connection
3. Content created in Aranx publishes to your site automatically

== External services ==

This plugin connects your site to [Aranx](https://aranx.com), an SEO content service run by Aranx. **An Aranx account is required.** Aranx writes articles and publishes them to your site through this plugin.

**No data is sent until you connect your site.** The plugin makes no external requests before you click "Connect to Aranx" on its settings page.

When you click "Connect to Aranx", your browser opens app.aranx.com with these details so Aranx can set up your site:

* Site URL, site name, and the site admin email address
* WordPress version, plugin version, site language, timezone, and permalink structure

After you approve the connection, the plugin sends these requests to api.aranx.com:

* Once, to exchange a short-lived, one-time authorization code for paired API keys. The request contains the code, a PKCE verifier, and the site URL.
* When an Aranx-created post is edited, changes status, or is deleted. The request contains the post ID, title, content, excerpt, status, type, slug, URL, edit URL, created and modified dates, categories, tags, featured image, comment and ping status, menu order, parent ID, and the author's ID and display name.
* Every hour, a heartbeat for connection health. It contains the site URL, admin URL, site ID, WordPress, PHP, and plugin versions, and post and page counts.
* After the plugin imports article images, a report for each import job. It contains the job ID, the result, the new media library IDs and URLs, and any errors.
* Once a day, a connection check that sends empty HEAD requests to three Aranx API endpoints.
* Every 5 minutes, the visits of AI search bots and AI answer fetchers (OAI-SearchBot, ChatGPT-User, Claude-SearchBot, Claude-User, PerplexityBot, Perplexity-User) since the last send. Each visit contains the page URL without its query string, the time, the response status code, the user agent, and the IP address of the request. Aranx uses the IP address only to check that the visit came from the AI company's published IP ranges, and does not store it. Visits of other user agents are not recorded or sent. Visits wait in a database table until they are sent, at most 3 days. The plugin deletes them when you disconnect, deactivate, or turn this off. The `aranx_ai_traffic_enabled` filter turns this off.
* Every 5 minutes, with the AI bot visits, the visits of people who opened your site from a link in ChatGPT, Perplexity, Gemini, Claude, or Copilot. While the site is connected, a small script on your public pages checks the referrer and the `utm_source` parameter in the visitor's browser. Only when they name one of these apps does it send the page path, the referrer's domain, the `utm_source` value, and whether the page was found to your site's own REST API (`/wp-json/aranx/v1/ai-visit`). The plugin stores these with the time and sends them to Aranx. It stores no IP address, user agent, cookie, or other query parameter for these visits. To limit abuse, it keeps a salted hash of the IP address for 10 minutes, and a count of the site's visit reports for 1 hour. Other visits send nothing. The `aranx_ai_traffic_enabled` filter turns this off too.
* When Aranx publishes, updates, or removes one of its articles on your site, Aranx (not the plugin) sends the article URL to IndexNow (api.indexnow.org), which shares it with Bing, Yandex, and other search engines. To prove that the site owns the URLs, the heartbeat response carries a key, and the plugin serves it at `/{key}.txt` on your site. Aranx and the search engines fetch that file. The plugin sends nothing for this. The [IndexNow terms](https://www.indexnow.org/terms) apply.
* When you open the AI visits or Articles page of the Aranx admin, a request for the site's AI visit counts over the last 7 or 30 days. It contains only the number of days. The plugin keeps the answer for 15 minutes.
* Every 30 days, a request to rotate the API keys.
* When you disconnect or delete the plugin, a request to revoke the site's keys. On deletion this request also contains the site URL, site name, admin email address, and plugin version.

After you connect, Aranx also calls the plugin's REST API on your site. All of these calls require the site's API key. Aranx uses them to:

* Create, update, and delete the posts it publishes, and upload their images
* Read posts, categories, media, and authors (ID, display name, role, and avatar URL), so you can pick a category and author in Aranx
* Read the connection status: site name and URL, WordPress, PHP, and plugin versions, and which SEO plugins are active

The plugin downloads article images over HTTPS from images.aranx.com and from other public image URLs that Aranx sends with an article. It adds them to your media library.

* [Aranx Terms of Service](https://aranx.com/terms)
* [Aranx Privacy Policy](https://aranx.com/privacy)

== Installation ==

1. Upload the `aranx-connector` folder to `/wp-content/plugins/`
2. Activate the plugin through the **Plugins** menu in WordPress
3. Go to **Aranx** in your admin sidebar
4. Click **Connect to Aranx** and authorize your site

== Frequently Asked Questions ==

= Do I need an Aranx account? =

Yes. This plugin is a connector between your WordPress site and the Aranx platform. Create an account at [aranx.com](https://aranx.com).

= What happens to my content if I deactivate the plugin? =

All published content remains on your site. Deactivating pauses the connection to Aranx. Reactivating restores it automatically.

= Does this work with my SEO plugin? =

Yes. If Yoast SEO or Rank Math is active, Aranx saves the article's meta title and description in that plugin's fields. With neither active, Aranx prints them itself.

= Is the connection secure? =

All communication uses HTTPS with separate, revocable API keys for each direction. Browser callbacks carry only a short-lived authorization code. Webhooks, heartbeats, and image-transfer callbacks are HMAC-signed. API keys are encrypted in non-autoloaded WordPress options.

== Screenshots ==

1. Overview: connection health, articles from the last 30 days, AI visits, and recent activity
2. Articles: every post Aranx published or scheduled, with its status and AI visits
3. AI visits: which AI bots read your site, and which pages they read most
4. Activity: what Aranx published, what you edited in WordPress, and connection checks
5. Connection: who connected the site, connection checks, and request signing

== Changelog ==

= 1.8.2 =
* Security fix for image imports in posts written by Contributors and Authors. Update recommended.

= 1.8.1 =
* Fixed: on the Overview page, times in Recent activity no longer run past the edge of the list.

= 1.8.0 =
* Serves the IndexNow key file that Aranx sends, so Aranx can tell Bing and other IndexNow search engines when an Aranx article is published, changed, or removed
* Warns on the Aranx Overview and the WordPress Dashboard when Aranx refuses post events, with a Reconnect button. Held events are sent again after the connection works
* Takes at most 120 AI app visit reports per hour for the whole site, and counts an IPv6 network (/64) as one visitor for the limit per IP address. The `aranx_ai_visit_hourly_limit` filter changes the hourly cap

= 1.7.0 =
* New Aranx admin: Overview, Articles, Activity, AI visits, SEO, Connection, and Diagnostics pages, with a history of connection checks and Aranx requests. Image import failures show the cause, with Retry and Dismiss
* The AI visits page shows which AI bots read your site in the last 7 or 30 days, and which pages they read
* Counts the people who open your site from a link in ChatGPT, Perplexity, Gemini, Claude, or Copilot, for Aranx AI Visibility. A small script on public pages reports these visits to your site's REST API, so pages that a page cache or a CDN serves count too
* Sites behind a proxy other than Cloudflare should set the `aranx_ai_traffic_client_ip` filter. Without it, their visitors share one limit of 30 visit reports per 10 minutes

= 1.6.0 =
* Counts the visits of AI search bots and AI answer fetchers (ChatGPT, Claude, Perplexity) and sends them to Aranx every 5 minutes for AI Visibility. Pages that a page cache serves are not counted
* Reads the client IP from REMOTE_ADDR, or from CF-Connecting-IP when the request comes from Cloudflare and not from another site's Worker. Sites behind another proxy can set it with the `aranx_ai_traffic_client_ip` filter

= 1.5.1 =
* Sends its requests to api.aranx.com and opens the connection page on app.aranx.com. No change in features

= 1.5.0 =
* Tells Aranx about an edit to an Aranx post at the end of the save, so Aranx updates its copy within seconds. A failed send stays in the outbox, and cron retries it
* Writes an Aranx update only when the post is still the version Aranx read. If you changed the post since, nothing is overwritten
* Never writes to a post that has a newer autosave or a PublishPress revision that is not published yet
* Lets Aranx read one post, and list posts with a fingerprint instead of the full text

= 1.4.1 =
* Links image blocks in posts sent before Aranx wrote attachment IDs to their Media Library image, so the editor no longer offers to upload them again
* Fixes Aranx image blocks that the editor reported as invalid content
* Keeps embeds and other HTML that an administrator saved when it updates a post in the background
* Tries every image of a post before it retries one that failed, and waits a week before it tries again an image that keeps failing
* Never reuses an image that another upload is still processing
* Keeps the image link setting and the Media Library alt text

= 1.4.0 =
* Moves article images that are still on the Aranx image server into the Media Library, then links each image block to its attachment
* Runs in the background after Aranx sends a post and after each save, and once a day for older posts
* Stops the editor from offering to upload these images, an upload that failed with "Upload failed, try again"

= 1.3.3 =
* Accepts only the one-time authorization code on the connect callback, never API keys in the URL
* Sends only post and page counts in the hourly heartbeat, not user counts or server details
* Translates the connection notices
* Lists every request to and from Aranx under External services

= 1.3.2 =
* Parses URLs with wp_parse_url()
* Tested with WordPress 7.1

= 1.3.1 =
* Keeps backslashes in post titles and content
* "Publish now" publishes a scheduled post instead of keeping it scheduled
* Keeps private posts private when Aranx changes their date
* Reports a wrong server clock as clock skew instead of disconnecting the site
* Shows connection notices only to administrators, only on the Dashboard and Plugins screens, and lets them be dismissed
* Makes no requests to Aranx before you connect
* Removes every scheduled task on deactivation and uninstall
* Lists all data sent to Aranx in this readme

= 1.3.0 =
* Queues post changes while the site is disconnected and sends them after it reconnects
* Keeps retrying webhooks that failed for network, server, or auth reasons instead of dropping them
* Sends the current site identity with each delayed webhook

= 1.2.0 =
* Encrypts API keys and pending authorization credentials at rest
* Adds automatic and manual two-phase WordPress API key rotation
* Signs outbound webhooks and heartbeats and adds replay identifiers
* Removes author email addresses from the users response
* Hardens production builds, callback privacy, SSRF checks, logs, and admin output

= 1.1.0 =
* Activates confirmed connections without depending on WordPress cron
* Adds durable webhook and image-transfer queues with safe retries
* Preserves updates for legacy Aranx and BlogEmpire-generated posts
* Improves authorization, reconnection, and credential-rotation safety
* Adds WordPress 5.0-compatible one-off cron scheduling

= 1.0.0 =
* Initial release
* One-time authorization-code exchange with paired API keys
* Automatic content publishing via webhooks
* Post status synchronization
* SEO meta tag output (when no SEO plugin is active)
* Connection health monitoring with auto-reconnection
* Activity logging and debug tools

== Upgrade Notice ==

= 1.8.2 =
Security fix for image imports in posts written by Contributors and Authors. Update recommended.

= 1.8.1 =
Fixes times that ran past the edge of the Recent activity list on the Overview page.

= 1.8.0 =
Recommended update. Aranx can tell Bing and other IndexNow search engines when your Aranx articles change, and the plugin warns you when Aranx refuses your edits.

= 1.7.0 =
Recommended update. A new Aranx admin, and Aranx AI Visibility counts the visitors who come from AI apps.

= 1.6.0 =
Recommended update. Aranx AI Visibility shows which pages ChatGPT, Claude, and Perplexity read, with no code to add.

= 1.5.1 =
Recommended update. The plugin talks to the Aranx API host, api.aranx.com.

= 1.5.0 =
Recommended update. Aranx sees your edits within seconds and never overwrites a post you changed since it last read it.

= 1.4.1 =
Recommended update. Images in older Aranx posts link to their Media Library copy, so the editor stops offering an upload that fails or makes a duplicate. Aranx image blocks no longer show as invalid content.

= 1.4.0 =
Recommended update. Article images that stayed on the Aranx image server move into the Media Library, so the editor no longer offers a failing upload.

= 1.3.3 =
Recommended update. The heartbeat sends less data, and the connect callback no longer accepts API keys in the URL.

= 1.3.2 =
Maintenance update for the WordPress.org plugin directory. No change in behavior.

= 1.3.1 =
Recommended update. Fixes lost backslashes in posts, "Publish now" on scheduled posts, and false disconnects when the server clock is wrong.

= 1.3.0 =
Recommended update. Post changes made while the site is disconnected now reach Aranx after it reconnects.

= 1.2.0 =
Recommended security update for all Aranx Connector installations.

= 1.1.0 =
Recommended reliability update for all existing Aranx Connector installations.

= 1.0.0 =
Initial release.
