=== QianMing Contract E-Sign ===
Contributors: koeloo
Tags: e-signature, contract, pdf signature, digital signature, electronic signature
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.1
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Create, customize, send, and electronically sign PDF contracts directly inside WordPress with visual drag-and-drop placement and hand-drawn signing.

== Description ==

**QianMing Contract E-Sign** is a lightweight, self-hosted online contract e-signature plugin for WordPress. All contract drafting, PDF rendering, hand-drawn signatures, and verification happen 100% on your own WordPress server — no third-party SaaS fees and no per-document charges.

Official Website & Live Preview: [https://qm.zhanqun8.com/](https://qm.zhanqun8.com/)

### Key Features (100% Free & Self-Hosted)

* **3 Ways to Create Contracts**:
  * **Rich-Text Online Drafting**: Built-in offline visual editor to draft custom contracts and convert them directly into clean A4 PDFs.
  * **Reusable Templates with Dynamic Variables**: Insert `{{PartyA_Name}}`, `{{Contract_Amount}}`, or any custom variable — fill once and even tweak clauses per client without altering the shared template.
  * **Upload Existing PDFs**: Upload ready-made PDF contracts directly.
* **Visual PDF Drag-and-Drop Field Editor**: Powered by bundled offline PDF.js — preview every page and drag/resize Signature and Date fields to exact coordinates.
* **Smooth PC & Mobile Hand-Drawn Signing**: Dedicated distraction-free signing page (`/qm-sign/{token}`) with high-DPI smooth canvas signature pad for mouse, trackpad, and mobile touchscreens.
* **Private Protected Storage**: Contracts and signatures are stored inside a protected `uploads/qm-esign-vault/` folder with `.htaccess` protection and authenticated streaming.
* **Public Verification Center**: Built-in verification page (`/qm-verify/`) and shortcode `[qm_contract_verify]` to check contract status and document fingerprint.
* **Bilingual Ready (English & Simplified Chinese)**: Full WordPress i18n support with bundled `zh_CN` translation and optional HD Chinese TTF font upload in Settings.

### Optional Commercial Pro Add-On

Need enterprise-grade workflows? An optional separate Pro add-on plugin is available at [https://qm.zhanqun8.com/](https://qm.zhanqun8.com/) (Contact Telegram: `@koeloo`):

* **Electronic Seal Studio**: Auto-generate transparent red circular company seals, personal square seals, or upload custom PNG seals.
* **Unlimited Multi-Party & Parallel Signing**: Support 3+ parties with sequential or concurrent signing flows.
* **Passcode & 6-Digit OTP Verification Gates**: Lock contract PDF access until signers verify their identity.
* **OpenSSL X.509 Digital PDF Signatures & Audit Certificate Report**: Cryptographically sign finalized PDFs (PKCS#7) and append a full audit certificate page.
* **Full Lifecycle Controls**: Revert pending contracts to draft and one-click clone completed contracts for new clients.
* **File-Upload SHA-256 Tamper Verification**: Upload any PDF on the verify page to validate byte-level integrity.

### Third-Party Libraries & Licenses

All bundled libraries run locally on your server with no external CDN calls:

* **TCPDF** (`vendor/tecnickcom/tcpdf`) — Licensed under GNU LGPLv3 (https://tcpdf.org/)
* **FPDI** (`vendor/setasign/fpdi`) — Licensed under MIT License (https://www.setasign.com/products/fpdi/)
* **PDF.js** (`assets/vendor/pdfjs`) — Licensed under Apache License 2.0 (https://mozilla.github.io/pdf.js/)

== Installation ==

1. Upload `qm-contract-esign.zip` via **Plugins > Add New > Upload Plugin** in your WordPress dashboard, or unzip into `/wp-content/plugins/qm-contract-esign/`.
2. Activate **QianMing Contract E-Sign** through the **Plugins** screen.
3. Ensure pretty permalinks are enabled under **Settings > Permalinks** (e.g. Post name).
4. Go to **E-Sign > + New Contract** to create your first contract, drag signature fields onto the PDF, and send the unique signing link to your client.
5. (Optional) Embed `[qm_contract_verify]` on any page for public contract verification.

== Frequently Asked Questions ==

= Does this plugin send my contracts to any external cloud server? =
No. All PDF generation, hand-drawn signatures, and file storage run 100% locally on your own WordPress server.

= Does it work on mobile phones and WeChat browsers? =
Yes! The standalone signing page is fully responsive and uses HTML5 Pointer Events for smooth finger drawing on iOS, Android, and desktop devices.

= Why is the plugin ZIP under 3MB? How do I embed HD Chinese fonts? =
To guarantee compatibility with shared hosts that have 8MB upload limits, we keep the core plugin lightweight. English works out of the box, and Chinese uses a lightweight built-in font. You can optionally upload a `.ttf` font pack under **E-Sign > Settings & Fonts** (free download available at https://qm.zhanqun8.com/).

= Where can I learn more about the Pro add-on? =
Visit [https://qm.zhanqun8.com/](https://qm.zhanqun8.com/) or reach out on Telegram `@koeloo`.

== Changelog ==

= 1.0.0 =
* Initial public release.
* Custom rich-text contract drafting, variable templates, and PDF upload support.
* Visual PDF.js drag-and-drop field placement and standalone mobile-friendly signing portal.
* Built-in English and Simplified Chinese (`zh_CN`) translations.
* Public contract verification page and `[qm_contract_verify]` shortcode.

== Upgrade Notice ==

= 1.0.0 =
Initial release of QianMing Contract E-Sign.
