Git Product home page Git Product logo

slack-notifications's Introduction

Slack Notifications by dorzki

Light and customisable WordPress plugin to integrate your site with Slack.

Choose what type of notification you would like to receive:

  • WordPress Update Available
  • Plugins Updates Available
  • Administrator Login
  • New User Registration
  • New Comments
  • Nee WooCommerce Orders
  • WooCommerce Product with Low Stock
  • And much more!

Download the plugin from WordPress's plugins directory.

Table of Contents

  1. Plugin Hooks
  2. Examples
  3. Changelog
  4. Contributions
  5. Contact

Plugin Hooks

Soon.

Examples

Soon.

Changelog

Version Changes
2.0.7 [HOTFIX] Fixed WooCommerce order not showing products.
[FEATURE] Added Contact Form 7 integration.
2.0.6 [HOTFIX] Fixed CPT notification being fired for unwanted CPT.
2.0.5 [FEATURE] On post type update the user who updated will be displayed on the notification.
2.0.4 [FEATURE] Added failed administrator login notification.
[HOTFIX] Skip notification if a comment was marked as spam.
[HOTFIX] Fixed typo on new note notification. (Thanks to Music47ell)
[HOTFIX] Fixed wrong IP address when the server is behind load balancer.
2.0.3 [HOTFIX] two factor collision.
[FEATURE] Added new support page.
2.0.2 [HOTFIX] Fixed issue with const no accepting return value. (Thanks to Sven Wagener)
[HOTFIX] Fixed issue with PHP 5.4. (Thanks to Sven Wagener)
[HOTFIX] Fixed text domain.
2.0.1 [FEATURE] Added RTL support.
[HOTFIX] Fixed issue with plugin doesn't update database.
2.0.0 New version with new UI and better notification customization.
Added actions and filters.
Added native WooCommerce support.
1.0.12 Fixed an issue when a CPT is being updated a notification of publication was fired, thanks to nunas for reporting.
1.0.11 Fixed wrong parameters order on custom post type notification.
1.0.10 Removed languages directory. Added the ability to post to several channels.
1.0.9 Fixed issue with old PHP versions.
1.0.8 Fixed broken plugins notification.
1.0.7 Added future, pending and updated post notifications.
Added future, pending and updated page notifications. Several plugin fixes.
1.0.6 Fixed issue with image embed on WYSIWYG editor.
1.0.5 Changed text domain slug to plugin slug.
Added error notice if there is a problem with API.
Fixed notifications not firing because of value type.
Added test integration button.
Updated Hebrew translation files.
1.0.4 Fixed plugin text domain function.
Added Hebrew translation.
Plugin directory cleanup.
1.0.3 Fixed translation strings.
Added .pot file.
1.0.2 Fixed notices errors ( thanks to LocalGhost-IL ).
Fixed issue when sometimes the slack notifies on new theme without version ( thanks to yehudah ).
Added support for Travis CI & PHPUnit ( thanks to barzik ).
1.0.1 Now when a notification is generated, the website name & url will be appended at the end.
Added the ability to choose if and for which custom post type to enable notifications.
1.0.0 Hooray! First version!

Contributions

Soon.

Contact

If you have any questions feel free to contact me at webmaster[AT]dorzki.co.il.

slack-notifications's People

Contributors

barzik avatar yehudah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

slack-notifications's Issues

Changing the namespace broke customisations

Changing the namespace in 81aaaf0 was a breaking change and should have been documented as such in the readme.

We were using the class to create a custom notification type.

use Slack_Notifications\Notifications\Notification_Type;

/**
 * Class used to register a custom notification type for the job board.
 *
 * @link https://github.com/dorzki/Slack-Notifications/blob/master/core/notifications/class-notification-type.php
 */
class JobBoard extends Notification_Type {}

Set the webhook value as a constant?

Would you accept a pull request that allows the webhook value to be a constant? This would allow those who run the site in local/dev/stage environments to use a different webhook than they do in production.

Author in Slack always creator of page

I noticed that the UpdateBot always shows the original author of a page below "Updated By" no matter who updated the page. Is there a way to change this to always display the user that is the author of the current revision, the one that made the change?

Greetings

Integration with WP Project Manager

1st off Great Plugin!

it would be nice to integrate with wedevs WP Project Manager plugin

here is a list of their actions. If you can point me in the right direction, I could help in coding these into your plugin with you.

What file and coding standard should I follow to get your plugin to recognize these actions?

https://wedevs.com/docs/wp-project-manager/developer-docs/actions/

It might be interesting to provide a way to add them via a gui in your plugin similar to the way this plugin works.

https://wordpress.org/plugins/my-custom-functions/

WooCommerce error

When changing order status I get this error:

