=== GEOHATS Connector ===
Contributors: REPLACE_WITH_WPORG_USERNAME
Tags: seo, schema, json-ld, meta description, ai search
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Lets GEOHATS write its Site optimizer fixes (titles, meta descriptions, schema, alt text, internal links) into your site, with undo.

== Description ==

GEOHATS (https://geohats.com) is a generative engine optimization (GEO) platform. Its Site optimizer crawls your site the way AI crawlers such as GPTBot, ClaudeBot and PerplexityBot read it, and suggests concrete fixes. This plugin lets GEOHATS write the fixes you approve into your WordPress site.

**This plugin requires a GEOHATS account.** On its own it does nothing: it has no settings screen and adds no features until you connect the site in GEOHATS and choose fixes to apply. GEOHATS is a paid service.

What GEOHATS can write through this plugin, one fix at a time, when you click Apply:

* Page titles and meta descriptions. When Yoast SEO or Rank Math is active, they are saved in that plugin's own fields. Otherwise this plugin prints them.
* Canonical URLs (same rule as above).
* JSON-LD structured data: FAQPage, Article and Organization.
* Image alt text, in the Media Library and in the page content.
* Internal links: wraps a phrase that already exists in the page content in a link to another page on your site.

Why server-side: AI crawlers fetch your HTML and, in most cases, do not run JavaScript. Fixes added by a JavaScript snippet are invisible to them. This plugin stores fixes in WordPress, so they are in the HTML every crawler receives.

Safety:

* Every change can be undone from GEOHATS. The previous value is returned to GEOHATS when a fix is applied, so it can be restored.
* Before content edits (alt text in content, internal links), WordPress saves a revision of the post.
* The plugin adds two REST API endpoints. Both require an authenticated WordPress user who can edit posts, and per-page changes also check that the user can edit that specific page.
* The plugin keeps a short local log (the last 100 changes: time, fix type, page URL) in the `geohats_log` option.

The plugin does not add tracking, ads, credit links, admin notices or any front-end script.

== Installation ==

1. In WordPress, go to Plugins > Add New, search for "GEOHATS Connector", then Install and Activate. (Or upload the plugin zip under Plugins > Add New > Upload Plugin.)
2. In WordPress, go to Users > Profile > Application Passwords and create an Application Password for GEOHATS. We recommend an Administrator or Editor account.
3. In GEOHATS, open your website, go to Integrations, choose WordPress and enter your site URL, username and the Application Password.
4. In GEOHATS, go to Site optimizer > Fixes, select the fixes you want and click Apply.

== Frequently Asked Questions ==

= Do I need a GEOHATS account? =

Yes. The plugin is the receiving end for fixes you approve in GEOHATS. Without a connected GEOHATS account it does nothing.

= Does the plugin contact geohats.com or any other server? =

No. The plugin itself makes no outgoing requests. GEOHATS's servers call the plugin's REST endpoints on your site when you apply or undo a fix. See "External services" below for exactly what is exchanged.

= Does it work with Yoast SEO or Rank Math? =

Yes. When Yoast SEO is active, titles, descriptions and canonicals are saved in Yoast's fields. When Rank Math is active and set up (connected, or its setup wizard skipped), they are saved in Rank Math's fields. With neither, this plugin prints them in the page head. JSON-LD schema from GEOHATS is always printed by this plugin.

= Does it change my content? =

Only for two fix types: image alt text inside the content, and internal links. Both save a post revision first. All other fixes are stored in post meta or options.

= Which WordPress user should I connect? =

An Administrator or Editor. The plugin checks permissions on every request, so a user who cannot edit a page cannot change it through GEOHATS.

= What happens if I deactivate or delete the plugin? =

Fixes stored in Yoast SEO or Rank Math fields stay. Alt text and links written into your content stay. Titles, descriptions, canonicals and JSON-LD printed by this plugin stop appearing on your pages. The stored values are left in the database, so reactivating the plugin restores them.

== External services ==

This plugin is an interface to GEOHATS, a third-party service operated at https://geohats.com. It is needed so GEOHATS can apply the Site optimizer fixes you approve.

The plugin itself does not send any data to geohats.com or anywhere else. Data is exchanged only when GEOHATS's servers call the plugin's REST endpoints on your site, authenticated with the WordPress username and Application Password you entered in GEOHATS.

When data is exchanged:

* When you connect the site or click "Test connection" in GEOHATS: GEOHATS calls `/wp-json/geohats/v1/status`.
* When you apply or undo a fix in GEOHATS, or when an AI coding assistant you connected to GEOHATS with a publish-scoped token applies fixes with your explicit confirmation: GEOHATS calls `/wp-json/geohats/v1/seo`.

What is sent and received:

* Sent to your site by GEOHATS: the fix type, the URL of the page on your site, the new value (for example a title, description, alt text or JSON-LD), and for alt text and links the image URL, link target and anchor phrase.
* Returned by your site to GEOHATS: whether the change succeeded, the previous value of the changed field (so GEOHATS can undo it), the post ID, the plugin version, and which SEO plugin is active (Yoast SEO, Rank Math or none).

Separately from this plugin, GEOHATS uses the same Application Password with the standard WordPress REST API (wp/v2) to check the connected user's permissions and, if you choose to, to publish pages you approve in GEOHATS as posts.

GEOHATS terms of service: https://geohats.com/terms
GEOHATS privacy policy: https://geohats.com/privacy

== Changelog ==

= 1.0.1 =
* Security: only administrators can change site-wide settings (latest-posts homepage title, description, canonical and the Organization schema).
* Security: JSON-LD is re-encoded with HTML-safe escaping when printed, and titles are escaped.

= 1.0.0 =
* First release: titles, meta descriptions, canonical URLs, FAQ/Article/Organization JSON-LD, image alt text and internal links, with undo. Works with Yoast SEO, Rank Math, or on its own.
