Make WordPress Core

Opened 12 months ago

Last modified 45 hours ago

#60549 new enhancement

"Site Upload Quota Space" should indicate network default and possibly site's current usage

Reported by: madtownlems's profile MadtownLems Owned by:
Milestone: 6.8 Priority: normal
Severity: normal Version:
Component: Networks and Sites Keywords: has-patch
Focuses: multisite Cc:

Description

In Multisite, there is a network default site quota which can be overridden on individual sites by visiting /wp-admin/network/site-settings.php?id=BLOG_ID

It says:
Site Upload Space Quota (input box here) MB (Leave blank for network default).

It would be incredibly helpful to have easy access to two other pieces of information here.

1) The network default.

This could be shown as: (Leave blank for network default: 2500 MB)

2) The site's current use.

This could be shown as. (Leave blank for network default: 2500 MB) (Space currently used: 100 MB)

Each of these pieces of information would really help in editing sites to change the storage quota. I'd suggest the network default is more important, and if only one were to be added, that should be it.

Change History (6)

This ticket was mentioned in PR #8303 on WordPress/wordpress-develop by @lenasterg.


3 days ago
#1

  • Keywords has-patch added

This pull request fixes the issues descripted in the ticket Trac ticket: [](https://core.trac.wordpress.org/ticket/60549)
In superadmin 'Edit site' page:

  1. Shows the network default Site upload space
  2. The site's current use.

and also displays space usage information to the sub site administration in the media gallery pages.

This update introduces a new function, get_space_usage(), which enhances the way WordPress reports upload space usage for a site. The function calculates the space used for uploads and provides a detailed or simplified report based on whether the upload space check is enabled or disabled.

When upload space check is disabled: The function returns a simple message showing the space used in megabytes (e.g., "500 MB Space Used").

When upload space check is enabled: The function provides a more detailed report, including the percentage of space used and the total space allowed (e.g., "Used: 500 MB (50%) of 1 GB").

This enhancement improves transparency and usability for site administrators by offering clearer insights into their site's storage usage. The function also uses localization-friendly strings, ensuring compatibility with multilingual setups.

Technical Details:

The function get_space_usage() leverages existing helper functions like get_space_used(), get_space_allowed(), and size_format() to calculate and format the space usage.

The function respects the upload_space_check_disabled site option to determine the level of detail in the output.

This change is backward-compatible and does not affect existing functionality. It is particularly useful for multisite networks where storage management is critical.
The following images show the visual changes to the various pages.

In "Edit site"
https://github.com/user-attachments/assets/4782ed2f-5787-4379-80cd-57f78b0be02e

In 'Dashboard'
Before the suggested changes, when the upload_space_check_disabled site option was enabled, the admin had no information about the storage space.
https://github.com/user-attachments/assets/db033a5c-a9c2-449c-9e9e-ff14ddf612ed
After the suggested changes:
https://github.com/user-attachments/assets/9e53e26d-ce9a-487b-8749-4e79f753d0af
https://github.com/user-attachments/assets/3e8a0303-5818-4d94-9259-cbed68462b61

In 'Media Gallery'
https://github.com/user-attachments/assets/4b9ac166-6141-4caf-9519-60c58ec85965
https://github.com/user-attachments/assets/9af3f306-d15e-43d6-a76c-a8e0901b94bc

In media upload pages
https://github.com/user-attachments/assets/24e82ec6-1b51-4255-8c84-eb6204132d22
https://github.com/user-attachments/assets/c51b5b40-4b18-4201-b9c5-169bdafb2d47
https://github.com/user-attachments/assets/4c80fe11-50a0-4367-af37-a229991f06bf

This ticket was mentioned in Slack in #core-multisite by lenasterg. View the logs.


3 days ago

This ticket was mentioned in Slack in #core by lenasterg. View the logs.


3 days ago

#4 @joemcgill
3 days ago

  • Milestone changed from Awaiting Review to 6.8

Adding to the 6.8 milestone for visibility.

#5 follow-up: @MadtownLems
3 days ago

I like all of these inclusions except the one at the top of the Media Library. Users already complain frequently about too many notices at the top of their admin screens; I don't think we should contribute to that problem. Thank you for putting this together!

#6 in reply to: ↑ 5 @lenasterg
45 hours ago

Replying to MadtownLems:

I like all of these inclusions except the one at the top of the Media Library. Users already complain frequently about too many notices at the top of their admin screens; I don't think we should contribute to that problem. Thank you for putting this together!

Hi.
I understand the concern about notices at the top of the Media Library. However, it’s placed where users expect to find storage-related information, making it easier to manage upload space without having to navigate elsewhere. I believe it provides value by being contextually relevant rather than disruptive.

Note: See TracTickets for help on using tickets.