PHP Fatal error: Uncaught Error: Call to a member function get_name() on boolean in /srv/users/wordpress/apps/wordpress/public/wp-content/plugins/dorzki-notifications-to-slack/core/notifications/woocommerce.php:175 Stack trace: #0 /srv/users/wordpress/apps/wordpress/public/wp-content/plugins/dorzki-notifications-to-slack/core/notifications/woocommerce.php(244): SlackNotifications\Notifications\WooCommerce->build_order_attachments(Object(WC_Order)) #1 /srv/users/wordpress/apps/wordpress/public/wp-includes/class-wp-hook.php(288): SlackNotifications\Notifications\WooCommerce->order_transition(7682) #2 /srv/users/wordpress/apps/wordpress/public/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #3 /srv/users/wordpress/apps/wordpress/public/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #4 /srv/users/wordpress/apps/wordpress/public/wp-content/plugins/woocommerce/includes/class-wc-order.php(327): do_action('woocommerce_ord...', 7682, Object(WC_Order)) #5 /srv/users/wordpress/apps/wordpress/public/wp-content/plugins/woocommerce/inc in /srv/users/wordpress/apps/wordpress/public/wp-content/plugins/dorzki-notifications-to-slack/core/notifications/woocommerce.php on line 175

Show who deleted a page/post

The usual behaviour of this plugin when a page/post is updated is to show who made the update in the Slack Notifications. However, when a post is "moved to trash" the notification shows who originally created the page/post rather than who actually did the deletion.

Adding Multiple Webhooks

It might be nice to have the ability to add more than one webhook to you can feed notifications to different slack workspaces and channels.

i have run into a situation where an organization has created a workspace and wants to see notifications in their channel. However, I don't want to cough up the alerts in my workspace's channel.

fantastic plugin. thank you for your efforts.

Does not work with Cloudflare

Our site is protected by cloudflare, and the "run test" button on the general settings page does not work. Behind the scenes, there is a 400 error on the admin_ajax.php page.

If I disable cloudflare, or place it into Development mode, it works.

I haven't had any issues with other plugins using the WP API.

How about WP comments based on Disqus?

Hello!
I'm dealing with a WordPress site I've created for training teachers of Italian as second language.
I've grouped them through a Slack team and I've installed your Slack Notifications plugin, to receive notifications for new posts and new comments (that is all we need).
By the way, in the WP site there's the Disqus plugin, that enhance the commenting system, and I've noticed that Slack Notifications plugin doesn't work with Disqus.
In the meantime I've deactivated Disqus (and got back to WP original comments). Of course, now everything works fine. But... we're very sorry about that.
Since Disqus is very popular, I'm asking if you might consider to integrate it into Slack Notifications.
Thanks for all your work (and for your attention).

Product informations no more added to slack message (v2.0.6)

Hi,
I upgrade the plugin to v2.0.6 and since this update, informations about order are not added to slack message anymore.

I compare both versions (the old and the current) source. I didn't find the issue (I'm not a Wordpress dev so...).

My current version of WooCommerce is 3.8.1 and some other plugins related to WooCommerce. Tell me if you need them to debug.

Previous version (v2.0.5 today at 4:27PM):

There is a new order on Box!

Order ID
8194
Order Status
Pending
Order Total
22,80€
Paid Via
Carte de paiement (Stripe)

Product Name
Box Décembre 2019 x1

New version (v2.0.6 today at 5:55PM):

There is a new order on Box!

Order ID
8202
Order Status
Pending
Order Total
59,70€
Paid Via
Carte de paiement (Stripe)

Thanks you for your future update ;)

Contact form 7 Notification

Hello @dorzki
There are no any issues but a new feature request and thanks for great plugin.

Add contact form 7 plugin to this plugin for notification. When anyone sends a message using contact form 7 give the option to sent notification on the slack channel.

Thank You
Yuvraj

Fatal error

Hi,

I had to disable the plugin after updating a content started to throw this error:

Fatal error: Uncaught Error: Cannot use object of type WP_Error as array in ../htdocs/wp-content/plugins/dorzki-notifications-to-slack/core/class-slack-bot.php on line 135

Is it possible to have multiple Webhook URL?

Hi @dorzki
Currently it only can integrate with single Webhook URL. But normally on difference Slack channel it will be difference Webhook URL. I saw when we add new notification in plugin, it able to post to different channel.

I wonder how we can get it post to different channel with single Webhook URL. Do I missing something?

Also, I have create Slack App instead of Legacy Slack incoming webhook. If you can have difference approach to integrate slack instead of using Legacy Webhook, it may using Slack App integration as well. It more powerful.

Regards,

Client IP should be replaced with value from X-Forwarded-For header if present

We are running the plugin in a setup where WordPress is behind a CDN (AWS CloudFront) and a LoadBalancer (AWS ALB). Both of which will terminate SSL (and thus TCP) - therefor the real client IP is not visible except as an HTTP Header.

What we see on slack is the internal IP of the LoadBalancer (in the 10.0.0.0/8 non-public range):

Most proxies (and all we use) handle this by following RFC 7239 - ie. by injecting an HTTP header called X-Forwarded-For with a list of IPs.

See: the RFC - section 5.2 for details

