Skip to content

Commit

Permalink
Fixed the issues with imagify message
Browse files Browse the repository at this point in the history
  • Loading branch information
CrochetFeve0251 committed Oct 25, 2023
1 parent 707a2b7 commit 3045ad8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions inc/classes/class-imagify-files-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,10 @@ public function column_optimization( $item ) {
<span class="data"><?php esc_html_e( 'WebP generated:', 'imagify' ); ?></span>
<strong class="data-value"><?php echo esc_html( $has_webp ); ?></strong>
</li>
<li class="imagify-data-item">
<span class="data"><?php esc_html_e( 'WebP generated:', 'imagify' ); ?></span>
<strong class="data-value"><?php echo esc_html( $has_webp ); ?></strong>
</li>
<?php
}
}
Expand Down
13 changes: 13 additions & 0 deletions inc/classes/class-imagify.php
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,19 @@ private function curl_http_call( $url, $args = [] ) {
return new WP_Error( 'curl', 'cURL isn\'t installed on the server.' );
}

/**
* Allows to mock Imagify calls to the API.
*
* @param stdClass|null $response Response from the call.
* @param string $url URL from the call.
* @param array $args Arguments from the call.
*/
$response = apply_filters('pre_imagify_request', null, $url, $args);

if ( $response ) {
return $response;
}

try {
$url = self::API_ENDPOINT . $url;
$ch = curl_init();
Expand Down

0 comments on commit 3045ad8

Please sign in to comment.