{"id":15375292,"url":"https://github.com/sy-records/wp-baidu-textcensor","last_synced_at":"2025-04-15T11:32:58.904Z","repository":{"id":54503351,"uuid":"231867693","full_name":"sy-records/wp-baidu-textcensor","owner":"sy-records","description":"基于百度文本内容审核技术来提供WordPress评论内容审核。","archived":false,"fork":false,"pushed_at":"2025-03-31T01:24:05.000Z","size":357,"stargazers_count":14,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T08:11:29.887Z","etag":null,"topics":["baidu","textcensor","wordpress"],"latest_commit_sha":null,"homepage":"https://qq52o.me/2720.html","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sy-records.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":"https://donate.qq52o.me","github":"sy-records"}},"created_at":"2020-01-05T04:35:48.000Z","updated_at":"2025-04-01T22:16:37.000Z","dependencies_parsed_at":"2024-04-03T01:29:34.737Z","dependency_job_id":"324e349e-40df-4350-85b4-44f0ae1033f8","html_url":"https://github.com/sy-records/wp-baidu-textcensor","commit_stats":{"total_commits":40,"total_committers":2,"mean_commits":20.0,"dds":0.125,"last_synced_commit":"74d56184cae3451aa31769ed770afd666ae52538"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sy-records%2Fwp-baidu-textcensor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sy-records%2Fwp-baidu-textcensor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sy-records%2Fwp-baidu-textcensor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sy-records%2Fwp-baidu-textcensor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sy-records","download_url":"https://codeload.github.com/sy-records/wp-baidu-textcensor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249061212,"owners_count":21206470,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["baidu","textcensor","wordpress"],"created_at":"2024-10-01T14:02:33.584Z","updated_at":"2025-04-15T11:32:58.897Z","avatar_url":"https://github.com/sy-records.png","language":"PHP","funding_links":["https://donate.qq52o.me","https://github.com/sponsors/sy-records"],"categories":[],"sub_categories":[],"readme":"\u003ch2 align=\"center\"\u003eBaidu TextCensor For Comments\u003c/h2\u003e\n\n基于百度文本内容审核技术来提供 WordPress 评论内容审核，对网站用户的评论信息检测，一旦发现用户提交恶意垃圾内容，可以做到文本的自动审核与实时过滤。\n\n## 百度文本内容审核\n\n[百度文本内容审核](https://ai.baidu.com/tech/textcensoring) 能一站式检测文本中夹杂的色情、推广、辱骂、违禁、涉政、灌水等垃圾内容，净化网络环境，为您的应用提供更可靠的内容安全保障，运用业界领先的深度学习技术，判断一段文本内容是否符合网络发文规范，实现自动化、智能化的文本审核，大幅节省内容审核的人力成本，为您的产品体验保驾护航\n\n### 能力介绍\n\n- 文本色情：对文本中的色情行为描述、色情资源链接、低俗交友、污秽文爱等内容进行识别\n- 暴恐违禁：对暴力行为、恐怖描述、赌博、毒品、枪支弹药等违禁内容进行识别\n- 政治敏感：对文本中的敏感事件、涉政人物、散布谣言、反动宣传等内容进行识别\n- 恶意推广：对文本中带有售卖意向的软文广告，微信、QQ 等个人联系方式等违规内容及变体进行识别\n- 低俗辱骂：对文本中的侮辱谩骂、人身攻击、消极宣泄等内容进行识别\n- 低质灌水：对网络社区常见的乱码、水帖、刷屏等无意义的灌水信息进行识别\n\n## 安装\n\n### 推荐使用\n\n在 WordPress 后台安装插件页面搜索 `Baidu TextCensor For Comments`\n\n### 下载源码\n\n从 GitHub 或 [WordPress Plugins](https://wordpress.org/plugins/baidu-textcensor/) 下载源码，通过 WordPress 后台上传安装，或者直接将源码上传到 WordPress 插件目录 `wp-content/plugins`，然后在后台启用\n\n## 设置\n\n在百度 Ai 控制台的 [产品服务 / 内容审核 - 应用列表 创建应用](https://console.bce.baidu.com/ai/?fromai=1#/ai/antiporn/app/list) 后获取 AppID、API Key、Secret Key\n\n![](.wordpress-org/screenshot-1.png)\n\n### Redis 配置\n\n增加了 Redis 缓存，用于限制 IP 请求次数，避免浪费检测次数，可以在 `wp-config.php` 中配置进行启用：\n\n| 常量                  | 说明             |\n| :-------------------- |:---------------|\n| `BDTC_ENABLE_REDIS`   | 启用 Redis 配置    |\n| `BDTC_REDIS_HOST`     | Redis 主机地址     |\n| `BDTC_REDIS_PORT`     | Redis 端口       |\n| `BDTC_REDIS_PASSWORD` | Redis 密码       |\n| `BDTC_REDIS_DB`       | Redis 数据库      |\n| `BDTC_LIMIT`          | 限制次数，默认 `5` 次  |\n| `BDTC_EXPIRE`         | 过期时间，默认 `60` 秒 |\n\n```php\ndefine('BDTC_ENABLE_REDIS', true);\ndefine('BDTC_REDIS_HOST', '127.0.0.1');\ndefine('BDTC_REDIS_PORT', 6379);\ndefine('BDTC_REDIS_PASSWORD', '');\ndefine('BDTC_REDIS_DB', 1);\n\n// 以下配置表示：同一个 IP 1 分钟内最多请求 10 次\ndefine('BDTC_LIMIT', 10);\ndefine('BDTC_EXPIRE', 60);\n```\n\n## 文章内容审核\n\n请使用`TextCensor For Articles`插件。\n\n[GitHub](https://github.com/sy-records/textcensor-for-articles)、[WordPress Plugins](https://wordpress.org/plugins/textcensor-for-articles)\n\n## 其他\n\n### Typecho\n\n下载源码，将源码上传到 Typecho 插件目录 `usr/plugins`，然后在后台启用\n\n项目地址：[https://github.com/sy-records/ty-baidu-textcensor](https://github.com/sy-records/ty-baidu-textcensor)\n\n### 其他博客系统\n\n在其他博客系统中，如 ThinkPHP、Laravel 等，可以直接使用 composer 包，自行调用处理\n\n项目地址：[https://github.com/sy-records/baidu-textcensor](https://github.com/sy-records/baidu-textcensor)\n\n## License\n\nApache-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsy-records%2Fwp-baidu-textcensor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsy-records%2Fwp-baidu-textcensor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsy-records%2Fwp-baidu-textcensor/lists"}