Skip to content

Absorb post-to-instagram: Shared image tracking and post history #13

@chubes4

Description

@chubes4

Context

PTI tracks which images from a WordPress post have been shared to Instagram, preventing duplicate posts and showing history. DMS has a basic _dms_shared_posts meta key but the implementations differ.

What PTI Has

  • Post meta key: _pti_instagram_shared_images — array of records per post:
    [
      'image_id' => (int),           // WP attachment ID
      'instagram_media_id' => (str), // Instagram media ID
      'timestamp' => (int),          // Unix timestamp
      'permalink' => (str|null),     // Instagram post URL
    ]
  • Used to show "Posted" badges in image selection UI
  • Used to filter out already-shared images

What DMS Has

  • Post meta key: _dms_shared_posts — array of sharing records:
    • timestamp, platforms[], image_count
  • REST endpoint: GET /status/{post_id} returns this meta

Gap

DMS tracking is platform-generic but less granular than PTI:

  • No per-image tracking (only total image count)
  • No platform-specific media IDs (Instagram media ID, tweet ID, etc.)
  • No permalinks to the published social post
  • Can't tell which specific images were shared vs just the count

Tasks

  • Design unified tracking schema that supports per-image + per-platform granularity
  • Migrate _dms_shared_posts schema to include: platform, media_id, permalink, individual image IDs
  • Port "already shared" filtering logic from PTI
  • Update REST endpoint to return richer history data
  • Consider migration path for existing _dms_shared_posts data

Related

  • PTI source: inc/Core/Actions/Post.php (meta update logic)
  • DMS source: inc/RestApi.php (/status/{post_id} endpoint)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions