Skip to content

Added fallback for media thumbnail retrieval#1207

Merged
vytisbulkevicius merged 2 commits intodevelopmentfrom
bugfix/pro/957
Apr 14, 2026
Merged

Added fallback for media thumbnail retrieval#1207
vytisbulkevicius merged 2 commits intodevelopmentfrom
bugfix/pro/957

Conversation

@girishpanchal30
Copy link
Copy Markdown
Contributor

Summary

Added a fallback to retrieve media from the thumbnail tag for the RSS feed.

Check before Pull Request is ready:

Closes https://github.com/Codeinwp/feedzy-rss-feeds-pro/issues/957

@girishpanchal30 girishpanchal30 requested a review from Copilot April 9, 2026 07:42
@girishpanchal30 girishpanchal30 added the pr-checklist-skip Allow this Pull Request to skip checklist. label Apr 9, 2026
@pirate-bot pirate-bot added the pr-checklist-complete The Pull Request checklist is complete. (automatic label) label Apr 9, 2026
@pirate-bot
Copy link
Copy Markdown
Contributor

pirate-bot commented Apr 9, 2026

Plugin build for cc1b8d5 is ready 🛎️!

Note

You can preview the changes in the Playground

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a fallback image extraction path in feedzy_retrieve_image() to support feeds that expose thumbnails via a media:thumbnail tag (MRSS), improving thumbnail detection when enclosures/itunes/content images aren’t present.

Changes:

  • Add media:thumbnail lookup (http://search.yahoo.com/mrss/) as an additional thumbnail source in feedzy_retrieve_image().
  • Prefer the newly found thumbnail before falling back to content/description parsing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread includes/abstract/feedzy-rss-feeds-admin-abstract.php Outdated
Comment on lines +1773 to +1774
if ( isset( $data['0']['data'] ) && ! empty( $data['0']['data'] ) ) {
$the_thumbnail = $data['0']['data'];
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

This change adds a new image-source fallback (media:thumbnail), but the existing PHPUnit coverage for feedzy_retrieve_image() (see tests/test-admin-abstract.php) doesn’t include a case for media:thumbnail. Please add a test feed item containing a media:thumbnail element so the new behavior is verified and protected against regressions.

Suggested change
if ( isset( $data['0']['data'] ) && ! empty( $data['0']['data'] ) ) {
$the_thumbnail = $data['0']['data'];
if ( ! empty( $data['0']['data'] ) ) {
$the_thumbnail = $data['0']['data'];
} elseif ( ! empty( $data['0']['attribs']['']['url'] ) ) {
$the_thumbnail = $data['0']['attribs']['']['url'];
} elseif ( ! empty( $data['0']['attribs']['']['href'] ) ) {
$the_thumbnail = $data['0']['attribs']['']['href'];

Copilot uses AI. Check for mistakes.
@vytisbulkevicius vytisbulkevicius merged commit 9f3b26c into development Apr 14, 2026
10 of 11 checks passed
@vytisbulkevicius vytisbulkevicius deleted the bugfix/pro/957 branch April 14, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-checklist-complete The Pull Request checklist is complete. (automatic label) pr-checklist-skip Allow this Pull Request to skip checklist.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants