Opened 11 years ago
Closed 11 years ago
#30476 closed enhancement (duplicate)
Plugin installation via URL appends .tmp to the plugin directory in some cases
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 4.0.1 |
| Component: | Upgrade/Install | Keywords: | |
| Focuses: | administration | Cc: |
Description
When the plugin content is in the root of the a zip file and when installing the plugin via remote URL, the extracted plugin will be installed like wp-content/plugins/example.tmp/example.php, because download_url function will download it as /tmp/example.tmp and the installer later won't strip the .tmp like it does with .zip at line 156 of wp-admin/includes/class-wp-upgrader.php.
It's not exactly a bug, but removing the .tmp suffix would improve the installer.
I've attached the code snippet to reproduce the issue (it's enough to run php test.php while in a clean WordPress installation).
Expected behavior:
plugin is installed as wp-content/plugins/example/example.php
Current behavior:
plugin is installed as wp-content/plugins/example.tmp/example.php
Script to run from a WordPress root to reproduce the issue