hughc / wordfence-slack-notifications

posts wordfence alerts to your slack channel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wordfence Slack Notifications

This is a proof-of-concept plugin to demonstrate the value of adding a few simple hooks to Wordfence to allow 3rd-party reporting services.

If you find yourself managing a number of sites, and thus swimming in a sea of emails from Wordfence, a few of which are of interest, others that are not, then aggregating that data into a feed that can be more easily parsed may be of value.

It does not work with vanilla Wordfence. It requires this fork that I created to demonstrate that adding a set of simple action hooks does not require a massive amount of code.

It is not, at this point, recommended for production sites. If there is interest, I will consider tightening both it and its dependant parent plugin up.

Usage

Once activated (alongside Wordfence With Notifications), proceed to Settings > Wordfence Slack Notifications and enter a valid Slack API Access Token and the channel to which you want to post.

The plugin posts to Slack when a matching action hook is fired. Initially, the only hooks implemented are those around general alerts and new issues. This will cover a lot of posibilities, as many other actions use the alert function.

You can test that the integration you have set up is working, by using the 'send test email' function in the Settings screen Wordfence With Notifications. You should see a Slack post as follows:

screenshot from Slack

Code

The code is based on Wordpress Plugin Boilerplate, and this gist for posting to the Slack API.

About

posts wordfence alerts to your slack channel

License:GNU General Public License v2.0


Languages

Language:PHP 93.9%Language:JavaScript 5.5%Language:CSS 0.6%