WP Manifestindependent plugin directory
manifest / security / aliyun-captcha-2

阿里云验证码 2.0

为 WordPress 登录、注册和找回密码接入阿里云验证码 2.0(Web/H5 V3)。

★ 0stars

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/liutao91/aliyun-captcha-2/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.

一个为 WordPress 登录、注册和找回密码接入阿里云验证码 2.0(Web/H5 V3)的插件。

功能

  • 接入 WordPress 原生登录、注册、找回密码表单
  • 支持阿里云验证码 2.0 Web/H5 V3
  • 提供后台设置页,配置 Prefix、Scene ID、AccessKey ID、AccessKey Secret
  • 支持 Region / Endpoint 预设与联动选择
  • 在插件列表提供“设置”入口
  • 支持短代码 [aliyun_captcha2] 用于自定义页面接入

安装

  1. 将插件目录上传到 WordPress 的 wp-content/plugins/ 目录
  2. 在 WordPress 后台启用插件
  3. 进入 设置 -> 阿里云验证码 2.0 填写配置

配置说明

  • 身份标(Prefix):从阿里云验证码控制台获取
  • 场景 ID:从阿里云验证码控制台获取
  • AccessKey ID / AccessKey Secret:从阿里云 RAM 访问控制获取
  • Region:当前支持 cn、sgp、ga
  • Endpoint:建议与 Region 保持匹配

Region 与 Endpoint

  • cn:中国内地
  • sgp:新加坡
  • ga:全球加速

其中 Endpoint 会根据所选 Region 自动联动到对应的官方域名。你也可以手动切换到其他官方预设值。

自定义页面接入

在任意页面、文章或表单模板中加入:

[aliyun_captcha2]

插件会输出验证码模块,并在验证通过后把结果写入隐藏字段 aliyun_captcha2_param。你可以在自定义表单提交时一并提交该字段。

使用建议

  • 建议使用 RAM 子账号的 AccessKey
  • 确保 RAM 用户已授权 AliyunYundunAFSFullAccess
  • 保持 Region 和 Endpoint 配套
  • 如果验证失败,优先检查 Prefix、Scene ID、AccessKey Secret 是否正确

兼容性

  • WordPress 5.8+
  • PHP 7.4+

许可证

GPLv2 or later