=== Flipbook PDF Viewer & Embedder ===

Contributors:      raselsha
Donate link:       https://lieusoft.com
Tags:              pdf-viewer, pdf-embed, flipbook, 3d-flipbook, ebook
Requires at least: 3.0
Tested up to:      7.0
Requires PHP:      7.0
Stable tag:        1.5.6
License:           GPLv2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html

Turn any PDF into a realistic, interactive 3D page-flip flipbook — or a standard viewer — for eBooks, catalogs, manuals, newsletters & reports.

== Description ==

Most PDF viewer plugins just drop a flat, static embed on the page — a rectangle you scroll through, no different from opening the file directly. **Flipbook PDF Viewer & Embedder** treats a PDF like what it actually is: a book. Every document you upload gets a realistic, interactive 3D page-flip flipbook automatically, with a standard traditional viewer always one click away — no coding, no conversion step, just upload a PDF and drop in a shortcode.

[youtube https://www.youtube.com/watch?v=8EgfVxynlPo]

[Live Demo](https://flipbook.lieusoft.com/) | [Support](https://lieusoft.com)

= 📖 A Real Reading Experience, Not Just an Embed =
* **Realistic 3D page-flip** — drag a page corner or tap to turn it, a genuine flip animation, not a fade or a slide.
* **3D Flipbook & Standard modes** — visitors can switch between the immersive 3D view and a plain traditional viewer at any time (or you can hide the switcher and lock in one view).
* **Reading Direction (RTL/LTR)** — set per document, so the flipbook, its Previous/Next arrows, and the E-Book grid's hover animation all mirror correctly for Arabic, Hebrew, and other right-to-left documents.
* **Interactive Ebook archive view** — covers flip open on hover with a smooth 3D animation and a real preview of the document's next page, not a placeholder icon.
* **Seamless theme integration** — the single PDF page renders using your active theme's own header and footer, including modern block themes, so it never looks like a bolted-on plugin page.

= 🗂️ Four Archive Layouts =
Display your whole library — or a filtered slice of it — in whichever layout fits the page:
* **List** 📋 — a clean, scannable row-based layout.
* **Grid** 🟦 — card-based, with cover, title, description, and meta.
* **Newsletter** 📰 — grouped by year, built for an archive that reads like a publication.
* **Ebook** 📚 — cover-flip hover previews, shelf-style.

= 🧩 Elementor Integration =
* Drag-and-drop **Archive View** and **Single PDF View** widgets — no shortcode typing required.
* Full support for every shortcode attribute, visually configurable.
* Category filtering built into the widget controls.
* Compatible with any Elementor-ready theme.

= ⚙️ Built for Real Libraries, Not Just One PDF =
* **Category organization** — organize documents by category for easy browsing.
* **Manual drag-and-drop ordering** — reorder your library exactly how you want it from the admin list, or set an exact position per document; List, Grid, and Ebook views respect that order.
* **Remote PDF support** — link to a PDF hosted elsewhere, or clone it into your own Media Library with one click.
* **Document meta** — Author, Publisher, Published Year, Edition, and Description, each individually shown or hidden globally or per shortcode.
* **Usage counters** — track reads and downloads per document, shown or hidden independently.
* **Demo content import** — one click to see the plugin populated with sample PDFs.

= 🎨 Admin Experience =
* **Modern settings dashboard** — sidebar navigation, cards, toggle switches, and styled dropdowns.
* **Redesigned PDF editor screen** — General, Book Info, and Template settings in organized tabs.
* **Modernized admin list** — status badges, taxonomy pills, and a one-click shortcode copy button per document.
* **Shortcode Generator** — build a shortcode with the exact attributes you want, without memorizing syntax.
* **Brand color customization** — match the viewer to your site's own palette, including the flipbook container's border, background, and max width.
* **Editable archive URLs & titles** — the archive slug and page title are yours to set.

= 🛠️ Shortcodes & Attributes =

**Single PDF** — `[pdfev_embed_viewer id="post_id"]`

* `show_description`, `show_author`, `show_publisher`, `show_year`, `show_edition`, `show_download` — each `yes`/`no`, overrides this document's own setting for just this one embed.

**Archive (multiple PDFs)** — `[pdfev_viewer]`

* `template` — `list`, `grid`, `ebook`, `newsletter` (default `list`)
* `category` — filter by category slug
* `limit` — number of items to show (default `10`)
* `order` — `asc`, `dsc` (default `dsc`)
* `read` / `download` — show the Read/Download button, `yes`/`no` (default `yes`)
* `reading_count` / `downloading_count` — show the read/download counter, `yes`/`no` (default `yes`)
* `show_description` / `show_author` / `show_publisher` / `show_year` / `show_edition` — `yes`/`no` (default `yes`)

**Examples:**
* `[pdfev_viewer template="grid" limit="10" order="dsc" show_author="yes" show_year="yes"]`
* `[pdfev_embed_viewer id="123" show_download="no"]`

Prefer a visual builder? Use **Settings → Shortcode Generator** instead of writing these by hand.

= 🔒 Privacy =
This plugin uses the [Appsero](https://appsero.com) SDK to collect basic telemetry — but **only after you explicitly consent** via an admin notice. By default, no data is collected at all, and nothing personal or sensitive is gathered without permission. See the [Appsero Privacy Policy](https://appsero.com/privacy-policy/) for details.

= 🌍 Languages =
English (en_US), Bengali (bn_BD), French (fr_FR) — and translation-ready for any other locale.

== Installation ==

= Install via WordPress Dashboard =
1. Go to **Plugins → Add New**.
2. Click **Upload Plugin**.
3. Choose the `pdf-embed-viewer.zip` file from your computer.
4. Click **Install Now**, then activate the plugin. ✅

= Install via FTP =
1. Download `pdf-embed-viewer.zip` and extract it.
2. Upload the extracted `pdf-embed-viewer` folder to `/wp-content/plugins/` on your server.
3. Go to **Plugins** in your WordPress dashboard and activate it. ✅

== Frequently Asked Questions ==

= What is the best free WordPress plugin for a 3D flipbook PDF viewer? =
3D Flipbook PDF Viewer & Embedder lets you display any PDF as a realistic, interactive page-flip flipbook — or as a standard PDF viewer — on any post, page, or Elementor layout, completely free.

= How do I embed a PDF on a single page or post? =
Use the shortcode `[pdfev_embed_viewer id="post_id"]`, replacing `post_id` with the ID of your uploaded PDF post.

= How do I show a PDF as a flipbook instead of a plain embed? =
Every uploaded PDF automatically gets an interactive 3D Flipbook view — visitors can toggle between the Flipbook and a Traditional (standard) viewer right on the page, no extra setup needed.

= Can I create a gallery or archive of multiple PDFs? =
Yes! Use `[pdfev_viewer template="list"]`, `[pdfev_viewer template="grid"]`, `[pdfev_viewer template="ebook"]`, or `[pdfev_viewer template="newsletter"]` to display different archive layouts.

= Does it support right-to-left (RTL) documents like Arabic or Hebrew PDFs? =
Yes. Each document has its own Reading Direction setting — when set to RTL, the flipbook, its Previous/Next navigation, and the E-Book grid's hover animation all mirror correctly for that document, independent of your site's overall language.

= Will the single PDF page match my theme, including block themes? =
Yes. The single PDF view renders using your active theme's own header and footer — including modern block themes like Twenty Twenty-Five — so it looks like a native part of your site, not a plugin bolt-on.

= Does the plugin support Elementor? =
Yes, the plugin includes Elementor widgets for both archive and single PDF views. You can drag-and-drop PDF lists or individual PDF viewers into your pages, with full support for shortcode attributes and visual customization.

= Can I organize my PDFs by category? =
Yes, you can assign categories to your PDFs, making it easy to organize and allow users to browse documents by topic or type.

= Can I use my PDFs from a remote server? =
Yes, you can link to a PDF hosted on a remote server, or clone it into your own Media Library with one click.

= How do I track how many times a PDF is read or downloaded? =
The plugin automatically tracks reads and downloads. You can view the counts in the plugin settings and post list.

= Is there an option to show or hide the download and view counters on buttons? =
Yes, you can enable or disable the read (view) and download counters on the action buttons from the plugin settings.

= Can I customize the archive page URL and titles? =
Yes, you can change the archive page slug and title from the plugin settings.

= How do I switch between the Traditional PDF View and 3D Flipbook View? =
You can choose your preferred mode in the plugin's settings.

= Does the plugin support multiple languages? =
Yes, it is translation-ready and compatible with multilingual websites.

= Can I override the plugin templates in my child theme? =
Yes, copy the desired template files from the plugin's `template/` folder to your child theme (e.g., `your-child-theme/template/archive.php`). You can then modify the copied files as needed.

= How do I import demo content? =
Click the "Import Demo" button in the plugin settings to quickly add sample content.

= Will this plugin slow down my website? =
No, the plugin is lightweight and optimized for fast performance.

= Do I need coding knowledge to use this plugin? =
No coding skills are required. You can manage everything with shortcodes and plugin settings.

= Is Appsero collecting my private data? =
No. Appsero only collects basic telemetry data after you give permission. It's 100% optional and secure.

== Screenshots ==

1. Interactive 3D flipbook view with realistic page-flip animation.
2. E-Book archive grid — hover a cover to flip it open and preview the document.
3. List, Grid, and Newsletter archive layouts for displaying multiple PDFs.
4. Modern PDF Embed post editor — General, Book Info, and Template tabs.
5. Plugin settings dashboard with archive, display, and branding options.
6. Elementor widgets for drag-and-drop Archive and Single PDF views.

== Changelog ==

= 1.5.6 =
* Added: a Container Max Width setting (Display & Behavior) to control the whole viewer's overall width, previously fixed at 1300px.
* Added: a "Show Flipbook/Traditional Switcher" toggle (Display & Behavior) to hide the view-toggle buttons — independent of the Download button's own visibility control.
* Added: a show_download shortcode attribute to override a document's Download button visibility for one specific embed, matching show_description/show_author and the other existing show_* attributes.
* Changed: the flipbook container's border and background are now off by default (previously a fixed gray fill/border) with rounded corners either way — two new Brand Colors settings (Book Container Border, Book Container Background) let you turn either back on.
* Changed: adjusted the flipbook container's default height so portrait-oriented covers/pages have enough room without leaving excess empty space around the book.
* Redesigned the Grid archive template's cards: title, description, cover, then meta, in that order — rounded corners with a hover lift, a clamped multi-line description, and meta fields (pages, file size, publisher, year, edition) shown as label/value rows instead of one bullet-joined line; removed the cover image's date badge and dark gradient overlay.
* Fixed: a shortcode's CSS/JS didn't load when used outside a post's saved content (e.g. called directly from a theme template) — the viewer's container rendered but never initialized.
* Fixed: setting a flipbook container border color could make its bottom edge disappear in some browsers.
* Fixed: the PDF editor screen's "last-viewed tab" was remembered site-wide instead of per-document — switching tabs on one PDF's edit screen no longer changes the default tab shown on every other PDF's edit screen.
* Fixed: frontend.css could keep serving a stale cached copy after an update instead of the new version.

= 1.5.5 =
* Fixed the color pickers on the settings page rendering incorrectly: the hue slider dropped below the color square instead of sitting beside it (showing as a tall stray bar over the fields underneath), and the round drag handle rendered half its size and off-centre from the color it pointed at.
* Fixed the color pickers' drag handles being stretched out of shape — the round handle into an ellipse and the hue slider's handle into a box.

= 1.5.4 =
* Added: PDF display order can now be set manually — drag and drop to reorder in the "PDF Embed" admin list (or set an exact position via the Order field on each PDF's edit screen), and the Grid, List and Ebook archive views now respect that order. A PDF uploaded later no longer has to sort by date away from the related ones it belongs with.
* Redesigned the "PDF Embed" admin list screen: cleaner columns, status badges, taxonomy pills, and a one-click copy button for each item's shortcode.
* Security fix: the demo-data importer's AJAX handler skipped its nonce check entirely whenever the nonce field was simply missing from the request, instead of failing closed. It's now verified unconditionally, and a capability check was added.

= 1.5.3 =
* Fixed: the flipbook could fail to open on some hosts/CDNs with a "Bad end offset" error and a blank viewer, caused by HTTP Range request responses for the PDF file being altered in transit. The viewer now always fetches the full file in one request instead of relying on Range support.

= 1.5.2 =
* Renamed the plugin from "3D Flipbook PDF Viewer & Embedder" to "Flipbook PDF Viewer & Embedder".
* Trimmed the plugin's WordPress.org search tags down to the 5 that actually count toward search ranking.

= 1.5.1 =
* Added a per-document Reading Direction (RTL/LTR) setting — the flipbook, its Previous/Next arrows, and the E-Book archive grid's hover effect all now flip correctly for Arabic/Hebrew and other right-to-left documents, on a per-book basis.
* Redesigned the E-Book archive grid: a smoother 3D cover-flip animation, a real preview of the document's second page rendered on hover (instead of a placeholder icon), hardcover-style page-thickness edges, and a fully responsive grid sized to the covers themselves.
* Fixed the single PDF page's header and footer looking different from the rest of the site on block themes (e.g. a smaller site title, missing navigation) — it now matches the theme's own header/footer exactly.
* Fixed a block theme adding its own duplicate title, a blank byline, and unrelated content (a second Previous/Next navigation, a "more posts" list) around the plugin's single PDF page.
* Fixed the single PDF page's title/actions and Previous/Next navigation not lining up with the width of the PDF viewer below them.
* Fixed a large empty gap that could appear at the bottom of the single PDF page on block themes.
* Added a "Download to Media Library" button to clone a remote PDF URL into your own site's Media Library.
* The Featured Image box now stays in sync with the Book Cover preview when you set a featured image.
* Redesigned the Book Info and Template tabs of the PDF editor screen with the same modern dropdowns, panels, and description editor as the rest of the settings.
* Added a Copy button for the single-item shortcode shown in the post editor.
* Fixed the settings page's bottom Save button not submitting the form.

= 1.5.0 =
* Redesigned the settings page and the PDF editor screen with a modern sidebar-navigation layout, cards, toggles, and styled dropdowns.
* Security: settings save now also verifies the current user's capability, not just the nonce.
* Fixed: flipbook scripts and styles were being loaded on every page of the site instead of only pages that actually display a PDF viewer.
* Added extensibility hooks so an official Pro add-on can offer secure PDF delivery and extra flipbook display options, without modifying this plugin's files.

= 1.4.4 =
* Security fix: PDF proxy endpoint could be used to reach internal/private network addresses; now restricted to public http(s) hosts and verified PDF responses only.
* Security fix: post save and download-counter requests are now properly nonce-verified.
* Fixed: admin list columns for download/view counts no longer routed through translation lookups.
* Fixed: featured image upload now verifies the file is a real image before saving.

= 1.4.2 =
* file size and pages count added with settings.

= 1.4.1 =
* pagination upgrade to ajax load more.

= 1.4.0 =
* Author, Description, Published Year, Published Edition fields Added.
* Global setting to display/hide of these info settings added.
* all template design updated with buttons.

= 1.3.9 =
* fixed. shortcode for single item id missing issue.

= 1.3.8 =
* pdf.js and pdf.worker.js library update.

= 1.3.7 =
* on plugin activation show dummy data import notice.

= 1.3.6 =
* Remote pdf file can be used instead of uploaded.

= 1.3.5 =
* github to wordpress release

= 1.3.4 =
* Translation Updated
* France language Updated

= 1.3.3 =
* Added category feature 🏷️
* Elementor widgets now support category selection 🧩

= 1.3.2 =
* Fixed full width issue in archive list view

= 1.3.1 =
* Fixed settings options saving issue

= 1.3.0 =
* Added Elementor Widgets Support 🧩
* Introduced Archive View and Single View Widgets

= 1.2.8 =
* Refactored code
* Added support form
* Adjusted width for single and shortcode pages
* Added preview image setup

= 1.2.7 =
* Fixed toggle button for single page shortcode
* Backend now shows file size and total pages

= 1.2.6 =
* Added PDF preview thumbnail generation 🖼️
* Set featured image from preview thumbnail

= 1.2.5 =
* Fixed admin icons
* Added Shortcode Generator 🛠️

= 1.2.4 =
* Added template shortcode attribute
* Added ebook cover flipping style on hover 📚
* Updated ebook design

= 1.2.3 =
* Fixed archive view pagination

= 1.2.2 =
* Updated single page template
* Updated shortcode view for 3D flipbook

= 1.2.1 =
* Fixed empty page loading issue

= 1.2.0 =
* Added 3D flipbook library 📖

= 1.1.2 =
* Added demo pages for shortcode view 🚀
* Fixed default counter value
* Refactored code

= 1.1.1 =
* Added option to return page when using shortcode
* Added setting to show/hide counter
* Refactored code

= 1.1.0 =
* Fixed missing template file error

= 1.0.10 =
* Fixed download button counter
* Added read button show/hide settings
* Improved button styles
* Added template hook for editing templates
* Added download and read data to post table

= 1.0.9 =
* Improved grid and ebook archive view responsiveness and CSS

= 1.0.8 =
* Fixed fatal error with count manager
* Fixed single page navigation icon

= 1.0.7 =
* Added PDF read and download counters 📊
* Updated translations

= 1.0.6 =
* Fixed demo import button 🚀
* Updated translations

= 1.0.5 =
* Made archive page slug editable from settings
* Added import demo button 🚀
* Updated translations

= 1.0.4 =
* Added shortcode for single view
* Improved button translation and read button
* Added download button hover effect
* Added shortcode section to general tab
* Added shortcode column to backend

= 1.0.3 =
* Added shortcode for 4 template views
* Fixed color changing issue for templates
* Added translation for template header
* Inserted sample data on activation

= 1.0.2 =
* Set up Appsero analytics

= 1.0.1 =
* Added admin support info

= 1.0.0 =
* Initial release 🎉

== Upgrade Notice ==

= 1.5.6 =
Adds a Container Max Width setting, a Flipbook/Traditional switcher visibility toggle, a per-shortcode show_download override, and a redesigned Grid template — plus fixes for a shortcode-outside-post-content asset-loading bug, a site-wide (instead of per-document) remembered editor tab, and stale cached CSS after updates.
