Skip to:
Content

BuddyPress.org

Opened 3 years ago

Closed 3 years ago

Last modified 2 years ago

#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:
Priority: low Milestone:
Component: (not sure) Version:
Severity: minor 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)

#2 @imath
3 years ago

  • Milestone Awaiting Review12.0.0

Hi @aleey1982

Thanks a lot for your report and PR. I’ll look at it asap 👌

#3 @imath
3 years ago

  • Component Core(not sure)
  • Milestone 12.0.0
  • Priority highlow
  • Resolutionfixed
  • Severity majorminor
  • Status newclosed

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.

https://cldup.com/nL-PwMK3JY.png

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.

@imath commented on PR #74:


3 years ago
#4

This PR is about a BuddyPress fork, not about the genuine BuddyPress. Please report to the fork's support team.

#5 @aleey1982
3 years 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.

Note: See TracTickets for help on using tickets.