=== DropDMS – Receipt & Document Archive with OCR ===
Contributors: dropdms
Tags: document management, receipts, ocr, archive, invoices
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Archive receipts and documents by drag & drop. Text recognition runs in the browser, duplicates are caught before upload, everything is searchable.

== Description ==

DropDMS turns WordPress into a simple, private archive for receipts, invoices and letters.

* **Drag & drop upload** of PDF, JPG, PNG, WebP and GIF files, many at once.
* **Text recognition (OCR) in the browser.** PDFs with a text layer are read directly; scans and photos are recognized with Tesseract. Nothing is sent to a cloud service, and your server needs no extra software.
* **Duplicate check before upload.** The browser computes a SHA-256 fingerprint first, so a receipt that is already in the archive is reported before any OCR time is spent.
* **Search** in title, file name, note and recognized text – partial words or the MySQL full-text index.
* **Categories** (hierarchical), **document date**, **note**, and the recognized text can be corrected by hand.
* **Thumbnails** in the list and a preview on the edit screen.
* **Run text recognition again** for a single document.
* **Files are stored in the database** together with their text and thumbnail. They are not reachable by URL in the uploads folder; WordPress delivers them only after a permission check. This also works on nginx without server rules.
* **Own capabilities** (`dropdms_view`, `dropdms_upload`, `dropdms_edit`, `dropdms_delete`, `dropdms_manage`) that you can assign to any role.
* No limits on the number of documents.

= DropDMS Pro =

The separate add-on [DropDMS Pro](https://dropdms.de) adds a document list for your website (block and shortcode with search, filters and visibility per category) and text recognition for many documents at once. DropDMS works fully without it.

= Privacy =

DropDMS does not contact external services. All libraries for text recognition (Tesseract.js, its WebAssembly core, the language data for German and English, pdf.js) ship with the plugin and are loaded from your own site. Your documents never leave your site.

== Installation ==

1. Install and activate the plugin.
2. Open **DropDMS → Documents** and drop files into the upload area.
3. Optional: create categories under **DropDMS → Categories** and adjust the recognition language and file size under **DropDMS → Settings**.

The largest file you can store depends on your PHP upload limits and on the MySQL/MariaDB setting `max_allowed_packet`. The settings page shows the effective limit.

== Frequently Asked Questions ==

= Why are the files stored in the database? =

Receipts are confidential. In the database they are protected by the same permission check as the rest of the archive, are included in every database backup, and cannot be guessed or opened by a direct link.

= My database grows although I deleted documents. =

MySQL keeps freed space for reuse. **DropDMS → Settings → Free up space** rebuilds the table (OPTIMIZE TABLE) and returns the space to the server.

= Which languages can be recognized? =

German and English (models "tessdata_fast"). PDFs that already contain text are read in any language.

= What happens to my documents when I delete the plugin? =

Nothing, unless you tick "Delete all documents, categories and settings when the plugin is deleted" in the settings first.

== Screenshots ==

1. Upload area and document list.
2. Editing a document with preview and recognized text.
3. Settings and storage.

== Changelog ==

= 1.0.0 =
* First release.

== Third-party libraries ==

DropDMS bundles the following libraries in `assets/vendor`. They are unmodified builds from the official packages; only source map references were removed and the pdf.js ES modules were renamed from `.mjs` to `.js`, so every web server delivers them with a JavaScript MIME type.

* **Tesseract.js 5.1.1** – Apache License 2.0 – https://github.com/naptha/tesseract.js (npm package `tesseract.js`, files `dist/tesseract.min.js`, `dist/worker.min.js`)
* **tesseract.js-core 5.1.1** (Tesseract OCR compiled to WebAssembly) – Apache License 2.0 – https://github.com/naptha/tesseract.js-core (files `tesseract-core-lstm.wasm.js`, `tesseract-core-simd-lstm.wasm.js`)
* **tessdata_fast 4.1.0** language data `deu` and `eng` – Apache License 2.0 – https://github.com/tesseract-ocr/tessdata_fast (files `deu.traineddata`, `eng.traineddata`). They are stored as JSON data files (`assets/vendor/tessdata/*.json`: the unmodified file, gzip-compressed and base64-encoded, with its SHA-256 checksum), because `.traineddata` files cannot be included in plugins on WordPress.org. Decoding the base64 string and unpacking it with gzip gives back the original file byte for byte.
* **pdf.js 4.10.38** – Apache License 2.0 – https://github.com/mozilla/pdf.js (npm package `pdfjs-dist`, files `build/pdf.min.mjs`, `build/pdf.worker.min.mjs`)

The full license texts are included next to the files. The human-readable source code is available at the repositories listed above.
