Since 3.28.0 lh-profile-page provides one shared helper for suggesting a gender from a first name: LH_Profile_First_Name_Gender::suggest( $first_name ) (includes/class-lh-profile-first-name-gender.php). Every plugin that infers gender from a name, such as email ingestion enrichment, imports or bulk fills, should call it rather than run its own lookup, so the same rules apply everywhere. LH User Provisioning (1.5.0+) also uses it to tell which part of an email address is the first name. Guard calls with class_exists( 'LH_Profile_First_Name_Gender' ).
'Male' or 'Female' when the name clearly reads as that gender, otherwise ''. It is deliberately conservative: getting no suggestion is always better than a wrong one. The checks run in this order:
tuqqu/gender-detector library (the nam_dict data used by Python’s gender-guesser) must read the name as strictly Male or Female. Mostly male, mostly female, unisex and unknown names give nothing.lh_profile-gender, and should only fill an empty gender, never overwrite one a member or admin has set.There are no admin settings. The lists are static methods with filterable defaults, so a site plugin can adjust them for its own members:
lh_profile_return_ambiguous_first_names filters return_ambiguous_first_names(): an array of names that never get a suggestion.lh_profile_return_known_first_names filters return_known_first_names() (3.30.0+): an array of name => 'Male' or 'Female'. Only common, clearly gendered names belong here; a name that was right for one person (a Chris or a Kelly) does not.lh_profile_return_gender_check_countries filters return_check_countries(): ISO 3166 codes whose reading must agree with the global one (default GB, US). The detector reads AU and CA as its US column, and codes it does not know as its "other countries" column.The detector parses its whole dictionary when it is created, which takes noticeable time and memory. The helper creates it only on first use and reuses it for the rest of the request, so batch callers should make all their lookups in one request rather than one per request. A name on the ambiguous or known list never loads the detector. If the library cannot be loaded, the helper logs an error and returns ''.