Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions includes/abstract/feedzy-rss-feeds-admin-abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -1767,6 +1767,13 @@ public function feedzy_retrieve_image( $item, $sc = null ) {
$the_thumbnail = $data['0']['attribs']['']['href'];
}
}
// xmlns:media thumbnail.
if ( empty( $the_thumbnail ) ) {
$data = $item->get_item_tags( 'http://search.yahoo.com/mrss/', 'thumbnail' );
if ( isset( $data['0']['data'] ) && ! empty( $data['0']['data'] ) ) {
$the_thumbnail = $data['0']['data'];
Comment thread
girishpanchal30 marked this conversation as resolved.
Outdated
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.
}
}
// Content image.
if ( empty( $the_thumbnail ) ) {
$feed_description = $item->get_content();
Expand Down
Loading