Making WordPress.org


Ignore:
Timestamp:
05/10/2021 05:42:47 AM (5 years ago)
Author:
dd32
Message:

Registration: Introduce a new check on some heuristics to determine if a signup looks spammy.

This is intended to replace the usage of Akismet (which isn't designed for this) to hopefully reduce the number of blocked signups that require manual review.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-registration.php

    r10949 r10961  
    122122    }
    123123
     124    if ( function_exists( 'wporg_registration_check_private_heuristics' ) ) {
     125        // Returns block, review, allow.
     126        $pending_user['meta']['heuristics'] = wporg_registration_check_private_heuristics( compact( 'user_login', 'user_email' ) );
     127    }
     128
    124129    $pending_user['meta']['akismet_result'] = wporg_login_check_akismet( $user_login, $user_email );
    125130
    126131    $pending_user['cleared'] = (
     132        // ( !isset( $pending_user['meta']['heuristics'] ) || 'allow' === $pending_user['meta']['heuristics'] ) && // Disabled for now, review results first, replace Akismet below
    127133        'spam' !== $pending_user['meta']['akismet_result'] &&
    128134        (float)$pending_user['scores']['pending'] >= (float) get_option( 'recaptcha_v3_threshold', 0.2 )
     
    213219
    214220    // Cast the int fields to an integer.
    215     foreach ( [ 'pending_id', 'cleared', 'created' ] as $field ) {
    216         $pending_user[ $field ] = (int) $pending_user[ $field ];
    217     }
     221    $pending_user['pending_id'] = (int) $pending_user['pending_id'];
     222    $pending_user['cleared']    = (int) $pending_user['cleared'];
     223    $pending_user['created']    = (int) $pending_user['created'];
    218224
    219225    return $pending_user;
Note: See TracChangeset for help on using the changeset viewer.