Fixed correct content retrieval#1217
Conversation
|
Plugin build for 286b90d is ready 🛎️!
Note You can preview the changes in the Playground |
There was a problem hiding this comment.
Pull request overview
Fixes how condition evaluation retrieves an item’s description vs. full content, aligning field behavior with the intended SimplePie APIs (and removing a now-unneeded PHPStan baseline suppression).
Changes:
- Update conditions evaluation to use
SimplePie\Item::get_description()for thedescriptionfield. - Update conditions evaluation to use
SimplePie\Item::get_content()for thefullcontentfield. - Remove the PHPStan baseline entry related to the previously referenced
SIMPLEPIE_NAMESPACE_ATOM_10constant.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
includes/util/feedzy-rss-feeds-conditions.php |
Corrects which SimplePie fields are used for description vs fullcontent when evaluating filters. |
phpstan-baseline.neon |
Drops an ignore for a constant that is no longer referenced. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| case 'description': | ||
| $value = wp_strip_all_tags( $item->get_content(), true ); | ||
| $value = wp_strip_all_tags( $item->get_description(), true ); | ||
| break; | ||
| case 'fullcontent': | ||
| $content = $item->get_item_tags( SIMPLEPIE_NAMESPACE_ATOM_10, 'full-content' ); | ||
| $content = ! empty( $content[0]['data'] ) ? $content[0]['data'] : ''; | ||
| $value = wp_strip_all_tags( $content, true ); | ||
| $value = wp_strip_all_tags( $item->get_content(), true ); |
There was a problem hiding this comment.
The behavior of the 'description' and 'fullcontent' condition fields is changed here (description now uses SimplePie Item::get_description(); fullcontent uses Item::get_content()). There are existing PHPUnit tests for this class (tests/test-conditions.php) but none currently exercise evaluate_conditions(); please add/extend unit tests to cover these two fields so regressions in content/description selection are caught.
Summary
Fixed the item's description and content retrieval.
Check before Pull Request is ready:
Closes https://github.com/Codeinwp/feedzy-rss-feeds-pro/issues/958