Integrate with Public Posts Preview
Is your enhancement related to a problem? Please describe.
10up commonly uses the third-party plugin Public Post Preview to allow sites to share draft posts with logged-out users before publication. Unfortunately, this plugin does not have any in-built compatibility with Restricted Site Access, which prevents logged-out users from seeing the site. RSA is commonly used on staging and development sites.
On my projects, clients have often requested the ability to share a post or page on development with stakeholders who do not have a WordPress account on the site running Restricted Site Access, such as executives previewing designs for an in-development site refresh, or legal teams reviewing privacy integrations. It would be nice if the two plugins worked together.
Designs
No response
Describe alternatives you've considered
On existing client sites, I've used a shim plugin to integrate the two plugins: wp-plugin-ppp-rsa-compat.php.txt
The shim works, but I'd like to make sure it's maintained in the long run, so upstreaming it to RSA or PPP seems preferable.
I've considered adding this feature directly to PPP, and have opened a PR there (https://github.com/ocean90/public-post-preview/pull/184). Integrating it within PPP is easier than within RSA because we can make use of PPP's native authentication code, instead of having to reimplement it as the shim does. However, I'm not sure that it's the best place for the integration to live.
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
I'm a little concerned about including this in the base plugin.
With RSA alone:
- Editors/Admins can preview all unpublished posts
- Authors/Contributors can preview their own unpublished posts
- Subscribers can not preview unpublished posts
- Public can not access website
With PPP alone:
- Anyone with or without an account can preview posts with ppp enabled.
With both:
- Editors/Admins can preview all unpublished posts
- Authors/Contributors can preview their own unpublished posts
- Subscribers can not preview unpublished posts
- Authors/Contributors/Subscribers can preview posts with ppp enabled.
- Users who do not pass RSA restrictions can not preview posts, regardless of the ppp setting.
The current behavior seems expected to me as the plugins are serving different purposes, ppp is making posts available to those who can access the site, RSA is limiting who can access the site.
I'd be hesitant in allowing all access to PPP posts because I don't think it would meet RSA users' expectations when installing the plugin.
There are a few code examples in readme.md that include bypassing the restrictions for certain settings, I think providing the ppp bypass as a gist and linking to that would be suitable.
There are a few code examples in readme.md that include bypassing the restrictions for certain settings, I think providing the ppp bypass as a gist and linking to that would be suitable.
@ocean90 does that seem like a solid approach from your PPP perspective?
@ocean90 does that seem like a solid approach from your PPP perspective?
Sounds good to me. But I guess it will be helpful to provide an action in PPP around these lines so the requested action can be added there.