Make WordPress Core

#66771 new enhancement

Show a summary of changed files when replacing a plugin or theme from an uploaded zip

Reported by: cccode Owned by:
Priority: normal Milestone: Awaiting Review
Component: Upgrade/Install Version: trunk
Severity: minor Keywords:
Cc: Focuses: ui

Description

Problem

Since 5.5, uploading a zip for an already-installed plugin or theme shows a comparison table (name, version, author, required WP/PHP) and a "Replace current with uploaded" button.

The table compares headers only. It says nothing about what the package will actually change on disk. Two zips with the same version number look identical, and a user has no way to see that files are being added or removed before overwriting.

Proposal

Below the existing table, add a collapsed summary:

  • Counts of files added, removed, and changed
  • An expandable list of those file paths

No line-level diff. That stays plugin territory, and the existing install_plugin_overwrite_comparison filter already covers it.

The same change would apply to the theme screen.

Why core

  • The uploaded package is already unpacked when this screen renders, so the comparison is a file-hash walk of two directories.
  • Replacing code blind is a security and support risk, most of all for zips from outside the directory.
  • It is small: one collapsed section, no new screen, no new settings.

Prior art

I maintain Patchmark (​https://wordpress.org/plugins/patchmark/),
which implements a fuller version of this through the existing filter. I am happy to write the patch.

Open questions

  • Very large packages: cap the list, or the comparison time?
  • Should unchanged files be counted too?

Attachments (2)

mockup-collapsed.png​ (185.6 KB ) - added by cccode 63 minutes ago.
Collapsed mockup
mockup-expanded.png​ (322.8 KB ) - added by cccode 63 minutes ago.
Expanded mockup

Download all attachments as: .zip

Change History (2)

Note: See TracTickets for help on using tickets.