Commit Graph
4 Commits
Author SHA1 Message Date
Keith Solomon 1f4c6754e2 feature: Assign feed season to a configurable taxonomy on import
CI / Composer, lint, static analysis, and unit tests (push) Successful in 2m10s
CI / WordPress activation smoke test (push) Failing after 2m0s
Adds a 'Season taxonomy' setting (default empty) that points at an existing
taxonomy registered against the destination post type. On every successful
import the plugin reads itunes:season, looks up (or creates) a term with
that numeric name in the configured taxonomy, and assigns it to the
imported post via wp_set_object_terms.

Behavior:
- Empty option: no-op. Existing posts and installs without a season
  taxonomy are unaffected.
- Tax that doesn't exist or isn't attached to the post type: no-op.
- Feed item with no itunes:season: no-op. Manual taxonomy assignments
  are preserved on subsequent refreshes.
- Otherwise: the feed value wins, on both create and update paths.

The new assign_season_term() helper is public so it is unit-testable,
and four smoke tests cover the lookup, create-on-miss, unconfigured, and
no-season paths.
2026-08-24 12:04:09 -05:00
Keith Solomon 7887f7d9ce feature: Add reset-cache action to settings page
Adds a 'Reset cache' button to the Podcast RSS Import settings page that
clears the SimplePie feed-cache rows (both the cached XML and the
modification timestamp) plus the importer's per-feed import lock for the
configured feed. Multisite site-transient variants are also cleared.

Use this when the importer is skipping items or refusing to re-fetch a
feed that has changed at the source. The next 'Import now' click will
re-pull the XML from the network.

clear_feed_cache() is exposed as a public method so it is unit-testable,
and a do_action hook (rss2cpt_cache_cleared) lets other code react when
the cache is cleared. Two smoke tests pin down the expected option and
site-transient names, and a third ensures an empty feed URL is a no-op.
2026-08-24 11:05:16 -05:00
Keith Solomon 0a6cf92146 🐛fix: Use feed publication date as post_date on import
Extracted the wp_insert_post/wp_update_post argument construction into a
private build_postarr() helper so the post_date/post_date_gmt derivation
from the feed timestamp can be exercised in isolation. Added smoke tests
that pin down the create-path behavior (feed timestamp becomes post_date)
and the fallback path (no feed date leaves post_date unset for WordPress
to fill in at import time). Added minimal get_date_from_gmt and
get_gmt_from_date stubs to the test bootstrap so the new tests run
without WordPress loaded.
2026-08-24 10:14:50 -05:00
Keith Solomon 158f978021 feature: Initial commit 2026-08-24 08:46:51 -05:00