Improve Compatibility for Self-Hosted Audio Files in Podcast Block

Open
#330 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
php
Domain
frontend

Research direction

Start in includes/blocks/podcast/markup.php around lines 29–31, then reproduce the failure by inserting a self-hosted audio URL through the Podcast block’s “Insert from URL” option. Trace how the null attachment_id affects front-end rendering and verify that audio URLs outside the Media Library render correctly without breaking library-backed files.

Written by the indexing model from the issue text.

Description

help wanted needs:engineering
Is your enhancement related to a problem? Please describe.

As noted by @bacoords:

The podcast block currently fails to render properly on the front-end when audio files are self-hosted and inserted via the "Insert from URL" option. This appears to be due to a null attachment_id being returned for audio files not in the Media Library.

Steps to Reproduce:

  1. Use the Podcast block to add an audio file.
  2. Insert an audio file URL manually via "Insert from URL" (bypassing the Media Library).
  3. Observe that the block does not render on the front-end.

Expected Behavior:

The Podcast block should gracefully handle audio files inserted via "Insert from URL," even when they are not part of the Media Library.

Actual Behavior:

The block fails to render on the front-end, likely due to the conditional check here:
https://github.com/10up/simple-podcasting/blob/develop/includes/blocks/podcast/markup.php#L29C1-L31C2

Additional Context:

  • This issue was noticed when transitioning from Offload Media Lite (S3) to a self-hosted setup for MP3s.
  • It seems the block is heavily reliant on Media Library metadata, which isn’t available for files inserted via URL.

Suggested Improvement:

Explore ways to make the block more agnostic to file sources. For instance:

  • Allow rendering based solely on the provided URL without requiring an attachment_id.
  • Improve conditional handling for cases where the attachment_id is null.

Additional Questions:

  • Is there a particular reason the block relies on attachment_id?
  • Are there specific metadata fields that could be optional or dynamically fetched for self-hosted files?
Designs

No response

Describe alternatives you've considered

No response

Code of Conduct
  • I agree to follow this project's Code of Conduct
Dominant language
PHP
Stars
221
Forks
32
Avg merge
13m
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from 10up/simple-podcasting

All issues in 10up/simple-podcasting

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.