WP Manifestindependent plugin directory
manifest / integrations / wp-slack-notify

Slack WordPress Review Notify

WordPressで記事が 「レビュー待ち(pending)」に送信されたときにSlackへ通知し、レビュー済みの記事が公開された際に、既存のSlack通知へリアクションを自動付与するプラグインです。

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/tpgsat/wp-slack-notify/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Slack Review Notify for WordPress

WordPressで記事が 「レビュー待ち(pending)」に送信されたときにSlackへ通知し、
レビュー済みの記事が公開された際に、既存のSlack通知へリアクションを自動付与するプラグインです。


機能概要

  • 記事が レビュー待ち(pending) になった瞬間にSlackへ通知
  • 通知は Slack Web API(chat.postMessage)を使用
  • 公開(publish)時に、既に送信済みのSlack通知にリアクションを追加
  • Slack Webhook URL の直書き不要
  • 管理画面から設定可能
  • 投稿タイプを選択可能(post / page / カスタム投稿タイプ)

動作イメージ

  1. 編集者が記事を「レビュー待ち」として送信
    → Slackに「📝 レビュー待ちに送信されました」と通知
  2. レビュー後に記事を公開
    → そのSlack通知に :white_check_mark: などのリアクションが自動で付く

インストール

  1. プラグインを配置

  2. WordPress管理画面
    プラグイン → 有効化


ファイル構成

tpg-slack-review-notify/
├─ tpg-slack-review-notify.php # メインロジック
├─ includes/
│ ├─ slack.php # Slack API 通信
│ └─ admin.php # 管理画面(設定)
└─ readme.md


Slack 側の準備

1. Slack App を作成

2. Bot Token Scopes を設定

以下のスコープが必要です:

  • chat:write
  • reactions:write

3. ワークスペースにインストール

  • Bot Token(xoxb-...)を取得

4. 通知先チャンネルにBotを招待

/invite @YourBotName

※ チャンネルID(C0123ABCDEF の形式)の使用を推奨


WordPress 側の設定

管理画面
設定 → Slack Review Notify

設定項目

項目 説明
Slack Bot Token xoxb- から始まるBot Token
通知先チャンネル #general または Channel ID
公開時リアクション 例:white_check_mark(コロン不要)
対象の投稿タイプ 通知対象にする投稿タイプ

仕様詳細

レビュー待ち通知

  • transition_post_status フックで pending への遷移を検知
  • Slackへ chat.postMessage
  • 返却される ts(timestamp)と channel を post meta に保存

公開時リアクション

  • publish への遷移を検知
  • 保存済みの ts / channel を使い reactions.add
  • 二重付与防止のため、付与済みフラグを post meta に保存

保存される post meta

meta key 内容
_srn_slack_ts Slackメッセージの timestamp
_srn_slack_channel SlackチャンネルID
_srn_reacted_published 公開リアクション付与済みフラグ

注意点・制限

  • Slack通知が削除・移動された場合、公開時リアクションは失敗します
  • 予約投稿(future → publish)は pending 通知がないためリアクションは付きません
  • Botがチャンネルに参加していないと通知・リアクションは失敗します