Skip to:
Content

BuddyPress.org

Opened 9 years ago

Closed 6 years ago

#6308 closed enhancement (maybelater)

bp_settings_action_general() could be broken down into smaller functions

Reported by: henrywright's profile henry.wright Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Settings Keywords: good-first-bug, trac-tidy-2018
Cc:

Description

Opening this ticket after a discussion at WordCamp London Contributor Day.

Inside bp-settings-actions.php there's a function bp_settings_action_general() which could be broken down into smaller functions.

Change History (7)

#1 @DJPaul
9 years ago

  • Keywords good-first-bug added
  • Milestone changed from Awaiting Review to Future Release
  • Type changed from defect (bug) to enhancement

Yep. :)

Marking this as good-first-bug because though it's not a trivial task, it'd be a good ticket for a contributor looking for something larger to have a go at.

#2 @needle
8 years ago

I'm looking at this ticket because I have a need to enforce strong passwords across WordPress and BuddyPress and there's no filter available in bp_settings_action_general() to add additional checks to the password submitted via the Profile Settings form. The structure of the function doesn't seem to lend itself to an effective filter since the feedback message switch statement would apparently require a second one. Refactoring the function seems to me the logical answer to this.

The question I have is about this ticket is what the preferred approach would be - i.e. would it be preferable to hook new functions to the bp_actions hook or create subroutines for the existing function?

#3 follow-up: @DJPaul
8 years ago

I think new functions hooked, that deal with one aspect. Like most of the rest of the functions in this file, I'd say. What do you think?

#4 in reply to: ↑ 3 @needle
8 years ago

Replying to DJPaul:

I think new functions hooked, that deal with one aspect.

My hesitation regarding this approach is that:

  1. feedback would be limited to either email errors or password errors, not both as is currently the case.
  2. it would be tricky to return the "No changes were made to your account." feedback
  3. wp_update_user() would be called twice
  4. it's not clear where the bp_core_general_settings_after_save hook should live

Other than that, I agree with you :-)

#5 @DJPaul
8 years ago

@needle Sorry, I missed your reply here. Interested in progressing this for 2.7?

#6 @DJPaul
6 years ago

  • Keywords trac-tidy-2018 added

We're closing this ticket because it has not received any contribution or comments for at least two years. We have decided that it is better to close tickets that are good ideas, which have not gotten (or are unlikely to get) contributions, rather than keep things open indefinitely. This will help us share a more realistic roadmap for BuddyPress with you.

Everyone very much appreciates the time and effort that you spent sharing your idea with us. On behalf of the entire BuddyPress team, thank you.

If you feel strongly that this enhancement should still be added to BuddyPress, and you are able to contribute effort towards it, we encourage you to re-open the ticket, or start a discussion about it in our Slack channel. Please consider that time has proven that good ideas without contributions do not get built.

For more information, see https://bpdevel.wordpress.com/2018/01/21/our-awaiting-contributions-milestone-contains/
or find us on Slack, in the #buddypress channel: https://make.wordpress.org/chat/

#7 @DJPaul
6 years ago

  • Milestone Awaiting Contributions deleted
  • Resolution set to maybelater
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.