Skip to content

Commit f233877

Browse files
authored
Merge pull request #16 from NeilWJames/master
Create initial version of PublishPress Revisions Integration
2 parents 82b2e6f + ec7fbd2 commit f233877

7 files changed

Lines changed: 1123 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
TRAVIS_BUILD_DIR: ${{ github.workspace }}
1616
strategy:
1717
matrix:
18-
php_version: [8.1]
18+
php_version: [8.2]
1919
steps:
20-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@v6
2121

2222
- name: Setup PHP
2323
uses: shivammathur/setup-php@v2

composer.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@
1111
"require": {
1212
},
1313
"require-dev": {
14-
"phpcsstandards/phpcsutils": "^1.0",
15-
"phpcsstandards/phpcsextra": "^1.2.0",
16-
"squizlabs/php_codesniffer": "^3.11.1",
17-
"wp-coding-standards/wpcs": "~3.1",
14+
"phpcsstandards/phpcsutils": "^1.2",
15+
"phpcsstandards/phpcsextra": "^1.5",
16+
"wp-coding-standards/wpcs": "~3.3",
1817
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
1918
"yoast/phpunit-polyfills": "*",
2019
"phpcompatibility/php-compatibility": "*",

phpcs.ruleset.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<properties>
1414
<property name="text_domain" type="array">
1515
<element value="wp-document-revisions"/>
16+
<element value="wpdr-revisionary"/>
1617
</property>
1718
</properties>
1819
</rule>
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Integration Processing
2+
3+
The primary objective is to allow PublishPress Revisions to operate using its normal processing from the time it creates a revision, but at the time that a revision is reintegrated into the original document then it is done so using rules appropriate to WP Document Revisions processing.
4+
5+
This has several implications identified below.
6+
7+
## Structure of a WP Document Revisions Document
8+
9+
A WP Document Revisions document consists of:
10+
- A custom post of type Document. Its post content contains text linking to the Attachment post and may contain a description of the document.
11+
- An Attachment post linking to the actual document file and has the Document post as its parent.
12+
13+
If a new version of the file is uploaded then this will provoke a new Attachment post to be created together with a Revision post.
14+
15+
Over time, the Document post can be the parent to a number of Attachment and Revision records.
16+
17+
## Terminology
18+
19+
The plugin WP Document Revisions will be referred to as WPDR.
20+
21+
The plugin PublishPress Revisions will be referred to as PPR.
22+
23+
Use of the terms here can be somewhat confusing, So these terms will be used:
24+
25+
| Term | What it is |
26+
|---------------| ------------------------------------------------------|
27+
| WPDR Document | A post created using WP Document Revisions |
28+
| | This can have a number of revision posts. |
29+
| PPR Document | When a New Revision is created from a WPDR Document |
30+
| | it is created as another WPDR Document (see below) |
31+
| | When integrated it will become a revision of the |
32+
| | WPDR Document. Prior to that it can have revisions. |
33+
34+
## Creation of a PublishPress Revision
35+
36+
PublishPress Revisions puts a button on the Document Edit screen that will create a Revision.
37+
38+
When a Revision is created, it is not a revision in the sense of a WordPress revision post, but it is a new Document post. It is differentiated from a standard Document in that it has some specific metadata. The post content contains the text linking to the Attachment post, but, of course, the attachment's parent is the original Document.
39+
40+
This would appear as an Invalid document in WP Document Revisions validation processing. Measures are taken to exclude it from this list.
41+
42+
PublishPress Revisions permits multiple Revisions of a post to be present at the same time. This is managed by a user setting (under New Revisions) that can restrict its functionality to one active revision per post.
43+
44+
This can be very confusing with revision being held for the published document and also with PPR documents. Thus the integration plugin will override its value for Documents to allow only one active PPR Document for a WPDR Document.
45+
46+
## Subsequent Update to the PPR Document prior to integration
47+
48+
Updates can be made using a variation of the Document management screens. New versions of the document file may be loaded as Attachments and will have the PPR Document as their parent and also have revision posts created for it as per normal WPDR processing.
49+
50+
PublishPress Revisions permits the revision history of the revision process to be retained on integration. Since the revision history is part of the public record it would be confusing if a number of revisions would suddenly appear in the list some of which were never available publicly (but representing the editing process). Thus this integration plugin will delete any PPR Document revisions found and integrate only the PPR Document and the Attachment record associated with it.
51+
52+
Since any PPR Document revisions will be deleted, measures are taken to reduce their creation. Normally a revision is created if there is a change to the title, content or excerpt fields. For a PPR Document, only a change to the content field will cause a revision to be created. The excerpt field should be used to maintain an audit history of changes made to the Document.
53+
54+
## Update to the WPDR Document
55+
56+
Updates can be made to the WPDR Document whilst a PPR Document exists, i.e. prior to its integration. A warning notice is shown on the edit screen when there is one.
57+
58+
## Integration of the PPR Document
59+
60+
This can occur in two circumstances:
61+
1. The PPR Document is approved online. It may have been Submitted previously.
62+
2. The PPR Document is approved online and given a scheduled date; and time passes.
63+
64+
The PublishPress Revisions publish process is the triggered using its process to integrate the PPR Document into the WPDR Document by converting the PPR Document as a revision of the WPDR Document.
65+
66+
## Navigation
67+
68+
The standard process is to display the PPR Document text after submission or approval.
69+
70+
However, this leaves the user with the only option to go back to the edit screen. This is now a revision (or may have been moved) and is not valid to be edited.
71+
72+
So the user will be sent to either the edit page of the WPDR Document or to the PP New Revisions page.
73+

0 commit comments

Comments
 (0)