[WordPress] 外掛分享: Vanilla Bean Slack Hooker

首頁外掛目錄 › Vanilla Bean Slack Hooker
10+
安裝啟用
★★★★★
5/5 分(1 則評價)
17 天前
最後更新
問題解決
WordPress 5.9+ PHP 7.4+ v5.7.0 上架:2015-12-20

內容簡介

Vanilla Bean Slack Hooker 外掛可自動將 WordPress 網站的通知發送至 Slack、Mattermost 和 Google Chat 頻道。無論是插件安裝、文章發佈、評論、註冊或 WooCommerce 銷售等事件,都能透過短碼和鉤子輕鬆整合,提升網站管理效率。

【主要功能】
• 實時通知:即時發送文章狀態變更、評論和用戶註冊的通知
• WooCommerce 整合:提供銷售通知及訂單詳情
• 插件管理警報:安裝、更新及刪除通知
• PHP 錯誤警報:將 PHP 錯誤路由至 Slack,並可配置例外
• 多個 webhook 支援:可發送至多個平台或自定義端點
• 短碼支援:輕鬆在文章和頁面中整合

外掛標籤

開發者團隊

⬇ 下載最新版 (v5.7.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Vanilla Bean Slack Hooker」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Automated notifications from your WordPress site to your Slack, Mattermost and Google Chat channels.
Notify one or more webhook endpoints when things happen on your site: plugin installs and updates, post publication, comments, signups, PHP errors, WooCommerce sales, or anything you like via shortcodes, hooks and filter functions.
There is no limit to the ways you may integrate this plugin.
It supports all other Vanilla Bean plugins and is available for under-the-hood use as well as shortcode access.
Key Features

Real-time WordPress notifications – Post status changes, comments, user registrations
WooCommerce integration – Sales notifications with order details
Plugin management alerts – Install, update, and deletion notifications
PHP Error Alerts – Route PHP errors to Slack with a call trace and configurable exemptions. Off by default (NEW in 5.6.4)
Multiple webhook support – Send to Slack, Mattermost, Google Chat, or custom endpoints
Formatted data messages – Rich attachments with structured name-value pairs (NEW in 5.5.2)
Smart queueing – Non-blocking message delivery with optional immediate sending
Email fallback – Send notifications via email when webhooks aren’t available
Shortcode support – Easy integration in posts and pages
Programmatic API – Full developer access with PHP functions

Shortcode Examples
[slackhooker text="Here is a message from my WordPress site"]

or
[slackhooker text="Here is a message" channel="general" username="My WordPress"]

or
[slackhooker text="Here is a message" channel="https://myorg.slack.com/services/xxoxlsodsfsfsdfds#channelname" username="My WordPress"]

Messages are queued last in the PHP process to ensure your other page processing is not interrupted, but you can override:
[slackhooker text="Here is a message from my WordPress." sendnow="true"]

Multiple or custom webhooks supported:
[slackhooker text="Here is a message to multiple webhooks" alsoto="https://hooks.slack.com/services/T03TDTbUF/BBG9SQV6X/abcdefghij,https://hooks.slack.com/services/T03TDTbUF/BBG9SQV6X/abcxxxxxxx"]

Programmatic Examples
Simple text messages:
if(function_exists('\VanillaBeans\SlackHooker\vbean_slackhooker')){
\VanillaBeans\SlackHooker\vbean_slackhooker('Here is my notification');
}

if(function_exists('\VanillaBeans\SlackHooker\vbean_slackhooker')){
\VanillaBeans\SlackHooker\vbean_slackhooker('Here is my notification','mychannel','Username',':specific_icon:');
}

if(function_exists('\VanillaBeans\SlackHooker\vbean_slacknotify')){
\VanillaBeans\SlackHooker\vbean_slacknotify(array('text'=>'Here is my notification','icon'=>':open_mouth:'));
}

Formatted data messages (NEW in 5.5.2):
if(function_exists('\VanillaBeans\SlackHooker\vbean_send_data')){
$data = array(
'User ID' => '12345',
'Email' => '[email protected]',
'Status' => 'Active',
'Last Login' => '2025-10-03 14:30:00'
);
\VanillaBeans\SlackHooker\vbean_send_data('User Registration', $data);
}

Custom formatted messages with options:
if(function_exists('\VanillaBeans\SlackHooker\vbean_send_data')){
$data = array(
'Order ID' => '#WC-12345',
'Amount' => '$299.99',
'Customer' => 'John Doe',
'Payment Method' => 'Credit Card'
);

$options = array(
'color' => '#00ff00',
'pretext' => 'New WooCommerce Sale!',
'text' => 'Payment processed successfully'
);

\VanillaBeans\SlackHooker\vbean_send_data('E-commerce Sale', $data, $options);
}

Building custom attachment messages:
if(function_exists('\VanillaBeans\SlackHooker\vbean_build_data_message')){
$message = \VanillaBeans\SlackHooker\vbean_build_data_message('System Alert', array(
'Server' => 'web-01.example.com',
'CPU Usage' => '85%',
'Memory' => '3.2GB / 4GB',
'Disk Space' => '75% full'
), array('color' => '#ff9900'));

// Send using existing notification system
Vanilla_Bean_Slack_Hooker::notification_send($message);
}

Parameters
There are defaults for all except the message. You can specify:

text – required. This is your message
endpoints – override defaults with a comma separated list of endpoints with optional channel and alert eg: endpoints=’https://endpoint.com#channel#here’
channel – defaults to ‘general’ or your admin default specified channel – deprecated
username – the identity you would like displayed as the sender in the channel
icon – any of the available emoji icons in the slack system
sendnow – true or false. Defaults to false. True means that the message would be executed at the time it is called rather than at the end of page load.

New Data Message Parameters (5.5.2):

title – required for data messages. Main title of the message
data – associative array of name => value pairs to display
options – array of formatting options (color, pretext, text, author_name, etc.)

Use Cases

E-commerce monitoring – WooCommerce order notifications
Error monitoring – PHP errors pushed to a channel as they happen, with a call trace
User activity tracking – Registration and login alerts
System monitoring – Server status and health checks
Content management – Post publication and comment notifications
Security alerts – Failed login attempts and suspicious activity
Plugin management – Installation, update, and deletion notifications

Contact
We can be found at:

Website: Velvary Contact
Twitter: @VelvaryVanilla
Email: [email protected] or [email protected]

延伸相關外掛

文章
Filter
Apply Filters
Mastodon