Skip to:
Content

BuddyPress.org

Opened 6 weeks ago

Last modified 5 weeks ago

#8212 new enhancement

Do not use random number for resolve slug group conflict

Reported by: ExoConsult Owned by:
Milestone: Under Consideration 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 (2)

#1 @johnjamesjacoby
6 weeks ago

  • Component changed from Core to Groups
  • Keywords reporter-feedback 2nd-opinion added
  • Milestone changed from Awaiting Review to Under Consideration
  • Priority changed from normal to low
  • Severity changed from normal to trivial
  • Version set to 1.0

a better choice could be to iterate on a number until a non existing slug is found

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!

#2 @ExoConsult
5 weeks ago

Yeah. That's a good point of view...

Note: See TracTickets for help on using tickets.