[wp-trac] [WordPress Trac] #58945: Issues with downloading and unpacking plugins with PHP 8.2

WordPress Trac noreply at wordpress.org
Mon Jul 31 10:56:25 UTC 2023


#58945: Issues with downloading and unpacking plugins with PHP 8.2
-----------------------------+-----------------------------
 Reporter:  pablo07          |      Owner:  (none)
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Upgrade/Install  |    Version:  6.2.2
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 Hello,

 I've encountered an issue when trying to download and install plugins or
 update WordPress on PHP 8.2, both from the admin dashboard and using WP-
 CLI. This issue does not occur on PHP 8.1.

 When attempting to install or update a plugin, the ZIP file is downloaded
 correctly, but when it comes to unzipping and installing, the process ends
 with an error of "Could not copy file.". The same issue occurs during a
 WordPress update.

 I conducted a series of tests trying to pinpoint the issue. I carried out
 tests with both native PHP functions (curl, copy) and WordPress functions
 (download_url, unzip_file) that are typically used for downloading and
 installing plugins and updates.

 Moreover, I noticed that the issue also arises when trying to update to a
 previous version via WP-CLI. In this case, after the ZIP file is
 downloaded, unzipped, and attempted to install, an error of "Warning:
 Could not copy file." is produced.

 Here seems to be a WP-CLI cache clearing issue as empty zip files remain


 Given the above, I suspect that the problem might be due to some
 incompatibility between PHP 8.2 and the WordPress functions used for
 downloading and installing plugins and updates.

 Could someone take a look at this issue? Any help would be greatly
 appreciated.




 {{{
 :~/public_html$ wp plugin update classic-editor
 Downloading update from https://downloads.wordpress.org/plugin/classic-
 editor.1.6.3.zip...
 Unpacking the update...
 Installing the latest version...
 Removing the old version of the plugin...
 Plugin updated successfully.
 +----------------+-------------+-------------+---------+
 | name           | old_version | new_version | status  |
 +----------------+-------------+-------------+---------+
 | classic-editor | 1.6.1       | 1.6.3       | Updated |
 +----------------+-------------+-------------+---------+
 Success: Updated 1 of 1 plugins.

 :~/public_html$ wp plugin update classic-editor --version=1.6.1
 Installing Classic Editor (1.6.1)
 Downloading installation package from
 https://downloads.wordpress.org/plugin/classic-editor.1.6.1.zip...
 Unpacking the package...
 Installing the plugin...
 Removing the old version of the plugin...
 Plugin updated successfully.
 Success: Installed 1 of 1 plugins.

 :~/public_html$ wp plugin update classic-editor
 Downloading update from https://downloads.wordpress.org/plugin/classic-
 editor.1.6.3.zip...
 Using cached file '/home/***/.wp-cli/cache/plugin/classic-
 editor-1.6.3.zip'...
 Error: Error copying cached file /home/***/.wp-cli/cache/plugin/classic-
 editor-1.6.3.zip to https://downloads.wordpress.org/plugin/classic-
 editor.1.6.3.zip


 :~/.wp-cli/cache/plugin$ ls -l
 total 0
 -rw-r--r-- 1 *** *** 0 Jul 31 10:40 classic-editor-1.6.1.zip
 -rw-r--r-- 1 *** *** 0 Jul 31 10:40 classic-editor-1.6.3.zip

 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58945>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list