create-block-theme icon indicating copy to clipboard operation
create-block-theme copied to clipboard

Zip File is corrupt when define( 'WP_DEBUG', true );

Open matiasbenedetto opened this issue 2 years ago • 4 comments

If you have your WP_DEBUG setting activated the resulting zip file is corrupted.

How to reproduce

  1. in your wp-config.php file look for WP_DEBUG setting and set it as true: define( 'WP_DEBUG', true );
  2. Export a theme using the plugin
  3. Try to open the exported zip file

matiasbenedetto avatar Jan 25 '23 07:01 matiasbenedetto

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.

pax avatar Feb 27 '23 12:02 pax

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.

philbraun avatar Mar 06 '23 16:03 philbraun

just run in exactly this issues! for me it worked with define('WP_DEBUG', false);

s-light avatar May 10 '23 09:05 s-light

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.

t-hamano avatar Jan 14 '24 12:01 t-hamano

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.

skorasaurus avatar Apr 11 '24 16:04 skorasaurus

I also am unable to reproduce this. Closing until it happens again.

pbking avatar Apr 15 '24 13:04 pbking