From 3e271cf2a11ac06fbcfaaafbf93d54eed6fe5e5d Mon Sep 17 00:00:00 2001 From: Nate Weller Date: Tue, 15 Oct 2024 13:02:36 -0600 Subject: [PATCH] Protect: Add a 30 second timeout argument to the threat history request (#39766) --- .../protect/changelog/add-protect-history-request-timeout | 5 +++++ projects/plugins/protect/src/class-scan-history.php | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 projects/plugins/protect/changelog/add-protect-history-request-timeout diff --git a/projects/plugins/protect/changelog/add-protect-history-request-timeout b/projects/plugins/protect/changelog/add-protect-history-request-timeout new file mode 100644 index 0000000000000..2abd2178ffed4 --- /dev/null +++ b/projects/plugins/protect/changelog/add-protect-history-request-timeout @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Increased threat history request timeout limit from 10 to 30 seconds. + + diff --git a/projects/plugins/protect/src/class-scan-history.php b/projects/plugins/protect/src/class-scan-history.php index 1533402ea9c79..de88b135778cc 100644 --- a/projects/plugins/protect/src/class-scan-history.php +++ b/projects/plugins/protect/src/class-scan-history.php @@ -182,7 +182,10 @@ public static function fetch_from_api() { $response = Client::wpcom_json_api_request_as_blog( $api_url, '2', - array( 'method' => 'GET' ), + array( + 'method' => 'GET', + 'timeout' => 30, + ), null, 'wpcom' );