[wp-trac] [WordPress Trac] #46707: Site health: notify the user while gathering site data

WordPress Trac noreply at wordpress.org
Fri Apr 12 17:34:35 UTC 2019


#46707: Site health: notify the user while gathering site data
-------------------------------------------------+-------------------------
 Reporter:  azaozz                               |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  5.2
Component:  Administration                       |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  site-health has-patch needs-testing  |     Focuses:  ui,
                                                 |  performance
-------------------------------------------------+-------------------------

Comment (by azaozz):

 @xkon @afercia Thanks for testing and the reviews! :)

 > One thing I'm seeing and I'm a bit confused is on the totals, I think
 the calculation is going wrong somewhere.
 > ...
 > Also getting a PHP Notice.

 Uh, sorry about that, it's a "copy/paste" bug I introduced. Should have
 been `strpos( $attributes['path']...`. Fixing.

 > Adds an extra value of `unformatted_size`.

 Yeah, that may be useful in the future, or perhaps if plugins reuse this
 (although reusing is not really intended I think).

 > If recurse_dirsize() was able to accept multiple directories to
 exclude...

 Yeah, was looking into this too. It's really pointless to calculate
 /plugins, /themes, /uploads directory sizes twice (when they are in the
 default location). We should be able to make `recurse_dirsize()` accept a
 string (one path) or an array of paths.

 > WordPress uses some constants to define KB, MB, GB, etc. and they're
 based on the 1024 binary value. Worth noting size_format() uses these
 constants. This used to be the industry standard. However, in recent years
 a new IEC-SI standard has been adopted by various operating systems and
 it's based on a value of 1000. As far as I know, Mac OS starting from
 version 10.6 and Ubuntu starting from version 10.10 switched to 1000. I
 think Windows still uses 1024.

 Yep, that's why we have these constants, we can change them to the "new
 standard" whenever it's appropriate. Thinking we need a new ticket for
 that, and do a bit of investigating what units most hosts use.

 BTW the reported size is off not only because of these calculations. Most
 OS report "size on disk" as the used space. That may be quite different
 when there are a lot of small files. Typically the smallest "size on disk"
 is 4kb even when a file is only a few bytes.

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


More information about the wp-trac mailing list