Added fallback for media thumbnail retrieval#1207
Added fallback for media thumbnail retrieval#1207vytisbulkevicius merged 2 commits intodevelopmentfrom
Conversation
|
Plugin build for cc1b8d5 is ready 🛎️!
Note You can preview the changes in the Playground |
There was a problem hiding this comment.
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:thumbnaillookup (http://search.yahoo.com/mrss/) as an additional thumbnail source infeedzy_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.
| if ( isset( $data['0']['data'] ) && ! empty( $data['0']['data'] ) ) { | ||
| $the_thumbnail = $data['0']['data']; |
There was a problem hiding this comment.
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.
| 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']; |
Summary
Added a fallback to retrieve media from the
thumbnailtag for the RSS feed.Check before Pull Request is ready:
Closes https://github.com/Codeinwp/feedzy-rss-feeds-pro/issues/957