Black Friday Super Sale 2024 is Coming Soon

WIN AN iPAD, LIFETIME MEMBERSHIP
×
Incompatible Archive Error WordPress Plugin and Theme Upload

Feb 2, 2024 | WordPress

Incompatible Archive Error in WordPress 6.4.3 While Uploading Plugins and Themes

If you’ve encountered the ‘Incompatible Archive Error’ after updating to WordPress 6.4.3, you’re not alone. This issue has puzzled many in the WordPress community, especially those using MacOS to compress their plugin zip archives for upload. But don’t worry, we’ve got you covered with an easy-to-understand guide on why this is happening and how you can fix it.

What’s Causing the Error?

The core of the problem lies in the way MacOS compresses zip files and how WordPress 6.4.3 interprets them upon upload. Recent security enhancements aimed at tightening up the upload process inadvertently introduced challenges for MacOS compressed zip files, leading to the dreaded ‘Incompatible Archive’ error message. Similar issues previously affected WordPress and WP-CLI and the behavior ties back to PHP’s libzip version discrepancies.

A Look at the Error

How to Fix the Issue

Thankfully, the WordPress community is vibrant and quick to respond. Through collective effort, several workarounds have been identified. Here are the steps you can take to navigate this issue:

Recompress Using Windows File Explorer

Suppose you are a customer who made a purchase or downloaded a product file and facing the issue and are also a Windows user. In that case, you can extract the zip file you have downloaded, and compress the main directory/folder again. Here are the steps.

  1. Right-click the main plugin or theme folder.
  2. Select Send to > Compressed (zipped) folder.
  3. Use it to upload.

After re-zipping your file on Windows, you can test the upload process in your WordPress site to ensure the “Incompatible Archive” error does not occur. If the problem persists, it might be unrelated to the zip file’s creation method and could be due to other factors such as file permissions, server configurations, or a specific issue with the WordPress installation.

Use the MacOS Command Line for Compression

Instead of using the MacOS right-click ‘Compress’ option, compress your plugin folder using the terminal. Here’s how:

zip -r my-plugin.zip my-plugin/

This method ensures compatibility with WordPress’s upload process.

Apply a Temporary Plugin Solution

A plugin has been developed by Aaron Jorbin to force WordPress to use PclZip instead of ZipArchive, effectively bypassing the issue. You can install and activate this plugin as a temporary fix.

// Reference code for developers. 
add_filter('unzip_file_use_ziparchive', '__return_false');

Click here to download the PclZip plugin.

Implement a fallback to PclZip if ZipArchive::open() Fails

Here is a code snippet for developers to implement a fallback solution.

// Potential workaround in custom code until official fix is deployed
if (!$zip->open($file_path) === TRUE) {
    use PclZip instead of ZipArchive
}

Looking Ahead

The WordPress community is actively working on a patch to resolve this issue in an upcoming release. By staying engaged with the community through forums and tracking updates, you can stay informed about the latest solutions and ensure your site remains unaffected.

WordPress’s strength lies in its community. Issues like the ‘Incompatible Archive Error’ remind us of the importance of collaboration and shared knowledge in overcoming challenges. With the steps outlined above, you’ll be able to navigate this hiccup and continue leveraging WordPress to its fullest potential.

Posted By:
Shoeb
Hi, I'm Shoeb. I've been fortunate to work with WordPress for over a decade and I'm continuously learning from this journey. Alongside some wonderful people, I help run Elicus in Jaipur. Our aim is to make WordPress tools that are simple and helpful.

