=== Ansico Mastodon-tool ===
Contributors: aphandersen
Tags: mastodon, fediverse, social, gutenberg, block
Requires at least: 6.1
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Display your latest Mastodon posts in a clean, Twitter-style Gutenberg block — with a smart Follow button for remote following.

== Description ==

Ansico Mastodon-tool lets you embed your public Mastodon feed directly on your WordPress site using a native Gutenberg block. Posts appear in a polished, compact card layout inspired by modern social feeds — with your avatar, display name, relative timestamps, and post content all flowing together consistently, whether or not a post contains hashtags.

**Features**

* **Gutenberg block** — drag it into any post, page, or widget area
* **Live feed** — fetches your latest public posts via your Mastodon profile RSS feed, cached for performance
* **Twitter-style layout** — avatar, name, @handle, relative time ("2h", "3d", "Apr 5"), and post content in one clean card
* **Hashtag normalisation** — hashtags are merged inline with the post text, never broken out into a separate floating element
* **Clickable cards** — the entire post card links to the original post on Mastodon
* **Profile header (optional)** — toggle a header above the feed showing your avatar, display name, and full Mastodon handle (e.g. @user@mastodon.social), with a tooltip on hover
* **Smart Follow button** — opens a dialog where visitors enter their own Mastodon instance; they are then sent directly to the standard `authorize_interaction` remote-follow flow, so they can follow you without leaving your site
* **rel="me" verification** — outputs a `<link rel="me">` tag in the page head for Mastodon identity verification
* **Mastodon API integration** — fetches your real profile picture, display name, and full handle via the Mastodon REST API with HTML scraping as fallback
* **Block settings** — choose how many posts to display (1–20), toggle replies, and toggle the profile header — all from the block sidebar

== Installation ==

1. Upload the `ansico-mastodon-tool` folder to the `/wp-content/plugins/` directory, or install via **Plugins → Add New → Upload Plugin**.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Go to **Settings → Ansico Mastodon-tool** and enter your Mastodon profile URL (e.g. `https://mastodon.social/@username`).
4. Add the **Mastodon Feed** block to any post or page via the Gutenberg block inserter.

== Frequently Asked Questions ==

= Which Mastodon instances are supported? =
Any public Mastodon instance that exposes a standard RSS feed and the `/api/v1/accounts/lookup` endpoint — which is virtually all of them.

= Does the Follow button require any configuration? =
No. It reads the profile URL you entered in settings and uses Mastodon's standard `authorize_interaction` endpoint automatically.

= How often is the feed refreshed? =
Posts are cached for 10 minutes, and profile data (avatar, name, handle) for 1 hour. The cache is cleared automatically when you save new settings.

= Does this plugin support Pixelfed, Pleroma, or other ActivityPub platforms? =
The RSS feed and profile API calls are Mastodon-specific. Other platforms may work partially, but are not officially supported.

== Screenshots ==

1. The Mastodon Feed block with profile header and Follow button
2. The remote Follow dialog
3. Block settings in the Gutenberg sidebar

== Changelog ==

= 1.0.0 =
* First stable release
* Smart Follow button with remote-instance dialog using the `authorize_interaction` endpoint
* Optional profile header with avatar, display name, full @handle@instance tooltip, and links
* Mastodon REST API used for accurate profile data (avatar, display name, full handle)
* Overlay link pattern for valid HTML — entire post card is clickable without wrapping block-level elements in `<a>`
* Hashtag normalisation: trailing hashtag paragraphs merged inline with post text
* Relative timestamps ("2h", "3d", "Apr 5", "Apr 5, 2023")
* Compact, consistent card layout with thin dividers — no theme margin bleed
* rel="me" link output for Mastodon identity verification
* Block sidebar settings: post count, include replies, show profile header

