b2evolution b2evolution

  • Sign in
  • Sign up
  • About
  • Downloads
  • Hosting
  • Docs
  • Support
  • Sign in
  • Sign up
  • Manuals Home
  • Latest Updates
 
  1. b2evolution CMS User Manual
  2. Developer Reference
  3. Plugins
  4. Plugin development
  5. Creating an Antispam Plugin

Creating an Antispam Plugin

An Antispam Plugin is a plugin that implements methods to prevent/fight back at spam.

Creating an Antispam Plugin is the same as creating a "regular" plugin. This page only handles topics and introduces methods that are common to Antispam plugins.

Feedback spam

Your plugin should implement the method GetSpamKarmaForComment(). This gets passed the following values in the $params function parameter array:

  • "Comment": the comment object

The following values are interesting if you want to skip your test:

  • ‘cur_karma’: current karma value (cur_karma_abs/cur_karma_divider)
  • ‘cur_karma_abs’: current karma absolute value
  • ‘cur_karma_divider’: current divider (sum of weights)
  • ‘cur_count_plugins’: number of Plugins that have already been asked

Your plugin should return an integer value between -100 and 100, where -100 means "it’s absolutely not spam" and 100 means "I’m damn sure this is spam.".
If you don’t want to return a spam probability value (e.g. because ‘’cur_karma'’ is already above a certain value), just return NULL.

For example:
Step1:

  • if domain ends with ‘.info’ => return 20
  • if domain ends with ‘.biz’ => return 30
  • no match => return 0

Step2

  • if domain contains ’search’ => return 20
  • no match => return 0

Step3

  • if full url contains ‘-anal-’ => return 80
  • if full url contains ‘anal’ => return 20
  • no match => return 0

Step4

  • …

The core then decides upon the results of
$karma_abs / $karma_divider
what to do with the comment. Your plugin provides a part of $karma_abs and $karma_divider is the total weight of the antispam plugins, which can be setup in Settings - Spam Detection Relevance Weight.

Created by fatimahnasra • Last edit by fplanque on 2020-06-09 00:25 • •

No feedback yet

On this page

  • Feedback spam

Search the Manual

Content Hierarchy

  • b2evolution CMS User Manual
  • User's Guide
  • Installation / Upgrade
  • Front-office Reference
  • Back-office Reference
  • Developer Reference
    • Website Skins/Themes
    • Email Skins/Themes
    • b2evolution Files
    • Website Integration
    • Plugins
      • Introduction to Plugins
      • Renderer Plugins
      • Plugin development
        • Localizing Plugins
        • Plugin API for item settings
        • Coding Standard Guidelines
        • How to turn plugins on/off
        • How to write a new plugin
        • Creating A Plugin
        • Plugin / Apply Rendering
        • Plugin Documentation
        • Plugins Repository
        • Creating an Antispam Plugin
        • List of Plugin Hooks
      • Plugin / Apply Rendering
      • Widget Plugins
    • Debugging
    • Technical Reference
    • Hacks
    • Credits
    • Development
    • How to... (Customize)
    • Scheduled Tasks Reference
  • Operations Reference
  • Advanced Topics
  • Glossary
  • Archives
powered by an open-source CMS

This online manual is powered by b2evolution CMS – A complete engine for your website.

About b2evolution

  • What is it?
  • Features
  • Getting Started
  • Screenshots
  • Online demo
  • Testimonials
  • Design philosophy
  • Free & open source
  • Terms of service

Downloads

  • Latest releases
  • Skins
  • Plugins
  • Language packs

About us

  • About us
  • Contact

Webhosting Guide

  • Web hosting blog
  • Best web hosting
  • Cheap web hosting
  • Green web hosting
  • Hosting with SSH
  • VPS hosting
  • Dedicated servers
  • Reseller hosting
  • Int'l: UK / France

Docs & Support

  • Online manual
  • Forums
  • Hire a pro !

Other

  • Adsense
  • Press room
  • Privacy policy

Stay in touch

  • GitHub
  • Twitter
  • Facebook
  • LinkedIn
  • News blog
  • RSS feed
  • Atom feed

Founded & Maintained by François Planque