Skip to content

Commit

Permalink
Fixes #7133 Correctly load translations in some cases + remaining doi…
Browse files Browse the repository at this point in the history
…ng_it_wrong warning (#7134)
  • Loading branch information
remyperona authored Nov 25, 2024
1 parent 90ca318 commit 59e6a0e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private function send_request( $method, $params = [], $safe = false ) {

$transient_key = $this->get_transient_key();
if ( get_transient( $transient_key . '_timeout_active' ) ) {
return new WP_Error( 429, __( 'Too many requests.', 'rocket' ) );
return new WP_Error( 429, 'Too many requests.' );
}
// Get previous_expiration early to avoid multiple parallel requests increasing the expiration multiple times.
$previous_expiration = (int) get_transient( $transient_key . '_timeout' );
Expand All @@ -82,7 +82,7 @@ private function send_request( $method, $params = [], $safe = false ) {
$body = wp_remote_retrieve_body( $response );
if ( empty( $body ) || ( ! empty( $response['response']['code'] ) && 200 !== $response['response']['code'] ) ) {
$this->set_timeout_transients( $previous_expiration );
return new WP_Error( 500, __( 'Not valid response.', 'rocket' ) );
return new WP_Error( 500, 'Not valid response.' );
}

$this->delete_timeout_transients();
Expand Down Expand Up @@ -148,6 +148,6 @@ private function send_remote_request( $api_url, $method, $params, $safe ) {
return wp_safe_remote_post( $api_url, $params );
}

return new WP_Error( 400, __( 'Not valid request type.', 'rocket' ) );
return new WP_Error( 400, 'Not valid request type.' );
}
}
2 changes: 1 addition & 1 deletion wp-rocket.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Licence: GPLv2 or later
*
* Text Domain: rocket
* Domain Path: languages
* Domain Path: /languages
*
* Copyright 2013-2024 WP Rocket
*/
Expand Down

0 comments on commit 59e6a0e

Please sign in to comment.