Codeinwp / Codeinwp/feedzy-rss-feeds
Feed Order labels select the opposite chronological import order
- Dominant language
- PHP
- Stars
- 121
- Forks
- 27
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 11
Description
Summary
The campaign Feed Order control produces the opposite chronological result for its newest-first and oldest-first choices. Selecting Latest items first is expected to import newer entries before older entries, but the inspected path sorts older entries first. This prevents campaigns from reliably selecting the newest limited set without choosing the oppositely labeled option.
Customer context
Product / area: Feedzy RSS Feeds, feed-to-post campaign ordering
Version: Not provided; the behavior is present in current source through v5.2.9
Environment: WordPress environment details not provided
Integration / third party: Dozens of RSS sources were reportedly tested
Reported error / symptom: Newest-first produces the opposite chronological import order
Impact: The customer cannot select the ten newest entries using the matching UI label
Reproduction notes
- Create or edit a Feedzy import campaign using an RSS fixture with known publication timestamps.
- Select
Latest items firstunderStep 4 → General feed settings → General → Items. - Limit the import and run it.
- Observe that older entries precede newer entries.
Repository-confirmed from the selected token and comparator; an isolated runtime fixture was not executed during triage.
Diagnosis
Conclusion
The campaign UI maps Latest items first to date_asc, while the reachable import path passes that token to a comparator that places an item after another item when its timestamp is newer. This produces oldest-first ordering for the newest-first choice. The staff response independently reports that both labels are reversed.
Where this likely occurs
- Campaign control:
includes/views/import-metabox-edit.php— Feed Order selector inFeedzy_Rss_Feeds_Import::feedzy_import_feed_options()approx. lines 942–965 mapsdate_asctoLatest items firstanddate_desctoOldest items first. - Import data flow:
includes/admin/feedzy-rss-feeds-import.php—Feedzy_Rss_Feeds_Import::run_job_logic()lines 1880–1902 passes persistedimport_orderdirectly as thesortoption. - Sorting behavior:
includes/util/feedzy-rss-feeds-util-feed.php—Feedzy_Rss_Feeds_Util_Feed::sort_items()lines 76–87 returns a positive comparison fordate_ascwhen the first item's timestamp is newer, placing newer entries later. - History: commit
2bc201f559c5ba08ce8fbb0f247ea88e1eaa0f0bintroduced the campaign selector and mapping; the first containing release is v5.1.0. The behavior remains in v5.2.9.
Engineering notes
The UI value is persisted as campaign metadata and consumed without remapping. The date sorting implementation predates the campaign labels. Existing saved campaigns may therefore depend on the token behavior despite the contradictory labels. Pro does not override this campaign sorting path; ownership is in the free repository.
Test coverage status
tests/test-plugin.php — Test_Feedzy_Plugin::test_shortcode_order_param() lines 81–117 checks title sorting only. tests/test-import.php — Test_Feedzy_Import::test_feedzy_imports() beginning at line 63 exercises imports without setting or asserting import_order. The Pro E2E suite tests/e2e/specs/common/import.spec.js lines 43–77 verifies label text and the default selection but not resulting item chronology.
What to verify or explore next
- Reproduce campaign runs against a deterministic fixture containing out-of-order publication dates for each Feed Order choice.
- Verify item limiting occurs after chronological sorting for a ten-item campaign.
- Run the import PHPUnit suite and the Pro common import E2E suite with chronology assertions.
Unknowns / follow-up
The ticket does not provide the installed Feedzy version. The attachment could not be retrieved through the sanctioned ticket-image tool.
Confidence
Confidence: 98/100
Repository inspection directly confirms that the campaign UI maps newest-first to an ascending date comparator, and that the preview path supplies a fixed sort value instead of the saved campaign selection. No matching open issue was found.
Source: HelpScout #3452624552
Generated by bug-report-triage (ID: bug-report-triage_6aaa5ab4e62834.92507993)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.