Skip to content

Add cleanup logic for reblog mapping posts#290

Merged
akirk merged 2 commits intomainfrom
cleanup-reblog-mappings
Mar 26, 2026
Merged

Add cleanup logic for reblog mapping posts#290
akirk merged 2 commits intomainfrom
cleanup-reblog-mappings

Conversation

@akirk
Copy link
Copy Markdown
Owner

@akirk akirk commented Mar 26, 2026

Summary

  • Clean up enable-mastodon-apps CPT posts and mastodon_reblog_id postmeta when original posts are deleted or trashed
  • Add cleanup_orphaned_reblog_mappings() for bulk cleanup of the existing backlog of orphaned mappings
  • Add "Delete orphaned reblog mappings" button to the admin debug and registered apps pages

Ref #283

Test plan

  • New ReblogMapping_Tests cover: remap creation, idempotency, cleanup on original delete, cleanup on trash, cleanup on mapping delete, orphan cleanup
  • CI phpunit run passes

akirk added 2 commits March 26, 2026 11:12
Clean up orphaned enable-mastodon-apps CPT posts and mastodon_reblog_id
postmeta when original posts are deleted or trashed. Also adds a bulk
cleanup button in the admin for the existing backlog of orphaned mappings.

Ref #283
Test-only: direct $wpdb->delete() is needed to simulate orphaned data by
bypassing WordPress hooks, which is exactly the pre-cleanup scenario.
@akirk akirk merged commit 2954f04 into main Mar 26, 2026
17 checks passed
@akirk akirk deleted the cleanup-reblog-mappings branch March 26, 2026 21:52
@akirk akirk mentioned this pull request Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant