Skip to content

Replace bare <image> in feed items with namespaced <ssp:image> #841#900

Merged
zahardev merged 3 commits into
developfrom
version/3.16.0-namespaced-episode-image-tag
May 7, 2026
Merged

Replace bare <image> in feed items with namespaced <ssp:image> #841#900
zahardev merged 3 commits into
developfrom
version/3.16.0-namespaced-episode-image-tag

Conversation

@zahardev

@zahardev zahardev commented May 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Replace bare <image> element in feed items with namespaced <ssp:image> to fix RSS 2.0 validation and Spotify feed ingestion (Version 3.10.0-alpha.6 #841)
  • Declare xmlns:ssp namespace in the RSS root element
  • Update XSL stylesheet to read from the namespaced element
  • Add ?v=2 cache-buster to XSL stylesheet URL

Test plan

  • Visit feed URL in browser — episode artwork displays in human-readable view
  • View raw feed XML — items contain <ssp:image>, no bare <image> in items
  • Channel-level <image> is unchanged
  • Validate feed at W3C RSS validator — no <image> errors in items

Summary by CodeRabbit

  • Updates
    • RSS stylesheet URL now includes a version parameter for improved cache handling.
    • Podcast feed declares a podcast-specific XML namespace for clearer metadata organization.
    • Podcast artwork metadata in feeds moved into the new namespace structure for better compatibility with podcast platforms.

RSS 2.0 only allows <image> at the channel level. The bare tag in
feed items broke W3C validation and Spotify ingestion.

Co-Authored-By: Claude via AIContext
@coderabbitai

coderabbitai Bot commented May 7, 2026

Copy link
Copy Markdown

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 15fca2a6-359c-4516-8b2f-b94034c828ee

📥 Commits

Reviewing files that changed from the base of the PR and between 8dde210 and fe8d327.

📒 Files selected for processing (1)
  • tests/Acceptance/3_main-feed.feature
✅ Files skipped from review due to trivial changes (1)
  • tests/Acceptance/3_main-feed.feature

📝 Walkthrough

Walkthrough

Feed templates and stylesheet adopt an ssp: XML namespace for podcast image elements; feed items now emit <ssp:image> with <ssp:url> and <ssp:title>, the XSL stylesheet declares and selects ssp: elements, and the stylesheet URL is versioned with ?v=2. Tests updated accordingly.

Changes

RSS Image Namespace

Layer / File(s) Summary
XML Namespace Declaration
templates/feed-podcast.php
RSS feed root element declares xmlns:ssp="https://castos.com/seriously-simple-podcasting/namespace/1.0".
Feed Item Image Emission
templates/feed/feed-item.php
Episode image output changes from <image> to <ssp:image> containing <ssp:url> and <ssp:title>.
Stylesheet Namespace Declaration
templates/feed-stylesheet.xsl
XSLT root declares ssp namespace to enable ssp:-prefixed XPath selections.
Stylesheet Image References
templates/feed-stylesheet.xsl
Image XPath expressions and conditionals updated from image/... to ssp:image/ssp:... within per-item and channel image handling.
Stylesheet Versioning
php/classes/handlers/class-feed-handler.php
Handler appends ?v=2 query parameter to the feed stylesheet URL returned by the ssp_rss_stylesheet filter.
Tests
tests/WPUnit/FeedControllerTest.php, tests/Acceptance/3_main-feed.feature
Expected feed XML updated to include xmlns:ssp and a versioned stylesheet URL (?v=2).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰
In XML fields I hop and sing,
ssp: flags on image cling,
XSL learns the namespace tune,
v=2 hums for cache at noon,
Feed hops out tidy — what a spring! 🌷

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly summarizes the main change: replacing bare elements with namespaced ssp:image elements in feed items, including the GitHub issue reference.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch version/3.16.0-namespaced-episode-image-tag

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@templates/feed/feed-item.php`:
- Around line 70-73: The ssp:title element is double-encoding the pre-escaped
title by calling esc_attr( $title ); update the template so the <ssp:title> echo
uses the already-escaped $title directly (replace the esc_attr( $title ) usage
in templates/feed/feed-item.php with a bare echo of $title) to match the
existing usage at the top of the file and avoid producing entities like
&amp;amp; in the output.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 18798eb9-1af1-433d-9b48-6e5c9bb370e6

📥 Commits

Reviewing files that changed from the base of the PR and between 75da8f2 and 7f88bb5.

📒 Files selected for processing (4)
  • php/classes/handlers/class-feed-handler.php
  • templates/feed-podcast.php
  • templates/feed-stylesheet.xsl
  • templates/feed/feed-item.php

Comment thread templates/feed/feed-item.php

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
tests/WPUnit/FeedControllerTest.php (1)

77-97: ⚡ Quick win

Add a direct assertion for item-level <ssp:image> behavior.

This test now checks the namespace declaration, but it still doesn’t directly verify the core item-level replacement (<image><ssp:image>) in an image-present episode case. Please add/assert that scenario so regressions are caught at the behavior this PR is targeting.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/WPUnit/FeedControllerTest.php` around lines 77 - 97, Update the
FeedControllerTest item expectations to assert the item-level image replacement:
inside the test that builds the $expected item block (the array around
'<item>'...'</item>') add an expectation for the new '<ssp:image>' element for
the episode (using the same $episode_id context used elsewhere in the test)
and/or assert the rendered feed contains '<ssp:image' and does not contain the
legacy '<image>' for that item; locate the assertion code in
FeedControllerTest.php near the $episode_id and $expected item array and add the
new expectation so the test explicitly checks item-level '<ssp:image>' behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tests/WPUnit/FeedControllerTest.php`:
- Around line 77-97: Update the FeedControllerTest item expectations to assert
the item-level image replacement: inside the test that builds the $expected item
block (the array around '<item>'...'</item>') add an expectation for the new
'<ssp:image>' element for the episode (using the same $episode_id context used
elsewhere in the test) and/or assert the rendered feed contains '<ssp:image' and
does not contain the legacy '<image>' for that item; locate the assertion code
in FeedControllerTest.php near the $episode_id and $expected item array and add
the new expectation so the test explicitly checks item-level '<ssp:image>'
behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d888cca0-cf02-403d-bb4d-fbe0ddd2a39d

📥 Commits

Reviewing files that changed from the base of the PR and between 7f88bb5 and 8dde210.

📒 Files selected for processing (1)
  • tests/WPUnit/FeedControllerTest.php

coderabbitai[bot]
coderabbitai Bot previously approved these changes May 7, 2026
Co-Authored-By: Claude via AIContext
@zahardev zahardev merged commit 9acf823 into develop May 7, 2026
2 checks passed
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.

1 participant