Skip to content

Sync Bluesky replies back as WordPress comments #5

@pfefferle

Description

@pfefferle

Summary

Pull replies to published Bluesky posts back into WordPress as comments, enabling two-way interaction between the WordPress site and the AT Protocol network.

Background

ATmosphere currently publishes posts to Bluesky (app.bsky.feed.post) and standard.site (site.standard.document). Replies on Bluesky are not synced back. standard.site does not define a reply/comment mechanism, so this is Bluesky-only for now.

Approach

Primary: Poll listNotifications

  • Register a WP-Cron event (e.g. every 15 minutes) calling app.bsky.notification.listNotifications with reasons=["reply"].
  • Track a cursor in wp_options to only process new notifications.
  • For each reply:
    • Match record.reply.root.uri or record.reply.parent.uri to a local post via _atmosphere_bsky_uri post meta.
    • Resolve the author via app.bsky.actor.getProfile (display name, handle, avatar).
    • Insert as a WordPress comment using wp_new_comment().
    • Store comment_meta: protocol, source_uri, source_did for deduplication and attribution.
  • Handle nested replies by setting comment_parent when the parent URI maps to an existing comment.

Secondary: getPostThread backfill

  • On manual trigger or less-frequent cron, call app.bsky.feed.getPostThread for each published post's AT-URI.
  • Walk the replies[] tree and insert any missing comments.
  • Useful for catching replies from before the plugin was installed.

Why not Jetstream/firehose?

Requires a persistent WebSocket connection, which is impractical in a standard WordPress/PHP environment.

Reference

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions