WP Document Revisions

plugin banner

A document management and version control plugin that allows teams of any size to collaboratively edit files and manage their workflow.

Author:Ben Balter (profile at wordpress.org)
WordPress version required:4.6
WordPress version tested:5.8.4
Plugin version:3.4.0
Added to WordPress repository:30-04-2011
Last updated:19-03-2024
Rating, %:74
Rated by:22
Plugin URI:http://ben.balter.com/2011/08/29/wp-document-...
Total downloads:136 487
Active installs:3 000+
plugin download
Click to start download

WP Document Revisions is a document management and version control plugin. Built for time-sensitive and mission-critical projects, teams can collaboratively edit files of any format — text documents, spreadsheets, images, sheet music… anything — all the while, seamlessly tracking the document’s progress as it moves through your organization’s existing workflow.

WP Document Revisions is three things

  1. A document management system (DMS), to track, store, and organize files of any format
  2. A collaboration tool to empower teams to collaboratively draft, edit, and refine documents
  3. A file hosting solution to publish and securely deliver files to a team, to clients, or to the public

See the full list of features for more information.

Documentation

See the full documentation

Learn

Get Involved

Features

Overview

Powerful Collaboration ToolsWith great power does not have to come great complexity. Based on a simple philosophy of putting powerful but intuitive tools in the hands of managers and content creators, WP Document Revisions leverages many of the essential WordPress features that, for more than eight years, have been tested and proven across countless industries — posts, attachments, revisions, taxonomies, authentication, and permalinks — to make collaborating on the creation and publication of documents a natural endeavor. Think of it as an open-source and more intuitive version of the popular Microsoft collaboration suite, Sharepoint.

Document History – At each step of the authoring process, WP Document Revisions gives you an instant snapshot of your team’s progress and the document’s history. It even gives you the option to revert back to a previous revision — so don’t fret if you make a mistake — or receive updates on changes to the document right in your favorite feed reader.

Access Control – Each document is given a persistent URL (e.g., yourcompany.com/documents/2011/08/TPS-Report.doc) which can be private (securely delivered only to members of your organization), password protected (available only to those you select such as clients or contractors), or public (published and hosted for the world to see). If you catch a typo and upload a new version, that URL will continue to point to the latest version, regardless of how many changes you make.

Enterprise Security – Worried about storing propriety or sensitive information? WP Document Revisions was built from the first line of code with government- and enterprise-grade security in mind. Each file is masked behind an anonymous 128-bit MD5 hash as soon as it touches the server, and requests for files are transparently routed through WordPress’s time-tested URL rewriting, authentication, and permission systems (which can even integrate with existing enterprise active directory or LDAP servers). Need more security? WP Document Revisions allows you to store documents in a folder above the htdocs or public_html web root, further ensuring that only those you authorize have access to your work.

Customization – WP Document Revisions recognizes that no two teams are identical, and as a result, molds to your firm’s needs, not the other way around. Need to track additional information associated with a document? Departments, editors, issues, sections, even arbitrary key-value pairs — whatever you can throw at it, it can handle. Development and customization costs are further minimized by its extensive plugin API, and the WordPress Custom Taxonomy Generator makes it easy for even the uninitiated to add custom taxonomies to documents. Need an audit trail to track check-ins and check-outs? User-level permissions based on the document’s state or another custom taxonomy? Support for third-party encryption? Check out the WP Document Revisions Code Cookbook for sample code. Looking for even more advanced control of your workflow? WP Document Revisions will detect the popular workflow plugin Edit Flow, if installed, and will automatically pull Edit Flow’s advanced workflow management tools into WP Document Revisions. Simply put, virtually every aspect of the plugin’s functionality from workflow states to user-level permissions can be fully customized to your team’s unique needs.

Future Proof – Switching costs a concern? WP Document Revisions is built with tomorrow’s uncertainty in mind. Equally at home in an in-house server room as it is in the cloud, moving individual files or entire document repositories in and out of WP Document Revisions is a breeze (history and all). And since the software is open-source, you can easily add tools to automate the process of moving to or integrating with future third-party systems.

