attachment_id ), $image->attachment_id ); } else { ewwwio_debug_message( 'async optimize complete, running wp_update_attachment_metadata()' ); wp_update_attachment_metadata( $id, $meta ); } return false; } /** * Runs failure routine for an item from the Media Library queue. * * @access protected * * @param array $item The id of the attachment, how many attempts have been made to process * the item and whether it is a new upload. */ protected function failure( $item ) { if ( empty( $item['id'] ) ) { return; } $file_path = false; $meta = wp_get_attachment_metadata( $item['id'] ); if ( ! empty( $meta ) ) { list( $file_path, $upload_path ) = ewww_image_optimizer_attachment_path( $meta, $item['id'] ); } if ( $file_path ) { ewww_image_optimizer_add_file_exclusion( $file_path ); } } }