Make WordPress Core

Opened 23 months ago

Last modified 21 months ago

#46967 new defect (bug)

Site health, info tab: show the current uploads directory info on network installs

Reported by: azaozz Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 5.2
Component: Site Health Keywords: site-health 2nd-opinion dev-feedback has-patch has-screenshots
Focuses: Cc:


Follow-up from #46954.

Most of the information shown in the "Directories and Sizes" section doesn't apply for sites on a network install. Useful debug info would be to show the current site's upload directory path, size, and percentage of used space. Other info that may be useful there is the max file size allowed, as set in the network settings.

Attachments (4)

46967.diff (8.1 KB) - added by xkon 23 months ago.
46967diff_multisite_main-site.jpg (120.4 KB) - added by xkon 23 months ago.
46967diff_multisite_sub-site.jpg (44.4 KB) - added by xkon 23 months ago.
46967diff_single_site.jpg (119.8 KB) - added by xkon 23 months ago.

Download all attachments as: .zip

Change History (10)

#1 @azaozz
23 months ago

Ideally we should add this to 5.2 if possible to do it and test it before 5.2-RC :)

#2 @azaozz
23 months ago

  • Summary changed from Site health, info tab: show the current uploads directory info to Site health, info tab: show the current uploads directory info on network installs

23 months ago

#3 @xkon
23 months ago

  • Keywords 2nd-opinion dev-feedback has-patch added

46967.diff was the "follow up" patch that I was working when #46954 was opened so I've reworked on it a bit since the commits were made so it can apply cleanly again for some testing.

This had a little "different" view on what to show with 1 extra step for the Main Site of a Multisite. I think that maybe we can leave the data there as is since usually the main site is handled by a Super Admin in most cases ( if not I'll be happy to update this ).

What this patch does:
On single installations everything remains the same as seen at 46967diff_single_site.jpg .

On Multisites there are 2 "views":
Main site 46967diff_multisite_main-site.jpg
It adds the Max upload file size, Site upload space as set in the network options.

Sub sites 46967diff_multisite_sub-site.jpg
It only shows the Uploads directory & it's size, the Max upload file size from the network settings and the Site upload space either from network settings or the specific value from the site settings in case it's overwritten.


Notes and thoughts:

Maybe calculating the "total" uploads directory size is too much in most cases in Multisites, this was just a way of having a full set of info for Super Admins as well, but it can be modified the same as subsites.

I didn't convert the Site upload space and Max upload file size with size_format() so they can show their actual values as set ( MB & KB respectively ).

#4 @xkon
23 months ago

  • Keywords has-screenshots added

#5 @azaozz
23 months ago

46967.diff looks good. One thing I'm a bit concerned about is calculating the sizes on multisite's main site. Both the DB and the uploads dir are typically much larger there, and on "big installs" (with DB replication, load balancers, etc.) these calculations can be pretty bad/harmful :)

To remedy that thinking we can do two things:

  • Put the "calculate size" as a separate button when on the main site of a network.
  • Add a filter so the calculations can be disabled from a plugin.

Actually having a filter may be good for single installs too. There are some installs with many users, they may want to manage this directly.

For the main site calculations we also need to account for old multisite installs that may still be using /wp-content/blogs.dir/ for the uploads.

#6 @desrosj
21 months ago

  • Component changed from Administration to Site Health

Moving Site Health tickets into their lovely new home, the Site Health component.

Note: See TracTickets for help on using tickets.