[wp-trac] [WordPress Trac] #55890: Site Health / Info / WordPress show User count -1

WordPress Trac noreply at wordpress.org
Wed Jun 1 15:20:03 UTC 2022


#55890: Site Health / Info / WordPress show User count -1
--------------------------+------------------------------
 Reporter:  knutsp        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Site Health   |     Version:  6.0
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+------------------------------

Comment (by knutsp):

 Replying to [comment:2 SergeyBiryukov]:
 > Replying to [ticket:55890 knutsp]:
 > > Site Health Info shows "User count" on both multisite and single. In
 both cases it now uses the `get_user_count` function, but this function
 still emits "Doing it wrong" and returns -1 when not on multisite.
 >
 > As far as I can tell, it only emits `_doing_it_wrong()` on single site
 if the `$network_id` parameter is passed, which does not appear to be the
 case in Site Health.

 Correct. The returned number -1 must be the default when 'user_count'
 option not present, and I can confirm this option is not set on the single
 sites I have checked so far.

 It seems the option should be updated via a cron task
 'wp_update_user_counts'

 I can see `upgrade_600()` runs an intial `wp_update_user_counts()`.

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


More information about the wp-trac mailing list