• jfbprivate

    (@jfbprivate)


    The error messages for mentioned scenarios are no longer displayed, but are overwritten by the error message intended for special characters.

    So instead of “This username is not allowed, choose another please.”, “Username must be at least %min% characters.”, and “Username may not be longer than %max% characters.”, it will now say “This username is invalid because it uses illegal characters. Please enter a valid username.”

    Thank you for looking into this.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Benaceur

    (@benaceur)

    yes, because priority is given to the message “This username is invalid because it uses illegal characters”, if the username contains unauthorized characters then priority has this error.

    • This reply was modified 5 months ago by Benaceur.
    Thread Starter jfbprivate

    (@jfbprivate)

    Thanks for the quick response.

    I forgot to mention that this is not the case. Otherwise I wouldn’t have started this thread.

    Let’s say I set the length to a minimum of 3 and a maximum of 24 and then try a 10-letter username without any special characters whatsoever, it will still return the invalid character error message.

    I should also mention that this is a BuddyBoss install which already overrides some of the error messages defined in the plugin.

    I’m 100% sure that this used to work correctly before though.

    Plugin Author Benaceur

    (@benaceur)

    I tested on BuddyPress:

    Capture-d-cran-2024-06-27-225427

    Thread Starter jfbprivate

    (@jfbprivate)

    I did some more testing and it’s actually BuddyBoss Platform itself that is causing the issue. Once deactivated the correct error message will show. We will have to look into this with their support team.

    Please let me know if you should come up with anything in the meantime.

    Thanks much!

    Plugin Author Benaceur

    (@benaceur)

    I will fix this problem in the next version of the plugin.
    for the moment edit this file:

    wp-content\plugins\restrict-usernames-emails-characters\classes\classe_val.php

    and to the lines 86-87 replace this:

    $__valid = $this->mu() || $_bp_signup_username ? true : $valid;
    $_valid = $this->mu() || $_bp_signup_username ? $valid = true : $valid = false;

    by:

    $__valid = $this->mu() || $this->bp() ? true : $valid;
    $_valid = $this->mu() || $this->bp() ? $valid = true : $valid = false;
    • This reply was modified 5 months ago by Benaceur.
    Thread Starter jfbprivate

    (@jfbprivate)

    Thank you for looking into this. Your help is much appreciated. Looking forward to the new release.

    Thread Starter jfbprivate

    (@jfbprivate)

    Hi,

    Replacing those lines seems to have fixed that particular issue.

    I’ve come across some other (related) problems however.

    ================

    Instead of what is set in the plugin I’m getting the default BuddyBoss/BuddyPress error messages for the following scenarios:

    Username too short:
    [1 character] = “Username must be at least 3 characters” (BuddyBoss)
    [2 characters] = “Username must be at least 3 characters” (BuddyBoss)
    [3 characters] = “Username must be at least 5 characters.” (plugin)
    [4 characters] = “Username must be at least 5 characters.” (plugin)

    Username too long:
    [16 characters] = “Username may not be longer than 15 characters.” (plugin)
    [32 characters] = “Username may not be longer than 15 characters.” (plugin)
    [33 characters] = “Username must be shorter than 32 characters.” (BuddyBoss)
    [34 characters] = “Username must be shorter than 32 characters.” (BuddyBoss)

    Username empty:
    [0 characters] = “This is a required field.” (BuddyBoss)

    ================

    Here are more but I realized that there are no options for name and empty password fields in the plugin, even though that would actually be a useful addition.

    Name too long:
    [33 characters] = “Name must be shorter than 32 characters.” (BuddyBoss)
    [34 characters] = “Name must be shorter than 32 characters.” (BuddyBoss)

    Name empty:
    [0 characters] = “This is a required field.” (BuddyBoss)

    Password empty:
    [0 characters] = “Please make sure to enter your password.” (BuddyBoss)
    [0 characters] = “Please make sure to enter your password twice.” (BuddyBoss)

    ================

    At least in the case of BuddyBoss/BuddyPress the plugin doesn’t seem to successfully overwrite the default error messages.

    In fact only the email field seems to be working correctly for both empty and existing values.

    I would very much appreciate if you could look into this. I can’t be the only one having these issues.

    Thank you!

    Plugin Author Benaceur

    (@benaceur)

    I will fix compatibility issues with buddyBoss in the next release.

    note: my plugin is based on the username (in BuddyBoss Nickname) and email in the process of registering a new member or updating a user’s profile, and not other fields like password and other …

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.