Make WordPress Core

Opened 16 months ago

Last modified 2 weeks 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.9 Priority: normal
Severity: normal Version:
Component: Networks and Sites Keywords: has-test-info needs-design-feedback
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 (18)

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


4 months 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.


4 months ago

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


4 months ago

#4 @joemcgill
4 months ago

  • Milestone changed from Awaiting Review to 6.8

Adding to the 6.8 milestone for visibility.

#5 follow-up: @MadtownLems
4 months 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
4 months 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.

@audrasjb commented on PR #8303:


4 months ago
#7

I added some commits to fix a handful of WPCS issues.

@audrasjb commented on PR #8303:


4 months ago
#8

Phew, all the coding standard issues are now fixed 😅

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


4 months ago

#10 @audrasjb
4 months ago

  • Keywords needs-testing added
  • Milestone changed from 6.8 to 6.9

As per today's bug scrub: It appears this ticket is still needs user testing. As 6.8 beta 1 is very close, I'm moving it to 6.9. Feel free to move it back to 6.8 if it can be committed by Monday.

#11 follow-up: @MadtownLems
4 months ago

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.

My suggestion is to only display it here when the quota is approaching full. There's little value in mentioning the space quota if they're using, say, 5% of it. I would definitely argue that's it's disruptive, rather than helpful, in that case. Perhaps if it was only displayed when it's becoming a concern; something like when 90% or more of the site's storage space is used.

#12 in reply to: ↑ 11 @lenasterg
4 months ago

Hi.

If I understand correctly, your only concern is that it appears as a notice in the Media Gallery.
This is easy to change in the proposed patch.

Would you agree if I remove the following from the proposed patch?

add_action( 'load-upload.php', 'upload_page_notice_display_space_usage_notice' );

https://github.com/WordPress/wordpress-develop/blob/140d05bdce4ee58aeffabe3ef41d11041bfed248/src/wp-admin/includes/ms-admin-filters.php#L13

Along with the related functions:

  • upload_page_notice_display_space_usage_notice()
  • display_space_usage_notice()

https://github.com/WordPress/wordpress-develop/blob/140d05bdce4ee58aeffabe3ef41d11041bfed248/src/wp-admin/includes/ms.php#L281

What do you think, about it?

Replying to MadtownLems:

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.

My suggestion is to only display it here when the quota is approaching full. There's little value in mentioning the space quota if they're using, say, 5% of it. I would definitely argue that's it's disruptive, rather than helpful, in that case. Perhaps if it was only displayed when it's becoming a concern; something like when 90% or more of the site's storage space is used.

#13 follow-up: @SirLouen
2 months ago

  • Keywords has-testing-info changes-requested added; has-patch needs-testing removed

Patch Test Report

Description

❌ This report can't fully validate that the indicated patch works as expected.

Patch tested: https://github.com/WordPress/wordpress-develop/pull/8303.diff

Environment

  • WordPress: 6.9-alpha-60093-src
  • PHP: 8.2.28
  • Server: nginx/1.27.5
  • Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.2.28)
  • Browser: Chrome 135.0.0.0
  • OS: Windows 10/11
  • Theme: Twenty Fifteen 4.0
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Patch Testing Reproduction Steps

  1. Here are the places where the content should be seen:
  • /wp-admin/network/site-settings.php?id=<blog_id>
  • /wp-admin/ ⇒ Individual Site Dashboard > At a Glance Widget
  • /wp-admin/upload.php ⇒ As a Notice
  • /wp-admin/upload.php ⇒ Inside Media > Add Media File button
  • /wp-admin/media-new.php
  1. Check Network Settings > Site upload space

Expected Results

  • Used Space, and, remaining space should be displayed in all 5 areas

Actual Results

  • ✅ The text can be seen in all these 5 areas
  • ✅ If the Site Site upload space is checked and filled, it displays the right information in all areas
  • ❌ If the Site Site upload space is checked but not filled there is an issue, check notes

Additional Notes

  1. The only error I've found is that when Site upload space is not filled, it doesn't display default 100 MB in this section:

https://i.imgur.com/S2u44uK.png

  1. Regarding this suggestion I have provided some ideas within the PR 8303

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


7 weeks ago

#15 @wordpressdotorg
6 weeks ago

  • Keywords has-test-info added; has-testing-info removed

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


3 weeks ago

#17 in reply to: ↑ 13 @ideag
3 weeks ago

  • ❌ If the Site Site upload space is checked but not filled there is an issue, check notes

This was fixed with the latest commit - it now respects and shows the default value for the option

#18 @SirLouen
2 weeks ago

  • Keywords needs-design-feedback added; changes-requested removed

Design Feedback Needed

@ideag now everything is working, but I believe, as many others have stated, that the notice is too much in wp-admin/upload.php

Personally, I would opt to remove it or, at best, just add that notice when it drops under certain fixed % (say for example 10%), configurable via filter hook.

Note: See TracTickets for help on using tickets.