[wp-trac] [WordPress Trac] #59442: Duplicate query in WP_Query

WordPress Trac noreply at wordpress.org
Wed Feb 7 02:53:45 UTC 2024


#59442: Duplicate query in WP_Query
-------------------------------------------------+-------------------------
 Reporter:  spacedmonkey                         |       Owner:  joemcgill
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  6.5
Component:  Query                                |     Version:  6.2
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch dev-feedback commit early  |     Focuses:
  changes-requested                              |  performance
-------------------------------------------------+-------------------------

Comment (by joemcgill):

 Replying to [comment:22 spacedmonkey]:
 > @peterwilsoncc @joemcgill If we are scale this patch back. I think we
 should consider the first version from @thekt12 of this patch. See thie
 [https://github.com/WordPress/wordpress-
 develop/pull/5295/commits/e69cc40698b103ad9ce330d94b6491cc9b9e362c
 commit].
 >

 At first glance, this looks clearer than the final PR, but would
 appreciate @peterwilsoncc's thoughts. I would still like to see a unit
 test that demonstrates the issue in addition to the included test that
 improves coverage for the current behavior.

 > I think we are a little overly worried about backwards compat here. It
 is an extreme edge case to break this code. If anything, I feel like the
 post type variable being set is a good thing.
 >
 > I feel like this is really close to committed.

 I think it's always good to be extra cautious about backwards
 compatibility when modifying `WP_Query`. From what I can tell, this
 addresses an issue that is not that common (e.g., you have to have a
 sticky post active) and even then provides just a moderate performance
 benefit without any change to the end user experience, so I'd rather get
 good test coverage and consensus on the PR before committing.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59442#comment:23>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list