10 Comments

  1. Richard

    @JELO thank you for the explanation on suggestion to open Terminal directly from the file within which the archived file is being held. I would never have figured this out, being a novice. 5 Stars to you, sir!

    Reply
  2. Jono Slade

    My issue was the my browser, Safari was decompressing the zip files on download. I went to settings>general and unchecked the “safe” download checkbox. This keeper the zip file and it uploaded to WordPress no problem!

    Reply
  3. Tomek

    Or you could consider simply providing a zip file instead of regular folder or for the rest of the hard that does not work with WinPCs. Another option is to use online zip service if you don’t have access to a Windows PC and simply do that. I used EzyZip – took less than a minute to upload, zip, download and install.

    Reply
  4. Brio

    Recompressing Helped. Thankyou

    Reply
  5. Jelo

    A few more instructions should be added for those not super familiar with Terminal such as myself. It took me awhile to figure it out as I kept getting error messages. The way that eventually worked for me was “right-clicking” on the pathname ‘Downloads’ (where my folder was located) at the bottom of the Finder window and opening Terminal from there rather than opening it from Launchpad. I’ve used Terminal before without having to open it from a specific location so I was unaware that was even a thing. But once I was able to figure that out installing my new theme worked perfectly. Thank you.

    Reply
  6. Janice

    Wow – the plugin worked like magic! What a simple solution! I just uploaded the original zip file of my theme. Thank you SO much for this plugin it just simplifies my life and bypassing the steps of decompressing and compressing folders.

    Reply
  7. Mc Toner

    Unzip the flexile folder, re-compress with forklift on the mac and you should be ok. Forklift is free in the App store.

    Reply
  8. Tran Thai Hoang

    Oh my god! to day my wordpress update to 6.4.3 and cannot upload Theme zip in my Macos, i tried zip -r my-theme.zip my-theme/ and work well! thank you

    Reply
  9. Lance

    THANK YOU!

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

10 Comments

  1. Richard

    @JELO thank you for the explanation on suggestion to open Terminal directly from the file within which the archived file is being held. I would never have figured this out, being a novice. 5 Stars to you, sir!

    Reply
  2. Jono Slade

    My issue was the my browser, Safari was decompressing the zip files on download. I went to settings>general and unchecked the “safe” download checkbox. This keeper the zip file and it uploaded to WordPress no problem!

    Reply
  3. Tomek

    Or you could consider simply providing a zip file instead of regular folder or for the rest of the hard that does not work with WinPCs. Another option is to use online zip service if you don’t have access to a Windows PC and simply do that. I used EzyZip – took less than a minute to upload, zip, download and install.

    Reply
  4. Brio

    Recompressing Helped. Thankyou

    Reply
  5. Jelo

    A few more instructions should be added for those not super familiar with Terminal such as myself. It took me awhile to figure it out as I kept getting error messages. The way that eventually worked for me was “right-clicking” on the pathname ‘Downloads’ (where my folder was located) at the bottom of the Finder window and opening Terminal from there rather than opening it from Launchpad. I’ve used Terminal before without having to open it from a specific location so I was unaware that was even a thing. But once I was able to figure that out installing my new theme worked perfectly. Thank you.

    Reply
  6. Janice

    Wow – the plugin worked like magic! What a simple solution! I just uploaded the original zip file of my theme. Thank you SO much for this plugin it just simplifies my life and bypassing the steps of decompressing and compressing folders.

    Reply
  7. Mc Toner

    Unzip the flexile folder, re-compress with forklift on the mac and you should be ok. Forklift is free in the App store.

    Reply
  8. Tran Thai Hoang

    Oh my god! to day my wordpress update to 6.4.3 and cannot upload Theme zip in my Macos, i tried zip -r my-theme.zip my-theme/ and work well! thank you

    Reply
  9. Lance

    THANK YOU!

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

How to Check Fonts Used on a Website (an Easy Guide)

How to Check Fonts Used on a Website (an Easy Guide)

A website should only use a maximum of three fonts for its content. Therefore, you ought to be careful about your font choice for readability. With a wide variety of fonts, you might get confused about the best to use. Luckily, there are some reliable online tools you...

Black Friday 2024 WordPress Themes and Plugins Deals

Black Friday 2024 WordPress Themes and Plugins Deals

40% sitewide discount. Freebies and much more.40% sitewide discount. Freebies and much more.Up to 73% off.Get 50% off on all new licenses.Enjoy a 50% discount for your first year on any purchase.30% off WordPress plugins and services.Up to 40% off.Up to 40% off.Up to...

Divi Extended Black Friday Sale
Divi WooCommerce Extended