[wp-trac] [WordPress Trac] #59842: WordPress 6.4 wp_remote_get (cURL error 28: Operation timed out)

WordPress Trac noreply at wordpress.org
Wed Nov 8 18:29:59 UTC 2023


#59842: WordPress 6.4 wp_remote_get (cURL error 28: Operation timed out)
--------------------------+------------------------------
 Reporter:  cenkdemir     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  6.4
 Severity:  critical      |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------

Comment (by cenkdemir):

 ***BACKUP FIRST***

 If you need to bulk update Curl.php for multiple WordPress instances:

 fix_wp_curl.sh:

 {{{
 #!/bin/bash

 # Define the pattern to search for and the replacement string
 search_for="if (\$this->version < self::CURL_7_22_0 &&
 !isset(\$headers\['Connection'\])) {"
 replace_with="if (!isset(\$headers['Connection'])) {"

 # Define the path to the Curl.php files relative to the WordPress
 installations
 relative_path="wp-includes/Requests/src/Transport/Curl.php"

 # Find all Curl.php files under the specified directory
 # Usually, WordPress installations are under /var/www/vhosts/ in Plesk
 find /var/www/vhosts/ -type f -name "Curl.php" | while read file; do
     # Check if the file contains the string we want to replace
     if grep -q "$search_for" "$file"; then
         # Take a backup of the original file
         cp "$file" "$file.bak"

         # Replace the string
         sed -i "s/$search_for/$replace_with/" "$file"

         # Output the file path that was changed
         echo "Modified: $file"
     else
         # Output the file path that was not changed because the pattern
 was not found
         echo "Pattern not found, not modified: $file"
     fi
 done

 # Script complete message
 echo "All matching instances have been updated."
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59842#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list