WP Manifestindependent plugin directory
manifest / security / wordpress-plugin-sensitivefilter

DFA 敏感词卫士

一款WordPress的敏感词过滤插件。基于 DFA 算法。支持设置敏感词,评论拦截、文章敏感词提醒、用户名注册屏蔽。

★ 2stars
正式版latest · 8mo ago

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/o1dyer/wordpress-plugin-sensitivefilter/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

WP DFA Sensitive Filter (DFA 敏感词卫士)

WP DFA Sensitive Filter 是一款专为 WordPress 开发的高性能敏感词过滤插件。不同于传统的正则匹配,本插件采用 DFA (确定有穷自动机) 算法,即使在处理海量词库时也能保持毫秒级的响应速度。

🌟 核心功能

  • 文章发布检测:在保存文章时自动扫描标题与内容,包含敏感词的文章将强制转为“草稿”状态并弹出警告。
  • 评论实时拦截:自动识别违规评论敏感词并拦截发布,同时标记为垃圾评论(Spam)。
  • 用户注册屏蔽:禁止用户注册包含敏感词的用户名,维护社区环境从源头开始。
  • 干扰符规避:算法会自动过滤文本中的非中英文字符、空格、星号等干扰符,让变体敏感词无所遁形。
  • 简洁管理界面:提供独立的设置页面,支持通过换行、逗号或顿号快速批量导入词库。
  • 原生界面优化:自动隐藏 WordPress 原生低效的评论审核与黑名单设置,避免功能冗余。

🚀 技术原理

本插件的核心逻辑基于 DFA (Deterministic Finite Automaton):

  1. 构建前缀树:插件在初始化时将词库解析为多层嵌套的 PHP 数组(Trie Tree)。
  2. 高效检索:检测时只需对目标文本进行一次遍历,匹配到末梢节点即判定为敏感词,检索效率极高。
  3. 正则清洗:在匹配前通过正则表达式 /[^\x{4e00}-\x{9fa5}a-zA-Z0-9]/u 清除非必要符号。

🛠️ 安装指南

  1. 下载本项目代码。
  2. 将文件夹上传至你的 WordPress 网站的 /wp-content/plugins/ 目录。
  3. 在 WordPress 后台“插件”菜单中启用 DFA 敏感词卫士。
  4. 前往 设置 > 敏感词过滤 配置你的专属词库。

Releases

1 release.

Tag
Published
正式版 latest
Mar 8, 2026 8mo ago

These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.