=== ZeeMee Flipbooks ===
Contributors: zeemeemedia
Tags: flipbook, pdf, catalog, magazine, newspaper
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Turn PDFs into accessible page-flip documents with clickable areas, validity periods, scheduling, RSS feed, shortcodes and webhooks.

== Description ==

ZeeMee Flipbooks lets newspapers, magazines and shops publish PDF documents as page-flip readers on their own site. Upload a PDF, mark the areas that should be clickable, set a validity period for offer catalogues, and embed the result with a shortcode.

**Features**

* Page-flip viewer rendered in the browser with the bundled PDF.js library (no external services, no third-party iframes)
* Two-page spreads on wide screens, single pages on phones; zoom, fullscreen, thumbnails, keyboard and swipe navigation
* Clickable areas: step through the pages in the editor, drag a rectangle and give it a URL and an accessible label
* Scheduled publishing (WordPress publish box) and scheduled unpublishing (set to draft, private or trash)
* Validity period (from/to) for offer catalogues
* Categories
* RSS feed of published documents with the PDF as enclosure and validity dates
* Shortcode that always shows the latest document, or the latest currently valid document
* Shortcode that shows a library of all published documents with category filter and pagination
* Outgoing webhook: a flat JSON object (no nested values) is POSTed when a document is published, with custom headers and optional HMAC signature
* Accessibility: WCAG 2.1 AA oriented markup, screen-reader text layer for the visible pages, labelled controls, focus management, reduced-motion support
* Schema.org DigitalDocument / ItemList JSON-LD
* WebMCP tool registration (navigator.modelContext) for AI agents, when the browser supports it
* All admin screens live under the shared "ZeeMee Plugins" menu

**Shortcodes**

* `[zeemee_flipbook_latest]` - embeds the most recently published document
* `[zeemee_flipbook_latest mode="valid" category="offers"]` - the newest document whose validity period includes today
* `[zeemee_flipbook_latest display="card"]` - card with cover and link instead of the viewer (display: embed, card or link)
* `[zeemee_flipbook id="123"]` - one specific document
* `[zeemee_flipbook_library per_page="12" columns="3" valid_only="no" filter="yes"]` - library grid

Viewer attributes for the embed shortcodes: `spread="auto|single|double"`, `height="700"`, `download="yes|no"`, `thumbnails="yes|no|open"`, `highlight="yes|no"`.

**Webhook payload**

A flat JSON object with these keys: event, id, title, url, pdf_url, cover_url, excerpt, published_at, modified_at, valid_from, valid_to, unpublish_at, categories (comma separated names), category_slugs (comma separated slugs), page_count, site_url, sent_at. Custom headers are configured in the settings. When a signing secret is set, the request carries `X-Zmfl-Signature: sha256=<HMAC-SHA256 of the body>`.

== Installation ==

1. Upload the `zeemee-flipbooks` folder to `/wp-content/plugins/` or install the zip from Plugins > Add New.
2. Activate the plugin.
3. Go to ZeeMee Plugins > Flipbooks, add a flipbook, select a PDF from the media library and publish.
4. Place `[zeemee_flipbook_latest]` or `[zeemee_flipbook_library]` on a page.

== External services ==

This plugin does not call any external service by itself. The bundled PDF.js library is served from your own site.

If you enter a webhook URL in the settings, the plugin sends an HTTP POST request to that URL every time a flipbook is published (and optionally when it is updated). The request contains the document's title, links, dates and categories as described above. You choose the recipient; consult that service's terms and privacy policy.

== Frequently Asked Questions ==

= Does the viewer load anything from a CDN? =

No. PDF.js is bundled with the plugin and served from your own site.

= How is a document unpublished automatically? =

Set "Unpublish at" on the document. A single WP-Cron event is scheduled for that time and an hourly sweep acts as a safety net. Low-traffic sites should trigger wp-cron.php from a real cron job.

= Can visitors download the PDF? =

Yes, unless you disable the download button in the settings or with `download="no"`. The PDF file is still reachable by its media URL, as with any file in the media library.

= Are clickable areas accessible? =

Each area is a real link positioned over the page. Give it a label in the editor; screen readers announce the label, keyboard users reach it with Tab, and the "Show links" button highlights all areas.

= Which RSS feed URL do I use? =

`/feed/flipbooks/` on your site. Add `?zmfl_category=slug` to limit it to one category.

== Changelog ==

= 1.1.2 =
* Arrow keys, Page Up/Down, Home and End turn pages without first focusing the viewer (as long as the flipbook is on screen and focus is not in a form field).

= 1.1.1 =
* Fix: thumbnail strip was not actually collapsed (plugin CSS overrode the hidden attribute).
* Fix: toolbar colours could be overridden by theme link styles; toolbar now uses SVG icons with hardened styles.

= 1.1.0 =
* Double-click to zoom in and out; drag with the mouse to pan while zoomed.
* Covers and back covers are centred in two-page mode.
* Page thumbnails are collapsed by default (new setting and thumbnails="open").
* Per-document setting for the PDF download button, which is now an icon.
* SEO plugin meta boxes (Yoast, Rank Math, AIOSEO, SEOPress) are removed from the flipbook edit screen.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.1.2 =
Keyboard navigation works without focusing the viewer first.

= 1.1.1 =
Fixes collapsed thumbnails and toolbar icon colours on themes with strong link styles.

= 1.1.0 =
Zoom, panning, centred covers and collapsible thumbnails.

= 1.0.0 =
Initial release.
