If you’re trying to manually update a WordPress plugin at the Plugins screen:
/wp-admin/update.php?action=upload-plugin
and encounter this error “Incompatible Archive.”
Below you will see how to fix it, from the perspectives of WordPress end users and developers.
Understanding the problem of Incompatible Archive
The Incompatible Archive error in WordPress is a sporadic stumbling block that users encounter, often when uploading a new plugin, or importing a WordPress file from one site to another.
This error message pops up when you attempt to import a site data file, causing a disruption in the functionality of your WordPress site. Understanding the root cause of this error is the first step toward resolving it.
Digging into the root causes
Let’s assume the zip file is not corrupted in any way. There are two reasons for this trouble.
- WordPress PHP’s libzip versions
- The uploaded file exceeded the limitation
1. Discrepancies in PHP’s libzip versions
The root cause of the Incompatible Archive error lies in the compression method used by MacOS for zipping files and how WordPress processes these files during the upload: Check for and verify ZIP archives. This combination results in WordPress mistakenly interpreting them as a threat upon upload.
Confirmed: Recent security upgrades in WordPress 6.4.3 have unintentionally complicated the handling of zip files compressed on MacOS.
Good news: The WordPress core team is working on adjusting the security check and applying the fix in the next version, 6.4.4, as expected.
This issue is linked to past challenges encountered with WordPress and WP-CLI, largely due to discrepancies in PHP’s libzip versions.
Solutions
Here are step-by-step guides on how to fix the Incompatible Archive error in WordPress. Please pick just a method that works for you.
Compress plugin files properly
You will be able to upload the plugin zip file successfully if you compress files using MacOS Terminal.
Step 1: Unzip the plugin.zip
Step 2: Use a command to compress the archive
zip -r plugin.zip plugin/ -x "*.DS_Store"
zip
– command for zipping
plugin.zip
– the destination file that will be created after running the zip command.
plugin
– source folder that you want to be compressed.
-r
– recursively repeat folders and subfolders.
-x “*.DS_Store” – excluding the .DS_Store
files.
Step 3: Upload the new file
Temporarily force to PclZip
You can opt to temporarily add a fallback to PclZip, or force to use PclZip instead of ZipArchive.
To force it, simply download and install force-pclzip-0.1.zip on your WordPress site.
This method allows your clients or other web managers to upload files without having to rezip them.
Alternatively, upload via FTP
Last but not least, you can use an FTP client for MacOS, like FileZilla, to copy and paste the directory files.
2. Incompatible file format
Apart from the plugin compression issue, if you’re trying to import and export site data, you may fail due to the file size exceeding your webhost’s allowance. This can happen when you are on a multisite network, or using multi-language plugins.
By default, your WordPress installation allows 64MB. But in many scenarios, that is not sufficient for your successful PHP requests.
To adjust this limit of your WordPress installation, you can go to the wp-config.php
file and change the WP_MEMORY_LIMIT to a bigger value, like 512M maximum.
define( ‘WP_MEMORY_LIMIT’, ‘512M’ );
In case you’re unable to find such value in your wp-config.php
file, you will need to contact your web host or consult with your developers. You might need to upgrade to a more advanced hosting plan to manipulate it.
How to prevent it from happening
As the MacOS compression method is the hidden culprit, here’s a suggestion to help you as a developer avoid including unnecessary files in your WordPress plugin package.
For instance, instead of using MacOS’s native function, utilize the command line or a dedicated archiver app like Keka.
Remember, the key to avoiding this error in the future lies in understanding the compression methods and their impact on the upload process in WordPress. You may explain so to your WordPress end users or clients.
Wrapping up
In summary, the Incompatible Archive error in WordPress is a temporary issue that arises due to the compression methods used by MacOS. By understanding the root causes and the role of different compression methods, both end users and developers can navigate this error effectively.
We encourage you to apply these solutions and tips to enhance your WordPress experience and ensure successful file uploads. Remember, a smooth WordPress experience is just a few steps away!
[…] If you’re getting an “Incompatible Archive” error or zip-related issue, like PCLZIP_ERR_BAD_FORMAT, then you can follow this guide to fix the archive error. […]