Description
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
- A document management system (DMS), to track, store, and organize files of any format
- A collaboration tool to empower teams to collaboratively draft, edit, and refine documents
- 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
Learn
- Features and Overview
- Screenshots
- Installation
- Frequently Asked Questions
- Links
- Where to get Support or Report an Issue
- Translations
- Plugin Actions
- Plugin Filters
- Plugin Shortcodes and Widget
- Useful Plugins and Tools
Get Involved
Features
Overview
Powerful Collaboration Tools – With 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
- Remove Workflow States – Completely removes Workflow state taxonomy backend and UI
- Change Tracker – Auto-generates and appends revision summaries for changes to taxonomies, title, and visibility
Security Policy
To report a security vulnerability, please email [email protected].
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_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 Filters
This plugin makes use of many filters 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 shown at the bottom.
Filter document_block_taxonomies
In: class-wp-document-revisions-front-end.php
Filters the Document taxonomies (allowing users to select the first three for the block widget.
Filter document_buffer_size
In: class-wp-document-revisions.php
Filter to define file writing buffer size (Default 0 = No buffering).
Filter document_caps
In: class-wp-document-revisions.php
Filters the default capabilities provided by the plugin.
Note that by default all custom roles will have the default Subscriber access.
Filter document_content_disposition_inline
In: class-wp-document-revisions.php
Sets the content disposition header to open the document (inline) or to save it (attachment).
Ordinarily set as inline but can be changed.
Filter document_custom_feed
In: class-wp-document-revisions.php
Sets to false to use the standard RSS feed.
Filter document_extension
In: class-wp-document-revisions.php
Allows the document file extension to be manipulated.
Filter document_help
In: class-wp-document-revisions-admin.php
Filters the (UNDEFINED) help text for current screen.
Filter document_help_array
In: class-wp-document-revisions-admin.php
Filters the default help text for current screen.
Filter document_internal_filename
In: class-wp-document-revisions.php
Filters the encoded file name for the attached document (on save).
Filter document_lock_check
In: class-wp-document-revisions.php
Filters the user locking the document file.
Filter document_lock_override_email
In: class-wp-document-revisions.php
Filters the lost lock document email text.
Filter document_output_sent_is_ok
In: class-wp-document-revisions.php
Filter to serve file even if output already written.
Filter document_path
In: class-wp-document-revisions.php
Filters the file name for WAMP settings (filter routine provided by plugin).
Filter document_permalink
In: class-wp-document-revisions.php
Filters the Document permalink.
Filter document_read_uses_read
In: class-wp-document-revisions.php
Filters the users capacities to require read (or read_document) capability.
Filter document_revision_query
In: class-wp-document-revisions.php
Filters the plugin query to fetch all the attachments of a parent post.
Filter document_revisions_cpt
In: class-wp-document-revisions.php
Filters the delivered document type definition prior to registering it.
Filter document_revisions_ct
In: class-wp-document-revisions.php
Filters the default structure and label values of the workflow_state taxonomy on declaration.
Filter document_revisions_limit
In: class-wp-document-revisions-admin.php
Filters the number of revisions to keep for documents.
Filter document_revisions_mimetype
In: class-wp-document-revisions.php
Filters the MIME type for a file before it is processed by WP Document Revisions.
Filter document_revisions_owners
In: class-wp-document-revisions-admin.php
Filters the author metabox query for document owners.
Filter document_revisions_serve_file_headers
In: class-wp-document-revisions.php
Filters the HTTP headers sent when a file is served through WP Document Revisions.
Filter document_revisions_use_edit_flow
In: class-wp-document-revisions.php
Filter to switch off integration with Edit_Flow/PublishPress statuses.
Filter document_rewrite_rules
In: class-wp-document-revisions.php
Filters the Document rewrite rules.
Filter document_serve
In: class-wp-document-revisions.php
Filters file name of document served. (Useful if file is encrypted at rest).
Filter document_serve_use_gzip
In: class-wp-document-revisions.php
Filter to determine if gzip should be used to serve file (subject to browser negotiation).
Filter document_shortcode_atts
In: class-wp-document-revisions-front-end.php
Filters the Document shortcode attributes.
Filter document_shortcode_show_edit
In: class-wp-document-revisions-front-end.php
Filters the controlling option to display an edit option against each document.
Filter document_slug
In: class-wp-document-revisions.php
Filters the document slug.
Filter document_taxonomy_term_count
In: class-wp-document-revisions.php
Filter to select which taxonomies with default term count to be modified to count all non-trashed posts.
Filter document_title
In: class-wp-document-revisions.php
Filter the document title from the post.
Filter document_to_private
In: class-wp-document-revisions-admin.php
Filters setting the new document status to private.
Filter document_use_workflow_states
In: class-wp-document-revisions.php
Filter to switch off use of standard Workflow States taxonomy. For internal use.
Filter document_verify_feed_key
In: class-wp-document-revisions.php
Allows the RSS feed to be switched off.
Filter default_workflow_states
In: class-wp-document-revisions.php
Filters the default workflow state values.
Filter lock_override_notice_subject
In: class-wp-document-revisions.php
Filters the locked document email subject text.
Filter lock_override_notice_message
In: class-wp-document-revisions.php
Filters the locked document email message text.
Filter send_document_override_notice
In: class-wp-document-revisions.php
Filters the option to send a locked document override email
Filter serve_document_auth
In: class-wp-document-revisions.php
Filters the decision to serve the document through WP Document Revisions.
Links
- Source Code (GitHub)
- Development version (Build Status)
- Code Cookbook
- Translations (GlotPres)
- Project Wiki
- Where to get Support or Report an Issue
- How to Contribute
WP-Documents-Revisions Shortcodes and Widget
These shortcodes and widget are available both in their historic form and as blocks.
Existing shortcodes can be converted to and from their block forms.
They are held in a grouping called WP Document Revisions
.
Documents Shortcode
In a post or page, simply type [documents]
to display a list of documents.
WP_Query parameters
The shortcode accepts most Standard WP_Query parameters which should allow you to fine tune the output. Parameters are passed in the form of, for example, [documents numberposts="5"]
.
Specifically, the shortcode accepts: author__in
, author__not_in
, author_name
, author
, cat
, category__and
, category__in
, category__not_in
, category_name
, date_query
, day
, has_password
, hour
, m
, meta_compare
, meta_key
, meta_query
, meta_value_num
, meta_value
, minute
, monthnum
, name
, numberposts
, order
, orderby
, p
, page_id
, pagename
, post__in
, post__not_in
, post_name__in
, post_parent__in
, post_parent__not_in
, post_parent
, post_password
, post_status
, s
, second
, tag__and
, tag__in
, tag__not_in
, tag_id
, tag_slug__and
, tag_slug__in
, tag
, tax_query
, title
, w
and year
.
If you’re using a custom taxonomy, you can add the taxonomy name as a parameter in your shortcode. For example, if your custom taxonomy is called “document_categories”, you can write insert a shortcode like this:
[documents document_categories="category-name" numberposts="6"]
(Where “category-name” is the taxonomy term’s slug)
Strictly it uses accepts the “query_var” parameter of the taxonomies used for documents. That is, if you have defined a taxonomy for your documents with slug “document_categories”. If you have not defined the query_var parameter then you use the slug. However if you have set query_var to “doc_cat”, say, then you can insert a shortcode as
[documents doc_cat="category-name" numberposts="5"]
Important parameters WP_Query will be the ordering and number of posts to display.
numberposts (with a number parameter) will give the maximum number of posts to display.
order (with value 'ASC' or 'DESC') gives the ordering,
orderby (with a string value) gives the field to order the documents. Common values are "title", "date", "name", "modified" and "ID".
Display parameters
It is also possible to add formatting parameters:
show_edit (with a true/false parameter) that can add a link next to each document shown in the list that the user is able to edit by them. This permits the user to edit the document directly from the list. A value set here will override the default behaviour.
As delivered, administrators will have the show_edit implicitly active. A filter document_shortcode_show_edit
can be used to set this for additional user roles.
new_tab (with a true/false parameter) that will open the document in a new browser tab rather than in the current one.
Both of these boolean variables can be entered without a value (with default value true).
Block Usage
When using the block version of the shortcode called Document List
, some compromises have been necessary.
Since queries are often selecting a single taxonomy value, the block provides the possibility to select single values from up to three taxonomies. Since there can be more than three taxomomies attached to documents, a filter document_block_taxonomies
allows the list of taxonomies to be edited to select the taxonomies to be displayed.
The parameters numberposts
, order
, orderby
, show_edit
and new_tab
are directly supported. However, since there are many other parameters are possible, as well as differet structures, additional parameters may be entered as a text field as held in the shortcode.
Document Revisions Shortcode
In a post or page, simply type [document_revisions id="100"]
where ID is the ID of the document for which you would like to list revisions.
You can find the ID in the URL of the edit document page.
To limit the number of revisions displayed, passed the “number” argument, e.g., to display the 5 most recent revisions [document_revisions id="100" number="5"]
.
Display parameters
It is also possible to add formatting parameters:
numberposts (with a number parameter) will give the maximum number of revisions to display.
summary (with a true/false parameter) that will add the excerpt for the revision to the output.
new_tab (with a true/false parameter) that will open the revision in a new browser tab rather than in the current one.
Both of these boolean variables can be entered without a value (with default value true ).
Block Usage
When using the block version of the shortcode called Document Revisions
, a change have been necessary.
number is a reserved word within javascript so `numberposts` is also supported even for the shortcode format. `numberposts` is used by the block.
Since the block is dynamically displayed as parameters are entered, if the post number entered is not a document, then an appropriate message will be entered.
Latest Documents Widget
Go to your theme’s widgets page (if your theme supports widgets), and drag the widget to a sidebar of you choice. Once in a sidebar, you will be presented with options to customize the widget’s functionality.
Block Usage
The block version of the widget called Document Widget
can be used on pages or posts. It cannot be converted to or from a shortcode block.
Translations
Interested in translating WP Document Revisions? You can do so via Crowdin, or by submitting a pull request.
- French – Hubert CAMPAN
- Spanish – IBIDEM GROUP, TradiArt, and elarequi
- Norwegian – Daniel Haugen
- German –Konstantin Obenland
- Chinese – Tim Ren
- Swedish – Daniel Kroon, Examinare AB, Sweden.
- Czech – Hynek Šťavík
- Italian – @guterboit
- Russian – Evgeny Vlasov
- Dutch – @tijscruysen
Useful plugins and tools
Permissions management
-
Members � Membership & User Role Editor Plugin
(Previously called Members)
Taxonomy management
Document workflow management
Screenshots
Blocks
This plugin provides 3 blocks.
- Latest Documents
- Documents List
- Document Revisions
Installation
Automatic Install
- Login to your WordPress site as an Administrator, or if you haven’t already, complete the famous WordPress Five Minute Install
- Navigate to Plugins->Add New from the menu on the left
- Search for WP Document Revisions
- Click “Install”
- Click “Activate Now”
Manual Install
- Download the plugin from the link in the top left corner
- Unzip the file, and upload the resulting “wp-document-revisions” folder to your “/wp-content/plugins directory” as “/wp-content/plugins/wp-document-revisions”
- Log into your WordPress install as an administrator, and navigate to the plugins screen from the left-hand menu
- Activate WP Document Revisions
FAQ
-
I’m a user/developer/administrator… can I contribute?
-
Of course. Please! WP Document Revisions is an open source project and is supported by the efforts of an entire community. We’d love for you to get involved. Whatever your level of skill or however much time you can give, your contribution is greatly appreciated. Check out the “How to Contribute” page for more information.
-
Does it work on Mac? PC? Mobile?
-
WP Document Revisions should work on just about any system with a browser. You can easily collaborate between, Mac, PC, and even Linux systems. Mobile browsers, such as iOS or Android should be able to download files, but may not be able to upload new versions in all cases.
-
What are the different levels of visibility?
-
Each document can have one of three “visibilities”:
- Private – visible only to logged in users (this can be further refined either based on users or based on the document’s status)
- Password Protected – Non-logged in users can view files, but they will require a document-specific password
- Public – Anyone with the document’s URL can download and view the file
-
How many people can access a document at a time?
-
A virtually unlimited number of people can view a document at the same time, but only one user can edit a document at a time.
-
While a file is “checked out” can others view it? What about a previous versions?
-
Yes.
-
Is there a time limit for checking out a file?
-
No. So long as the user remains on the document page (it’s okay if the window is minimized, etc.), the user will retain the file lock. By default, administrators can override this lock at any time. The origin lock-holder will receive a notification.
-
Does it keep track of each individual’s changes?
-
Yes and no. It will track who uploaded each version of the file, and will provide an opportunity to describe those changes. For more granular history, the plugin is designed to work with a format’s unique history features, such as tracked changes in Microsoft Word.
-
How do permissions work?
-
There are default permissions (based off the default post permissions), but they can be overridden either with third-party plugins such as the Members plugin, or for developers, via the
document_permissions
filter. -
What types of documents can my team collaborate on?
-
In short, any. By default, WordPress accepts most common file types, but this can easily by modified to accept just about any file type. In WordPress multisite, the allowed file types are set on the Network Admin page. In non-multisite installs, you can simply install a 3d party plugin to do the same. The only other limitation may be maximum file size, which can be modified in your php.ini file or directly in wp-config.php
-
Are the documents I upload secure?
-
WP Document Revisions was built from the ground up with security in mind. Each request for a file is run through WordPress’s time-tested and proven authentication system (the same system that prevents private or un-published posts from being viewed) and documents filenames are hashed upon upload, thus preventing them from being accessed directly. For additional security, you can move the document upload folder above the web root, (via settings->media->document upload folder). Because WP Document Revisions relies on a custom capability, user permissions can be further refined to prevent certain user roles from accessing certain documents.
-
Is there any additional documentation?
-
In the top right corner of the edit document screen (where you upload the document or make other changes) and on the document list (where you can search or sort documents), there is a small menu labeled “help”. Both should provide some contextual guidance. Additional information may be available on the WP Document Revisions page.
-
What happens if I lose internet connectivity while I have a file checked out?
-
WP Document Revisions will “ping” the server every minute to let it know that you have the file open. If for some reason you lose connectivity, the server will give you roughly a two minute grace period before it lifts the file lock. If it’s brief (e.g., WiFi disconnected), you should be fine, but if it’s for an extended period of time (e.g., a flight), you may find that someone else has checked the file out. You do not need to re-download the file (if no one else has modified it), simply remain on the document page to maintain the file lock.
-
Do you have any plans to implement a front end?
-
In short, “no”, because each site’s use would be radically different. Although, you can always link directly to the permalink of any public document, which will always point the latest revision and is available on the document edit screen (right click on the “download” link), or through the add-link wizard when editing a post or page (simply search for the document you want). The long answer, is “it’s really easy to adapt a front end to your needs.” There are more than 35 document-specific API hooks, and the plugin exposes two global functions,
get_documents()
andget_document_revisions()
, all of which are designed to allow plugin and theme developers to extend the plugins native functionality (details below). Looking for a slightly more out-of-the-box solution? One site I know of uses a combination of two plugins count shortcode, which can make a front end to browse documents, especially in coordination with a faceted search widget. -
No really, how do I present documents on the front end?
-
A chronological list of all documents a user has access to can be seen at yourdomain.com/documents/. Moreover, because documents are really posts, many built in WordPress features should work and public documents should act similar to posts on the front end (searching, archives, etc.). The plugin comes with a customizable recently revised documents widget, as well as two shortcodes to display documents and document revisions (details below).
-
Can WP Document Revisions work in my language?
-
Yes! So far WP Document Revisions has been translated to French and Spanish, and is designed to by fully internationalized. If you enjoy the plugin and are interested in contributing a translation (it’s super easy), please take a look at the Translating WordPress page and the plugin’s translations repository. If you do translate the plugin, please be sure to contact the plugin author so that it can be included in future releases for other to use.
-
Will in work with WordPress MultiSite
-
Yes! Each site can have its own document repository (with the ability to give users different permissions on each repository), or you can create one shared document repository across all sites.
-
Will it work over HTTPS (SSL)
-
Yes. Just follow the standard WordPress SSL instructions.
-
Can I tag my documents? What about categories or some other grouping?
-
Yes. You can use the Simple Taxonomy plugin to add taxonomies, or can share your existing taxonomies (e.g., the ones you use for posts) with documents.
-
Can I put my documents in folders?
-
WP Document Revisions doesn’t use the traditional folder metaphor to organize files. Instead, the same document can be described multiple ways, or in folder terms, be in multiple folders at once. This gives you more control over your documents and how they are organized. You can add a folder taxonomy with the Simple Taxonomy Refreshed. Just add the taxonomy with a post type of “Documents”, and as the “Hierarchical” set to True.
-
What if I want even more control over my workflow?
-
Take a look at the Edit Flow Plugin which allows you to set up notifications based on roles, in-line comments, assign all sorts of metadata to posts, create a team calendar, budget, etc. WP Document Revisions will detect if Edit Flow is installed and activated, and will adapt accordingly (removing the workflow-state dialogs, registering documents with Edit Flow, etc.). If you’re looking for even more control over your team’s work flow, using the two plugins in conjunction is the way to go.
Equally the PublishPress Plugin, a fork of Edit Flow, is detected and can be used with WP Document Revisions in exactly the same manner as Edit Flow.
-
I want some small changes to the processing, but there are few configuration options. How do I do this?
-
Yes, there are few Settings. However there are many filters that allows processing to be configured to your requirement. These are described here. This will need some coding to be done.
-
Can I make it so that users can only access documents assigned to them (or documents that they create)?
-
Yes. Each document has an “owner” which can be changed from a dialog on the edit-document screen at the time you create it, or later in the process (by default, the document owner is the person that creates it). If the document is marked as private, only users with the read_private_documents capability can access it. Out of the box, this is set to Authors and below, but you can customize things via the Members plugin (head over to roles after installing).
-
How do I use the documents shortcode?
-
In a post or page, simply type
[documents]
to display a list of documents.
More information is on this page. -
How do I use the document revisions shortcode?
-
In a post or page, simply type
[document_revisions id="100"]
where ID is the ID of the document for which you would like to list revisions.
More information is on this page. -
How do I use the recently revised documents widget?
-
Go to your theme’s widgets page (if your theme supports widgets), and drag the widget to a sidebar of you choice. Once in a sidebar, you will be presented with options to customize the widget’s functionality.
-
How do I use the `get_documents` function in my theme or plugin?
-
Simply call
get_documents()
. Get documents accepts an array of Standard WP_Query parameters as an argument. Use it as you would get_posts. It returns an array of document objects. Thepost_content
of each document object is the attachment ID of the revision.get_permalink()
with that document’s ID will also get the proper document permalink (e.g., to link to the document). -
How do I use the `get_document_revisions` function in my theme or plugin?
-
Simply call
get_document_revisions( 100 )
where 100 represents the ID of the document you’d like to query. The function returns an array of revisions objects. Each revisions’spost_content
represents the ID of that revisions attachment object.get_permalink()
should work with that revision’s ID to get the revision permalink (e.g., to link to the revision directly). -
Can I set the upload directory on multisite installs if I don’t want to network activate the plugin?
-
Yes. There’s a plugin in the WP Document Revisions Code Cookbook to help with that. Just install and network activate.
-
Can I limit access to documents based on workflow state, department, or some other custom taxonomy?
-
Yes. Download (and optionally customize) the taxonomy permissions plugin from the Code Cookbook. Out of the box, it will register a “departments” taxonomy (which can be easily changed at the top of the file, if you want to limit access by a different taxonomy), and will create additional permissions based on that taxonomy’s terms using WordPress’s built-in capabilities system. So for example, instead simply looking at
edit_document
to determine permissions, it will also look atedit_document_in_marketing
, for example. You can create additional roles and assign capabilities using a plugin like Members. -
Is it possible to do a bulk import of existing documents / files already on the server?
-
Yes. It will need to be slightly customized to meet your needs, but take a look at the Bulk Import Script in the code cookbook.
Reviews
Contributors & Developers
“WP Document Revisions” is open source software. The following people have contributed to this plugin.
Contributors“WP Document Revisions” has been translated into 1 locale. Thank you to the translators for their contributions.
Translate “WP Document Revisions” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
3.3.1
- FIX: Content-Length header suppressed for HTTP/2 File Serve. (#254)
- FIX: MOD_DEFLATE modifies etag, so no caching occurred in this case.
- FIX: Gzip process invoked for encodings gzip, x-gzip and deflate.
3.3.0
- SECURITY: Password-protected document can leak existence (by showing next/previous)
- SECURITY: Queries on post_status do not do proper permissions check
- SECURITY: Suppress excerpt output in feeds to stop information leakage
- SECURITY: WP creates images when saving PDF documents (using the encoded name). These were being left when deleting the document.
- NEW: Rewrite rules extended to access documents without year/month and/or file extension. (#253) @NeilWJames
- NEW: Use standard WP process for Taxonomy workflow_state on Document Admin List. Note that it will change the column order seen as taxonomiees are on the end.
- NEW: Implement Gutenberg Blocks for Shortcodes and Widget.
- NEW: Integrate with either Edit-flow or PublishPress plugins
- NEW: Taxonomy workflow_state is set as show_in_rest.
- NEW: Add action ‘document_serve_done’ which can be use to delete decrypted files (needed for encrypted at rest files)
- NEW: Add filter ‘document_buffer_size’ to define file writing buffer size (Default 0 = No buffering).
- NEW: Add filter ‘document_output_sent_is_ok’ to serve file even if output already written.
- NEW: Add filter ‘document_read_uses_read’ to use read_document capability (and not read) to read documents
- NEW: Add filter ‘document_serve_use_gzip’ to determine if gzip should be used to serve file (subject to browser negotiation).
- NEW: Add filter ‘document_serve’ to filter the file to be served (needed for encrypted at rest files)
- NEW: New Crowdin updates (#244, #245)
- FIX: Access to revisions when permalink structure not defined.
- FIX: Design conflict with Elementor (#230) @NeilWJames
- FIX: Document directory incorrect test for Absolute/Relative entry on Windows implementations
- FIX: Document Taxonomies using default term counts will use same method as WORKFLOW_STATE, i.e. count all not-trashed documents
- FIX: Ensure the action point to detect change in workflow_state worked (for CookBook functionality).
- FIX: Fix error in time difference display when client and server are in different time zones
- FIX: Fix WP 5.7 Breaking change (#38843) for Term Counts. (#250) @NeilWJames
- FIX: Remove existing workaround for WP bug 16215 and long time fixed – and made information incorrect
- FIX: Remove restore option on the current document and latest revision as it makes no sense.
- FIX: Review document serving process to try to identify where other plugins could output text and corrupt file download
- FIX: Review documentation. (#208) @NeilWJames
- FIX: Review of Rewrite rules with/without trailing slash; also extend file extension length
- FIX: Testing of blocks showed that if document taxonomies are changed, then existing blocks may not work. Some changes are now handled. (#217) @NeilWJames
- FIX: Fixing compatibility issue with double slash in Documents URL when using WPML (#218) @BobbyKarabinakis
- DEV: Update code to WP Coding Standards 2.2.1 (and fix new sniff errors)
- DEV: Update coveralls to 2.2, dealerdirect/codesniffer to 0.6, phpunit/phpunit to 8.5 and wp/cli to 2.4.1
- DEV: Rewrite Test library to increase code coverage.
- DEV: Use GitHub Actions for CI (#251)
- DEV: Fixed wp_die() tests ending tests prematurely (#252)
3.2.4
- Address technical debt for WP Document Standards (#192) @NeilWJames
- On plugin activation, check that the user has edit_documents capability. If not, a warning message will be output that the menu may be incorrect. (#180) @NeilWJames
- PHPCS review (#179) @NeilWJames
- Bump phpunit/phpunit from 8.2.5 to 8.3.4 (#177) @dependabot-preview
- Addresses phpunit and toolset versions and prepare for future release (#174) @NeilWJames
- Version 3.2.2 gives an “property of non-object” at line 1403 on load (#161) @NeilWJames
3.2.3
- Full phpcs 2.2 standardisation, complete filter documentation (#192) @NeilWJames
- On plugin activation, admin warning if user doesn’t have edit_documents capability (#180) @NeilWJames
- PHPCS Review (no functional changes) (#179) @NeilWJames
- Review for WP Coding standard 2.1.1 and newer phpunit (#174) @NeilWJames
- Bump version to V3.2.3 and Tested WP 5.2.2 (#174) @NeilWJames
3.2.2
- Version 3.2.2 gives an “property of non-object” at line 1403 on load (#161) @NeilWJames
- Add default capabilities only when they are absent. (#146) @NeilWJames
- Fix multi-network (needs WP 4.6) (#143) @geminorum
- Allow Sites to use WP_POST_REVISIONS for other post types (#140)
- Media Library URL’s change after plugin update (#139) @NeilWJames
- New crowdin translations (#137/#138) @benbalter
3.2.1
- Fix for $wp_query->query_vars being null (#136) @benbalter
- Media Library URL’s change after plugin update (#139) @NeilWJames
- New Crowdin translations (#137) @benbalter
- New Crowdin translations (#138) @benbalter
3.2.0
- Enable filter by workflow_state on Admin screen (#121) @NeilWJames
- missing translate on metabox titles (#122) @geminorum
- Addresses #124 (is_feed has doing_it_wrong error) (#125) @NeilWJames
- New Crowdin translations (#120) @benbalter
- Allow HTTP headers to be filtered in serve_file() (#123) @jeremyfelt
- Small fixes in Admin function (#126) @NeilWJames
- Support Featured Images (#131) @NeilWJames
- Error if directory option not present (#132) @NeilWJames
- Create Edit link on document shortcode (#133) @NeilWJames
- Bump version to V3.2 and Tested WP 4.9.8 (#134) @NeilWJames
3.1.2
Fix for 404 error when serving documents from non-standard upload directory.
3.1.1
Updated documentation.
3.1.0
- NEW: Added dashboard widget (#109, props @NeilWJames)
- NEW: Added Finish translation (Props @xcoded)
- NEW: Added Spanish translation (Props @alejnavarro)
- NEW: Added Indonesian translation (Props @barzah and @fajarsdq)
- NEW: Provide a way to filter or skip mime type detection (#106, props @jeremyfelt)
- FIX: Do not escape end list widget HTML in function widget (#99, props @NeilWJames)
- FIX: Only cache revisions output if revisions exist (#101, props @jeremyfelt)
- FIX: Update WPCS and adjust code to meet new standards (#104, props @jeremyfelt)
- FIX: Fix possible data pollution in archive views (#103, props @jeremyfelt)
- FIX: Account for
the_title
filter used with only one arg (#105, props @jeremyfelt) - FIX: Don’t verify posts that don’t exist (#107, props @jeremyfelt)
- FIX: Fixed issue with translation files not properly loading (#108, props @NeilWJames)
- FIX: Better multisite support (#113, props @JonasBrand)
- DEV: You can now contribute to the project’s translation’s via Crowdin: https://crowdin.com/project/wordpress-document-revisions
- DEV: Added Contributor Code of Conduct
- DEV: Updated contributing documentation
3.0.1
- Fix for calling the wrong escaping function in the widget code.
3.0.0
- Dropped support for WordPress prior to version 3.3
- Dropped WebDav support
- Implemented WordPress coding standards
- Added additional nonces
- Added additional translation strings and comments
- Updated documentation
2.2.0
- Add filter to allow opt-out of WebDAV Edit Document
- Filter documents from the grid view in Media, queried via Ajax
- Added code to preserve file exts on revision links, and
- Verify a post ID has been passed before verifying post type
- Use H2 for “Feed Privacy” heading
2.0.0
- Note: The project is looking for additional contributors. Please consider contributing your time: https://github.com/wp-document-revisions/wp-document-revisions/blob/master/docs/how-to-contribute.md
- Added (beta) WebDAV support thanks to @linuxBozo and @poorgeek (https://github.com/wp-document-revisions/wp-document-revisions/pull/69)
- Added Brazilian Portuguese translation thanks to @rafaelfunchal
- Significantly improved automated testing via WP-CLI
- Better guarding against binary files being corrupted by other plugins
- Improved documentation (https://github.com/wp-document-revisions/wp-document-revisions/tree/master/docs)
1.3.6
- Fix for workflow state not properly saving under certain circumstances
- Added Italian translation, props @guterboit
- Added Russian translation, props Evgeny Vlasov
- Updated all translations
- Workflow state saving improvements, props @cojennin (#48)
- Fix restore revision link bug, props @cojennin (#55)
- Welcome @cojennin to the core team. Want to join?
1.3.5
- Added Dutch translation, props @tijscruysen.
- To prevent potential errors, verify
workflow_state
is set before checking for change, props @rachelbaker. - Added
document_custom_feed
anddocument_verify_feed_key
filters to customize feed behavior, props @nodakjones. - Prevent errors when newly added documents do not have attached files, props @rachelbaker.
- Better compatibility with WordPress 3.5 media uploader
- Significant Javascript improvements to prevent conflicts with other plugins
1.3.4
- Testing framework no longer distributed with the plugin.
- Added Swedish translation, special thanks to Daniel Kroon, Examinare AB, Sweden.
- Added Czech translation set, special thanks to Hynek Šťavík.
1.3.3
- Fix for fatal error (undefined function) when Edit Flow custom post status were enabled, props Leho Kraav, fixes #24
- Fix for testing framework not being properly included in plugin repository due to bad deploy script
- Added German translation (de_DE), special thanks to Konstantin Obenland
- Added Chinese translation (zh_CN), special thanks to Tim Ren
- Updated Spanish, French, and Norwegian translations
1.3.2
- Plugin documentation now maintained in collaboratively edited wiki. Feel free to contribute!
- Created listserv to provide a discussion forum for users of and contributors, as well as general annoucements. Feel free to join!
- Added Norwegian translation, special thanks to Daniel Haugen
- Crisper menu icon, special thanks to Phil Russell
- Pushpin icon replaced with Retina document icon on document list and document edit screen, special thanks to Marvin Rühe
- Unit tests now utilizes newer wordpress-tests framework, as recently adopted by core
serve_file
now hooks intotemplate_include
filter (rather thantemplate_single
) to prevent potential conflict with themes/plugins hooking into subsequent filters and producing extranous output after the document is served which would result in corrupting some files- Fix for
document_to_private
filter not properly passing the pre-filtered document object, props Marvin Rühe. - Better loading of administrative functions
- Better toggling of Workflow state support for integration with Edit Flow and other plugins
- Administrative CSS now stored in a separate file (rather than being injected directly to document head), and loads via
enqueue_style
API - Administrative CSS and Javascript files now versioned based on plugin version to allow for better caching
1.3.1
- Better permalink support for draft and pending documents
- Whenever possible browser will attempt to display documents in browser, rather than prompting with save as dialog (e.g., PDFs)
- Fix for function
get_file_type()
breaking the global$post
variable when no document argument is supplied - Improved Spanish translation with additional strings (special thanks, elarequi)
1.3
- Plugin now includes unit tests to ensure security and stability, and undergoes extensive testing (WordPress 3.2/3.3/Trunk, Multisite/single, PHP 5.3/5.4) via continuous integration service Travis CI prior to release.
- Translations now curated on collaborative editing platform GlotPress if any user would like to submit a translation (no technical knowledge necessary)
- If you would like to help out by testing early releases, please try the continuously updated development version. Any feedback, technical or prose is helpful.
- Added Spanish Translation Support (es_ES — special thanks to TradiArt)
- Document URL slug (used for archive and prefixing all documents) now customizable via settings page and translatable. (e.g., http://domain.com/documentos/2012/04/test.txt rather than /documents/)
- Subscribers and unauthenticated users no longer have the ability to read revisions by default (you can override this setting using the Members plugin.
- Attempts to access unauthorized files now properly respond with HTTP code 403 (rather than 500 previously). Note: attempting to access private documents will continue to result in 404s.
- Enhanced authentication prior to serving files now provides developers more granular control of permissions via
serve_document_auth
filter. - Better Edit Flow support (can now toggle document support on and off using native Edit Flow user interface). Note: You may need to manually toggle on custom status support for documents after upgrading.
- Default document upload directory now honors WordPress-wide defaults and features enhanced multisite support
- Ability to separate documents on server by site subfolder on multisite installs
1.2.4
- Better support for custom document upload directories on multisite installs
- Gallery, URL, and Media Library links now hidden from media upload popup when uploading revisions
- Fix for plugin breaking media gallery when filtered by mimetype (MySQL ambiguity error)
- Fix for upload new version button appearing for locked out users in WordPress 3.3
- Fix for upload new version button not appearing after document lock override on WordPress 3.3
1.2.3
- Owner metabox no longer displays if user does not have the ability to
edit_others_documents
- Fix for serving documents via SSL to Internet Explorer version 8 and earlier
- GPL License now distributed with plugin
- Code cleanup, minor bug fixes, and additional inline documentation
1.2.2
- Plugin posted to Github if developers would like to fork and contribute
- Documents shortcode now accepts additional parameters. See the FAQ for a full list.
- Performance and scalability improvements to backend; files attached to documents are now excluded from media lists by join statements rather than subqueries
- If plugin is unable to locate requested file on server, standard theme’s 404 template is served (rather than serving “404 — file not found” via
wp_die()
previously) and E_USER_NOTICE level error is thrown. Diagnostic information will be available via debug bar (if WP_DEBUG is enabled) or in the standard PHP error log /documents/
now supports pagination- Support for linking to revisions with ugly permalinks
- Custom post type’s
has_archive
property changed totrue
to help with theme compatibility - Fix for fatal error when user without
read_document_revisions
capability calledwp_get_attachment_url()
on file attached to a revision - Fix for broken permalink returned when get_permalink is called multiple times on the same document revision
- Fix for wp_get_attachment_image_src returning broken URLs or the direct path to the document
- Fix for “
Call-time pass-by-reference has been deprecated
” error when running certain versions of PHP - General code cleanup
1.2.1
- French translation (Special thanks to Hubert CAMPAN)
- Enhanced support for running on WAMP systems (XAMPP, etc.)
- Improved integration with WordPress 3.3’s new upload handler
- Significant performance improvements to
verify_post_type()
method - Document requests no longer canonically 301 redirect with a trailing slash
- Fix for wp_get_attachment_url returning the attachment URL, rather than the document permalink when called directly
- Menu item now reads “All Documents” (rather than simply “Documents”) for clarity
- Fix for E_WARNING level error on edit-tags.php with custom taxonomies
- Taxonomy counts (e.g., workflow states) now reflects non-published documents
- Better translation support (see the FAQ if you are interested in translating the plugin into your language)
- Compatibility fix for WordPress SEO’s “Clean Permalinks” mode
1.2
- Added shortcode to display list of documents meeting specified criteria
- Added shortcode to display a document’s revisions (formerly in code cookbook)
- Added widget to display recently revised documents (formerly in code cookbook)
- Created new global
get_documents()
andget_document_revisions()
functions to help build and customize themes and plugins - Added filter to
wp_get_attachment_url
to force document/revision urls when attachments are queried directly - Better organization of plugin files within plugin folder
- Fixed bug where revision summary would not display under certain circumstances
1.1
- Added support for the Edit Flow Plugin if installed
- Added “Currently Editing” column to documents list to display document’s lock holder, if any
- Added support for new help tabs in WordPress versions 3.3 and greater
- Fixed bug where media library would trigger an SQL error when no documents had been uploaded
- Fixed bug where owner dropdown on edit screen would only list “author” level users
- “- Latest Revision” only appended to titles on feeds
1.0.5
- Fixed bug where password-protected documents would not prompt for password under certain circumstances
1.0.4
- Significant performance improvements (now relies on wp_cache)
- Feed improvements (performance improvements, more consistent handling of authors and timestamps)
- Workflow States in documents list are now link to a list of all documents in that workflow state
- Changed “Author” column heading to “Owner” in documents list to prevent confusion
- If a revision’s attachment ID is unknown, the plugin now defaults to the latest attached file, rather than serving a 404
1.0.3
- A list of all documents a user (or visitor) has permission to view is now available at yourdomain.com/documents/
- Changed functions get_latest_version and get_latest_version_url to “revision” instead of “version” for consistency
- Forces get_latest_revision to rely on get_revisions to fix inconsistencies in WP revision author bug
- Support for ugly permalink structures
- Changing metabox options does not enable the publish button on non-document pages
- Changing the title or other text fields enables the update button
- Fix for authors not having capability to edit documents by default
- No longer displays attachment ID when posts are queried via the frontend
1.0.2
- Fixed bug where RSS feeds would erroneously deny access to authorized users in multisite installs
1.0.1
- Better handling of uploads in WordPress versions 3.3 and above
- Added shadow to document menu icon (thanks to Ryan Imel of WPCandy.com)
- Fixed E_WARNING level error for undefined index on workflow_state_nonce when saving posts with WP_DEBUG on
- Corrected typos in contextual help dropdown
- Fixed permission issue where published documents were not accessible to non-logged in users
- Fixed last-modified author not displaying the proper author on document-edit screen
1.0
- Stable Release
0.6
- Release Candidate 1
- Revision Log
0.5
- Initial beta
0.1
- Proof of concept prototype