-
Notifications
You must be signed in to change notification settings - Fork 39
Add skip verbosity for PDF and empty metadata #201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 ) ); | ||
|
Comment on lines
+724
to
+726
|
||
| } | ||
|
|
||
| $skip_it = true; | ||
| return false; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These new log lines are emitted specifically in the
image_no_editorWP_Error branch, but the messages don’t mention the actual reason ($image_sizes->get_error_message()/ no editor available). In particular, “Skipping PDF file” implies all PDFs are skipped, and “No metadata” isn’t the cause of skipping here. Consider logging an info-level message that includes the underlyingimage_no_editorreason (and optionally the file type/metadata state) so the output accurately explains why regeneration was skipped.