=== AlphaPrepress PDF Preflight ===
Contributors: alphaprepress
Tags: pdf, preflight, print, prepress, woocommerce
Requires at least: 6.2
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

Upload and preflight PDF print artwork. Generate detailed reports, processing history, batch analysis, PDF and CSV exports, email notifications, and WooCommerce integration.
== Description ==


demonstration are available on the plugin website: 
https://alphaprepress.com/pdf-preflight/

AlphaPrepress PDF Preflight allows administrators and users to upload PDF files and check them for common print production issues directly in WordPress. All analysis runs on your own server without requiring an external service. common print-production problems — right inside WordPress, with no external service.

**Features**

* Upload PDF files from the admin or the front-end (shortcode).
* Native, dependency-free PDF analysis on your server.
* Detailed preflight reports with a 0–100 quality score.
* Checks: valid structure, encryption, page count & size, embedded fonts, image resolution (DPI), color space (RGB/CMYK/Gray/Spot), bleed & trim box, transparency.
* Reports saved in a custom database table with full processing history.
* Download reports as **PDF** (print-ready) or **CSV**.
* Batch processing to analyze multiple PDF files.
* WooCommerce integration allows customers to upload artwork for an order. Results are available in the order screen and orders list.
* Email notifications to the admin and/or the uploading user.
* Dashboard with statistics (total, passed, warnings, failed, average score).
* Configurable rules (minimum DPI, required bleed, preferred color space, allowed roles).

**Shortcode**

Add a front-end upload form to any page or post:

`[pdf_preflight]`

Attach uploads to a WooCommerce order:

`[pdf_preflight order_id="123"]`

== Installation ==

1. Upload the `alphaprepress-pdf-preflight` folder to `/wp-content/plugins/`, or install the ZIP via Plugins → Add New → Upload.
2. Activate the plugin through the *Plugins* menu in WordPress.
3. Go to **PDF Preflight → Settings** to configure your preflight rules.
4. Use **PDF Preflight → Upload & Analyze** to check files, or add the `[pdf_preflight]` shortcode to a page.

== Frequently Asked Questions ==

= Does this send my PDFs to a third-party service? =
No. All analysis is performed on your own server using PHP.

= How accurate is the image resolution check? =
Resolution is estimated from the image pixel dimensions relative to the page size. It is a strong indicator but, for pixel-perfect placement analysis, use a professional prepress RIP.

= Can I generate a real downloadable PDF report? =
Yes. The report exports as a self-printing HTML page (browser "Save as PDF"). If you install a PDF engine such as Dompdf and hook the `pdf_preflight_render_pdf` filter, a true PDF binary is produced.

== Screenshots ==

1. Dashboard with processing statistics.
2. Upload & analyze screen with drag-and-drop and batch support.
3. Detailed preflight report.
4. Processing history list.

== Changelog ==

= 1.1.1 =
* Fix: Uploaded files are now stored through the WordPress upload API (`wp_handle_upload()`) instead of direct PHP file functions.
* Fix: CSV exports no longer use raw PHP stream handles.
* Fix: Uninstall cleanup now uses `WP_Filesystem` and prepared identifiers for the table drop.
* Fix: Report queries are cached with the object cache and all table names are passed through `$wpdb->prepare()`.
* Fix: Added missing `translators:` comments and prefixed template variables.
* Fix: Translations are now loaded automatically by WordPress (removed the discouraged `load_plugin_textdomain()` call).
* Compatibility: Requires WordPress 6.2 or newer; tested up to WordPress 7.0.

= 1.1.0 =
* New: Redesigned front-end shortcode UI with a modern card layout, gradient header and animated result cards.
* New: Drag & drop PDF upload zone with a managed, removable file queue and per-file validation.
* New: Per-result "Download PDF" and "Download CSV" buttons on the front-end (generated client-side; works for guests too).
* New: "Guest uploads" setting to allow logged-out visitors to run the preflight test from the front-end (toggle on/off in the admin).

= 1.0.0 =
* Initial released version.

== Upgrade Notice ==

= 1.0.0 =
This release improves WordPress coding standards, security, performance, and compatibility with WordPress 6.2 and later.

= 1.0.0 =
Initial release.