Changeset 3372099
- Timestamp:
- 10/03/2025 02:17:42 AM (6 months ago)
- Location:
- vanilla-bean-slack-hooker
- Files:
-
- 4 added
- 7 edited
- 63 copied
-
tags/5.5.3 (copied) (copied from vanilla-bean-slack-hooker/trunk)
-
tags/5.5.3/CHANGELOG.md (copied) (copied from vanilla-bean-slack-hooker/trunk/CHANGELOG.md) (2 diffs)
-
tags/5.5.3/CHANGELOG_verbose.md (copied) (copied from vanilla-bean-slack-hooker/trunk/CHANGELOG_verbose.md)
-
tags/5.5.3/CONTRIBUTORS.md (added)
-
tags/5.5.3/README.md (added)
-
tags/5.5.3/VERSION (copied) (copied from vanilla-bean-slack-hooker/trunk/VERSION) (1 diff)
-
tags/5.5.3/admin/class-vanilla-bean-slack-hooker-admin.php (copied) (copied from vanilla-bean-slack-hooker/trunk/admin/class-vanilla-bean-slack-hooker-admin.php)
-
tags/5.5.3/exopite-simple-options/assets/ace-loader.min.js (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/assets/ace-loader.min.js)
-
tags/5.5.3/exopite-simple-options/assets/chosen-sprite_2x.png (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/assets/chosen-sprite_2x.png)
-
tags/5.5.3/exopite-simple-options/assets/chosen.jquery.min.js (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/assets/chosen.jquery.min.js)
-
tags/5.5.3/exopite-simple-options/assets/chosen.min.css (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/assets/chosen.min.css)
-
tags/5.5.3/exopite-simple-options/assets/jquery.finderSelect.min.js (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/assets/jquery.finderSelect.min.js)
-
tags/5.5.3/exopite-simple-options/assets/jquery.fine-uploader.min.js (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/assets/jquery.fine-uploader.min.js)
-
tags/5.5.3/exopite-simple-options/assets/jquery.interdependencies.min.js (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/assets/jquery.interdependencies.min.js)
-
tags/5.5.3/exopite-simple-options/assets/jquery.minicolors.css (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/assets/jquery.minicolors.css)
-
tags/5.5.3/exopite-simple-options/assets/loader-color-picker.min.js (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/assets/loader-color-picker.min.js)
-
tags/5.5.3/exopite-simple-options/assets/loader-datepicker.min.js (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/assets/loader-datepicker.min.js)
-
tags/5.5.3/exopite-simple-options/assets/loader-fine-uploader.min.js (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/assets/loader-fine-uploader.min.js)
-
tags/5.5.3/exopite-simple-options/assets/loader-jquery-chosen.min.js (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/assets/loader-jquery-chosen.min.js)
-
tags/5.5.3/exopite-simple-options/assets/loader-jquery-finderselect.min.js (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/assets/loader-jquery-finderselect.min.js)
-
tags/5.5.3/exopite-simple-options/assets/loader-jquery-trumbowyg.min.js (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/assets/loader-jquery-trumbowyg.min.js)
-
tags/5.5.3/exopite-simple-options/assets/loader-minicolors.min.js (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/assets/loader-minicolors.min.js)
-
tags/5.5.3/exopite-simple-options/assets/scripts.min.js (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/assets/scripts.min.js)
-
tags/5.5.3/exopite-simple-options/assets/styles.css (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/assets/styles.css)
-
tags/5.5.3/exopite-simple-options/assets/styles.min.css (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/assets/styles.min.css)
-
tags/5.5.3/exopite-simple-options/assets/sweetalert.min.js (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/assets/sweetalert.min.js)
-
tags/5.5.3/exopite-simple-options/assets/wp-color-picker-alpha.min.js (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/assets/wp-color-picker-alpha.min.js)
-
tags/5.5.3/exopite-simple-options/exopite-simple-options-framework-class.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/exopite-simple-options-framework-class.php)
-
tags/5.5.3/exopite-simple-options/fields-class.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields-class.php)
-
tags/5.5.3/exopite-simple-options/fields/accordion.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/accordion.php)
-
tags/5.5.3/exopite-simple-options/fields/attached.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/attached.php)
-
tags/5.5.3/exopite-simple-options/fields/backup.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/backup.php)
-
tags/5.5.3/exopite-simple-options/fields/button_bar.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/button_bar.php)
-
tags/5.5.3/exopite-simple-options/fields/card.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/card.php)
-
tags/5.5.3/exopite-simple-options/fields/checkbox.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/checkbox.php)
-
tags/5.5.3/exopite-simple-options/fields/color.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/color.php)
-
tags/5.5.3/exopite-simple-options/fields/color_wp.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/color_wp.php)
-
tags/5.5.3/exopite-simple-options/fields/content.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/content.php)
-
tags/5.5.3/exopite-simple-options/fields/date.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/date.php)
-
tags/5.5.3/exopite-simple-options/fields/editor.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/editor.php)
-
tags/5.5.3/exopite-simple-options/fields/fieldset.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/fieldset.php)
-
tags/5.5.3/exopite-simple-options/fields/gallery.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/gallery.php)
-
tags/5.5.3/exopite-simple-options/fields/group.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/group.php)
-
tags/5.5.3/exopite-simple-options/fields/hidden.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/hidden.php)
-
tags/5.5.3/exopite-simple-options/fields/image.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/image.php)
-
tags/5.5.3/exopite-simple-options/fields/image_select.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/image_select.php)
-
tags/5.5.3/exopite-simple-options/fields/meta.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/meta.php)
-
tags/5.5.3/exopite-simple-options/fields/number.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/number.php)
-
tags/5.5.3/exopite-simple-options/fields/password.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/password.php)
-
tags/5.5.3/exopite-simple-options/fields/radio.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/radio.php)
-
tags/5.5.3/exopite-simple-options/fields/range.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/range.php)
-
tags/5.5.3/exopite-simple-options/fields/select.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/select.php)
-
tags/5.5.3/exopite-simple-options/fields/switcher.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/switcher.php)
-
tags/5.5.3/exopite-simple-options/fields/tab.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/tab.php)
-
tags/5.5.3/exopite-simple-options/fields/tap_list.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/tap_list.php)
-
tags/5.5.3/exopite-simple-options/fields/textarea.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/textarea.php)
-
tags/5.5.3/exopite-simple-options/fields/typography.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/typography.php)
-
tags/5.5.3/exopite-simple-options/fields/upload.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/upload.php)
-
tags/5.5.3/exopite-simple-options/fields/video.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/fields/video.php)
-
tags/5.5.3/exopite-simple-options/lang/exopite-sof.pot (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/lang/exopite-sof.pot)
-
tags/5.5.3/exopite-simple-options/upload-class.php (copied) (copied from vanilla-bean-slack-hooker/trunk/exopite-simple-options/upload-class.php)
-
tags/5.5.3/includes/class-vanilla-bean-slack-hooker.php (copied) (copied from vanilla-bean-slack-hooker/trunk/includes/class-vanilla-bean-slack-hooker.php) (1 diff)
-
tags/5.5.3/includes/legacy.php (copied) (copied from vanilla-bean-slack-hooker/trunk/includes/legacy.php)
-
tags/5.5.3/includes/notifier.php (modified) (1 diff)
-
tags/5.5.3/readme.txt (copied) (copied from vanilla-bean-slack-hooker/trunk/readme.txt) (1 diff)
-
tags/5.5.3/vanilla-bean-slack-hooker.php (copied) (copied from vanilla-bean-slack-hooker/trunk/vanilla-bean-slack-hooker.php) (1 diff)
-
trunk/CHANGELOG.md (modified) (2 diffs)
-
trunk/CONTRIBUTORS.md (added)
-
trunk/README.md (added)
-
trunk/VERSION (modified) (1 diff)
-
trunk/includes/class-vanilla-bean-slack-hooker.php (modified) (1 diff)
-
trunk/includes/notifier.php (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/vanilla-bean-slack-hooker.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
vanilla-bean-slack-hooker/tags/5.5.3/CHANGELOG.md
r3277792 r3372099 1 ## 5.5.3 2 03 October 2025 3 4 - Updated Vanilla Bean Slack Hooker 5 - feat: changed file reference in MAIASS_VERSION_SECONDARY_FILES of .env.maiass 6 - feat: added new CONTRIBUTORS.md and README.md 7 - docs: populated README.md with comprehensive plugin description 8 - Removed vanilla-bean-slack-hooker reference 9 - rm: deleted reference to vanilla-bean-slack-hooker 10 - Enhanced MAIASS and SlackHooker features 11 - feat: added MAIASS configuration file 12 - feat: added new notifier functions in SlackHooker 13 - fix: updated .gitignore to ignore .env.maiass.local 14 - fix: renamed CHANGELOG_verbose.md to CHANGELOG_internal.md 15 - feat: created symlink for vanilla-bean-slack-hooker 16 1 17 ## 5.5.0 2 18 21 April 2025 … … 11 27 ## 5.3.5 12 28 21 April 2025 13 -
vanilla-bean-slack-hooker/tags/5.5.3/VERSION
r3277792 r3372099 1 5.5. 01 5.5.3 -
vanilla-bean-slack-hooker/tags/5.5.3/includes/class-vanilla-bean-slack-hooker.php
r3277792 r3372099 323 323 } 324 324 325 326 325 /** 326 * Build a formatted attachment message with data fields 327 * 328 * @param string $title The main title of the message 329 * @param array $data Associative array of name => value pairs 330 * @param array $options Optional settings: color, pretext, footer, etc. 331 * @return array Formatted attachment array 332 */ 333 public static function build_data_message($title, $data = array(), $options = array()) { 334 $defaults = array( 335 'color' => '#36a64f', 336 'pretext' => '', 337 'footer' => SLACKHOOKER_FOOTERTEXT, 338 'footer_icon' => SLACKHOOKER_LOGO, 339 'ts' => time() 340 ); 341 342 $settings = array_merge($defaults, $options); 343 344 $message = array( 345 'color' => $settings['color'], 346 'title' => $title, 347 'footer' => $settings['footer'], 348 'footer_icon' => $settings['footer_icon'], 349 'ts' => $settings['ts'] 350 ); 351 352 // Add optional fields 353 if (!empty($settings['pretext'])) { 354 $message['pretext'] = $settings['pretext']; 355 } 356 if (!empty($settings['text'])) { 357 $message['text'] = $settings['text']; 358 } 359 if (!empty($settings['title_link'])) { 360 $message['title_link'] = $settings['title_link']; 361 } 362 if (!empty($settings['author_name'])) { 363 $message['author_name'] = $settings['author_name']; 364 } 365 if (!empty($settings['author_link'])) { 366 $message['author_link'] = $settings['author_link']; 367 } 368 369 // Build fields array from data 370 if (!empty($data) && is_array($data)) { 371 $fields = array(); 372 foreach ($data as $name => $value) { 373 $fields[] = array( 374 'title' => $name, 375 'value' => $value, 376 'short' => true // Display fields in columns 377 ); 378 } 379 $message['fields'] = $fields; 380 } 381 382 return $message; 383 } 384 385 /** 386 * Send a formatted data message 387 * 388 * @param string $title The main title 389 * @param array $data Associative array of name => value pairs 390 * @param array $options Optional settings 391 * @param mixed $endpoints Custom endpoints 392 * @param string $endpointOptions Endpoint options 393 * @return mixed Send result 394 */ 395 public static function send_data_message($title, $data = array(), $options = array(), $endpoints = false, $endpointOptions = 'defaults') { 396 $message = self::build_data_message($title, $data, $options); 397 return self::notification_send($message, $endpoints, $endpointOptions); 398 } 327 399 328 400 } -
vanilla-bean-slack-hooker/tags/5.5.3/includes/notifier.php
r2953563 r3372099 142 142 // </editor-fold> 143 143 144 add_shortcode('slackhooker', '\VanillaBeans\SlackHooker\vbean_slacknotify'); 144 /** 145 * Send a formatted message with data fields 146 * 147 * @param string $title The main title of the message 148 * @param array $data Associative array of name => value pairs 149 * @param array $options Optional settings: color, pretext, footer, etc. 150 * @param mixed $endpoints Custom endpoints 151 * @param string $endpointOptions Endpoint options 152 * @return mixed Send result 153 */ 154 if (!function_exists('\VanillaBeans\SlackHooker\vbean_send_data')) { 155 function vbean_send_data($title, $data = array(), $options = array(), $endpoints = false, $endpointOptions = 'defaults') { 156 return \Vanilla_Bean_Slack_Hooker::send_data_message($title, $data, $options, $endpoints, $endpointOptions); 157 } 158 } 145 159 160 /** 161 * Build a formatted attachment message with data fields 162 * 163 * @param string $title The main title of the message 164 * @param array $data Associative array of name => value pairs 165 * @param array $options Optional settings: color, pretext, footer, etc. 166 * @return array Formatted attachment array 167 */ 168 if (!function_exists('\VanillaBeans\SlackHooker\vbean_build_data_message')) { 169 function vbean_build_data_message($title, $data = array(), $options = array()) { 170 return \Vanilla_Bean_Slack_Hooker::build_data_message($title, $data, $options); 171 } 172 } -
vanilla-bean-slack-hooker/tags/5.5.3/readme.txt
r3277792 r3372099 1 === Plugin Name===1 === Vanilla Bean Slack Hooker === 2 2 Contributors: vsmash 3 3 Donate link: http://www.velvary.com.au/vanilla-beans/wordpress/slack-hooker/ 4 Tags: slack, webhook, message, api, alerts 4 Tags: slack, webhook, message, api, alerts, notifications, mattermost, discord, automation 5 5 Requires at least: 5.4 6 6 Tested up to: 6.8 7 7 PHP Tested up to: 8.2 8 Stable tag: 5.5. 08 Stable tag: 5.5.3 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html 11 11 12 Notify one or more slack, mattermost or other endpoints with configured webhooks for 13 Wordpress events. Notifications for plugin installs and updates, page views, error messages, signups, woocommerce 14 or anything you like with fully customizable shortcodes, hooks 15 and filter functions. 12 Notify one or more Slack, Mattermost or other endpoints with configured webhooks for WordPress events. Notifications for plugin installs and updates, page views, error messages, signups, WooCommerce sales or anything you like with fully customizable shortcodes, hooks and filter functions. 16 13 17 14 == Description == 18 *Automated notifications from your Wordpress * to your Slack / Mattermost application channels and webhooks. 15 16 **Automated notifications from your WordPress site to your Slack / Mattermost application channels and webhooks.** 19 17 20 18 There is no limit to the ways you may integrate this plugin. 21 19 22 It supports all other Vanilla Bean plugins and is available for under-the-bonnet 23 use as well as shortcode access. 24 25 = Some shortcode examples: = 26 27 `[slackhooker text="Here is a message from my wordpress"]` 20 It supports all other Vanilla Bean plugins and is available for under-the-hood use as well as shortcode access. 21 22 = Key Features = 23 24 * **Real-time WordPress notifications** - Post status changes, comments, user registrations 25 * **WooCommerce integration** - Sales notifications with order details 26 * **Plugin management alerts** - Install, update, and deletion notifications 27 * **Multiple webhook support** - Send to Slack, Mattermost, Discord, or custom endpoints 28 * **Formatted data messages** - Rich attachments with structured name-value pairs *(NEW in 5.5.2)* 29 * **Smart queueing** - Non-blocking message delivery with optional immediate sending 30 * **Email fallback** - Send notifications via email when webhooks aren't available 31 * **Shortcode support** - Easy integration in posts and pages 32 * **Programmatic API** - Full developer access with PHP functions 33 34 = Shortcode Examples = 35 36 `[slackhooker text="Here is a message from my WordPress site"]` 28 37 29 38 or 30 39 31 `[slackhooker text="Here is a message" channel="general" username="My Word press"]`40 `[slackhooker text="Here is a message" channel="general" username="My WordPress"]` 32 41 33 42 or 34 43 35 `[slackhooker text="Here is a message" channel="https://myorg.slack.com/services/xxoxlsodsfsfsdfds#channelname" username="My Word press"]`36 37 Messages are queued last in the PHP process to insure your other page processing is not interrupted, but you can override:38 39 `[slackhooker text="Here is a message from my wordpress." sendnow="true"]`40 41 Multiple or custom Webhooks supported44 `[slackhooker text="Here is a message" channel="https://myorg.slack.com/services/xxoxlsodsfsfsdfds#channelname" username="My WordPress"]` 45 46 Messages are queued last in the PHP process to ensure your other page processing is not interrupted, but you can override: 47 48 `[slackhooker text="Here is a message from my WordPress." sendnow="true"]` 49 50 Multiple or custom webhooks supported: 42 51 43 52 `[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"]` 44 53 45 46 54 = Programmatic Examples = 55 56 **Simple text messages:** 57 47 58 `if(function_exists('\VanillaBeans\SlackHooker\vbean_slackhooker')){ 48 59 \VanillaBeans\SlackHooker\vbean_slackhooker('Here is my notification'); 49 }`60 }` 50 61 51 62 `if(function_exists('\VanillaBeans\SlackHooker\vbean_slackhooker')){ 52 63 \VanillaBeans\SlackHooker\vbean_slackhooker('Here is my notification','mychannel','Username',':specific_icon:'); 53 }`54 55 `if(function_exists('\VanillaBeans\SlackHooker\vbean_slack hooker')){64 }` 65 66 `if(function_exists('\VanillaBeans\SlackHooker\vbean_slacknotify')){ 56 67 \VanillaBeans\SlackHooker\vbean_slacknotify(array('text'=>'Here is my notification','icon'=>':open_mouth:')); 57 }` 58 59 There are defaults for all except the message. You can specify: 60 `* *text* - required. This is your message 61 * *endpoints* - override defaults with a comma separated list of endpooints with optional channel and alert eg: endpoints='https://endpoint.com#channel#here" 62 * *channel* - defaults to 'general' or your admin default specified channel - depracated 63 * *username* - the identity you would like displayed as the sender in the channel 64 * *icon* - any of the available emoji icons in the slack system 65 * *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. 66 67 68 }` 69 70 **Formatted data messages (NEW in 5.5.2):** 71 72 `if(function_exists('\VanillaBeans\SlackHooker\vbean_send_data')){ 73 $data = array( 74 'User ID' => '12345', 75 'Email' => 'user@example.com', 76 'Status' => 'Active', 77 'Last Login' => '2025-10-03 14:30:00' 78 ); 79 \VanillaBeans\SlackHooker\vbean_send_data('User Registration', $data); 80 }` 81 82 **Custom formatted messages with options:** 83 84 `if(function_exists('\VanillaBeans\SlackHooker\vbean_send_data')){ 85 $data = array( 86 'Order ID' => '#WC-12345', 87 'Amount' => '$299.99', 88 'Customer' => 'John Doe', 89 'Payment Method' => 'Credit Card' 90 ); 91 92 $options = array( 93 'color' => '#00ff00', 94 'pretext' => 'New WooCommerce Sale!', 95 'text' => 'Payment processed successfully' 96 ); 97 98 \VanillaBeans\SlackHooker\vbean_send_data('E-commerce Sale', $data, $options); 99 }` 100 101 **Building custom attachment messages:** 102 103 `if(function_exists('\VanillaBeans\SlackHooker\vbean_build_data_message')){ 104 $message = \VanillaBeans\SlackHooker\vbean_build_data_message('System Alert', array( 105 'Server' => 'web-01.example.com', 106 'CPU Usage' => '85%', 107 'Memory' => '3.2GB / 4GB', 108 'Disk Space' => '75% full' 109 ), array('color' => '#ff9900')); 110 111 // Send using existing notification system 112 Vanilla_Bean_Slack_Hooker::notification_send($message); 113 }` 114 115 = Parameters = 116 117 There are defaults for all except the message. You can specify: 118 119 * **text** - required. This is your message 120 * **endpoints** - override defaults with a comma separated list of endpoints with optional channel and alert eg: endpoints='https://endpoint.com#channel#here' 121 * **channel** - defaults to 'general' or your admin default specified channel - deprecated 122 * **username** - the identity you would like displayed as the sender in the channel 123 * **icon** - any of the available emoji icons in the slack system 124 * **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. 125 126 **New Data Message Parameters (5.5.2):** 127 128 * **title** - required for data messages. Main title of the message 129 * **data** - associative array of name => value pairs to display 130 * **options** - array of formatting options (color, pretext, text, author_name, etc.) 131 132 = Use Cases = 133 134 * **E-commerce monitoring** - WooCommerce order notifications 135 * **User activity tracking** - Registration and login alerts 136 * **System monitoring** - Server status and health checks 137 * **Content management** - Post publication and comment notifications 138 * **Security alerts** - Failed login attempts and suspicious activity 139 * **Plugin management** - Installation, update, and deletion notifications 68 140 69 141 = Contact = 142 70 143 We can be found at: 71 * (http://www.velvary.com.au/contact-us) 72 * Twitter: @VelvaryVanilla73 * E: info@ or support@ velvary.com.au74 144 145 * Website: [Velvary Contact](http://www.velvary.com.au/contact-us) 146 * Twitter: @VelvaryVanilla 147 * Email: info@velvary.com.au or support@velvary.com.au 75 148 76 149 == Installation == 77 Unzip into your plugins directory, install directly from 78 wordpress plugins site. 79 150 151 1. **Via WordPress Admin (Recommended)** 152 * Navigate to Plugins > Add New 153 * Search for "Vanilla Bean Slack Hooker" 154 * Click Install Now and then Activate 155 156 2. **Manual Installation** 157 * Download the plugin ZIP file 158 * Upload to `/wp-content/plugins/vanilla-bean-slack-hooker/` 159 * Activate through the Plugins menu in WordPress 160 161 3. **Configuration** 162 * Go to Settings > Slack Hooker in your WordPress admin 163 * Add your webhook URLs (Slack, Mattermost, etc.) 164 * Configure notification preferences 165 * Test your setup with the built-in test message feature 166 167 == Frequently Asked Questions == 168 169 = What webhook services are supported? = 170 171 The plugin supports any webhook-compatible service including Slack, Mattermost, Discord, Microsoft Teams, and custom webhook endpoints. Email addresses can also be used as fallback endpoints. 172 173 = Are messages sent immediately? = 174 175 By default, messages are queued and sent via WordPress cron to avoid blocking page loads. You can force immediate sending by setting `sendnow="true"` in shortcodes or `$now=true` in programmatic calls. 176 177 = Can I send to multiple channels at once? = 178 179 Yes! You can configure multiple default endpoints in the admin settings, or specify additional endpoints using the `alsoto` parameter in shortcodes and programmatic calls. 180 181 = What data is included in WooCommerce notifications? = 182 183 WooCommerce notifications include order ID, customer name, total amount, payment status, and admin links to view the order details. 184 185 = Is the plugin compatible with multisite? = 186 187 Yes, the plugin works on WordPress multisite installations. Each site maintains its own webhook configuration and notification settings. 188 189 = Can I customize the message format? = 190 191 Absolutely! The new data message functions (5.5.2+) allow you to create rich formatted messages with custom colors, structured data fields, and flexible styling options. 80 192 81 193 == Screenshots == 82 1. Example of wordpress monitoring 83 2. Admin instruction page 84 3. Another example of wordpress monitoring 85 4. Screenshot of default options 86 5. Screenshot of Notification choices 194 195 1. Example of WordPress monitoring notifications in Slack 196 2. Admin settings page with webhook configuration 197 3. Rich formatted data messages with structured fields 198 4. Plugin management notifications 199 5. WooCommerce sales notifications 87 200 88 201 == Changelog == 202 203 = 5.5.2 = 204 *Release Date: October 3, 2025* 205 206 * **NEW: Formatted data message support** - Rich attachments with name-value pairs 207 * **NEW: vbean_send_data() function** - Send structured data messages easily 208 * **NEW: vbean_build_data_message() function** - Build custom attachment messages 209 * Enhanced MAIASS configuration support 210 * Improved documentation with comprehensive examples 211 * Better Slack field formatting for structured data display 212 213 = 5.5.0 = 214 *Release Date: April 21, 2025* 215 216 * Fixed overly zealous escaping issues 217 * Improved message content handling 218 89 219 = 5.4.6 = 90 - securty update - removed unneeded files 91 - tested with wordpress 6.8 and php 8.2 92 - added input filtering for security reasons 220 *Release Date: April 21, 2025* 221 222 * **Security update** - Enhanced input filtering and validation 223 * Removed unneeded files for improved security 224 * Tested with WordPress 6.8 and PHP 8.2 225 * Added comprehensive input sanitization 93 226 94 227 = 5.3.1 = 95 - Tested with wordpress 6.5 and php 8.2 228 * Tested with WordPress 6.5 and PHP 8.2 229 * Compatibility updates 96 230 97 231 = 5.2.14 = 98 - Bugfix - fixed issue with default channel reference having typo resulting in plugin upgrades notificaitons not working 232 * **Bugfix** - Fixed default channel reference typo affecting plugin upgrade notifications 233 * Improved notification reliability 99 234 100 235 = 5.2.11 = 101 - Bugfix - fixed issue with default channel reference having typo resulting in plugin upgrades notificaitons not working 236 * **Bugfix** - Fixed default channel reference issue 237 * Enhanced plugin upgrade notification handling 102 238 103 239 = 5.2.7 = 104 - Fixed versioning inconsistency 240 * Fixed versioning inconsistency 241 * Updated version management 105 242 106 243 = 5.2.0 = 107 - Added support for email notifications 244 * **NEW: Email notification support** - Use email addresses as webhook endpoints 245 * Enhanced fallback messaging options 108 246 109 247 = 5.1.7 = 110 - Admin menu bugfix 248 * Admin menu bugfix 249 * Improved navigation 111 250 112 251 = 5.1.6 = 113 - tested with wordpress 6.2 252 * Tested with WordPress 6.2 253 * Compatibility verification 114 254 115 255 = 5.1.3 = 116 - fixed double up in get_url() string replace 117 256 * Fixed double replacement in get_url() string processing 257 * Improved URL handling 118 258 119 259 = 5.1.2 = 120 - fixed default valuefor fields121 - fixed missing admin menu item 260 * Fixed default value handling for fields 261 * Resolved missing admin menu item issue 122 262 123 263 = 5.1.1 = 124 - fixed path error for mce plugin 264 * Fixed path error for MCE plugin integration 265 * Improved file path handling 125 266 126 267 = 5.1.0 = 127 - Cron messages made optional for when cron not supported 128 129 130 Another major overhaul. Previous settings not carried forward. 268 * **NEW: Optional cron messaging** - Support for environments without cron 269 * Enhanced message delivery options 270 131 271 = 5.0.0 = 132 - Notification overrides can now be set for each endpoint 133 - Endpoints can now have alerts such as <!here> or <!channel> or <!everyone> added to them by adding #here or #channel or #everyone to the end of the endpoint url 134 - Improved admin layout 135 - Tested on PHP8.1 136 - Tested on Wordpress 6.1 137 138 139 Major overhaul. Previous settings not carried forward. 272 *Major overhaul - Previous settings not carried forward* 273 274 * **NEW: Notification overrides** - Per-endpoint configuration 275 * **NEW: Alert mentions** - Add @here, @channel, @everyone to endpoints 276 * Improved admin layout and user experience 277 * Tested with PHP 8.1 and WordPress 6.1 278 * Enhanced endpoint management 279 140 280 = 4.0.5 = 141 - bugfix naming conflict in javascript142 - bugfix path for css281 * Fixed JavaScript naming conflict 282 * Corrected CSS path issues 143 283 144 284 = 4.0.3 = 145 - bugfix for mattermost 146 - bugfix to textdomain 285 * **Bugfix** - Improved Mattermost compatibility 286 * Fixed text domain issues 147 287 148 288 = 4.0.0 = 149 - MAJOR OVERHAUL Rewrite 150 - More alerts added for posts 151 - Customisable endpoints for all alerts 289 *Major overhaul - Previous settings not carried forward* 290 291 * **NEW: Enhanced post alerts** - More notification types 292 * **NEW: Customizable endpoints** - Per-alert configuration 293 * Complete codebase rewrite for better performance 152 294 153 295 = 3.30 = 154 - added support for endpoints in channels 296 * Added support for endpoints in channels 297 * Enhanced channel targeting 155 298 156 299 = 3.22 = 157 - bugfix for post status change 300 * **Bugfix** - Fixed post status change notifications 301 * Improved reliability 158 302 159 303 = 3.21 = 160 - tested against wordpress 6.1 and php 8.1 304 * Tested with WordPress 6.1 and PHP 8.1 305 * Compatibility updates 161 306 162 307 = 3.10 = 163 - added site url to notificaitons 164 - added post/page published notifications 308 * Added site URL to notifications for better identification 309 * **NEW: Post/page publication notifications** 310 * Enhanced notification content 165 311 166 312 = 3.05 = 167 - added code for system plugin updater 313 * Added system plugin updater integration 314 * Improved plugin management 168 315 169 316 = 3.04 = 170 - Broken Image fix 317 * Fixed broken image references 318 * Improved asset handling 171 319 172 320 = 3.03 = 173 - Cosmetic fix 321 * Cosmetic improvements 322 * UI enhancements 174 323 175 324 = 3.02 = 176 - Added woocommerce sales hook 325 * **NEW: WooCommerce sales notifications** 326 * E-commerce integration support 177 327 178 328 = 3.00 = 179 - Added compatibility with Mattermost 180 181 = PREVIOUS VERSIONS REMOVED = 182 - Added current site to default user 329 * **NEW: Mattermost compatibility** 330 * Expanded webhook service support 183 331 184 332 = 2.60 = 185 - Added current user to plugin alerts 333 * Added current user information to plugin alerts 334 * Enhanced notification context 186 335 187 336 = 2.55 = 188 - Added toggle option for help 337 * Added toggle option for help display 338 * Improved user experience 189 339 190 340 = 2.47 = 191 - Enabled inheritance of <v2.46 channel default for alerts 341 * Enabled inheritance of v2.46 channel defaults 342 * Backward compatibility improvements 192 343 193 344 = 2.46 = 194 - Enabled channel selection for default alerts 345 * **NEW: Channel selection** for default alerts 346 * Enhanced configuration options 195 347 196 348 = 2.45 = 197 - Fixed test msg typo 349 * Fixed test message typo 350 * Improved testing functionality 198 351 199 352 = 2.44 = 200 - Added default notification options for when plugins are installed, updated etc 201 - Tested against WP5.3202 - Tested against Corona virus 353 * **NEW: Plugin management notifications** - Install, update, delete alerts 354 * Tested with WordPress 5.3 355 * Enhanced system monitoring 203 356 204 357 = 2.20 = 205 - Changed Curl to http-api 358 * Migrated from cURL to WordPress HTTP API 359 * Improved reliability and compatibility 206 360 207 361 = 2.14 = 208 - Changed @channel syntax to work with latest api 362 * Updated @channel syntax for latest Slack API 363 * Enhanced mention functionality 209 364 210 365 = 2.13 = 211 - Fixed bug of slack plugin validation updating incorrectly 212 - added programmatic examples to settings page 366 * Fixed plugin validation update bug 367 * Added programmatic examples to settings page 368 * Improved documentation 213 369 214 370 = 2.12 = 215 Updated Icon 371 * Updated plugin icon 372 * Visual improvements 216 373 217 374 = 2.11 = 218 Added missing menu icon 375 * Added missing menu icon 376 * UI enhancements 219 377 220 378 = 2.10 = 221 Tested against php7.1 and wordpress 4.7 379 * Tested with PHP 7.1 and WordPress 4.7 380 * Compatibility verification 222 381 223 382 = 2.0 = 224 * Added repetition prevention functionality 225 * Added support for multiple slack webhooks 383 * **NEW: Repetition prevention** - Avoid spam notifications 384 * **NEW: Multiple webhook support** 385 * Enhanced message management 226 386 227 387 = 1.50 = 228 Fixed issue with specified icon not displaying in notice 388 * Fixed icon display issue in notifications 389 * Improved visual consistency 229 390 230 391 = 1.42 = 231 Set delayed send to flag slack as working 392 * Set delayed send to properly flag Slack as working 393 * Enhanced status tracking 232 394 233 395 = 1.41 = 234 Moved slack message to immediate cron job so that it does not delay page load 396 * **Performance improvement** - Moved to cron job to prevent page load delays 397 * Non-blocking message delivery 235 398 236 399 = 1.24 = 237 Tested against wp 4.5 400 * Tested with WordPress 4.5 401 * Compatibility updates 238 402 239 403 = 1.23 = 240 Updated 404 test 404 * Updated 404 error handling 405 * Improved error management 241 406 242 407 = 1.22 = 243 Updated common functions 408 * Updated common functions 409 * Code optimization 244 410 245 411 = 1.21 = 246 Added support for default icon 412 * **NEW: Default icon support** 413 * Enhanced customization options 247 414 248 415 = 1.2 = 249 Added default comment alert 416 * **NEW: Default comment alerts** 417 * Comment notification system 250 418 251 419 = 1.1 = 252 Fix broken plugin download link 420 * Fixed broken plugin download link 421 * Improved distribution 253 422 254 423 = 1.01 = 255 Shortcode in admin documentation bugfix 424 * Fixed shortcode documentation bug 425 * Documentation improvements 256 426 257 427 = 1.0 = 258 Initial release 259 428 * Initial release 429 * Basic Slack webhook integration 430 431 == Upgrade Notice == 432 433 = 5.5.2 = 434 Major new feature: Formatted data messages with structured name-value pairs! Enhanced Slack integration with rich attachments. Update recommended for better notification formatting. 435 436 = 5.4.6 = 437 Important security update with enhanced input filtering. Update immediately for improved security. 438 439 = 5.2.0 = 440 New email notification support allows using email addresses as webhook endpoints. Great for fallback notifications! 441 442 = 5.0.0 = 443 Major overhaul with per-endpoint configuration and alert mentions. Previous settings will not be carried forward - reconfiguration required. 444 445 = 4.0.0 = 446 Complete rewrite with enhanced post alerts and customizable endpoints. Previous settings will not be carried forward. 447 448 = 3.00 = 449 Now supports Mattermost in addition to Slack! Expanded webhook compatibility. 260 450 261 451 = 2.44 = 262 Added alerts for when plugins are added/deleted/updated 263 264 = 1.5 = 265 Moved messaging to cron so that page load is not affected 266 267 = 1.2 = 268 Added functionality to notify channel of new comments 452 New plugin management notifications keep you informed of plugin installs, updates, and deletions. 453 454 = 2.0 = 455 Added repetition prevention and multiple webhook support for better notification management. -
vanilla-bean-slack-hooker/tags/5.5.3/vanilla-bean-slack-hooker.php
r3277792 r3372099 17 17 Plugin URI: https://www.velvary.com.au 18 18 Description: Integrate webhooks into your site for notifications via Slack, Mattermost or others 19 Version: 5.5. 019 Version: 5.5.3 20 20 Author: Velvary 21 21 Author URI: https://www.velvary.com.au -
vanilla-bean-slack-hooker/trunk/CHANGELOG.md
r3277792 r3372099 1 ## 5.5.3 2 03 October 2025 3 4 - Updated Vanilla Bean Slack Hooker 5 - feat: changed file reference in MAIASS_VERSION_SECONDARY_FILES of .env.maiass 6 - feat: added new CONTRIBUTORS.md and README.md 7 - docs: populated README.md with comprehensive plugin description 8 - Removed vanilla-bean-slack-hooker reference 9 - rm: deleted reference to vanilla-bean-slack-hooker 10 - Enhanced MAIASS and SlackHooker features 11 - feat: added MAIASS configuration file 12 - feat: added new notifier functions in SlackHooker 13 - fix: updated .gitignore to ignore .env.maiass.local 14 - fix: renamed CHANGELOG_verbose.md to CHANGELOG_internal.md 15 - feat: created symlink for vanilla-bean-slack-hooker 16 1 17 ## 5.5.0 2 18 21 April 2025 … … 11 27 ## 5.3.5 12 28 21 April 2025 13 -
vanilla-bean-slack-hooker/trunk/VERSION
r3277792 r3372099 1 5.5. 01 5.5.3 -
vanilla-bean-slack-hooker/trunk/includes/class-vanilla-bean-slack-hooker.php
r3277792 r3372099 323 323 } 324 324 325 326 325 /** 326 * Build a formatted attachment message with data fields 327 * 328 * @param string $title The main title of the message 329 * @param array $data Associative array of name => value pairs 330 * @param array $options Optional settings: color, pretext, footer, etc. 331 * @return array Formatted attachment array 332 */ 333 public static function build_data_message($title, $data = array(), $options = array()) { 334 $defaults = array( 335 'color' => '#36a64f', 336 'pretext' => '', 337 'footer' => SLACKHOOKER_FOOTERTEXT, 338 'footer_icon' => SLACKHOOKER_LOGO, 339 'ts' => time() 340 ); 341 342 $settings = array_merge($defaults, $options); 343 344 $message = array( 345 'color' => $settings['color'], 346 'title' => $title, 347 'footer' => $settings['footer'], 348 'footer_icon' => $settings['footer_icon'], 349 'ts' => $settings['ts'] 350 ); 351 352 // Add optional fields 353 if (!empty($settings['pretext'])) { 354 $message['pretext'] = $settings['pretext']; 355 } 356 if (!empty($settings['text'])) { 357 $message['text'] = $settings['text']; 358 } 359 if (!empty($settings['title_link'])) { 360 $message['title_link'] = $settings['title_link']; 361 } 362 if (!empty($settings['author_name'])) { 363 $message['author_name'] = $settings['author_name']; 364 } 365 if (!empty($settings['author_link'])) { 366 $message['author_link'] = $settings['author_link']; 367 } 368 369 // Build fields array from data 370 if (!empty($data) && is_array($data)) { 371 $fields = array(); 372 foreach ($data as $name => $value) { 373 $fields[] = array( 374 'title' => $name, 375 'value' => $value, 376 'short' => true // Display fields in columns 377 ); 378 } 379 $message['fields'] = $fields; 380 } 381 382 return $message; 383 } 384 385 /** 386 * Send a formatted data message 387 * 388 * @param string $title The main title 389 * @param array $data Associative array of name => value pairs 390 * @param array $options Optional settings 391 * @param mixed $endpoints Custom endpoints 392 * @param string $endpointOptions Endpoint options 393 * @return mixed Send result 394 */ 395 public static function send_data_message($title, $data = array(), $options = array(), $endpoints = false, $endpointOptions = 'defaults') { 396 $message = self::build_data_message($title, $data, $options); 397 return self::notification_send($message, $endpoints, $endpointOptions); 398 } 327 399 328 400 } -
vanilla-bean-slack-hooker/trunk/includes/notifier.php
r2953563 r3372099 142 142 // </editor-fold> 143 143 144 add_shortcode('slackhooker', '\VanillaBeans\SlackHooker\vbean_slacknotify'); 144 /** 145 * Send a formatted message with data fields 146 * 147 * @param string $title The main title of the message 148 * @param array $data Associative array of name => value pairs 149 * @param array $options Optional settings: color, pretext, footer, etc. 150 * @param mixed $endpoints Custom endpoints 151 * @param string $endpointOptions Endpoint options 152 * @return mixed Send result 153 */ 154 if (!function_exists('\VanillaBeans\SlackHooker\vbean_send_data')) { 155 function vbean_send_data($title, $data = array(), $options = array(), $endpoints = false, $endpointOptions = 'defaults') { 156 return \Vanilla_Bean_Slack_Hooker::send_data_message($title, $data, $options, $endpoints, $endpointOptions); 157 } 158 } 145 159 160 /** 161 * Build a formatted attachment message with data fields 162 * 163 * @param string $title The main title of the message 164 * @param array $data Associative array of name => value pairs 165 * @param array $options Optional settings: color, pretext, footer, etc. 166 * @return array Formatted attachment array 167 */ 168 if (!function_exists('\VanillaBeans\SlackHooker\vbean_build_data_message')) { 169 function vbean_build_data_message($title, $data = array(), $options = array()) { 170 return \Vanilla_Bean_Slack_Hooker::build_data_message($title, $data, $options); 171 } 172 } -
vanilla-bean-slack-hooker/trunk/readme.txt
r3277792 r3372099 1 === Plugin Name===1 === Vanilla Bean Slack Hooker === 2 2 Contributors: vsmash 3 3 Donate link: http://www.velvary.com.au/vanilla-beans/wordpress/slack-hooker/ 4 Tags: slack, webhook, message, api, alerts 4 Tags: slack, webhook, message, api, alerts, notifications, mattermost, discord, automation 5 5 Requires at least: 5.4 6 6 Tested up to: 6.8 7 7 PHP Tested up to: 8.2 8 Stable tag: 5.5. 08 Stable tag: 5.5.3 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html 11 11 12 Notify one or more slack, mattermost or other endpoints with configured webhooks for 13 Wordpress events. Notifications for plugin installs and updates, page views, error messages, signups, woocommerce 14 or anything you like with fully customizable shortcodes, hooks 15 and filter functions. 12 Notify one or more Slack, Mattermost or other endpoints with configured webhooks for WordPress events. Notifications for plugin installs and updates, page views, error messages, signups, WooCommerce sales or anything you like with fully customizable shortcodes, hooks and filter functions. 16 13 17 14 == Description == 18 *Automated notifications from your Wordpress * to your Slack / Mattermost application channels and webhooks. 15 16 **Automated notifications from your WordPress site to your Slack / Mattermost application channels and webhooks.** 19 17 20 18 There is no limit to the ways you may integrate this plugin. 21 19 22 It supports all other Vanilla Bean plugins and is available for under-the-bonnet 23 use as well as shortcode access. 24 25 = Some shortcode examples: = 26 27 `[slackhooker text="Here is a message from my wordpress"]` 20 It supports all other Vanilla Bean plugins and is available for under-the-hood use as well as shortcode access. 21 22 = Key Features = 23 24 * **Real-time WordPress notifications** - Post status changes, comments, user registrations 25 * **WooCommerce integration** - Sales notifications with order details 26 * **Plugin management alerts** - Install, update, and deletion notifications 27 * **Multiple webhook support** - Send to Slack, Mattermost, Discord, or custom endpoints 28 * **Formatted data messages** - Rich attachments with structured name-value pairs *(NEW in 5.5.2)* 29 * **Smart queueing** - Non-blocking message delivery with optional immediate sending 30 * **Email fallback** - Send notifications via email when webhooks aren't available 31 * **Shortcode support** - Easy integration in posts and pages 32 * **Programmatic API** - Full developer access with PHP functions 33 34 = Shortcode Examples = 35 36 `[slackhooker text="Here is a message from my WordPress site"]` 28 37 29 38 or 30 39 31 `[slackhooker text="Here is a message" channel="general" username="My Word press"]`40 `[slackhooker text="Here is a message" channel="general" username="My WordPress"]` 32 41 33 42 or 34 43 35 `[slackhooker text="Here is a message" channel="https://myorg.slack.com/services/xxoxlsodsfsfsdfds#channelname" username="My Word press"]`36 37 Messages are queued last in the PHP process to insure your other page processing is not interrupted, but you can override:38 39 `[slackhooker text="Here is a message from my wordpress." sendnow="true"]`40 41 Multiple or custom Webhooks supported44 `[slackhooker text="Here is a message" channel="https://myorg.slack.com/services/xxoxlsodsfsfsdfds#channelname" username="My WordPress"]` 45 46 Messages are queued last in the PHP process to ensure your other page processing is not interrupted, but you can override: 47 48 `[slackhooker text="Here is a message from my WordPress." sendnow="true"]` 49 50 Multiple or custom webhooks supported: 42 51 43 52 `[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"]` 44 53 45 46 54 = Programmatic Examples = 55 56 **Simple text messages:** 57 47 58 `if(function_exists('\VanillaBeans\SlackHooker\vbean_slackhooker')){ 48 59 \VanillaBeans\SlackHooker\vbean_slackhooker('Here is my notification'); 49 }`60 }` 50 61 51 62 `if(function_exists('\VanillaBeans\SlackHooker\vbean_slackhooker')){ 52 63 \VanillaBeans\SlackHooker\vbean_slackhooker('Here is my notification','mychannel','Username',':specific_icon:'); 53 }`54 55 `if(function_exists('\VanillaBeans\SlackHooker\vbean_slack hooker')){64 }` 65 66 `if(function_exists('\VanillaBeans\SlackHooker\vbean_slacknotify')){ 56 67 \VanillaBeans\SlackHooker\vbean_slacknotify(array('text'=>'Here is my notification','icon'=>':open_mouth:')); 57 }` 58 59 There are defaults for all except the message. You can specify: 60 `* *text* - required. This is your message 61 * *endpoints* - override defaults with a comma separated list of endpooints with optional channel and alert eg: endpoints='https://endpoint.com#channel#here" 62 * *channel* - defaults to 'general' or your admin default specified channel - depracated 63 * *username* - the identity you would like displayed as the sender in the channel 64 * *icon* - any of the available emoji icons in the slack system 65 * *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. 66 67 68 }` 69 70 **Formatted data messages (NEW in 5.5.2):** 71 72 `if(function_exists('\VanillaBeans\SlackHooker\vbean_send_data')){ 73 $data = array( 74 'User ID' => '12345', 75 'Email' => 'user@example.com', 76 'Status' => 'Active', 77 'Last Login' => '2025-10-03 14:30:00' 78 ); 79 \VanillaBeans\SlackHooker\vbean_send_data('User Registration', $data); 80 }` 81 82 **Custom formatted messages with options:** 83 84 `if(function_exists('\VanillaBeans\SlackHooker\vbean_send_data')){ 85 $data = array( 86 'Order ID' => '#WC-12345', 87 'Amount' => '$299.99', 88 'Customer' => 'John Doe', 89 'Payment Method' => 'Credit Card' 90 ); 91 92 $options = array( 93 'color' => '#00ff00', 94 'pretext' => 'New WooCommerce Sale!', 95 'text' => 'Payment processed successfully' 96 ); 97 98 \VanillaBeans\SlackHooker\vbean_send_data('E-commerce Sale', $data, $options); 99 }` 100 101 **Building custom attachment messages:** 102 103 `if(function_exists('\VanillaBeans\SlackHooker\vbean_build_data_message')){ 104 $message = \VanillaBeans\SlackHooker\vbean_build_data_message('System Alert', array( 105 'Server' => 'web-01.example.com', 106 'CPU Usage' => '85%', 107 'Memory' => '3.2GB / 4GB', 108 'Disk Space' => '75% full' 109 ), array('color' => '#ff9900')); 110 111 // Send using existing notification system 112 Vanilla_Bean_Slack_Hooker::notification_send($message); 113 }` 114 115 = Parameters = 116 117 There are defaults for all except the message. You can specify: 118 119 * **text** - required. This is your message 120 * **endpoints** - override defaults with a comma separated list of endpoints with optional channel and alert eg: endpoints='https://endpoint.com#channel#here' 121 * **channel** - defaults to 'general' or your admin default specified channel - deprecated 122 * **username** - the identity you would like displayed as the sender in the channel 123 * **icon** - any of the available emoji icons in the slack system 124 * **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. 125 126 **New Data Message Parameters (5.5.2):** 127 128 * **title** - required for data messages. Main title of the message 129 * **data** - associative array of name => value pairs to display 130 * **options** - array of formatting options (color, pretext, text, author_name, etc.) 131 132 = Use Cases = 133 134 * **E-commerce monitoring** - WooCommerce order notifications 135 * **User activity tracking** - Registration and login alerts 136 * **System monitoring** - Server status and health checks 137 * **Content management** - Post publication and comment notifications 138 * **Security alerts** - Failed login attempts and suspicious activity 139 * **Plugin management** - Installation, update, and deletion notifications 68 140 69 141 = Contact = 142 70 143 We can be found at: 71 * (http://www.velvary.com.au/contact-us) 72 * Twitter: @VelvaryVanilla73 * E: info@ or support@ velvary.com.au74 144 145 * Website: [Velvary Contact](http://www.velvary.com.au/contact-us) 146 * Twitter: @VelvaryVanilla 147 * Email: info@velvary.com.au or support@velvary.com.au 75 148 76 149 == Installation == 77 Unzip into your plugins directory, install directly from 78 wordpress plugins site. 79 150 151 1. **Via WordPress Admin (Recommended)** 152 * Navigate to Plugins > Add New 153 * Search for "Vanilla Bean Slack Hooker" 154 * Click Install Now and then Activate 155 156 2. **Manual Installation** 157 * Download the plugin ZIP file 158 * Upload to `/wp-content/plugins/vanilla-bean-slack-hooker/` 159 * Activate through the Plugins menu in WordPress 160 161 3. **Configuration** 162 * Go to Settings > Slack Hooker in your WordPress admin 163 * Add your webhook URLs (Slack, Mattermost, etc.) 164 * Configure notification preferences 165 * Test your setup with the built-in test message feature 166 167 == Frequently Asked Questions == 168 169 = What webhook services are supported? = 170 171 The plugin supports any webhook-compatible service including Slack, Mattermost, Discord, Microsoft Teams, and custom webhook endpoints. Email addresses can also be used as fallback endpoints. 172 173 = Are messages sent immediately? = 174 175 By default, messages are queued and sent via WordPress cron to avoid blocking page loads. You can force immediate sending by setting `sendnow="true"` in shortcodes or `$now=true` in programmatic calls. 176 177 = Can I send to multiple channels at once? = 178 179 Yes! You can configure multiple default endpoints in the admin settings, or specify additional endpoints using the `alsoto` parameter in shortcodes and programmatic calls. 180 181 = What data is included in WooCommerce notifications? = 182 183 WooCommerce notifications include order ID, customer name, total amount, payment status, and admin links to view the order details. 184 185 = Is the plugin compatible with multisite? = 186 187 Yes, the plugin works on WordPress multisite installations. Each site maintains its own webhook configuration and notification settings. 188 189 = Can I customize the message format? = 190 191 Absolutely! The new data message functions (5.5.2+) allow you to create rich formatted messages with custom colors, structured data fields, and flexible styling options. 80 192 81 193 == Screenshots == 82 1. Example of wordpress monitoring 83 2. Admin instruction page 84 3. Another example of wordpress monitoring 85 4. Screenshot of default options 86 5. Screenshot of Notification choices 194 195 1. Example of WordPress monitoring notifications in Slack 196 2. Admin settings page with webhook configuration 197 3. Rich formatted data messages with structured fields 198 4. Plugin management notifications 199 5. WooCommerce sales notifications 87 200 88 201 == Changelog == 202 203 = 5.5.2 = 204 *Release Date: October 3, 2025* 205 206 * **NEW: Formatted data message support** - Rich attachments with name-value pairs 207 * **NEW: vbean_send_data() function** - Send structured data messages easily 208 * **NEW: vbean_build_data_message() function** - Build custom attachment messages 209 * Enhanced MAIASS configuration support 210 * Improved documentation with comprehensive examples 211 * Better Slack field formatting for structured data display 212 213 = 5.5.0 = 214 *Release Date: April 21, 2025* 215 216 * Fixed overly zealous escaping issues 217 * Improved message content handling 218 89 219 = 5.4.6 = 90 - securty update - removed unneeded files 91 - tested with wordpress 6.8 and php 8.2 92 - added input filtering for security reasons 220 *Release Date: April 21, 2025* 221 222 * **Security update** - Enhanced input filtering and validation 223 * Removed unneeded files for improved security 224 * Tested with WordPress 6.8 and PHP 8.2 225 * Added comprehensive input sanitization 93 226 94 227 = 5.3.1 = 95 - Tested with wordpress 6.5 and php 8.2 228 * Tested with WordPress 6.5 and PHP 8.2 229 * Compatibility updates 96 230 97 231 = 5.2.14 = 98 - Bugfix - fixed issue with default channel reference having typo resulting in plugin upgrades notificaitons not working 232 * **Bugfix** - Fixed default channel reference typo affecting plugin upgrade notifications 233 * Improved notification reliability 99 234 100 235 = 5.2.11 = 101 - Bugfix - fixed issue with default channel reference having typo resulting in plugin upgrades notificaitons not working 236 * **Bugfix** - Fixed default channel reference issue 237 * Enhanced plugin upgrade notification handling 102 238 103 239 = 5.2.7 = 104 - Fixed versioning inconsistency 240 * Fixed versioning inconsistency 241 * Updated version management 105 242 106 243 = 5.2.0 = 107 - Added support for email notifications 244 * **NEW: Email notification support** - Use email addresses as webhook endpoints 245 * Enhanced fallback messaging options 108 246 109 247 = 5.1.7 = 110 - Admin menu bugfix 248 * Admin menu bugfix 249 * Improved navigation 111 250 112 251 = 5.1.6 = 113 - tested with wordpress 6.2 252 * Tested with WordPress 6.2 253 * Compatibility verification 114 254 115 255 = 5.1.3 = 116 - fixed double up in get_url() string replace 117 256 * Fixed double replacement in get_url() string processing 257 * Improved URL handling 118 258 119 259 = 5.1.2 = 120 - fixed default valuefor fields121 - fixed missing admin menu item 260 * Fixed default value handling for fields 261 * Resolved missing admin menu item issue 122 262 123 263 = 5.1.1 = 124 - fixed path error for mce plugin 264 * Fixed path error for MCE plugin integration 265 * Improved file path handling 125 266 126 267 = 5.1.0 = 127 - Cron messages made optional for when cron not supported 128 129 130 Another major overhaul. Previous settings not carried forward. 268 * **NEW: Optional cron messaging** - Support for environments without cron 269 * Enhanced message delivery options 270 131 271 = 5.0.0 = 132 - Notification overrides can now be set for each endpoint 133 - Endpoints can now have alerts such as <!here> or <!channel> or <!everyone> added to them by adding #here or #channel or #everyone to the end of the endpoint url 134 - Improved admin layout 135 - Tested on PHP8.1 136 - Tested on Wordpress 6.1 137 138 139 Major overhaul. Previous settings not carried forward. 272 *Major overhaul - Previous settings not carried forward* 273 274 * **NEW: Notification overrides** - Per-endpoint configuration 275 * **NEW: Alert mentions** - Add @here, @channel, @everyone to endpoints 276 * Improved admin layout and user experience 277 * Tested with PHP 8.1 and WordPress 6.1 278 * Enhanced endpoint management 279 140 280 = 4.0.5 = 141 - bugfix naming conflict in javascript142 - bugfix path for css281 * Fixed JavaScript naming conflict 282 * Corrected CSS path issues 143 283 144 284 = 4.0.3 = 145 - bugfix for mattermost 146 - bugfix to textdomain 285 * **Bugfix** - Improved Mattermost compatibility 286 * Fixed text domain issues 147 287 148 288 = 4.0.0 = 149 - MAJOR OVERHAUL Rewrite 150 - More alerts added for posts 151 - Customisable endpoints for all alerts 289 *Major overhaul - Previous settings not carried forward* 290 291 * **NEW: Enhanced post alerts** - More notification types 292 * **NEW: Customizable endpoints** - Per-alert configuration 293 * Complete codebase rewrite for better performance 152 294 153 295 = 3.30 = 154 - added support for endpoints in channels 296 * Added support for endpoints in channels 297 * Enhanced channel targeting 155 298 156 299 = 3.22 = 157 - bugfix for post status change 300 * **Bugfix** - Fixed post status change notifications 301 * Improved reliability 158 302 159 303 = 3.21 = 160 - tested against wordpress 6.1 and php 8.1 304 * Tested with WordPress 6.1 and PHP 8.1 305 * Compatibility updates 161 306 162 307 = 3.10 = 163 - added site url to notificaitons 164 - added post/page published notifications 308 * Added site URL to notifications for better identification 309 * **NEW: Post/page publication notifications** 310 * Enhanced notification content 165 311 166 312 = 3.05 = 167 - added code for system plugin updater 313 * Added system plugin updater integration 314 * Improved plugin management 168 315 169 316 = 3.04 = 170 - Broken Image fix 317 * Fixed broken image references 318 * Improved asset handling 171 319 172 320 = 3.03 = 173 - Cosmetic fix 321 * Cosmetic improvements 322 * UI enhancements 174 323 175 324 = 3.02 = 176 - Added woocommerce sales hook 325 * **NEW: WooCommerce sales notifications** 326 * E-commerce integration support 177 327 178 328 = 3.00 = 179 - Added compatibility with Mattermost 180 181 = PREVIOUS VERSIONS REMOVED = 182 - Added current site to default user 329 * **NEW: Mattermost compatibility** 330 * Expanded webhook service support 183 331 184 332 = 2.60 = 185 - Added current user to plugin alerts 333 * Added current user information to plugin alerts 334 * Enhanced notification context 186 335 187 336 = 2.55 = 188 - Added toggle option for help 337 * Added toggle option for help display 338 * Improved user experience 189 339 190 340 = 2.47 = 191 - Enabled inheritance of <v2.46 channel default for alerts 341 * Enabled inheritance of v2.46 channel defaults 342 * Backward compatibility improvements 192 343 193 344 = 2.46 = 194 - Enabled channel selection for default alerts 345 * **NEW: Channel selection** for default alerts 346 * Enhanced configuration options 195 347 196 348 = 2.45 = 197 - Fixed test msg typo 349 * Fixed test message typo 350 * Improved testing functionality 198 351 199 352 = 2.44 = 200 - Added default notification options for when plugins are installed, updated etc 201 - Tested against WP5.3202 - Tested against Corona virus 353 * **NEW: Plugin management notifications** - Install, update, delete alerts 354 * Tested with WordPress 5.3 355 * Enhanced system monitoring 203 356 204 357 = 2.20 = 205 - Changed Curl to http-api 358 * Migrated from cURL to WordPress HTTP API 359 * Improved reliability and compatibility 206 360 207 361 = 2.14 = 208 - Changed @channel syntax to work with latest api 362 * Updated @channel syntax for latest Slack API 363 * Enhanced mention functionality 209 364 210 365 = 2.13 = 211 - Fixed bug of slack plugin validation updating incorrectly 212 - added programmatic examples to settings page 366 * Fixed plugin validation update bug 367 * Added programmatic examples to settings page 368 * Improved documentation 213 369 214 370 = 2.12 = 215 Updated Icon 371 * Updated plugin icon 372 * Visual improvements 216 373 217 374 = 2.11 = 218 Added missing menu icon 375 * Added missing menu icon 376 * UI enhancements 219 377 220 378 = 2.10 = 221 Tested against php7.1 and wordpress 4.7 379 * Tested with PHP 7.1 and WordPress 4.7 380 * Compatibility verification 222 381 223 382 = 2.0 = 224 * Added repetition prevention functionality 225 * Added support for multiple slack webhooks 383 * **NEW: Repetition prevention** - Avoid spam notifications 384 * **NEW: Multiple webhook support** 385 * Enhanced message management 226 386 227 387 = 1.50 = 228 Fixed issue with specified icon not displaying in notice 388 * Fixed icon display issue in notifications 389 * Improved visual consistency 229 390 230 391 = 1.42 = 231 Set delayed send to flag slack as working 392 * Set delayed send to properly flag Slack as working 393 * Enhanced status tracking 232 394 233 395 = 1.41 = 234 Moved slack message to immediate cron job so that it does not delay page load 396 * **Performance improvement** - Moved to cron job to prevent page load delays 397 * Non-blocking message delivery 235 398 236 399 = 1.24 = 237 Tested against wp 4.5 400 * Tested with WordPress 4.5 401 * Compatibility updates 238 402 239 403 = 1.23 = 240 Updated 404 test 404 * Updated 404 error handling 405 * Improved error management 241 406 242 407 = 1.22 = 243 Updated common functions 408 * Updated common functions 409 * Code optimization 244 410 245 411 = 1.21 = 246 Added support for default icon 412 * **NEW: Default icon support** 413 * Enhanced customization options 247 414 248 415 = 1.2 = 249 Added default comment alert 416 * **NEW: Default comment alerts** 417 * Comment notification system 250 418 251 419 = 1.1 = 252 Fix broken plugin download link 420 * Fixed broken plugin download link 421 * Improved distribution 253 422 254 423 = 1.01 = 255 Shortcode in admin documentation bugfix 424 * Fixed shortcode documentation bug 425 * Documentation improvements 256 426 257 427 = 1.0 = 258 Initial release 259 428 * Initial release 429 * Basic Slack webhook integration 430 431 == Upgrade Notice == 432 433 = 5.5.2 = 434 Major new feature: Formatted data messages with structured name-value pairs! Enhanced Slack integration with rich attachments. Update recommended for better notification formatting. 435 436 = 5.4.6 = 437 Important security update with enhanced input filtering. Update immediately for improved security. 438 439 = 5.2.0 = 440 New email notification support allows using email addresses as webhook endpoints. Great for fallback notifications! 441 442 = 5.0.0 = 443 Major overhaul with per-endpoint configuration and alert mentions. Previous settings will not be carried forward - reconfiguration required. 444 445 = 4.0.0 = 446 Complete rewrite with enhanced post alerts and customizable endpoints. Previous settings will not be carried forward. 447 448 = 3.00 = 449 Now supports Mattermost in addition to Slack! Expanded webhook compatibility. 260 450 261 451 = 2.44 = 262 Added alerts for when plugins are added/deleted/updated 263 264 = 1.5 = 265 Moved messaging to cron so that page load is not affected 266 267 = 1.2 = 268 Added functionality to notify channel of new comments 452 New plugin management notifications keep you informed of plugin installs, updates, and deletions. 453 454 = 2.0 = 455 Added repetition prevention and multiple webhook support for better notification management. -
vanilla-bean-slack-hooker/trunk/vanilla-bean-slack-hooker.php
r3277792 r3372099 17 17 Plugin URI: https://www.velvary.com.au 18 18 Description: Integrate webhooks into your site for notifications via Slack, Mattermost or others 19 Version: 5.5. 019 Version: 5.5.3 20 20 Author: Velvary 21 21 Author URI: https://www.velvary.com.au
Note: See TracChangeset
for help on using the changeset viewer.