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
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
listNotificationsapp.bsky.notification.listNotificationswithreasons=["reply"].wp_optionsto only process new notifications.record.reply.root.uriorrecord.reply.parent.urito a local post via_atmosphere_bsky_uripost meta.app.bsky.actor.getProfile(display name, handle, avatar).wp_new_comment().comment_meta:protocol,source_uri,source_didfor deduplication and attribution.comment_parentwhen the parent URI maps to an existing comment.Secondary:
getPostThreadbackfillapp.bsky.feed.getPostThreadfor each published post's AT-URI.replies[]tree and insert any missing comments.Why not Jetstream/firehose?
Requires a persistent WebSocket connection, which is impractical in a standard WordPress/PHP environment.
Reference
app.bsky.notification.listNotifications— https://docs.bsky.app/docs/api/app-bsky-notification-list-notificationsapp.bsky.feed.getPostThread— https://docs.bsky.app/docs/api/app-bsky-feed-get-post-threadInteractions::add_comment()