Features

  • Support for any file type (docs, spreadsheets, images, PDFs — anything!)
  • Securely stores unlimited revisions of your business’s essential files
  • Provides a full file history in the form of a revision log, accessible via RSS
  • Helps you track and organize documents as they move through your organization’s existing workflow
  • Each file gets a permanent, authenticated URL that always points to the latest version
  • Each revision gets its own unique url (e.g.,TPS-Report-revision-3.doc) accessible only to those you deem
  • Files are intuitively checked out and locked to prevent revisions from colliding
  • Toggle documents between public, private, and password protected with a single mouse click
  • Runs in-house or in the cloud
  • Secure: filenames are hashed on upload and files are only accessible through WordPress’s proven authentication system
  • Can move document upload folder to location outside of web root to further ensure government- and enterprise-grade security
  • Documents and Revisions shortcodes, Recently Revised Documents widget
  • Multisite and Windows (XAMPP) support
  • French and Spanish language support (easily translated to your language)
  • Integration with Edit Flow
  • Recently Revised Documents Widget, shortcodes, and templating functions for front-end integration

Features Available via the [Code Cookbook](https://github.com/wp-document-revisions/wp-document-revisions-Code-Cookbook)

  • Audit Trail – creates check in / check out audit trail for all documents
  • Taxonomy-based Permissions – allows setting user-level permissions based on a custom taxonomy such as department
  • Third Party Encryption – example of how to integrate at rest encryption using third-party tools
  • Rename Documents – changes all references to “Documents” in the interface to any label of your choosing
  • State Change Notification – how to use document api to allow users to receive notification whenever documents change workflow state
  • Bulk Import – how to batch import a directory (or other list) of files as documents
  • Filetype Taxonomy – Adds support to filter by filetype
  • Track Changes – Auto-generates and appends revision summaries for changes to taxonomies, title, and visibility
  • Change Tracker – Auto-generates and appends revision summaries for changes to taxonomies, title, and visibility

Security Policy

To report a security vulnerability, please email ben@balter.com.

Where to get help or report an issue

  • For getting started and general documentation, please browse, and feel free to contribute to the project documentation.
  • For support questions (“How do I”, “I can’t seem to”, etc.) please search and if not already answered, open a thread in the Support Forums.
  • For technical issues (e.g., to submit a bug or feature request) please search and if not already filed, open an issue on GitHub.
  • For implementation, and all general questions (“Is it possible to..”, “Has anyone…”), please search, and if not already answered, post a topic to the general discussion list serve

Things to check before reporting an issue

  • Are you using the latest version of WordPress?
  • Are you using the latest version of the plugin?
  • Does the problem occur even when you deactivate all plugins and use the default theme?
  • Have you tried deactivating and reactivating the plugin?
  • Has your issue already been reported?

What to include in an issue

  • What steps can another user take to recreate the issue?
  • What is the expected outcome of that action?
  • What is the actual outcome of that action?
  • Are there any screenshots or screencasts that may be helpful to include?
  • Only include one bug per issue. If you have discovered two bugs, please file two issues.

WP-Documents-Revisions Action Hooks

This plugin makes use of many action hooks to tailor the delivered processing according to a site’s needs.

Most of them are named with a leading ‘document-‘ but there are a few additional non-standard ones.

Action change_document_workflow_state

Called when the post is saved and Workflow_State taxonomy value is changed. (Only post_ID and new value are available)

In: class-wp-document-revisions-admin.php

Action document_change_workflow_state

Called when the post is saved and Workflow_State taxonomy value is changed. (post_ID, new and old value are available)

In: class-wp-document-revisions-admin.php

Action document_edit

Called as part of the Workflow_State taxonomy when putting the metabox on the admin page

In: class-wp-document-revisions-admin.php

Action document_lock_notice

Called when putting the lock notice on the admin edit screen.

In: class-wp-document-revisions-admin.php

Action document_lock_override

Called after trying to over-ride the lock and possibly a notice has been sent.

In: class-wp-document-revisions.php

Action document_saved

Called when a document has been saved and all plugin processing done.

In: class-wp-document-revisions-admin.php

Action document_serve_done

Called just after serving the file to the user.

In: class-wp-document-revisions.php

Action serve_document

Called just before serving the file to the user.

In: class-wp-document-revisions.php

WP-Documents-Revisions Data Design and Data Structure

Requirements

  • To maintain a reference to a document and to hold a list of published versions of the documents.

    • It is not particularly concerned about how the document is created and the process to arrive at the state ready to upload.
    • It will maintain a status of where it is in the publishing process.
  • It makes use of a custom post type “document” and revisions to maintain the history of Document file uploads.

  • The Document file will be uploaded using the standard Media loader.

    • This will result in an Attachment post being created with the Document post as its parent.
    • It will not be visible in the Media library as Queries to the Media library remove attachments with parents that are documents.
    • Document files can be stored in a different host library.
  • The Document file should not be accessible directly by the user, but ideally via the WP interface.

    • This will be supported by changing the uploaded file name to be an MD5-hash of the original file name and load time.
    • This can be supplemented by changing .htaccess rules to stop direct access to files with MD5 format names
    • Standard WP processing may create a JPEG image of PDF uploads.
    • Since it will store these using the MD5 file name that will be downloaded to the user this would expose the MD5 file name. Therefore there is a process to change these images to use another name.
  • The document post record can also support Featured Images.

    • If loaded via the Edit document page, it would be considered as a Document file. So the parent post identifier will be removed to eliminate confusion between it being a Featured Image and a Document file being stored.
  • Since version 3.4 of the plugin, it is possible to enter a user-oriented description that can be displayed to users with the shortcodes or blocks provided with the plugin.

  • An audit trail of changes to published versions of the Document file.

    • The user can enter a reason for changing the Document including uploading a Document file; changing the Document Description; or Title; or any Taxonomy element.
    • This reason will be stored in the Excerpt field.
    • The aggregate information may be displayed as a Revision Log.
  • Use will be made of the standard WP Revisions functionality to contain the Audit Trail itself.

    • Standard WP processing creates a Revision if any one of these fields are changed: title, content or excerpt.
    • Since all Attachments are linked to the parent Document record, by storing the Attachment Id in the content field, then a Revision record will be created automatically.
  • This plugin is delivered with just one Taxonomy – Workflow_State. This shows the status of the Document file in its processing.

    • This is not considered very useful for user data classification.
    • However, being a generic tool, sites can use of a dedicated Taxonomy plugin.

Data Structure

The records held in the database will be:

  1. Document Record
  • post_content contains the id of the latest Document file attachment record.

    • When a Document file is loaded on editing this Document record, the post_content will be modified to contain the ID of the Attachment record created.
    • In plugin versions prior to 3.4, this would simply be the numeric ID.
    • Subsequent versions hold this in the form of an HTML comment “<!– WPDR nnn –>” where nnn is the ID of an attachment post. It can also contain a text Document description.
    • When editing the post, this field is decomposed into its two parts of ID and description with program management of the former and user management of the latter, recombined automatically when changes are made.
  • post_excerpt will contain any comment entered when the document record is updated.

  • As taxonomy records are held only against this Document record, there is no effective audit trail of changes to Taxonomy. Changes can be noted manually in the excerpt field

  1. Attachment Record(s)

There can be multiple Attachment records, one for each Document file loaded.

  • The name and title of the Attachment record is set to a MD5 hash of the original file name and the load time.

  • The Document file name is also set as this MD5 hash.

  • post_parent is set to the Document Record ID.

  • When a PDF Document file is loaded, then standard WP processing will attempt to make a JPEG image of the first page as a thumbnail (using all sizes). These will be held in the same directory as the Document file.

    • However if the file name is MD5Hash.pdf, then these images will be called MD5Hash-pdf.jpg.
    • If used on a page, this would expose the name of the file to the user.
    • To avoid this, there is a process to transform this name to another (essentially random) MD5 and rename these image files.
    • Once done, a postmeta record is created with these new file names (and a field denoting this process has been done).
  • If a Featured Image is loaded whilst editing the Document record, this would also have the same post_parent set, so in this case, the post_parent is set to 0 leaving the functional postmeta link to denote the presence of the featured image.

  1. Revision Record(s)

When saving a Document Record, standard WP processing will be invoked to detect a change in title, content or excerpt fields. If one is found then a Revision record is created.

There can be multiple Revision records held, one for each saving event where a change in these fields are detected.

Because the document content contains the latest Attachment ID, an upload of …


Screenshots
FAQ
ChangeLog