Opened 5 years ago
Closed 3 months ago
#8212 closed enhancement (maybelater)
Do not use random number for resolve slug group conflict
Reported by: | ExoConsult | Owned by: | |
---|---|---|---|
Milestone: | Priority: | low | |
Severity: | trivial | Version: | 1.0 |
Component: | Groups | Keywords: | reporter-feedback 2nd-opinion |
Cc: |
Description
Hello,
An enhancement could be made on how slug of a group is created when there's a conflict (see groups_check_slug method in the file bp-groups-function.php - line 439)
At the moment, a random number is added at the end of the existing "default" slug group. But a better choice could be to iterate on a number until a non existing slug is found (the same way wordpress handles slug of a post).
See Worpdress method "wp_unique_post_slug" in file "wp-includes\post.php" (line 4294)
Regards,
Didier
Change History (3)
Note: See
TracTickets for help on using
tickets.
Why is an incremental number better than a random one?
The reasons random slugs are used is because group slugs can be changed later, and random slugs cannot be enumerated through as easily if someone is trying to guess whether or not a group exists, either before or after it has been finalized by the creator.
WordPress sites generally have fewer content creators, making incremental numbers simpler to manage because authors are usually working together anyways. In a Community site, where Group creation is likely to be open to all Members, a random number also dramatically reduces the probability of a slug collision, in the event multiple Members happen to be attempting to create a Group with the same base slug at around the same time.
Open to hearing different opinions and suggestions here though!