WP Document Revisions

Changelog

Numbers in brackets show the issue number in https://github.com/wp-document-revisions/wp-document-revisions/issues/

5.0.0

Adds native text extraction and AI-generated revision summaries for document libraries. The full design and the twelve PRs that implemented it are tracked in #514; a smaller set of deferred follow-ups is in #531.

Breaking changes: raises the minimum PHP from 7.4 to 8.0 and the minimum WordPress from 5.0 to 5.9 to match what CI actually exercises. Sites on older PHP or WP will no longer see updates to this plugin until they upgrade their runtime. The composer floor was already at PHP 7.4, so install on PHP < 7.4 was already failing; this commit bumps the same constraint to 8.0 and brings the readme.txt declaration in line with what the test matrix verifies. WordPress 5.0–5.8 were never in CI’s matrix; that floor’s bump is similarly a “claim what we test” cleanup. PHP 7.4 has been EOL since November 2022 and WP 5.0 is from December 2018, so the practical population affected is small.

# Features

  • #514: Native text extraction from PDF (via smalot/pdfparser), DOCX, and ODT (via phpoffice/phpword). Extraction runs out-of-band via wp-cron after a revision is uploaded; results are SHA-256-keyed against the file’s contents and stored as post meta on the attachment so re-extracting unchanged content is a no-op. New wpdr_text_extractors filter lets a site register custom extractors for additional formats (see the cookbook recipe).
  • #514: AI-generated revision summaries via the WordPress 7.0 AI Client. After extraction completes, a second cron event computes a unified diff between the new revision’s text and the prior revision’s, sends it to the AI Client with a filterable prompt, and stores the 1–3-sentence summary as post meta on the attachment. Falls back gracefully to summarising the new document directly when the diff is too large or the prior revision has no extractable text. Skips silently when the AI Client is unavailable (older WordPress) or WP_AI_SUPPORT is false.
  • #514: Admin-editor JS pre-fills the AI summary into the revision log textarea on the document edit screen, with a dismiss link. Never clobbers user-typed content. Per-document opt-out (“Do not pre-fill the revision log with AI suggestions”) in a new “Text Extraction & AI” sidebar meta box; sitewide opt-out via the WPDR_AI_SUMMARY_PREFILL constant.
  • #514: Per-document and sitewide opt-outs for text extraction itself (“Skip text extraction for this document” checkbox, WPDR_TEXT_EXTRACTION constant). Flipping the per-document opt-out on clears every cache-managed meta key on the document’s revision attachments and unschedules pending cron events.
  • #514: WP-CLI document-revisions extract-text command for backfilling the extraction cache across an existing library. Selectors: –all, –missing (excludes failure-list entries to prevent infinite retry on malformed files), –id=<id>. Modifiers: –extractor=<class> to target reprocessing by tool identity, –force to bypass cache + failure list, –dry-run.
  • #514: Read + review REST endpoints under wpdr/v1. GET /documents/<doc>/revisions/<rev>/summary returns the cached summary with a status envelope (pending / ready / unavailable); read_document capability. POST …/summary/review marks a summary as human-reviewed; edit_document capability. Capability mapping by @NeilWJames.
  • #514: New action wpdr_text_extracted fires after extracted text is cached, so third-party search-indexing or embedding consumers can hook without monkey-patching the cache class.
  • Adds a Text Extraction & AI Summaries cookbook recipe covering custom extractors, prompt customization, the four opt-out switches, the WP-CLI backfill, alternative AI providers, and the REST surface.

4.0.7

# Bug Fixes

  • Fix #494: restore attachment ID in post_content when classic-editor upload save fails. Two root causes addressed: wp_kses_post stripping the <!– WPDR N –> HTML comment for users without unfiltered_html (fixed via restore_document_attachment_id on wp_insert_post_data), and JS upload callback not firing leaving post_content empty (fixed via save_document fallback to get_latest_attachment()).
  • Fix PHP TypeError in filter_from_media_grid(): the ajax_query_attachments_args filter passes an array, not a WP_Query object, so the incorrect type hint caused a fatal error that prevented media library items from loading in the block editor.
  • Add WP Plugin Check compliance: phpcs ignore directives for non-prefixed hook names and other plugin-check messages.
  • Remove 252 PHPStan baseline suppressions by resolving the underlying type errors.
  • Update filter/action documentation to reflect file-splitting of trait files.
  • Exclude build artifacts from distributed plugin package via .distignore.
  • Add npm ci && npm run build step to deploy workflow so compiled block JS is included in the WordPress.org distribution.
  • Exclude src/ (uncompiled JSX source) from the WordPress.org distribution via .distignore.

4.0.6

For complete changelog, see GitHub

Plugin Website
Visit website

Author
Ben Balter
Version:
5.0.0
Last Updated
May 24, 2026
Active Installs
2000
Requires
WordPress 5.9
Tested Up To
WordPress 7.0
Requires PHP
8.0

Share Post

Join our newsletter.

Get insights into what’s happening at ChangelogWP right in your inbox. We don’t believe in spam.