While reviewing sync-sched.php, I noticed that API failures inside the event sync loop currently terminate the entire sync process instead of skipping the failed event.
Current code (sync-sched.php, lines 53–55):
if ( is_wp_error( $data ) || ( wp_remote_retrieve_response_code( $data ) != 200 ) ) {
return false;
}
This code runs inside a loop iterating through active events:
while ( $the_query->have_posts() )
Since the file is included from sync_sched(), return false exits the entire included file, not just the current iteration.
Impact
If a single sched.com API request fails (temporary 5xx, timeout, rate limit, etc.):
- processing stops for all remaining events
- later speaker/session data never gets synced
- sync failures happen silently
update_option( 'lfevents_sync_sched_last_run', ... ) is skipped
- downstream speaker blocks may show stale or missing session data
This effectively turns one transient API failure into a full sync interruption.
Proposed fix
Skip only the failed event instead of aborting the entire sync process:
if ( is_wp_error( $data ) || ( wp_remote_retrieve_response_code( $data ) != 200 ) ) {
continue;
}
This allows the loop to continue syncing the remaining events even if one API request fails.

Would like to work on this fix and open a PR for it, if that sounds good.
While reviewing
sync-sched.php, I noticed that API failures inside the event sync loop currently terminate the entire sync process instead of skipping the failed event.Current code (
sync-sched.php, lines 53–55):This code runs inside a loop iterating through active events:
Since the file is included from
sync_sched(),return falseexits the entire included file, not just the current iteration.Impact
If a single sched.com API request fails (temporary 5xx, timeout, rate limit, etc.):
update_option( 'lfevents_sync_sched_last_run', ... )is skippedThis effectively turns one transient API failure into a full sync interruption.
Proposed fix
Skip only the failed event instead of aborting the entire sync process:
This allows the loop to continue syncing the remaining events even if one API request fails.
Would like to work on this fix and open a PR for it, if that sounds good.