Opened 10 months ago
Closed 9 months ago
#9099 closed defect (bug) (fixed)
Heartbeat requests need better parsing
Reported by: | needle | Owned by: | imath |
---|---|---|---|
Milestone: | 12.4.0 | Priority: | normal |
Severity: | normal | Version: | 12.0.0 |
Component: | Activity | Keywords: | has-patch |
Cc: |
Description
I opened this ticket on Query Monitor because I thought it was the source of PHP Warnings in my logs... however, it appears that it is BuddyPress that causes QM to throw the PHP Warning.
When heartbeat
was added to in 13526, BuddyPress resets the query during all heartbeat requests in bp_core_set_ajax_uri_globals(). This results in WP_Query->is_page = true
in WP_Query->parse_query()
because $qv['pagename']
is whatever the path component of bp_get_referer_path()
is set to, e.g. wp-admin/plugins.php
.
This introduces an inconsistency shown by QM because is_singular()
reports true
yet get_queried_object_id()
returns no ID. It seems to me that there needs to be more granularity in the checks in bp_core_set_ajax_uri_globals
and that looking at bp_ajax_action_is_registered
may not be enough to discern a BuddyPress heartbeat
request from ones in which BuddyPress has no interest.
Change History (7)
#1
follow-up:
↓ 2
@
10 months ago
- Component changed from Core to Activity
- Milestone changed from Awaiting Review to 12.3.0
#2
in reply to:
↑ 1
@
10 months ago
Replying to imath:
Thanks for your report. @Slaffik told me about it. I’ll try to fix it asap.
Thanks for looking into it @imath
This ticket was mentioned in PR #247 on buddypress/buddypress by imath.
9 months ago
#4
- Keywords has-patch added
The Query Monitor plugin is showing some notice errors about the way some specific Ajax requests were handled by the BP Rewrites API. This PR aims to remove these notices making sure the heartbeat
action is about a BuddyPress context.
Trac ticket: https://buddypress.trac.wordpress.org/ticket/9099
Thanks for your report. @Slaffik told me about it. I’ll try to fix it asap.