You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Hi @westonruter 👋🏻
We should use getters if possible, but in this case it is not working as expected, and $posts property is public, so $query->posts is fine and will be a minimal change. Or it can be:
$query = new WP_Query();
$found_posts = $query->query( $args );
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: