Repository navigation
What's changed
Back-sync reliability
- Batch completeness —
has_morewas computed from the pre-batch backlog count, so a full batch of N posts always returnedhas_more: false. It now uses the post-batch recount, so partially-failed batches correctly trigger the next run. - Duplicate prevention — before creating a new GHL record, the engine runs a pre-flight dedup check against the cached record list. If a record with the same title already exists (e.g. from a previous partial push where the ID was never saved back), the post is linked to the existing record instead of creating a duplicate.
- GHL eventual-consistency — if GHL's create response doesn't include the record ID in the expected shape, the fallback title-search now waits 0.8 s before querying, giving GHL time to index the new record. Added
records[0].idas an additional fallback ID path to cover more response shapes. - Back-sync cron —
ghl_scheduled_back_syncnow fires automatically on the same user-configured interval as the forward sync (offset +30 s to avoid API contention). Each fire processes one batch; the backlog shrinks naturally over time with no offset tracking needed. - Progress bar — manual back-sync runs show a live progress bar that caps at 99% until the final batch completes, then snaps to 100% with a "Done" label and final counts.
Cron self-healing
CronManager::maybe_reschedule()is now hooked toinit(every request, including frontend) instead ofadmin_init. The scheduled sync can no longer silently die after a WordPress core update or site migration without any admin visit.
PHP compatibility
- Removed
ini_get('safe_mode')(removed in PHP 7.0).set_time_limit()is now called directly.
Taxonomy slug normalisation
- GHL slugs use underscores; WordPress uses dashes. A
&in a category name produces double-underscores in GHL (e.g.bed_covers__tonneau_toppers). The sync engine now normalises these before lookup so existing WP terms are matched correctly instead of creating duplicates.
Code audit fixes
ghl_sync_origin_migrated_v1was written by the origin-migration routine but never cleaned up on uninstall. Added toGithubUpdater::ALL_OPTIONSanduninstall.php.ghl_sync_taxonomy_slugwas removed from plugin settings in v4.5.0 but remained listed inuninstall.php. Removed.update_post_meta( $post_id, 'category', … )insync_taxonomy()used the reserved WordPress meta keycategoryand stored a value never read back. Removed.
Other fixes
ghl_sync_cron_offsetandghl_scheduled_back_syncwere not cleared on uninstall/wipe. Both are now removed bywipe_plugin_data()anduninstall.php.
Full changelog: v4.5.0...v4.5.2