Digital Sovereignty for everyone

Notes

How sizes are measured

  • An attachment’s size comes from the filesize values WordPress records in attachment metadata (WordPress 6.0 and later), falling back to the file on disk. Variants sharing one file are counted once, and the pre-scaling original WordPress keeps for large uploads (original_image) counts as a variant.
  • Directory sizes are apparent sizes in bytes (du -b, or the PHP file sizes), so they agree with attachment sizes. A host’s quota usually counts disk blocks and reads a little higher.
  • On multisite the main site’s uploads directory also holds every other site’s under sites/, so the main site’s figure has that subtracted.
  • Uploads on disk includes files that are not in the media library, so it can be well above the media library figure. A big gap is worth an install scan of uploads.

The shell driver

When shell_exec is enabled and du is on the path, directories are measured with GNU du and large files found with find. Each command is fixed in the code; its only variable part is a path that has been resolved with realpath(), confirmed to be inside the WordPress install and passed through escapeshellarg(). Commands run under timeout when it exists, and a missing final total marks the result incomplete. The network features that use it are limited to super admins. When the shell is unavailable, or lh_disk_usage_use_shell returns false, a PHP walk does the same job within the time budget and reports anything it could not finish as incomplete. Plugin Check reports shell_exec; that is expected.

Moving from Media Library File Size

LH Disk Usage measures everything itself and does not read Media Library File Size’s data. That plugin stores SS88MLFS and SS88MLFSV post meta and its uninstall routine only removes them from one site, so on multisite use the leftovers action on the network screen once it has been removed.

If you like this plugin please consider making a donation to further development

Install LHero.org

lhero.org

Open it straight from your home screen, full screen and quicker to load.

  1. Tap the Share button . If you cannot see it, tap ••• first.
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add.
  1. Tap the browser menu â‹®.
  2. Tap Install app or Add to Home screen.
  1. In the menu bar, choose File, then Add to Dock.

Use your browser's menu to install this site or add it to your home screen.