Skip to content

Commit

Permalink
Merge branch 'develop' into enhancement/7136-discourage-use-of-update…
Browse files Browse the repository at this point in the history
…-option
  • Loading branch information
Miraeld committed Nov 25, 2024
2 parents 38a6a6e + df52190 commit e911bdc
Show file tree
Hide file tree
Showing 7 changed files with 1,520 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dynamic-lists-delayjs.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dynamic-lists.json

Large diffs are not rendered by default.

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.' );
}
}
Loading

0 comments on commit e911bdc

Please sign in to comment.