Download the PHP package silverstripe/akismet without Composer
On this page you can find all versions of the php package silverstripe/akismet. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download silverstripe/akismet
More information about silverstripe/akismet
Files in silverstripe/akismet
Package akismet
Short Description Akismet antispam module for Silverstripe
License BSD-3-Clause
Informations about the package akismet
Akismet Silverstripe Module
Simple spam filter for Silverstripe using Akismet
Also, please report any issues you may encounter, as it helps us all out!
Please see the changelog for module history.
Credits and Authors
- Damian Mooyman - https://github.com/tractorcow/silverstripe-akismet
- Attribution to Tijs Verkoyen for his Akismet API wrapper - https://github.com/tijsverkoyen/Akismet
Requirements
- Silverstripe ^4 || ^5
- Silverstripe SpamProtection module - https://github.com/silverstripe/silverstripe-spamprotection
-
Tijs Verkoyen's Akismet API wrapper - https://github.com/tijsverkoyen/Akismet
Note: For a Silverstripe 4.x compatible version, please use 4.x release.
Installation Instructions
This module can be easily installed on any already-developed website
- You can install using Composer, as below:
AkismetSpamProtector
is automatically assigned as the default spam protector class.
- Get an API key from akismet.com and set in the site against one of the following ways.
config.yml:
_config.php:
.env:
If instead you want to configure your akismet key via the siteconfig (as a password field) you can add the included extension to SiteConfig
mysite/_config/settings.yml:
Priority of defined API keys
Please note that the API key values defined in the various ways above will be prioritised as:
- Values assigned to the singleton via
AkismetSpamProtector::singleton()->setApiKey()
- Values defined in configuration, whether YAML or in _config.php files with
Config::modify()->set(...)
- Values defined in the environment via .env
Testing
By default, spam protection is disabled for users with ADMIN priviliges. There is also an option to disable spam protection for all logged in users. In order to disable this for testing purposes, you can temporarily modify these options in your development environment as below:
In order to check that your form is blocking spam correctly, you can always set 'viagra-test-123' as the author and Akismet will always mark this as spam.
Comments
If you're using Comments module you can quickly set akismet to filter these out by adding the CommentSpamProtection
extension to the CommentingController
config.yml
If necessary, you can also mark spam comments to be saved to the database. This will still display the spam rejection notice, but spam comments will now be available for moderation in the backend. In order to enable this feature add the following to your configuration.
config.yml
Custom Form Usage
To enable spam protection in your custom forms, call the enableSpamProtection method with your field names mapped to the akismet fields:
`
Important notes for those in the EU
Because of the way Akismet works (message, author, and other information sent to a third party) in some countries it's legally necessary to notify and gain the user's permission prior to verification.
To create a checkbox style authorisation prompt for this field set the following configuration option:
config.yml
_config.php
All versions of akismet with dependencies
silverstripe/framework Version ^4.10
silverstripe/cms Version ^4.0
tijsverkoyen/akismet Version 1.1.0
silverstripe/spamprotection Version ^3.0