Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#45020 closed enhancement (duplicate)

Can theme and plugin file uploading utilize the same form that media uploads use?

Reported by: shaneeckert's profile shaneeckert Owned by:
Milestone: Priority: normal
Severity: minor Version: 5.1
Component: Upload Keywords:
Focuses: ui Cc:

Description (last modified by SergeyBiryukov)

The media uploader in wp-admin/upload.php has an Add New button that loads media-new.php (Line 77) which calls the media_upload_form function in media.php (Line 1938). This form runs quite a few checks on the file. For example a file with an .exe extension cannot be uploaded.

This is not the same for uploading Plugins and Themes. Right now you can upload any file through these two sections.

For example In plugin-install.php on line 334 we create a form to upload instead of using the one in media.php line 1938..

There is no check, it just fails when the installer cannot work with the file. As well the file is not cleaned up upon failure. This leaves files in the directory.

For consistency can we please use the same form for uploading a plugin and a theme as we do for media, with adjustments that limit to just ZIP files?




Similar tickets

#44868 #44710

Change History (2)

#1 @SergeyBiryukov
6 years ago

  • Description modified (diff)

#2 @SergeyBiryukov
6 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi @shaneeckert, welcome to WordPress Trac!

Thanks for the ticket, we're already tracking this enhancement in #24579.

Note: See TracTickets for help on using tickets.