Skip to content

Commit

Permalink
Fix WebP naming (PR #563)
Browse files Browse the repository at this point in the history
* Update 'webp' naming in PHP translation strings
* Update 'webp' naming on documentation
* Update 'webp' naming on readme
  • Loading branch information
pedro-mendonca authored May 4, 2021
1 parent c548bf4 commit 5971929
Show file tree
Hide file tree
Showing 40 changed files with 199 additions and 199 deletions.
6 changes: 3 additions & 3 deletions assets/js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ window.imagify = window.imagify || {};
} )(window, document, jQuery);


// Generate missing webp versions ==================================================================
// Generate missing WebP versions ==================================================================
/* eslint-disable no-underscore-dangle, consistent-this */
(function(w, d, $, undefined) { // eslint-disable-line no-unused-vars, no-shadow, no-shadow-restricted-names

Expand Down Expand Up @@ -519,7 +519,7 @@ window.imagify = window.imagify || {};
this.$progressBar = this.$progressWrap.find( '.bar' );
this.$progressText = this.$progressBar.find( '.percent' );

// Enable/Disable the button when the "Convert to webp" checkbox is checked/unchecked.
// Enable/Disable the button when the "Convert to WebP" checkbox is checked/unchecked.
$( '#imagify_convert_to_webp' )
.on( 'change.imagify init.imagify', { imagifyOptionsBulk: this }, this.toggleButton )
.trigger( 'init.imagify' );
Expand All @@ -539,7 +539,7 @@ window.imagify = window.imagify || {};
// Event callbacks =========================================================================

/**
* Enable/Disable the button when the "Convert to webp" checkbox is checked/unchecked.
* Enable/Disable the button when the "Convert to WebP" checkbox is checked/unchecked.
*
* @param {object} e Event object.
*/
Expand Down
4 changes: 2 additions & 2 deletions classes/Bulk/BulkInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface BulkInterface {
public function get_unoptimized_media_ids( $optimization_level );

/**
* Get ids of all optimized media without webp versions.
* Get ids of all optimized media without WebP versions.
*
* @since 1.9
* @since 1.9.5 The method doesn't return the IDs directly anymore.
Expand All @@ -42,7 +42,7 @@ public function get_unoptimized_media_ids( $optimization_level );
public function get_optimized_media_ids_without_webp();

/**
* Tell if there are optimized media without webp versions.
* Tell if there are optimized media without WebP versions.
*
* @since 1.9
* @access public
Expand Down
6 changes: 3 additions & 3 deletions classes/Bulk/CustomFolders.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function get_unoptimized_media_ids( $optimization_level ) {
}

/**
* Get ids of all optimized media without webp versions.
* Get ids of all optimized media without WebP versions.
*
* @since 1.9
* @since 1.9.5 The method doesn't return the IDs directly anymore.
Expand Down Expand Up @@ -142,7 +142,7 @@ public function get_optimized_media_ids_without_webp() {
$backup_path = \Imagify_Custom_Folders::get_file_backup_path( $file_path );

if ( ! $this->filesystem->exists( $backup_path ) ) {
// No backup, no webp.
// No backup, no WebP.
$data['errors']['no_backup'][] = $file_id;
continue;
}
Expand All @@ -154,7 +154,7 @@ public function get_optimized_media_ids_without_webp() {
}

/**
* Tell if there are optimized media without webp versions.
* Tell if there are optimized media without WebP versions.
*
* @since 1.9
* @access public
Expand Down
4 changes: 2 additions & 2 deletions classes/Bulk/Noop.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function get_unoptimized_media_ids( $optimization_level ) {
}

/**
* Get ids of all optimized media without webp versions.
* Get ids of all optimized media without WebP versions.
*
* @since 1.9
* @since 1.9.5 The method doesn't return the IDs directly anymore.
Expand All @@ -52,7 +52,7 @@ public function get_optimized_media_ids_without_webp() {
}

/**
* Tell if there are optimized media without webp versions.
* Tell if there are optimized media without WebP versions.
*
* @since 1.9
* @access public
Expand Down
6 changes: 3 additions & 3 deletions classes/Bulk/WP.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public function get_unoptimized_media_ids( $optimization_level ) {
}

/**
* Get ids of all optimized media without webp versions.
* Get ids of all optimized media without WebP versions.
*
* @since 1.9
* @since 1.9.5 The method doesn't return the IDs directly anymore.
Expand Down Expand Up @@ -271,7 +271,7 @@ public function get_optimized_media_ids_without_webp() {
$backup_path = get_imagify_attachment_backup_path( $file_path );

if ( ! $this->filesystem->exists( $backup_path ) ) {
// No backup, no webp.
// No backup, no WebP.
$data['errors']['no_backup'][] = $id;
continue;
}
Expand All @@ -283,7 +283,7 @@ public function get_optimized_media_ids_without_webp() {
}

/**
* Tell if there are optimized media without webp versions.
* Tell if there are optimized media without WebP versions.
*
* @since 1.9
* @access public
Expand Down
2 changes: 1 addition & 1 deletion classes/Job/MediaOptimization.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ private function task_optimize( $item ) {
$item['error'] = $data;

} elseif ( 'already_optimized' === $data['status'] ) {
// Status is "already_optimized", try to create webp versions only.
// Status is "already_optimized", try to create WebP versions only.
$item['sizes'] = array_filter( $item['sizes'], [ $this->optimization_process, 'is_size_webp' ] );

} elseif ( 'success' !== $data['status'] ) {
Expand Down
8 changes: 4 additions & 4 deletions classes/Optimization/Data/AbstractData.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,15 @@ public function get_original_size( $human_format = true, $decimals = 2 ) {

/**
* Get the file size of the full size file.
* If the webp size is available, it is used.
* If the WebP size is available, it is used.
*
* @since 1.9
* @access public
* @author Grégory Viguier
*
* @param bool $human_format True to display the image human format size (1Mb).
* @param int $decimals Precision of number of decimal places.
* @param bool $use_webp Use the webp size if available.
* @param bool $use_webp Use the WebP size if available.
* @return string|int
*/
public function get_optimized_size( $human_format = true, $decimals = 2, $use_webp = true ) {
Expand Down Expand Up @@ -320,7 +320,7 @@ public function get_optimized_size( $human_format = true, $decimals = 2, $use_we
$filepath = false;

if ( $use_webp && ! empty( $data['sizes'][ $webp_size_name ]['success'] ) ) {
// Try with the webp file first.
// Try with the WebP file first.
$filepath = $media->get_raw_fullsize_path();
$filepath = $filepath ? imagify_path_to_webp( $filepath ) : false;

Expand All @@ -330,7 +330,7 @@ public function get_optimized_size( $human_format = true, $decimals = 2, $use_we
}

if ( ! $filepath ) {
// No webp? The full size then.
// No WebP? The full size then.
$filepath = $media->get_fullsize_path();
}

Expand Down
2 changes: 1 addition & 1 deletion classes/Optimization/Data/CustomFolders.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function update_size_optimization_data( $size, array $data ) {
}
} else {
/**
* Webp version or any other size.
* WebP version or any other size.
*/
$old_data['data'] = ! empty( $old_data['data'] ) && is_array( $old_data['data'] ) ? $old_data['data'] : [];
$old_data['data']['sizes'] = ! empty( $old_data['data']['sizes'] ) && is_array( $old_data['data']['sizes'] ) ? $old_data['data']['sizes'] : [];
Expand Down
4 changes: 2 additions & 2 deletions classes/Optimization/Data/DataInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,15 @@ public function get_original_size( $human_format = true, $decimals = 2 );

/**
* Get the file size of the full size file.
* If the webp size is available, it is used.
* If the WebP size is available, it is used.
*
* @since 1.9
* @access public
* @author Grégory Viguier
*
* @param bool $human_format True to display the image human format size (1Mb).
* @param int $decimals Precision of number of decimal places.
* @param bool $use_webp Use the webp size if available.
* @param bool $use_webp Use the WebP size if available.
* @return string|int
*/
public function get_optimized_size( $human_format = true, $decimals = 2, $use_webp = true );
Expand Down
4 changes: 2 additions & 2 deletions classes/Optimization/Data/Noop.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,15 @@ public function get_original_size( $human_format = true, $decimals = 2 ) {

/**
* Get the file size of the full size file.
* If the webp size is available, it is used.
* If the WebP size is available, it is used.
*
* @since 1.9
* @access public
* @author Grégory Viguier
*
* @param bool $human_format True to display the image human format size (1Mb).
* @param int $decimals Precision of number of decimal places.
* @param bool $use_webp Use the webp size if available.
* @param bool $use_webp Use the WebP size if available.
* @return string|int
*/
public function get_optimized_size( $human_format = true, $decimals = 2, $use_webp = true ) {
Expand Down
6 changes: 3 additions & 3 deletions classes/Optimization/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ public function backup( $backup_path = null, $backup_source = null ) {
* @type string $backup_path If a backup must be done, this is the path to use. Default is the backup path used for the WP Media Library.
* @type int $optimization_level The optimization level (2=ultra, 1=aggressive, 0=normal).
* @type bool $keep_exif To keep exif data or not.
* @type string $convert Set to 'webp' to convert the image to webp.
* @type string $convert Set to 'webp' to convert the image to WebP.
* @type string $context The context.
* @type int $original_size The file size, sent to the API.
* }
Expand Down Expand Up @@ -768,7 +768,7 @@ public function get_path() {
}

/**
* Replace the file extension by webp.
* Replace the file extension by WebP.
*
* @since 1.9
* @access public
Expand All @@ -789,7 +789,7 @@ public function get_path_to_webp() {
}

/**
* Tell if the file is a webp image.
* Tell if the file is a WebP image.
* Rejects "path/to/.webp" files.
*
* @since 1.9
Expand Down
Loading

0 comments on commit 5971929

Please sign in to comment.