[wp-trac] [WordPress Trac] #19372: Don't call wp_count_comments() when we don't need to

WordPress Trac noreply at wordpress.org
Wed Nov 4 21:27:19 UTC 2015


#19372: Don't call wp_count_comments() when we don't need to
----------------------------+-----------------------------
 Reporter:  johnbillion     |       Owner:  wonderboymusic
     Type:  task (blessed)  |      Status:  assigned
 Priority:  normal          |   Milestone:  4.4
Component:  Comments        |     Version:  3.2
 Severity:  minor           |  Resolution:
 Keywords:  has-patch       |     Focuses:  performance
----------------------------+-----------------------------

Comment (by justindocanto):

 Would like to point out that the proposed patch still does not address the
 issue mentioned in #32366 which was merged into this issue.

 With this patch, a user who can edit posts still has the issue of WP
 querying potentially millions of comments on every single page load and
 there is no way to disable it other than editing core files. There should
 be a 2nd check of some kind. Some sort of check if the user has flagged
 for this to be disabled...

 e.g.

 {{{#!php
 if ( current_user_can( 'edit_posts' ) && IF_USER_HAS_NOT_DISABLED_THIS ) {
 }}}

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


More information about the wp-trac mailing list