Add Public Post Preview compatibility shim to RSA#345
Conversation
|
This PR is a draft because, while the shim has been tested on live sites, I have not tested this specific PR's code in any environment. There's a PHPCS fail, and tests and docs are needed before this is ready for merge. However, this PR should be sufficient to determine whether this PR or ocean90/public-post-preview#184 is preferred. |
|
Bumping this to @10up/open-source-practice for input on preferred approach |
Looking at the code here, seems we're copying a lot of functionality from Public Post Preview so I think the ideal outcome here is getting a fix within that plugin instead of here. That said, we obviously have more control of RSA so if we think we have a better chance of getting this fix here, we can proceed with this. |
My initial reaction here is restricted to only those who have access via RSA, to default towards the more secure/restricted approach. |
This is my strong inclination too. @benlk Do you have bandwidth to repurpose this PR to provide documentation as to how to add a filter to allow ppp links through and add any hooks to the existing code base that are required to achieve this? |
|
@peterwilsoncc I don't have bandwidth to add more than a short comment pointing at this PR, or at a gist version of the shim, describing them as reference implementations.
The @jeffpaul regarding
That approach is already satisfied by the combination of RSA and PPP, without this shim. Without this shim, PPP parses requests after RSA checks whether the user can view the whole site. People who can't pass RSA don't see the PPP link. This shim moves parsing of requests for PPP-validity to before RSA checks the request, and bypasses RSA for PPP-validated requests. |
I remain of the view that this is the correct default behaviour and that site owners wishing to use PPP to allow all to access an RSA protected site should use the filter. I'm going to close this pull request off and document on the issue that a snippet would be helpful for users wishing to do the reverse. |
Description of the Change
This substantially integrates the shim wp-plugin-ppp-rsa-compat.php into Restricted Site Access.
The shim reimplements significant portions of Public Post Preview's functionality, because the methods in PPP used to verify whether the preview link is valid are set to private access.
I'm filing this PR against RSA, but if this feature is better implemented in PPP, I have a corresponding PR against PPP here: ocean90/public-post-preview#184
Resolves #344
How to test the Change
Changelog Entry
Credits
Props @benlk
Checklist: