diff --git a/.changeset/blockset-cleanup-on-failed-extraction.md b/.changeset/blockset-cleanup-on-failed-extraction.md new file mode 100644 index 000000000..f99669046 --- /dev/null +++ b/.changeset/blockset-cleanup-on-failed-extraction.md @@ -0,0 +1,5 @@ +--- +"@faustwp/wordpress-plugin": patch +--- + +fix[faustwp]: clean up uploaded blockset zip when extraction fails diff --git a/plugins/faustwp/includes/blocks/functions.php b/plugins/faustwp/includes/blocks/functions.php index 716e2ff71..8253f4053 100644 --- a/plugins/faustwp/includes/blocks/functions.php +++ b/plugins/faustwp/includes/blocks/functions.php @@ -53,6 +53,7 @@ function process_and_replace_blocks( $wp_filesystem, $file, $dirs ) { $unzip_result = unzip_uploaded_file( $target_file, $dirs['target'] ); if ( is_wp_error( $unzip_result ) ) { + $wp_filesystem->delete( $target_file ); return $unzip_result; }