Address feedback on port 443 support, add source:cloud - #13
Conversation
Commit a541e55 made the RSS <cloud> element advertise port='443' for https sites, which breaks FeedLand (the largest rssCloud consumer). Revert only the cloud element output to the original logic: explicit home port if present, otherwise 80, with protocol='http-post'. The notification-request 443->https subscriber logic and the non-standard port whitelist are intentionally kept. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The whitelist added in d05bd40 let wp_safe_remote_*() reach subscribers on non-standard ports. It won't achieve that on WordPress.com, where outbound requests are restricted by firewall rules independent of WordPress's own URL validation, so it adds complexity without reliably delivering the capability. Remove the filter from both the notification request and post notification paths, along with the tests and changelog entry documenting it. Subscribers on non-standard ports are no longer supported; ports 80 and 443 continue to work, as both are in WordPress's default allowed ports. The wp_safe_remote_*() calls introduced alongside the whitelist are kept, so that SSRF protection survives independently of the port workaround. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 34 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughChangesNotification port handling
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
Plugin check fails against the declared minimum of 2.8: wp_unslash() and wp_safe_remote_post() both require WordPress 3.6.0. Neither is new here, so this corrects metadata that has been wrong since those calls were introduced. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The cloud element is pinned to port 80 / http-post so FeedLand and other older readers keep working, which leaves it unable to advertise an https endpoint. source:cloud carries the full notification URL as element content, so newer readers get the site's real scheme. Emitting both gives the widest reader support. The namespace is declared on the element itself rather than through the rss2_ns action. Doing it the conventional way collides with any other plugin that binds the source prefix on the rss tag: the WordPress template concatenates rss2_ns callbacks with no separator, so two plugins emitting xmlns:source produce a duplicate attribute and the feed stops parsing. team51-markdown-rss does exactly this, unguarded, for its source:markdown element. Declaring inline also guards against the quieter failure. Namespace declarations are scoped, so a plugin binding the source prefix to a different uri on the rss tag would otherwise make source:cloud resolve to the wrong namespace, and newer readers would skip it with no error and no broken feed. The inner declaration shadows the outer one for this element, which the tests assert against a hostile rss tag. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Raising the minimum to 3.6 in the previous commit made plugin check newly flag these calls: wp_strip_all_tags() arrived in WordPress 2.9.0, so while the declared minimum was 2.8 the check could not recommend it. wp_strip_all_tags() is a safe swap here. It strips script and style content rather than just the tags, and trims the result; both values are short strings that then pass through ent2ncr() and esc_html() before being emitted as XML attributes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Follow-ups to the port 443 work in 0.5.1. Two commits walk back parts of it in response to feedback; a third restores https support in the place it actually belongs.
1. Revert the
<cloud>element to port-80 / http-post (7a6be2a)a541e55 made the
<cloud>element advertiseport='443'/protocol='https-post'for https sites. That breaks FeedLand, the largest rssCloud consumer.Reverts only the cloud element output to the original logic: explicit home port if present, otherwise 80, with
protocol='http-post'. Subscriber-side 443 handling is untouched.2. Remove the
http_allowed_safe_portswhitelist (e10ebad)d05bd40 added a filter whitelisting the subscriber's port so
wp_safe_remote_*()could reach non-standard ports. As raised in review, this won't work on WordPress.com — outbound requests are restricted by firewall rules independent of WordPress's own URL validation — so it adds complexity without reliably delivering the capability.Gives up: subscribers on non-standard ports. Ports 80 and 443 are unaffected, both being in WordPress's default allowed ports.
Keeps: the
wp_safe_remote_*()calls introduced alongside the whitelist — a separate improvement bundled into the same commit.send-post-notifications.phpis now byte-identical to its pre-d05bd40 state, whilenotification-request.phpends up safer than before the 443 series.3. Add
source:cloud(856be0c)With
<cloud>pinned to port 80 / http-post, it can no longer advertise https.source:cloudcarries the full notification URL as element content, so newer readers get the site's real scheme. Emitting both gives the widest reader support:On declaring the namespace inline rather than via
rss2_ns— this is deliberate, and worth a look since it's the unconventional choice:The
feed-rss2.phptemplate concatenatesrss2_nscallbacks with no separator. Any other plugin emittingxmlns:sourceon the<rss>tag would produce a duplicate attribute, which is a well-formedness error under XML 1.0 even with identical values — the feed stops parsing entirely. team51-markdown-rss does exactly this, unguarded, for itssource:markdownelement.Inline declaration also guards the quieter failure. Namespace declarations are scoped, so a plugin binding
sourceto a different URI on<rss>would makesource:cloudresolve to the wrong namespace — newer readers skip it, with no error and no visibly broken feed. Per Namespaces in XML 1.0 §6.1, the inner declaration shadows the outer one for this element.test_feed_with_source_cloud_is_well_formed_xmlasserts this against a deliberately hostile<rss>tag.4. Bump minimum WordPress version to 3.6 (
7c7b27d)Plugin check fails against the declared minimum of 2.8 —
wp_unslash()andwp_safe_remote_post()both need 3.6.0. Neither is new on this branch; the check surfaces here because d05bd40 and friends landed on main without a PR, so it never ran on them. One-line metadata correction, happy to split it out if you'd rather.Testing
63 tests, 110 assertions— all passing. Five new tests coversource:cloud: presence, inline namespace declaration, the https URL, escaping, and XML well-formedness under a conflicting<rss>binding.🤖 Generated with Claude Code