-
Notifications
You must be signed in to change notification settings - Fork 381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect use of $query->get_posts(), resulting in double request processing #7781
Comments
@OlaIola Hi! So you're saying that anywhere that we're calling |
Hi @westonruter 👋🏻
|
I discovered this issue at my own code with Query Monitor, it indicated that I am making some requests twice. Data can be served from the cache object the second time, but WP_Query is still processing the request. Query Monitor is not working with feeds, but I went to look in the site code base for this issue in general. |
Bug Description
The WP_Query() constructor calls $this->get_posts() inside __constructor() and it is the longest method in the class and the next time it is called it does not return the result but rebuilds the entire query. The plugin uses this methog in 5 places.
Expected Behaviour
The same as before but avoiding unnecessary data processing and requests.
Screenshots
No response
PHP Version
No response
Plugin Version
2.5.3
AMP plugin template mode
Standard
WordPress Version
6.5
Site Health
No response
Gutenberg Version
No response
OS(s) Affected
No response
Browser(s) Affected
No response
Device(s) Affected
No response
Acceptance Criteria
No response
Implementation Brief
No response
QA Testing Instructions
No response
Demo
No response
Changelog Entry
No response
The text was updated successfully, but these errors were encountered: