Zip File is corrupt when define( 'WP_DEBUG', true );
If you have your WP_DEBUG setting activated the resulting zip file is corrupted.
How to reproduce
- in your
wp-config.phpfile look for WP_DEBUG setting and set it as true:define( 'WP_DEBUG', true ); - Export a theme using the plugin
- Try to open the exported zip file
Thanks for the observation.
More specifically, unzip command outputs the following error:
End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive.
Interestingly, I just had the case when setting WP_DEBUG to false in wp-config.php only worked partially – most error messages (deprecations from PHP 8.1) were gone, but 4 remained stubbornly, and the zip file export failed (on MacOS).
Commenting out the WP_DEBUG line altogether fixed it.
just run in exactly this issues!
for me it worked with define('WP_DEBUG', false);
Does this error also occur in the latest version? I tested it in the following two environments, but could not reproduce it.
1
- WordPress version: 6.4.2
- Plugin version: Latest (1.13.8)
- PHP version: 8.2.13
- Start local environment with wp-env
- Export Twenty Twenty-Four > I was able to unzip it using standard Windows functions.
2
- WordPress version: 6.4.2
- Plugin version: Latest (1.13.8)
- PHP version: 8.0.29
- Launch the site with InstaWP
- Export Twenty Twenty-Four > I was able to unzip it using standard Windows functions.
not able to reproduce the error using the foloowing; WP 6.5.2 2.0.2 of this plugin;
able to unzip it successfully on ubuntu 20.04, using unzip.
I also am unable to reproduce this. Closing until it happens again.