luceos/flarum-simple-spam-tools
最新稳定版本:0.1.2
Composer 安装命令:
composer require luceos/flarum-simple-spam-tools
包简介
Provides local extenders to enact some spam prevention.
README 文档
README
This extension adds some advanced protection against spam runs on your community. This is not an extension but a bundle of local extenders. Local extenders need to be added to your extend.php in the root of your Flarum installation (next to flarum and composer.json you will see a file extend.php).
Install the extension:
composer require luceos/flarum-simple-spam-tools
Update the extension:
composer require luceos/flarum-simple-spam-tools
Make sure to confirm all local extenders still work afterwards.
Configuration
In your extend.php specify some settings which should speak for themselves:
return [ (new \Luceos\Spam\Filter) // use domain name ->allowLinksFromDomain('luceos.com') // or just a full domain with protocol, only the host name is used ->allowLinksFromDomain('http://flarum.org') // even a link works, only the domain will be used ->allowLinksFromDomain('discuss.flarum.org/d/26095') // Alternatively, use an array of domains ->allowLinksFromDomains([ 'luceos.com', 'flarum.org', 'discuss.flarum.org' ]) // How long after sign up all posts are scrutinized for bad content ->checkForUserUpToHoursSinceSignUp(5) // How many of the first posts of a user to scrutinize for bad content ->checkForUserUpToPostContribution(5) // Specify the user Id of the moderator raising flags for some actions ->moderateAsUser(2), ];
Prevent Bio Spam
return [ // ... new \Luceos\Spam\UserBio, ]
This will prevent any bad content etc based on the Filter settings from configuration.
Prevent CommentPost Spam
return [ // .. new \Luceos\Spam\CommentPost, ]
This will prevent any bad content in posts based on the Filter settings.
Prevent Discussion Subject Spam
return [ // .. new \Luceos\Spam\Discussion, ]
Prevents URL's in discussion subjects/titles.
Example full configuration
This could be an example local extend.php:
<?php /* * This file is part of Flarum. * * For detailed copyright and license information, please view the * LICENSE file that was distributed with this source code. */ return [ //.. some other extenders can come here, the last one needs to end with a comma. (new \Luceos\Spam\Filter) ->allowLinksFromDomain('luceos.com') ->allowLinksFromDomain('http://flarum.org') ->allowLinksFromDomain('discuss.flarum.org/d/26095') ->checkForUserUpToHoursSinceSignUp(24) ->checkForUserUpToPostContribution(10) ->moderateAsUser(10), new \Luceos\Spam\UserBio, new \Luceos\Spam\CommentPost, new \Luceos\Spam\Discussion, ];
luceos/flarum-simple-spam-tools 适用场景与选型建议
luceos/flarum-simple-spam-tools 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 34 次下载、GitHub Stars 达 4, 最近一次更新时间为 2022 年 08 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 luceos/flarum-simple-spam-tools 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 luceos/flarum-simple-spam-tools 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 34
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: mit
- 更新时间: 2022-08-17