#8853 closed defect (bug) (fixed)
Bug in filters for 2 entity (class-bp-invitation.php , class-bp-notifications-notification.php)
Reported by: | aleey1982 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | low | |
Severity: | minor | Version: | |
Component: | (not sure) | Keywords: | has-patch |
Cc: |
Description
Version: 2.2.9
Site: http://kluchimasterstva.ru/treningi/
I found a bug in
- class-bp-invitation.php
- class-bp-notifications-notification.php
In public static function get( $args = array() ) created an filter for sql query:
$where_sql = self::get_where_sql ... 'user_id' => $r['user_id']," ....
Look at "get_where_sql" function, in case if user is not login
if ( ! empty( $args['user_id'] ) ) {
filter by user is not created, and for non unauthorized user loaded data from all users. In my case I got an 120K rows for notifications and 20K extra request for DB in invitation.
It's easy fixed with adding
if (empty($r['user_id'])) return [];
after "self::parse_args( $args );"
In my case page generation down from 3.5 to 1.2, server load down to 40% of current.
Change History (5)
This ticket was mentioned in PR #74 on buddypress/buddypress by AleWhey.
18 months ago
#1
#2
@
18 months ago
- Milestone changed from Awaiting Review to 12.0.0
Hi @aleey1982
Thanks a lot for your report and PR. I’ll look at it asap 👌
#3
@
18 months ago
- Component changed from Core to (not sure)
- Milestone 12.0.0 deleted
- Priority changed from high to low
- Resolution set to fixed
- Severity changed from major to minor
- Status changed from new to closed
Hi @aleey1982
I wasn't able to reproduce because the corresponding requests are used when viewing pages restricted to the member displayed.
After looking at your site, I've seen you are not using BuddyPress but a fork of BuddyPress. As a result, I advise you to contact the support team of this fork to have your issue fixed.
We are not responsible for the code of this fork and cannot help you as we have no idea how their code has diverged from ours.
Thanks in advance for your comprehension.
18 months ago
#4
This PR is about a BuddyPress fork, not about the genuine BuddyPress. Please report to the fork's support team.
#5
@
18 months ago
I know what I used a fork, but you have the same codebase in files. The bug is present in both BuddyPress and it's fork.
Fix for https://buddypress.trac.wordpress.org/ticket/8853