Skip to content

N+1 problem fixed on member filter saving 10 queries a page#4890

Open
phe-sto wants to merge 11 commits intobuddyboss:releasefrom
phe-sto:remove-useless-user-query-request
Open

N+1 problem fixed on member filter saving 10 queries a page#4890
phe-sto wants to merge 11 commits intobuddyboss:releasefrom
phe-sto:remove-useless-user-query-request

Conversation

@phe-sto
Copy link
Copy Markdown

@phe-sto phe-sto commented Feb 2, 2026

  • Existing functions are isofunctional.
  • bp_activity_get_user_mentionname splited in two as only requires ID and login which are provides in many cases. If present formatting can be called without querying user data in base again.
  • bp_activity_get_user_mentionname replaced by bp_activity_format_mentionname in bp-members-filters.php saving my site 10 queries on feed page.

I have not check yet if bp_activity_get_user_mentionname could be replace by bp_activity_format_mentionname in other scripts.

@welcome
Copy link
Copy Markdown

welcome bot commented Feb 2, 2026

Thanks for your pull request. It looks like this may be your first contribution to the BuddyBoss Platform open source project. Please note that this project and all contributions to it are public and bounded by the GPL v2.0 license, and that a record of the contribution (including all personal information you submit with it, including your full name and email address) is maintained indefinitely and may be redistributed with this project. If you are not okay with these terms, please close this pull request. Alternatively, you can let us know about your concerns by adding a comment to this pull request.

phe-sto and others added 6 commits March 17, 2026 22:45
Co-authored-by: Chetan Satasiya <chetansatasiya88@gmail.com>
Co-authored-by: Chetan Satasiya <chetansatasiya88@gmail.com>
Co-authored-by: Chetan Satasiya <chetansatasiya88@gmail.com>
Co-authored-by: Chetan Satasiya <chetansatasiya88@gmail.com>
Co-authored-by: Chetan Satasiya <chetansatasiya88@gmail.com>
@phe-sto
Copy link
Copy Markdown
Author

phe-sto commented Mar 17, 2026

Hi @chetansatasiya,
Sorry I haven't so your remarks earlier. I have of course committed your suggested changes.
Thank you for the review.
Best-regards

@phe-sto phe-sto requested a review from chetansatasiya March 18, 2026 07:55
Copy link
Copy Markdown
Contributor

@chetansatasiya chetansatasiya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phe-sto Make the code format properly, as it breaking exisitng code format use the WordPress PHPCBF

@phe-sto
Copy link
Copy Markdown
Author

phe-sto commented Mar 18, 2026

@chetansatasiya I don't get it, what and where is it broken?

@chetansatasiya
Copy link
Copy Markdown
Contributor

chetansatasiya commented Mar 18, 2026

I would recommend to run the PHPCS and PHPCBF and it will correct.

@phe-sto phe-sto requested a review from chetansatasiya March 18, 2026 09:02
@phe-sto
Copy link
Copy Markdown
Author

phe-sto commented Mar 18, 2026

@chetansatasiya ok I reformated my code using this:

$ phpcbf --standard=WordPress src/bp-xprofile/bp-xprofile-functions.php

PHPCBF RESULT SUMMARY
---------------------------------------------------------------------------------------------------------------------------
FILE                                                                                                       FIXED  REMAINING
---------------------------------------------------------------------------------------------------------------------------
/home/chrichri/blockchain-over-rf/haven-0/buddyboss-platform/src/bp-xprofile/bp-xprofile-functions.php     3264   114
---------------------------------------------------------------------------------------------------------------------------
A TOTAL OF 3264 ERRORS WERE FIXED IN 1 FILE
---------------------------------------------------------------------------------------------------------------------------

Time: 1.31 secs; Memory: 48MB

But only kept the lines I changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants