Make WordPress Core

Opened 8 weeks ago

Last modified 9 days ago

#64445 new enhancement

Expose disk size for each installed plugin

Reported by: maulikmakwana2008's profile maulikmakwana2008 Owned by:
Milestone: 7.0 Priority: normal
Severity: normal Version:
Component: Site Health Keywords: has-patch has-screenshots changes-requested
Focuses: ui Cc:

Description

Currently, WordPress displays metadata such as Version, Author, and Details below each plugin name on the Plugins screen. However, there is no built-in way to view how much disk space an installed plugin consumes.

This enhancement proposes displaying the Plugin Size inline with existing metadata, improving transparency for administrators managing storage, backups, and performance—especially on shared or limited hosting environments.

Current Output
Version 5.6 | By Automattic – Anti-spam Team | View details

Proposed Output
Version 5.6 | Plugin Size 1.42 MB | By Automattic – Anti-spam Team | View details

Why This Belongs in Core

  • No UI clutter (uses existing plugin meta row)
  • Helps identify large plugins quickly
  • No frontend impact
  • No database schema changes
  • Uses existing WordPress hooks
  • Avoids need for third-party plugins

Technical Approach

  • Hook into plugin_row_meta to append plugin size
  • Calculate size from the plugin’s directory
  • Cache size using transients to prevent repeated filesystem scans
  • Clear cache on plugin update or deletion
  • Admin-only execution

Attachments (3)

show-plugin-directory-size.patch (3.3 KB) - added by maulikmakwana2008 8 weeks ago.
directories-and-sizes-tree-structure.patch (6.0 KB) - added by maulikmakwana2008 8 weeks ago.
Updated64445.jpg (134.5 KB) - added by maulikmakwana2008 7 weeks ago.

Download all attachments as: .zip

Change History (19)

#1 @westonruter
8 weeks ago

  • Component changed from Administration to Site Health
  • Keywords needs-patch added; has-patch needs-testing removed
  • Version trunk deleted

I don't think this is appropriate for plugins list table. I would imagine plugin size is rarely if ever an issue when compared with the amount of storage taken up by uploaded images.

So if we do this, I think it would make more sense to add to Site Health info, to break down the current "Plugins directory size" entry into the sizes for individual plugins.

#2 @westonruter
8 weeks ago

  • Focuses performance removed
  • Keywords 2nd-opinion added
  • Summary changed from Add the plugin directory size to the plugin meta row on the Plugins screen (wp-admin/plugins.php) next to the Version information. to Expose disk size for each installed plugin

#3 @maulikmakwana2008
8 weeks ago

  • Keywords needs-testing has-patch added; needs-patch removed
  • Version set to trunk

@westonruter
Patch attached.

This patch extends Site Health → Info → Directories and Sizes to expose
disk usage for each individual installed plugin.

It reuses existing filesystem logic via WP_Filesystem_Direct::dirsize(),
consistent with how core already calculates directory sizes, and adds
a new “Plugins (individual)” entry to the Site Health debug data.

The calculation runs only when viewing Site Health Info and does not
impact normal admin or front-end requests. No UI changes are introduced,
and no new public APIs are added.

Feedback welcome.

#4 @westonruter
8 weeks ago

  • Keywords needs-refresh added; 2nd-opinion removed
  • Milestone changed from Awaiting Review to 7.0
  • Version trunk deleted

The "version" field indicates when the issue was first introduced. It's not something newly in trunk, so this can be left blank.

Please open a pull request with the patch to facilitate review and testing. This is more helpful than attaching a patch file.

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


7 weeks ago
#5

  • Keywords needs-refresh removed

#6 @maulikmakwana2008
7 weeks ago

  • Keywords has-pr added
  • Version set to trunk

@westonruter
you can review added PR request https://github.com/WordPress/wordpress-develop/pull/10671 and attached Updated64445.jpg

#7 @westonruter
7 weeks ago

  • Version trunk deleted

Please leave the version blank, or else it could be set to back when the site info was added.

#8 @maulikmakwana2008
7 weeks ago

@westonruter
Thanks for the clarification. I don’t have permission to update the Version field, but I agree it should be left blank.

#9 @westonruter
7 weeks ago

@maulikmakwana2008 you set it to trunk again in your previous update.

#10 @r1k0
6 weeks ago

Test Report

Description

This report validates whether the indicated patch works as expected.

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

Environment

  • WordPress: 7.0-alpha-61215-src
  • PHP: 8.2.29
  • Server: nginx/1.29.4
  • Database: mysqli (Server: 8.4.7 / Client: mysqlnd 8.2.29)
  • Browser: Firefox 146.0
  • OS: Ubuntu
  • Theme: Twenty Twenty-Five 1.4
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.1

Actual Results

  1. ✅ Issue resolved with patch.

Before:

https://i.ibb.co/8L2GGh4x/before-plugin-sizes.png

After:

https://i.ibb.co/S48605Kb/after-plugin-sizes.png

#11 @ozgursar
5 weeks ago

Test Report

Description

This report validates whether the indicated patch works as expected.

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

Environment

  • WordPress: 7.0-alpha-61215-src
  • PHP: 8.2.29
  • Server: nginx/1.29.4
  • Database: mysqli (Server: 8.4.7 / Client: mysqlnd 8.2.29)
  • Browser: Chrome 143.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.4
  • MU Plugins: None activated
  • Plugins:
    • Performance Lab 4.0.1
    • Test Reports 1.2.1

Actual Results

  1. ✅ Issue resolved with patch.

Screenshots

Before After
https://i.snipboard.io/R5ozCN.jpg https://i.snipboard.io/XdPIAe.jpg

Additional Notes

  • Plugins can create files/folders outside their base folder. For example, they usually store certain files in the /wp-content/uploads/[plugin-name] folder. Therefore, this patch doesn't calculate disk space usage for files created outside the plugin's base directory.
Last edited 5 weeks ago by ozgursar (previous) (diff)

#12 @SirLouen
5 weeks ago

  • Keywords has-screenshots added; needs-testing has-pr removed

#13 @westonruter
5 weeks ago

  • Keywords changes-requested added

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


12 days ago

@vishalkakadiya commented on PR #10878:


9 days ago
#16

Raised a PR which adds Theme Sizes, Plugin Sizes and Upload Directory Content (except media) path sizes:

https://github.com/user-attachments/assets/5d5e0f6d-981e-4f24-ba1d-060cdccc220a

Note: See TracTickets for help on using tickets.