Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#46954 closed defect (bug) (fixed)

Site Health: Hide "Directories and Sizes" for Multisite installations

Reported by: xkon's profile xkon Owned by: desrosj's profile desrosj
Milestone: 5.2 Priority: normal
Severity: normal Version: 5.2
Component: Site Health Keywords: site-health has-patch
Focuses: ui, administration, multisite Cc:

Description (last modified by xkon)

We should hide the Directories & Sizes accordion item under the Info page in a Multisite installation. There is no actual need for most of the folders shown there as they are "shared" and their size isn't useful info for a sub-site administrator.

What might be good instead in a Multisite for this accordion item is to show the Site upload space and the Upload folder size only just to have a view of what space you've already used (we can split this part from this ticket for a future release though).

Attachments (1)

46954.diff (1.0 KB) - added by xkon 5 years ago.

Download all attachments as: .zip

Change History (11)

#1 @xkon
5 years ago

  • Description modified (diff)
  • Focuses multisite added

@xkon
5 years ago

#2 @Clorith
5 years ago

  • Keywords has-patch commit added; needs-patch removed

There might be a more elegant handling of this in the future if we ever flesh out the fetching element here, but for now this is a straight forward and simple approach, primarily because we don't want a multisite user "crashing" on their end from trying to calculate every subsite they're not a part of.

Let's get this in before RC, and good catch!

#3 @mukesh27
5 years ago

@xkon, In wp-admin/includes/class-wp-debug-data.php file system already define multisite variable $is_multisite and it is define at top $is_multisite = is_multisite() of the file so we we replace below condition?

if ( is_multisite() ) {
   unset( $info['wp-paths-sizes'] );
}

Replace to

if ( $is_multisite ) {
   unset( $info['wp-paths-sizes'] );
}

#4 @desrosj
5 years ago

  • Owner set to desrosj
  • Status changed from new to reviewing

#5 follow-ups: @desrosj
5 years ago

  • Keywords reporter-feedback added; commit removed

I don't think we have to rip out all of these fields for multisite. With a few adjustments, I think we can leave most of this group (which is still useful for debugging multisite).

In my testing, I found that only the primary site will calculate the size of the entire uploads directory. Sub sites will calculate the size of only their own upload directory (wp-content/uploads/sites/3).

With that in mind, what if we made the following changes for the current state:

  • Remove "Total installation size", "Database size", and "WordPress Directory Size" for all sites on multisite installs. These possess a high likelihood of being too large and the potential for causing "crashing".
  • Hide the "Uploads Directory Size" on the primary site of a network to avoid calculating the upload directory sizes for every site, and the potential for "crashing".
  • Do not calculate the Theme and Plugin directory sizes for all sites on a multisite install. These could be unwieldy for large multisite installs.
  • Leave all other fields as is.

In the future, I think the following could be added/adjusted for multisite:

  • Current site's allowed quota.
  • Percentage or amount of quota used.
  • Site's maximum allowed file size.
  • A way for network administrators to request the sizes of removed elements above.
  • A way for a network administrator to view "Network Health".

#6 in reply to: ↑ 5 @xkon
5 years ago

  • Keywords reporter-feedback removed

@desrosj if I'm not mistaken the only values left after your removal suggestions are the Location fields.

In my opinion the "WordPress directory location", "Themes directory location", "Plugins directory location" are not let's say "needed" either for a sub-site since they are shared.

The only useful information would be the Upload path and Quota (as you mention as well) that was going to be taken care of on a follow-up ticket/patch as said in the description. And this is a discussion that will take "time" in my opinion as we can calculate the full multisite size as well or add more options even in a future release to serve more Super Admin friendly purposes also.

This was meant as a "fast" patch to avoid issues and unwanted extra information to slip in for the time being and as 90% of them are not used and make it to RC.

I'll be happy to work on a fresh approach if RC time allows it and we can also see if we can get a more rounded up patch that has some actual data in it for this accordion item (instead of a future release). Unfortunately I won't be available today so if anyone can jump in for the suggestions it would be awesome (depending on the time we have). I just wanted to be clear under which conditions and mindset this ticket was created after some short discussions with @azaozz and @Clorith since we where looking at #46707 .

#7 in reply to: ↑ 5 @azaozz
5 years ago

Replying to desrosj:

With that in mind, what if we made the following changes for the current state:

  • Remove "Total installation size", "Database size", and "WordPress Directory Size" for all sites on multisite installs. These possess a high likelihood of being too large and the potential for causing "crashing".
  • Hide the "Uploads Directory Size" on the primary site of a network to avoid calculating the upload directory sizes for every site, and the potential for "crashing".
  • Do not calculate the Theme and Plugin directory sizes for all sites on a multisite install. These could be unwieldy for large multisite installs.
  • Leave all other fields as is.

I tend to agree with @xkon. Not really sure how valuable is to have the "WordPress directory location", "Themes directory location", and "Plugins directory location" in there. They are the same for the whole network and cannot be changed.

In the future, I think the following could be added/adjusted for multisite:

  • Current site's allowed quota.
  • Percentage or amount of quota used.

Yes, sounds good. Even thinking we can try doing something like that now if we have a chance.

  • Site's maximum allowed file size.

Is it possible to set that per-site? As far as I know it is a "global" setting for all sites. In that case not sure if it is "useful info" on per-site basis (can be seen and set on the network admin settings screen), but may be wrong :)

  • A way for network administrators to request the sizes of removed elements above.
  • A way for a network administrator to view "Network Health".

Yes, we'll need to make this "multisite aware" in few other places.

As we are very close to 5.2-RC thinking we should go with the existing patch and disable that whole section on multisite for now, then implement the "Uploads directory location" and "Uploads directory size" in another ticket. (As far as I see that will need some larger changes, including strings changes, etc.).

Last edited 5 years ago by azaozz (previous) (diff)

#8 @azaozz
5 years ago

Opened #46967 as a follow-up.

#9 @azaozz
5 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

Fixed in [45239]:

Site Health info tab: Remove the "Directories and Sizes" section on Multisite installations. Most of the info shown there doesn't apply for multisite.

Props xkon, desrosj, azaozz.

#10 @spacedmonkey
4 years ago

  • Component changed from Administration to Site Health
Note: See TracTickets for help on using tickets.