[wp-trac] [WordPress Trac] #29785: User count not correct

WordPress Trac noreply at wordpress.org
Wed Sep 14 15:08:14 UTC 2016


#29785: User count not correct
-------------------------------------------------+-------------------------
 Reporter:  psoluch                              |       Owner:
     Type:  defect (bug)                         |  boonebgorges
 Priority:  normal                               |      Status:  assigned
Component:  Users                                |   Milestone:  Future
 Severity:  normal                               |  Release
 Keywords:  good-first-bug has-unit-tests        |     Version:
  needs-patch                                    |  Resolution:
                                                 |     Focuses:
                                                 |  performance
-------------------------------------------------+-------------------------
Changes (by boonebgorges):

 * keywords:  good-first-bug has-unit-tests has-patch => good-first-bug has-
     unit-tests needs-patch


Comment:

 Hi @dots -

 > But still, I am confused here how exactly do we have to do unit testing
 on this issue.

 The tests are failing because the code is incorrect. That means that the
 tests are working properly :)

 > > Regarding your proposed fix: Be sure to add a corresponding fix for
 the 'time' $strategy.
 > Can you please explain more about your sentence?

 `count_users()` does two different kinds of query, depending on the value
 of the `$strategy` parameter. See
 https://core.trac.wordpress.org/browser/tags/4.6.1/src/wp-
 includes/user.php?marks=845,876#L837 Your proposed fix only addresses the
 "else" part. This also explains why the tests above are failing, because
 they use the default value for `$strategy`, which is 'time'.

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


More information about the wp-trac mailing list