Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Public Post Preview compatibility shim to RSA #345

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

benlk
Copy link

@benlk benlk commented Mar 7, 2025

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

  1. Enable PPP and RSA on the same site.
  2. Create a draft post.
  3. Verify that the draft post is visible to logged-in users, and blocked for logged-out users.
  4. Enable PPP for the post.
  5. Verify that the draft post is visible to both logged-in users and logged-out users.
  6. Disable PPP for the post.
  7. Verify that the draft post is visible to logged-in users, and blocked for logged-out users.

Changelog Entry

Added - Compatibility with Public Post Preview to allow logged-out users to view preview links.

Credits

Props @benlk

Checklist:

@benlk
Copy link
Author

benlk commented Mar 7, 2025

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.

@jeffpaul jeffpaul requested review from a team and peterwilsoncc and removed request for a team March 7, 2025 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate with Public Posts Preview
1 participant