It would be great if this otherwise great plugin could pickup if the user is accessing WordPress through a proxy and then pickup the actual client IP to post to Slack.

Fatal error during upgrade or activation

Hi,

Since the latest version, the plugin doesn't work.

This is the error :

"Parse error: syntax error, unexpected '.', expecting ',' or ';' in /wordpress/wp-content/plugins/dorzki-notifications-to-slack/core/notifications/notification-type.php on line 33"

Page Update Tracking doesnt work on private pages

Hello!
It seems I can’t track edits on a page that’s “private”.
Is there any workaround?

(Also I get notified twice when I am logged in as administrator).

Thank you for that great plugin!

Cheers.

MJZ

———————————-

System

  • WordPress Version: 5.4.1
  • Server Software: Apache/2.4.39 (Unix) OpenSSL/1.0.1e-fips Phusion_Passenger/5.3.1
  • PHP Version: 7.3.14
  • MySQL Version: 5.6.40
  • cURL Version: 7.60.0

Active Theme

Active Plugins

Error log empty.

Parse Error in 2.0

Hello and thank you for the great plugin! :)

There is a syntax error in the new version:

Parse error: syntax error, unexpected '.', expecting ',' or ';' in /wp-content/plugins/dorzki-notifications-to-slack/core/notifications/notification-type.php on line 33

Feature request for new notifications

Any chance getting new notifications for:

‘Author’ User Role Login
‘Contributor’ User Role Login
‘Editor’ User Role Login
Custom User Role(s)/Capabilities (these can be created using for example User Role Editor plugin)

Adding support for the roles above and optionally other roles (custom roles and/or capabilities created) would be very useful for tracking and accountability purposes as well as beneficial for security.

Basically, expanding the user’s choice of other roles and or capabilities as well and not just notify on ‘Administrator’ role. This can be in a form of a comma separated list/textbox in the notification.

Thank You,

https://wordpress.org/plugins/dorzki-notifications-to-slack/

Filtering Notifications by Post Type, Custom Post, Post Tag / Taxonomy

Love the plugin, but would definitely like to be able to do the following:

I have a single page called Change Log. I add the latest changes to the top of the page. I'd like to be able to tick a box on that page that would tell the Slack Notification plugin to send an update, but only if that box is ticked.

That's the idea.

Internal Server Error in checkout final step in case of wrong webhook

What I did :
on page /wp-admin/admin.php?page=slack-notifications-general
I saved an empty url for the webhook url (I wanted to inactivate the notifications) : the plugin raise an internal Server Error that is not catched resulting in blocking every payment checkout.

debug.log :
dorzki-notifications-to-slack

Allow message customization

While being metal 🤘 all the time is fun and all, in a corporate setting it would be nice to have more control over how the notification messages themselves are phrased.

Could the message templates be moved to settings on the settings page, so that individual Wordpress instances can tailor the notification messages to fit their brand/personality?

Support actions when building notification for interactive messages

Slack also has support for interactive messages which includes link buttons. Link buttons are added via attachments and the actions field. See https://api.slack.com/docs/interactive-message-field-guide#action_fields for more.

Currently when passing an attachment array to send_message() it's not really treated as an attachment which Slack would expect. It's more of a "fields" array, so just one part of an attachment. I'd really like to see a way to pass a fully prepared attachment to send_message(). This would give you also the possibility to add many of the other supported properties.

But for now, actions is probably something which the plugin itself would benefit from too. Imagine "View Order" or "View Post" buttons below some of the default notifications.

What are your thoughts on this? Happy to provide a PR for this once we have fleshed out the details. Thanks!

As a workaround I'm currently passing the actions in the $args parameter of send_message() and extend the notification with the actions via slack_after_notification_generation.

Multisite

Can you make Notifications work across all subsites on a multisite network? and make the plugin ignore actions by a super admin?

Fatal Error in version 2.0

Here it is!

Fatal error: Can't use method return value in write context in /wp-content/plugins/dorzki-notifications-to-slack/core/notifications/woocommerce.php on line 355

Updated CPT notification sent without setup

Hi,

Thanks for the great plugin. I seem to have a rather weird issue with the difference between post posts and custom post type posts. I have configured notifications for 'Post Pending' (and 'Post Scheduled') and have the same for every CPT configured for our site (over 10). However; when I update any custom post type post, the Update notification is being sent to Slack, without it actually being configured in the plugin settings. This doesn't happen for the post post type, but affects every other (custom) post type.

Any clue?

2018-10-01_23-07-14

2018-10-01_23-10-04

Feature request; support for BuddyPress activity

BuddyPress activity updates are kept in a separate table and don't trigger post type style updates. However, table layout is identical and uses the same database prefix; i.e. wp_bp_activity. The content fields is used to store activity; and hooks abound. This would be a nice feature.

Customize messages

Feature request to be able to customize the messages sent from the plugin to Slack. One use case is to be able to notify specific people (in addition to posting in the channel). Could also be used to provide more robust information so that users could decide how to handle certain notifications before even leaving Slack.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.