Conversation
#838 Replace delete_option() with race-safe reconciliation that re-reads the option from DB and only removes processed users whose data hasn't changed, preserving entries written by concurrent requests (Scenario E). Co-Authored-By: Claude via AIContext
Co-Authored-By: Claude via AIContext
The delete handler only cleared the URL field, leaving the attachment ID intact so the player kept showing stale artwork. Co-Authored-By: Claude via AIContext
📝 WalkthroughWalkthroughAdds a default-podcast toggle UI and related server-side handling; introduces a single-sync queue processor and helpers for WooCommerce Memberships integration (enqueue, process, reconcile, clean IDs); small sync_user overlap resolution; minor JS and CSS/SCSS updates; plugin version bump and accompanying tests for the memberships integrator. ChangesDefault Podcast UI & Series Handling
WooCommerce Memberships Single-Sync Queue
Sequence Diagram(s)sequenceDiagram
participant Membership as Membership System
participant WP as WordPress (option DB / cron)
participant Integrator as WC_Memberships_Integrator
participant Abstract as Abstract_Integrator (sync_user)
participant External as Remote Sync API
Membership->>Integrator: membership saved (wc_memberships_user_membership_saved)
Integrator->>WP: prepare_single_sync() -> update option (enqueue)
WP->>WP: schedule SINGLE_SYNC_EVENT
WP->>Integrator: SINGLE_SYNC_EVENT fired (process_single_sync)
Integrator->>WP: read snapshot option (bypass cache)
loop per user in snapshot
Integrator->>Integrator: compute revoke/add (exclude series allowed elsewhere)
Integrator->>Abstract: sync_user(user, revoke_ids, add_ids)
Abstract->>External: call remote revoke/add APIs
External-->>Abstract: remote responses
Abstract-->>Integrator: success/failure
end
Integrator->>WP: reconcile_sync_data(snapshot, pending) -> persist or reschedule option
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@php/classes/integrations/woocommerce/class-wc-memberships-integrator.php`:
- Around line 249-255: sync_membership currently assumes $membership is always
an object and calls $membership->get_status(), which will fatal if
get_user_membership returned null; add a guard at the start of sync_membership
to detect a missing/invalid membership (e.g., if null or not an object or
missing get_status) and bail out or call prepare_single_sync with safe params so
the sync fails gracefully. Locate the sync_membership method in
class-wc-memberships-integrator.php and implement a simple early-return check
before using get_status(), leaving the existing prepare_single_sync calls
unchanged when a valid membership is present.
In `@templates/settings/podcast-default-toggle.php`:
- Around line 16-22: The checkbox input named "ssp_default_podcast" is not
programmatically associated with the visible text "Set as default podcast" which
harms accessibility; fix by adding a unique id on the input (e.g.,
id="ssp_default_podcast") and associate the text span with that id using a
corresponding <label for="..."> or by moving the visible text inside the
existing <label class="ssp-toggle"> so the input and label are properly linked;
update the markup around the input and the element with class
"ssp-toggle__label" to reference the id so assistive tech can read the label.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c73dc4c2-f2e2-434d-86cf-d7efdcf306bb
📒 Files selected for processing (9)
assets/admin/css/admin.cssassets/admin/scss/_admin.scssassets/js/admin.jsphp/classes/controllers/class-series-controller.phpphp/classes/integrations/class-abstract-integrator.phpphp/classes/integrations/woocommerce/class-wc-memberships-integrator.phpseriously-simple-podcasting.phptemplates/settings/podcast-default-toggle.phptests/WPUnit/WCMembershipsIntegratorTest.php
sync_membership() now guards against null membership lookups. process_single_sync() clears the queue option at the retry cap. Toggle checkbox is now properly associated with its label. Co-Authored-By: Claude via AIContext
This reverts commit fa4ff07.
Co-Authored-By: Claude via AIContext
Summary
Allow admins to change the default podcast directly from the single series edit page, replacing the need for the SSA plugin's "Change Default Podcast" action.
Requirements
ss_podcasting_default_seriesoption to the current seriesmanage_podcastcapabilitySummary by CodeRabbit
New Features
Style
Bug Fixes
Tests