Akismet.Umbraco
4.0.3
See the version list below for details.
dotnet add package Akismet.Umbraco --version 4.0.3
NuGet\Install-Package Akismet.Umbraco -Version 4.0.3
<PackageReference Include="Akismet.Umbraco" Version="4.0.3" />
paket add Akismet.Umbraco --version 4.0.3
#r "nuget: Akismet.Umbraco, 4.0.3"
// Install Akismet.Umbraco as a Cake Addin #addin nuget:?package=Akismet.Umbraco&version=4.0.3 // Install Akismet.Umbraco as a Cake Tool #tool nuget:?package=Akismet.Umbraco&version=4.0.3
Akismet Management for Umbraco 9+
Adds Akismet dashboard to Umbraco backoffice.
Note: This package for Umbraco 9+ only. Check here for Umbraco 8
Installation
Install via NuGet
Install-Package Akismet.Umbraco
Note: installing packages via the backoffice will not be available beginning with Umbraco 9
Post-Installation
After package installation, log into the backoffice and navigate to Users, Groups, Administrators and be sure to add Akismet.
Usage
Once installed, the AkismetService
service becomes available for checking comments. It is up to the developer to wire up to the contact forms but here is an abbreviated example:
using Akismet.NET;
using Akismet.Umbraco;
public class ContactFormController : SurfaceController
{
private readonly AkismetService AkismetService;
public ContactFormController(AkismetService akismetService)
{
AkismetService = akismetService;
}
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult SubmitForm(ContactModel model)
{
// check validation
// eg - required fields, captcha, etc
string ip = Request.Headers["CF-Connecting-IP"] ?? Request.UserHostAddress;
if (String.IsNullOrWhiteSpace(ip))
ip = Request.ServerVariables["REMOTE_HOST"];
// see https://github.com/ahwm/Akismet.Net for all available options
AkismetComment comment = new AkismetComment
{
CommentAuthor = model.Name,
CommentAuthorEmail = model.EmailAddress,
Referrer = Request.UrlReferrer.ToString(),
UserAgent = Request.UserAgent,
UserIp = ip,
CommentContent = model.Message,
CommentType = AkismentCommentType.ContactForm,
Permalink = CurrentPage.Url(mode: UrlMode.Absolute)
};
// Specify true on CheckComment() to not include "Unspecified" as valid comments
bool isValid = AkismetService.CheckComment(comment, true);
if (!isValid)
{
return CurrentUmbracoPage();
}
// continue processing
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net7.0
- AkismetApi.Net (>= 3.0.0.1)
- Umbraco.Cms.Web.BackOffice (>= 12.0.0 && < 13.0.0)
- Umbraco.Cms.Web.Website (>= 12.0.0 && < 13.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
5.0.0-beta2 | 502 | 12/28/2023 |
5.0.0-beta1 | 410 | 12/18/2023 |
4.0.3 | 666 | 8/18/2023 |
4.0.2 | 549 | 8/18/2023 |
4.0.1 | 609 | 8/18/2023 |
4.0.0 | 557 | 8/17/2023 |
3.0.1 | 816 | 1/11/2023 |
3.0.0 | 807 | 1/6/2023 |
2.0.0.1 | 1,011 | 6/28/2022 |
2.0.0 | 1,033 | 6/28/2022 |
2.0.0-beta2 | 620 | 6/28/2022 |
2.0.0-beta1 | 625 | 6/15/2022 |
1.0.0 | 1,189 | 10/1/2021 |
Support for Umbraco 12; please report issues at https://github.com/ahwm/Akismet.Umbraco/issues