wp-admin/includes/class-wp-site-health.php:1892Tests if registration is open to everyone and the default role is privileged.
array public function get_test_insecure_registration() { $users_can_register = get_option( 'users_can_register' ); $default_role = get_option( 'default_role' ); $result = array( 'label' => __( 'Open Registration with privileged default role' ), 'status' => 'good', 'badge' => array( 'label' => __( 'Security' ), 'color' => 'blue', ), 'description' => '<p>' . __( 'The combination of open registration setting and the default user role may lead to security issues.' ) . '</p>', 'actions' => '', 'test' => 'insecure_registration', ); if ( $users_can_register && in_array( $default_role, array( 'editor', 'administrator' ), true ) ) { $result['description'] = __( 'Registration is open to anyone, and the default role is set to a privileged role.' ); $result['status'] = 'critical'; $result['actions'] = sprintf( '<p><a href="%s">%s</a></p>', esc_url( admin_url( 'options-general.php' ) ), __( 'Change these settings' ) ); } return $result; }Introduced in 7.0.0. Unchanged from 7.0.4 through 7.1.0.
Signature, return type and hooks compared across 2 parsed releases.
src/wp-admin/includes/class-wp-site-health.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.