=== Grandranker ===
Contributors: Grandranker
Tags: seo, ai, content, publishing, articles
Requires at least: 5.6
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.5.3
License: MIT
License URI: https://opensource.org/licenses/MIT

Automatically publish and update SEO-optimized articles from Grandranker — the AI content platform that helps you rank higher on Google and AI search engines.

== Description ==

[Grandranker](https://grandranker.com) is an AI-powered SEO platform that researches your niche, generates high-quality articles optimized for both traditional search engines and AI search (Google AI Overviews, ChatGPT, Perplexity, Claude, Gemini), and publishes them directly to your WordPress site.

This plugin connects your WordPress site to Grandranker so articles flow straight from the platform into your blog — no copy-pasting, no manual formatting.

**What Grandranker does for you:**

* Researches keywords and competitors in your niche
* Generates long-form, SEO-optimized articles with structured data (JSON-LD schema)
* Tracks your visibility across Google and AI search engines
* Publishes and updates articles on your WordPress site automatically

**How the plugin works:**

1. Install and activate the plugin.
2. Enter your Grandranker API token in **Grandranker** settings.
3. Click **Save & Connect**.
4. Articles published in Grandranker appear on your WordPress site automatically — with content, featured images, categories, meta descriptions, and structured data all handled for you.

**Plugin features:**

* Secure HMAC-SHA256 signature verification on every request
* Creates and updates WordPress posts with title, slug, content, excerpt, and featured image
* Injects JSON-LD structured data (schema markup) into page head for SEO
* Sets Yoast SEO meta description automatically
* Unpublish endpoint to remove articles remotely
* Ping endpoint for connectivity checks

== Installation ==

1. Upload the `grandranker` folder to the `/wp-content/plugins/` directory, or install the plugin through the WordPress plugins screen.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Go to **Settings → Grandranker**.
4. Enter your API token and domain ID from your Grandranker dashboard.
5. Click **Save & Connect**.

== Frequently Asked Questions ==

= Where do I find my API token and domain ID? =

Log in to [Grandranker](https://app.grandranker.com), go to your domain settings, and navigate to the Integrations section. Your API token and domain ID are displayed there.

= Is the connection secure? =

Yes. All article pushes are signed with HMAC-SHA256. The signing secret is exchanged during the initial connection and never transmitted again. Every incoming request is verified before any content is created.

= What happens when I publish an article in Grandranker? =

The article is sent to your WordPress site via a signed REST API call. The plugin creates a new WordPress post with the title, slug, HTML content, excerpt, meta description, featured image, and JSON-LD structured data. Re-publishing the same article updates the existing post.

= Can I unpublish articles from Grandranker? =

Yes. Grandranker can send a delete request to move the WordPress post to the trash.

== Changelog ==

= 1.5.3 =
* Fix corrupted JSON-LD schema: WordPress stripped backslashes on save, breaking escaped quotes and unicode characters (e.g. German umlauts) and producing invalid JSON in the page head
* Skip outputting stored schema that no longer parses as valid JSON, so pages published with older versions stop failing schema validation after updating

= 1.5.2 =
* Set the SEO plugin meta title on publish (Yoast / Rank Math / AIOSEO) so the SEO title is populated instead of empty

= 1.5.1 =
* Set the SEO plugin focus keyword on publish (Rank Math / Yoast) so keyword analysis scores correctly instead of showing an empty Focus Keyword

= 1.3.1 =
* Strip embedded JSON-LD schema from post content and inject via wp_head instead
* Update existing posts on re-publish instead of skipping
* Rename plugin from "Grandranker Publisher" to "Grandranker"

= 1.3.0 =
* Map article category to WordPress category on publish

= 1.0.0 =
* Initial release
* Secure HMAC-signed article publishing endpoint
* Automatic featured image attachment
* Yoast SEO meta description support
* Admin settings page for connection management
* Ping endpoint for connectivity verification
