diff --git a/src/Media_Command.php b/src/Media_Command.php index 8275cb45..90b22e05 100644 --- a/src/Media_Command.php +++ b/src/Media_Command.php @@ -720,7 +720,12 @@ private function needs_regeneration( $att_id, $fullsizepath, $is_pdf, $image_siz // Warn unless PDF or non-standard image. if ( ! $is_pdf && is_array( $metadata ) && ! empty( $metadata['sizes'] ) ) { WP_CLI::warning( sprintf( '%s (ID %d)', $image_sizes->get_error_message(), $att_id ) ); + } elseif ( $is_pdf ) { + WP_CLI::log( sprintf( 'Skipping PDF file (ID %d)', $att_id ) ); + } elseif ( ! is_array( $metadata ) || empty( $metadata ) ) { + WP_CLI::log( sprintf( 'No metadata (ID %d)', $att_id ) ); } + $skip_it = true; return false; }