=== Footnote Analytics ===
Contributors: soleil63
Tags: footnotes, analytics, gutenberg, rest-api, ga4
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add clickable footnotes to WordPress and track anonymous opens in your dashboard.

== Description ==

Plugin Name: Footnote Analytics

Footnote Analytics lets editors add reusable footnote text and connect it to selected text in posts or pages with a `data-term` key.
On the front end, readers can click the marked text to open a lightweight footnote popup.

The plugin records anonymous footnote click/open events inside WordPress, separate from GA4.
It stores the footnote key, title, post information, URL, referrer, device type, user agent, and clicked time. IP addresses are not stored.

The admin analytics screen displays all recorded ranking rows and latest events.

== Installation ==

1. Upload the `footnote-analytics` folder to the `/wp-content/plugins/` directory.
2. Activate `Footnote Analytics` through the WordPress Plugins screen.
3. Go to `Footnotes` in the WordPress admin and add a footnote entry.
4. Set a footnote key in the `data-term` field, or leave it empty to use the post slug.
5. In the block editor, select text and use the footnote toolbar button to apply the matching key.

== Frequently Asked Questions ==

= Does the plugin limit footnote registration? =

No. Footnote registration and front-end footnote display are unlimited.

= Does the analytics screen limit display rows? =

No. Ranking rows and latest events are displayed without the previous Free edition display limit.

= Does this plugin require GA4? =

No. WordPress internal measurement is the primary tracking method. If `gtag` exists on the site, the plugin also keeps the existing GA4 `glossary_open` event.

= Does the plugin store IP addresses? =

No. IP addresses are not stored in the analytics table. A temporary request hash may be used only for short rate-limit protection.

= What happens on uninstall? =

The plugin removes its analytics event table and short-lived rate-limit transients. Footnote posts and `term_key` post meta are preserved as user-created content.

== Screenshots ==

1. Footnote editor screen showing the `data-term` key field.
2. Gutenberg toolbar button for applying a footnote key to selected text.
3. Front-end footnote popup opened from marked text.
4. Analytics ranking tab showing recorded footnote opens.
5. Debug tab with table status, REST API URL, JS settings, and test event tools.

== Changelog ==

= 1.0.0 =
* Initial WordPress.org-ready release.
* Unified plugin name, slug, and Text Domain as `footnote-analytics`.
* Removed Free edition display limit and upsell logic.
* Added WordPress internal footnote analytics, Gutenberg footnote insertion, front-end popup display, REST event recording, nonce verification, rate limiting, GA4 `glossary_open` support, and uninstall cleanup.
