diff --git a/classes/Optimization/Process/AbstractProcess.php b/classes/Optimization/Process/AbstractProcess.php index bec0948df..4c6148f6d 100644 --- a/classes/Optimization/Process/AbstractProcess.php +++ b/classes/Optimization/Process/AbstractProcess.php @@ -259,7 +259,7 @@ public function optimize( $optimization_level = null, $args = [] ) { if ( $data->is_already_optimized() && $this->has_webp() ) { // If already optimized but has WebP, delete WebP versions and optimization data. $data->delete_optimization_data(); - $deleted = $this->delete_webp_files(); + $deleted = $this->delete_nextgen_files(); if ( is_wp_error( $deleted ) ) { return new WP_Error( 'webp_not_deleted', __( 'Previous WebP files could not be deleted.', 'imagify' ) ); @@ -935,7 +935,7 @@ protected function restore_thumbnails() { * In that case we must also delete the WebP file associated to the full size. */ $keep_full_webp = $media->get_raw_original_path() === $media->get_raw_fullsize_path(); - $this->delete_webp_files( $keep_full_webp ); + $this->delete_nextgen_files( $keep_full_webp ); // Generate new thumbnails. return $media->generate_thumbnails(); @@ -1321,7 +1321,7 @@ protected function can_backup( $size ) { * * @return bool|WP_Error True if successfully launched. A \WP_Error instance on failure. */ - public function generate_webp_versions() { + public function generate_nextgen_versions() { if ( ! $this->is_valid() ) { return new WP_Error( 'invalid_media', __( 'This media is not valid.', 'imagify' ) ); } @@ -1349,7 +1349,7 @@ public function generate_webp_versions() { $files = $media->get_media_files(); $sizes = []; $args = [ - 'hook_suffix' => 'generate_webp_versions', + 'hook_suffix' => 'generate_nextgen_versions', ]; foreach ( $files as $size_name => $file ) { @@ -1378,7 +1378,7 @@ public function generate_webp_versions() { * @param bool $keep_full Set to true to keep the full size. * @return bool|WP_Error True on success. A \WP_Error object on failure. */ - public function delete_webp_files( $keep_full = false ) { + public function delete_nextgen_files( $keep_full = false ) { if ( ! $this->is_valid() ) { return new WP_Error( 'invalid_media', __( 'This media is not valid.', 'imagify' ) ); } diff --git a/classes/Optimization/Process/Noop.php b/classes/Optimization/Process/Noop.php index 06a18aab8..bc168bd66 100644 --- a/classes/Optimization/Process/Noop.php +++ b/classes/Optimization/Process/Noop.php @@ -287,7 +287,7 @@ public function maybe_resize( $size, $file ) { /** ----------------------------------------------------------------------------------------- */ /** - * Generate WebP images if they are missing. + * Generate Nextgen images if they are missing. * * @since 1.9 * @access public @@ -295,7 +295,7 @@ public function maybe_resize( $size, $file ) { * * @return bool|WP_Error True if successfully launched. A \WP_Error instance on failure. */ - public function generate_webp_versions() { + public function generate_nextgen_versions() { return new \WP_Error( 'invalid_media', __( 'This media is not valid.', 'imagify' ) ); } @@ -306,7 +306,7 @@ public function generate_webp_versions() { * @access public * @author Grégory Viguier */ - public function delete_webp_files() {} + public function delete_nextgen_files() {} /** * Tell if a thumbnail size is an "Imagify WebP" size. diff --git a/classes/Optimization/Process/ProcessInterface.php b/classes/Optimization/Process/ProcessInterface.php index fa525647f..66bd00ca3 100644 --- a/classes/Optimization/Process/ProcessInterface.php +++ b/classes/Optimization/Process/ProcessInterface.php @@ -246,7 +246,7 @@ public function maybe_resize( $size, $file ); * * @return bool|WP_Error True if successfully launched. A \WP_Error instance on failure. */ - public function generate_webp_versions(); + public function generate_nextgen_versions(); /** * Delete the WebP images. @@ -260,7 +260,7 @@ public function generate_webp_versions(); * @param bool $keep_full Set to true to keep the full size. * @return bool|\WP_Error True on success. A \WP_Error object on failure. */ - public function delete_webp_files( $keep_full = false ); + public function delete_nextgen_files( $keep_full = false ); /** * Tell if a thumbnail size is an "Imagify WebP" size. diff --git a/inc/3rd-party/nextgen-gallery/inc/common/attachments.php b/inc/3rd-party/nextgen-gallery/inc/common/attachments.php index 183812061..05e452140 100644 --- a/inc/3rd-party/nextgen-gallery/inc/common/attachments.php +++ b/inc/3rd-party/nextgen-gallery/inc/common/attachments.php @@ -284,7 +284,7 @@ function imagify_ngg_cleanup_after_media_deletion( $image_id, $image ) { * The backup file has already been deleted by NGG. * Delete the WebP versions and the optimization data. */ - $process->delete_webp_files(); + $process->delete_nextgen_files(); $process->get_data()->delete_optimization_data(); } diff --git a/inc/classes/class-imagify-admin-ajax-post.php b/inc/classes/class-imagify-admin-ajax-post.php index b288d39f0..c799457bd 100755 --- a/inc/classes/class-imagify-admin-ajax-post.php +++ b/inc/classes/class-imagify-admin-ajax-post.php @@ -203,7 +203,7 @@ protected function optimize_missing_sizes( $media_id, $context ) { * @return bool|WP_Error True if successfully launched. A \WP_Error instance on failure. */ protected function generate_nextgen_versions( $media_id, $context ) { - return imagify_get_optimization_process( $media_id, $context )->generate_webp_versions(); + return imagify_get_optimization_process( $media_id, $context )->generate_nextgen_versions(); } /** @@ -233,7 +233,7 @@ protected function delete_nextgen_versions( $media_id, $context ) { } $data->delete_optimization_data(); - $deleted = $process->delete_webp_files(); + $deleted = $process->delete_nextgen_files(); if ( is_wp_error( $deleted ) ) { return new WP_Error( 'webp_not_deleted', __( 'Previous WebP files could not be deleted.', 'imagify' ) ); diff --git a/inc/common/attachments.php b/inc/common/attachments.php index b58f070e7..982790658 100755 --- a/inc/common/attachments.php +++ b/inc/common/attachments.php @@ -36,9 +36,9 @@ function imagify_cleanup_after_media_deletion( $process ) { /** * The optimization data will be automatically deleted by WP (post metas). - * Delete the WebP versions and the backup file. + * Delete the Nextgen versions and the backup file. */ - $process->delete_webp_files(); + $process->delete_nextgen_files(); $process->delete_backup(); }