docs(wporg): answer round 2 where a re-scan reads it (#161) - #162
Merged
Conversation
The get-media finding is fixed (#149), but the fix is on the execute path and the reviewer quoted the permission_callback line — so an automated re-scan quotes the same line again and reads it the same way. Makes the two-layer model legible at the registration site: a block note at the top of core-content.php saying the permission_callback gates the TOOL and require_readable_post()/collection() authorize the OBJECT, plus a pointer on each id-taking read and each listing. Says why the object check is on the execute path rather than in the gate — denial_reason() and is_callable_now() are input-free by construction, and an unexplained "no" is what puts an agent into a retry loop. get-preview-url's comment records that it is deliberately stricter than the funnel, not outside it. Comments only; no behaviour change. WPORG-SUBMISSION.md gains the round-2 history entry and two reusable answers: §13 the authorization model, what each control does, the divergence from core in `total`, and how it was verified; §14 the Unsplash 401 with the Anubis reproduction and the table showing every unsplash.com path behaves the same — including the /privacy link the checker did not flag, which is why swapping the flagged URL fixes nothing. Draft reply appended; not sent. Refs #161
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #161
Uses
Refs, notCloses— #161 also covers rebuilding and re-verifying the.orgzip, which happens after this and #160 land.
What
Makes Saddle's read-authorization model legible at the line the WordPress.org
reviewer quoted, and writes both round-2 answers into
WPORG-SUBMISSION.mdin a formthat can be reused verbatim if a round 3 raises them again. Comments and docs only —
no behaviour change, no new strings, nothing that ships differently.
Why
The reviewer flagged
saddle/get-media'spermission_callbackfor checking only thegeneric
readcapability. They were right, and #149 fixed it — six abilities wide,not one. But that fix routes every id-taking read through
Saddle_Abilities::require_readable_post()on the execute path, while the reviewerquoted the registration line. Nothing at that line says the object is authorized
elsewhere, so an automated re-scan quotes it again and reads it the same way.
The second finding —
https://unsplash.com/api-termsanswering 401 — is a falsepositive that no change to this plugin can clear, so it needs a written answer rather
than a fix.
How
Code comments. A block note at the top of
includes/abilities/core-content.phpsetting out the two layers explicitly:
Saddle_Capabilities::permission()require_readable_post()/collection()…plus a one-line pointer above each id-taking read (
get-media,get-post,get-page,get-blocks,list-post-revisions,lint-page,render-node,verify-page) and each listing (list-posts,list-pages,list-media,search-content).Two things the note records that were previously only implicit:
$inputtoWP_Ability::check_permissions()and accepts aWP_Errorback, so itcould move — but
denial_reason()andis_callable_now(), which buildtools/listand every refusal an agent reads, are input-free by construction, and a gate that says
"no" without naming which layer said so is what puts an agent into a retry loop.
get-preview-urlis deliberately stricter, not outside the funnel. A preview linkrenders unpublished content on the front end, so an unpublished post needs
edit_postthere rather than
read_post.WPORG-SUBMISSION.md. A round-2 history entry, plus:inherit → post_parentresolution, the password-protected refusal and why it refusesrather than blanks, and the deliberate
total-counts-dropped-rows divergence fromcore), and how it was verified on a live install.
every
unsplash.compath behaves identically, including the/privacylink thechecker did not flag. That table is the argument: swapping the flagged URL fixes
nothing, and there is no browser-reachable canonical Unsplash terms or privacy URL to
swap to.
unsplash.comlinks if the reviewer would rather the readme contain no URL their checker flags.
Testing
composer lint— 0 errors (3 pre-existing warnings, none in the changed files).composer test— unchanged; the read-authorization suite still passes.unsplash.com/api-terms,/privacy,/termsand/licenseall401to a browser UA and200tocurl;help.unsplash.comanswers200to both.WP_DEBUGon.WPORG-SUBMISSION.mdis excluded from both zips (root*.mdinGruntfile.js), sonone of the doc content ships.
Screenshots
None — no UI change.