fix(captcha): close human-verification loop end-to-end

Rewrite captcha core around aksrt_captcha_config only, require captcha
on login/comment/SMS/phone auth and related gates, wire frontend token
collection, and remove dead dual-source security settings plus slider enqueue.
This commit is contained in:
2026-07-13 19:52:30 +08:00
parent a0808bbe54
commit 02f77b756c
21 changed files with 1163 additions and 1515 deletions
+6 -6
View File
@@ -1004,8 +1004,8 @@ add_action('wp_ajax_aksrt_send_email_code', function () {
wp_send_json_error( array( 'message' => __( '无效的验证场景', 'aksrt' ) ) );
}
if ( aksrt_is_captcha_enabled_for( $scene ) ) {
$captcha_result = aksrt_verify_captcha( $_POST );
if ( function_exists( 'aksrt_require_captcha' ) ) {
$captcha_result = aksrt_require_captcha( $scene, wp_unslash( $_POST ) );
if ( $captcha_result !== true ) {
wp_send_json_error( array( 'message' => $captcha_result ) );
}
@@ -1113,8 +1113,8 @@ add_action('wp_ajax_aksrt_change_password', function () {
}
// 人机验证
if ( aksrt_is_captcha_enabled_for( 'change_password' ) ) {
$captcha_result = aksrt_verify_captcha( $_POST );
if ( function_exists( 'aksrt_require_captcha' ) ) {
$captcha_result = aksrt_require_captcha( 'change_password', wp_unslash( $_POST ) );
if ( $captcha_result !== true ) {
wp_send_json_error( array( 'message' => $captcha_result ) );
}
@@ -1178,8 +1178,8 @@ add_action('wp_ajax_aksrt_change_email', function () {
}
// 人机验证
if ( aksrt_is_captcha_enabled_for( 'change_email' ) ) {
$captcha_result = aksrt_verify_captcha( $_POST );
if ( function_exists( 'aksrt_require_captcha' ) ) {
$captcha_result = aksrt_require_captcha( 'change_email', wp_unslash( $_POST ) );
if ( $captcha_result !== true ) {
wp_send_json_error( array( 'message' => $captcha_result ) );
}