{"id":303931,"date":"2026-05-28T11:21:50","date_gmt":"2026-05-28T11:21:50","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/pdf-preview-for-woocommerce\/"},"modified":"2026-05-28T11:21:32","modified_gmt":"2026-05-28T11:21:32","slug":"saral-pdf-preview-for-woocommerce","status":"publish","type":"plugin","link":"https:\/\/pcd.wordpress.org\/plugins\/saral-pdf-preview-for-woocommerce\/","author":23486542,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.2.0","stable_tag":"1.2.0","tested":"6.9.4","requires":"6.5","requires_php":"8.1","requires_plugins":null,"header_name":"Saral PDF Preview for WooCommerce","header_author":"Akaal Creatives","header_description":"Add a PDF preview lightbox to WooCommerce product pages.","assets_banners_color":"1e1246","last_updated":"2026-05-28 11:21:32","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"https:\/\/www.akaalcreatives.com","rating":0,"author_block_rating":0,"active_installs":0,"downloads":93,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.2.0":{"tag":"1.2.0","author":"akaalcreatives","date":"2026-05-28 11:21:32"}},"upgrade_notice":{"1.2.0":"<p>Security and compatibility improvement \u2014 upgrade recommended. PDF.js updated to 5.7.284; output escaping hardened throughout.<\/p>","1.1.0":"<p>No action required. The default button continues to work as before \u2014 the custom trigger is an opt-in feature for developers.<\/p>","1.0.6":"<p>No action required. Existing automatic button placement is unchanged \u2014 the shortcode is an opt-in addition.<\/p>","1.0.5":"<p>No action required. PDF assignments are kept by default on uninstall.<\/p>","1.0.4":"<p>Security and stability improvements \u2014 upgrade recommended for all users.<\/p>","1.0.0":"<p>Initial release \u2014 no upgrade steps required.<\/p>"},"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3551995,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3551995,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3551995,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3551995,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.2.0"],"block_files":[],"assets_screenshots":{"screenshot-1.jpg":{"filename":"screenshot-1.jpg","revision":3551995,"resolution":"1","location":"assets","locale":"","width":946,"height":774},"screenshot-2.jpg":{"filename":"screenshot-2.jpg","revision":3551995,"resolution":"2","location":"assets","locale":"","width":764,"height":649},"screenshot-3.jpg":{"filename":"screenshot-3.jpg","revision":3551995,"resolution":"3","location":"assets","locale":"","width":959,"height":846}},"screenshots":{"1":"Admin settings page \u2014 configure button text, hook position, and file serving mode.","2":"The \"Preview Book\" button on a WooCommerce product page.","3":"The PDF lightbox open on a product page \u2014 zoom controls, keyboard accessible, no download option."}},"plugin_section":[],"plugin_tags":[237,1764,2475,746,286],"plugin_category":[45,50],"plugin_contributors":[264766],"plugin_business_model":[],"class_list":["post-303931","plugin","type-plugin","status-publish","hentry","plugin_tags-lightbox","plugin_tags-pdf","plugin_tags-preview","plugin_tags-product","plugin_tags-woocommerce","plugin_category-ecommerce","plugin_category-media","plugin_contributors-akaalcreatives","plugin_committers-akaalcreatives"],"banners":{"banner":"https:\/\/ps.w.org\/saral-pdf-preview-for-woocommerce\/assets\/banner-772x250.png?rev=3551995","banner_2x":"https:\/\/ps.w.org\/saral-pdf-preview-for-woocommerce\/assets\/banner-1544x500.png?rev=3551995","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/saral-pdf-preview-for-woocommerce\/assets\/icon-128x128.png?rev=3551995","icon_2x":"https:\/\/ps.w.org\/saral-pdf-preview-for-woocommerce\/assets\/icon-256x256.png?rev=3551995","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/saral-pdf-preview-for-woocommerce\/assets\/screenshot-1.jpg?rev=3551995","caption":"Admin settings page \u2014 configure button text, hook position, and file serving mode."},{"src":"https:\/\/ps.w.org\/saral-pdf-preview-for-woocommerce\/assets\/screenshot-2.jpg?rev=3551995","caption":"The \"Preview Book\" button on a WooCommerce product page."},{"src":"https:\/\/ps.w.org\/saral-pdf-preview-for-woocommerce\/assets\/screenshot-3.jpg?rev=3551995","caption":"The PDF lightbox open on a product page \u2014 zoom controls, keyboard accessible, no download option."}],"raw_content":"<!--section=description-->\n<p>Saral PDF Preview lets you attach a PDF file to any WooCommerce product. A configurable button appears on the product page and opens the PDF in a clean, distraction-free lightbox \u2014 no download, no print, just a smooth in-browser reading experience powered by PDF.js.<\/p>\n\n<p><strong>Features<\/strong><\/p>\n\n<ul>\n<li>Upload a PDF per product via a dedicated meta box in the product editor.<\/li>\n<li>Configurable button text (default: \"Preview Book\").<\/li>\n<li>Choose from 7 hook locations on the product page \u2014 a live visual diagram shows exactly where the button will appear.<\/li>\n<li><strong>Protected mode<\/strong> (default): the real PDF URL is never exposed to visitors; the file is streamed through a signed REST endpoint.<\/li>\n<li><strong>Public mode<\/strong>: uses the standard WordPress attachment URL.<\/li>\n<li>Zoom in \/ zoom out controls inside the lightbox.<\/li>\n<li>Keyboard accessible \u2014 press Escape to close.<\/li>\n<li>Responsive layout on mobile.<\/li>\n<li>No tracking, no external requests, no upsells.<\/li>\n<\/ul>\n\n<!--section=installation-->\n<ol>\n<li>Upload the <code>saral-pdf-preview-for-woocommerce<\/code> folder to <code>\/wp-content\/plugins\/<\/code>.<\/li>\n<li>Activate the plugin through the <strong>Plugins<\/strong> menu in WordPress.<\/li>\n<li>Go to <strong>WooCommerce \u2192 PDF Preview<\/strong> to configure the button text, position, and serving mode.<\/li>\n<li>Edit any product, find the <strong>PDF Preview<\/strong> meta box, and upload a PDF.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"does%20this%20work%20with%20any%20woocommerce%20theme%3F\"><h3>Does this work with any WooCommerce theme?<\/h3><\/dt>\n<dd><p>Yes. The button is injected via standard WooCommerce action hooks so it works with any theme that respects the WooCommerce template hierarchy.<\/p><\/dd>\n<dt id=\"can%20customers%20download%20the%20pdf%3F\"><h3>Can customers download the PDF?<\/h3><\/dt>\n<dd><p>No. The lightbox intentionally has no download or print controls. In Protected mode the real file URL is never sent to the browser, so determined users cannot easily retrieve it either.<\/p><\/dd>\n<dt id=\"is%20a%20login%20required%20to%20view%20the%20preview%3F\"><h3>Is a login required to view the preview?<\/h3><\/dt>\n<dd><p>No. All visitors (logged-in or not) can open the lightbox.<\/p><\/dd>\n<dt id=\"how%20large%20can%20the%20pdf%20be%3F\"><h3>How large can the PDF be?<\/h3><\/dt>\n<dd><p>There is no hard limit imposed by this plugin. Your server's <code>max_execution_time<\/code> and <code>memory_limit<\/code> settings apply as usual. For very large PDFs, consider splitting them into a shorter sample.<\/p><\/dd>\n<dt id=\"which%20pdf.js%20version%20is%20bundled%3F\"><h3>Which PDF.js version is bundled?<\/h3><\/dt>\n<dd><p>PDF.js 5.7.284.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.2.0<\/h4>\n\n<ul>\n<li>Upgraded PDF.js from 3.11.174 to 5.7.284.<\/li>\n<li>PDF.js now loads lazily on first lightbox open via dynamic import \u2014 reduces initial page weight.<\/li>\n<li>Hardened output escaping: button HTML is now passed through wp_kses() with an explicit allowlist; admin meta box attribute conditionals rewritten to eliminate unescaped echo calls.<\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>Added data-pdf-preview-trigger attribute as the lightbox trigger \u2014 any custom element can now open the lightbox without relying on the plugin's CSS class.<\/li>\n<li>Added saral_pdf_preview_for_woocommerce_trigger_attr() helper function for use in theme templates and custom markup.<\/li>\n<li>Added saral_pdf_preview_for_woocommerce_trigger_attr filter to override the trigger attribute string.<\/li>\n<li>Settings page now documents the custom trigger element feature with usage examples.<\/li>\n<\/ul>\n\n<h4>1.0.6<\/h4>\n\n<ul>\n<li>Added shortcode [saral_pdf_preview_for_woocommerce] \u2014 place the preview button in any custom location on a product page without touching theme files. Accepts an optional id attribute to target a specific product from any page.<\/li>\n<li>Added PHP template tag support: echo do_shortcode( '[saral_pdf_preview_for_woocommerce]' ) for use directly in theme templates.<\/li>\n<li>Settings page now includes a Manual Embedding section with copy-ready shortcode and PHP snippets.<\/li>\n<\/ul>\n\n<h4>1.0.5<\/h4>\n\n<ul>\n<li>Added \"Data on Uninstall\" setting \u2014 choose whether to keep or remove PDF assignments from products when the plugin is deleted. Defaults to keeping the data so assignments are restored on reinstall.<\/li>\n<\/ul>\n\n<h4>1.0.4<\/h4>\n\n<ul>\n<li>Security: protected endpoint now verifies the product exists and is published before streaming the PDF.<\/li>\n<li>Security: Content-Disposition filename is now sanitised before being sent in the response header.<\/li>\n<li>Fixed: REST endpoint returns a proper error response instead of calling wp_die().<\/li>\n<li>Fixed: loading spinner now hides correctly if a network error occurs during PDF load.<\/li>\n<li>Fixed: uploading a non-PDF attachment no longer leaves stale metadata on the product.<\/li>\n<li>Fixed: preview button is now guarded against malformed button hook settings.<\/li>\n<li>Fixed: PDF attachment MIME type is verified in public serving mode before use.<\/li>\n<li>Improved: admin media frame strings (Select PDF, Use this PDF) are now translatable.<\/li>\n<li>Improved: modal dialog now uses aria-labelledby for better screen reader support.<\/li>\n<\/ul>\n\n<h4>1.0.3<\/h4>\n\n<ul>\n<li>Added loading spinner shown while PDF is downloading and rendering.<\/li>\n<\/ul>\n\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>Bumped asset version to bust browser cache after identifier rename.<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Renamed all internal identifiers to match plugin slug.<\/li>\n<li>Fixed 403 on protected PDF endpoint for logged-in users.<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial release.<\/li>\n<\/ul>","raw_excerpt":"Add a PDF preview button to WooCommerce product pages. Customers can view a PDF sample in a lightbox without downloading.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/303931","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=303931"}],"author":[{"embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/akaalcreatives"}],"wp:attachment":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=303931"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=303931"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=303931"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=303931"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=303931"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=303931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}