-
Notifications
You must be signed in to change notification settings - Fork 26
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
Change methods name #785
Change methods name #785
Changes from 1 commit
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 | ||
---|---|---|---|---|
|
@@ -27,8 +27,8 @@ class Imagify_Admin_Ajax_Post extends Imagify_Admin_Ajax_Post_Deprecated { | |||
'imagify_manual_optimize', | ||||
'imagify_manual_reoptimize', | ||||
'imagify_optimize_missing_sizes', | ||||
'imagify_generate_webp_versions', | ||||
'imagify_delete_webp_versions', | ||||
'imagify_generate_nextgen_versions', | ||||
'imagify_delete_nextgen_versions', | ||||
'imagify_restore', | ||||
// Custom folders optimization. | ||||
'imagify_optimize_file', | ||||
|
@@ -202,20 +202,20 @@ protected function optimize_missing_sizes( $media_id, $context ) { | |||
* @param string $context The context. | ||||
* @return bool|WP_Error True if successfully launched. A \WP_Error instance on failure. | ||||
*/ | ||||
protected function generate_webp_versions( $media_id, $context ) { | ||||
protected function generate_nextgen_versions( $media_id, $context ) { | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
return imagify_get_optimization_process( $media_id, $context )->generate_webp_versions(); | ||||
} | ||||
|
||||
/** | ||||
* Delete WebP images for media that are "already_optimize". | ||||
* Delete Next gen images for media that are "already_optimize". | ||||
* | ||||
* @since 1.9.6 | ||||
* | ||||
* @param int $media_id The media ID. | ||||
* @param string $context The context. | ||||
* @return bool|WP_Error True if successfully launched. A \WP_Error instance on failure. | ||||
*/ | ||||
protected function delete_webp_versions( $media_id, $context ) { | ||||
protected function delete_nextgen_versions( $media_id, $context ) { | ||||
$process = imagify_get_optimization_process( $media_id, $context ); | ||||
|
||||
if ( ! $process->is_valid() ) { | ||||
|
@@ -363,21 +363,21 @@ public function imagify_optimize_missing_sizes_callback() { | |||
* | ||||
* @since 1.9 | ||||
*/ | ||||
public function imagify_generate_webp_versions_callback() { | ||||
public function imagify_generate_nextgen_versions_callback() { | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
$context = $this->get_context(); | ||||
$media_id = $this->get_media_id(); | ||||
|
||||
if ( ! $media_id || ! $context ) { | ||||
imagify_die( __( 'Invalid request', 'imagify' ) ); | ||||
} | ||||
|
||||
imagify_check_nonce( 'imagify-generate-webp-versions-' . $media_id . '-' . $context ); | ||||
imagify_check_nonce( 'imagify-generate-nextgen-versions-' . $media_id . '-' . $context ); | ||||
|
||||
if ( ! imagify_get_context( $context )->current_user_can( 'manual-optimize', $media_id ) ) { | ||||
imagify_die(); | ||||
} | ||||
|
||||
$result = $this->generate_webp_versions( $media_id, $context ); | ||||
$result = $this->generate_nextgen_versions( $media_id, $context ); | ||||
|
||||
imagify_maybe_redirect( is_wp_error( $result ) ? $result : false ); | ||||
|
||||
|
@@ -396,21 +396,21 @@ public function imagify_generate_webp_versions_callback() { | |||
* | ||||
* @since 1.9.6 | ||||
*/ | ||||
public function imagify_delete_webp_versions_callback() { | ||||
public function imagify_delete_nextgen_versions_callback() { | ||||
$context = $this->get_context(); | ||||
$media_id = $this->get_media_id(); | ||||
|
||||
if ( ! $media_id || ! $context ) { | ||||
imagify_die( __( 'Invalid request', 'imagify' ) ); | ||||
} | ||||
|
||||
imagify_check_nonce( 'imagify-delete-webp-versions-' . $media_id . '-' . $context ); | ||||
imagify_check_nonce( 'imagify-delete-nextgen-versions-' . $media_id . '-' . $context ); | ||||
|
||||
if ( ! imagify_get_context( $context )->current_user_can( 'manual-restore', $media_id ) ) { | ||||
imagify_die(); | ||||
} | ||||
|
||||
$result = $this->delete_webp_versions( $media_id, $context ); | ||||
$result = $this->delete_nextgen_versions( $media_id, $context ); | ||||
|
||||
imagify_maybe_redirect( is_wp_error( $result ) ? $result : false ); | ||||
|
||||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -700,7 +700,7 @@ public function column_actions( $item ) { | |||
$this->optimize_button( $item ); | ||||
$this->retry_button( $item ); | ||||
$this->reoptimize_buttons( $item ); | ||||
$this->generate_webp_versions_button( $item ); | ||||
$this->generate_nextgen_versions_button( $item ); | ||||
$this->delete_webp_versions_button( $item ); | ||||
$this->restore_button( $item ); | ||||
} | ||||
|
@@ -806,13 +806,13 @@ protected function reoptimize_buttons( $item ) { | |||
} | ||||
|
||||
/** | ||||
* Prints a button to generate WebP versions if they are missing. | ||||
* Prints a button to generate Next gen versions if they are missing. | ||||
* | ||||
* @since 1.7 | ||||
* | ||||
* @param object $item The current item. It must contain at least a $process property. | ||||
*/ | ||||
protected function generate_webp_versions_button( $item ) { | ||||
protected function generate_nextgen_versions_button( $item ) { | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
$button = get_imagify_attachment_generate_webp_versions_link( $item->process ); | ||||
|
||||
if ( $button ) { | ||||
|
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.
imagify-plugin/inc/classes/class-imagify-admin-ajax-post.php
Line 30 in ffcbe66