• Resolved mharpen

    (@mharpen)


    Matt, please consider sorting the list of subscribers with “case-Insensitive”. It’s hard to find someone when some emails with upper case are sorted at the top, and others are lower case and sorted below that. Especially for trying to spot if someone is in there twice. Also, please ignore case when checking if someone is already subscribed. I’m seeing a few subscribers in there twice with the different case, but same email address. Thanks!

    https://www.ads-software.com/extend/plugins/subscribe2/

Viewing 9 replies - 1 through 9 (of 9 total)
  • @mharpen,

    I’ll take a look at the Table class and see if this can be done.

    @mharpen,

    It was actually much easier than I though, in the classes/class-s2-list-table.php look for the usort_reorder() function towards the end of the file. In there you’ll see this line (approx line number 206):
    $result = strcmp($a[$orderby], $b[$orderby]);
    Change that to:
    $result = strcasecmp($a[$orderby], $b[$orderby]);

    Thread Starter mharpen

    (@mharpen)

    Thanks Matt! Do you plan to add this in the next update?

    @mharpen,

    Yes, it’s already committed to the development code.

    Thread Starter mharpen

    (@mharpen)

    Also, case insensitivity needs to be in the area that accepts new subscriptions also, so users get a message “you’ve already subscribed”. Does this change handle that too?

    @mharpen,

    No. Subscribe2 is standards compliant with RFC 2821. Capitalisation before the ‘@’ in an email is allowed and can be considered a different email from the same word in lower case. While it isn’t recommended it is the current standard.

    Anything after the ‘@’ should be in lower case, so Subscribe2 sanitises any input email address to the user part is left as it is input and the domain part is made lower case. Deviating from this means the plugin will no longer be standards compliant.

    EDIT, in fact RFC 2821 has been replaced by RFC 5321 but the same argument applies.

    Thread Starter mharpen

    (@mharpen)

    Thanks again Matt. yes, i just looked it up too. Interesting, but the research says “Hardly any email service or ISP enforces case sensitive email addresses”.

    Seems odd that this is a standard and hardly any isp is strict about it. I’m guessing it will probably fall off the standards list eventually.

    Anyway, maybe consider adding a checkbox option to force all email addresses to lower case, so we can choose to be strict or not. I only have about 50 subscribers, and 3 have duplicates (different case). I’m guessing the user wasn’t sure they subscribed or not, and subscribed again.

    Thanks again!!

    Thread Starter mharpen

    (@mharpen)

    hey, that usort() function is pretty cool. i didn’t know about that. nice implementation of it you did too!

    @mharpen,

    I’d love to take credit for the sort() function but it’s all taken from the WordPress core examples! ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Please change Sorted list of subscribers to Case-Insensitive sorting’ is closed to new replies.