Hi Ben,
Thanks for testing it out. I did some further testing to determine what might be going on.
Since you could not reproduce it, I had the idea that it might be OS related.
So i did some testing and it turns out that on 3 of out 3 computers with LocalWP running on Windows 10 had this problem. One of them is clean Windows 10 VM, offered by Microsoft, found here:
https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/
So that should be faily easy to reproduce using that image.
I also tried using a clean new Ubuntu 20.04, on which everything worked as it should.
I could not try it on Mac, since i do not own one. But Mac is pretty much Linux-like
So it would seem to be a issue only on Windows.
I have only tested on Win10 machines, so i do not know about other Windows versions.
I tested with latest LocalWP version, v. 6.1.2
I tested with both my first test script and yours.
Same result, one half succed and other half fails, alternating, like this:
C:\Users\User\Local Sites\wpsynchro\app\public\wp-content\plugins\wpsynchro-rest-test.php:25: object(WP_Error)[879] public ‘errors’ => array (size=1) ‘http_request_failed’ => array (size=1) 0 => string ‘cURL error 28: Operation timed out after 5000 milliseconds with 0 bytes received’ (length=80) public ‘error_data’ => array (size=0) empty protected ‘additional_data’ => array (size=0) empty
- Result 2 failed with Error:\n
- Result 3 was successful.
C:\Users\User\Local Sites\wpsynchro\app\public\wp-content\plugins\wpsynchro-rest-test.php:25: object(WP_Error)[882] public ‘errors’ => array (size=1) ‘http_request_failed’ => array (size=1) 0 => string ‘cURL error 28: Operation timed out after 5011 milliseconds with 0 bytes received’ (length=80) public ‘error_data’ => array (size=0) empty protected ‘additional_data’ => array (size=0) empty
- Result 4 failed with Error:\n
- Result 5 was successful.
C:\Users\User\Local Sites\wpsynchro\app\public\wp-content\plugins\wpsynchro-rest-test.php:25: object(WP_Error)[885] public ‘errors’ => array (size=1) ‘http_request_failed’ => array (size=1) 0 => string ‘cURL error 28: Operation timed out after 5011 milliseconds with 0 bytes received’ (length=80) public ‘error_data’ => array (size=0) empty protected ‘additional_data’ => array (size=0) empty
- Result 6 failed with Error:\n
C:\Users\User\Local Sites\wpsynchro\app\public\wp-content\plugins\wpsynchro-rest-test.php:25: object(WP_Error)[872] public ‘errors’ => array (size=1) ‘http_request_failed’ => array (size=1) 0 => string ‘cURL error 28: Operation timed out after 5000 milliseconds with 0 bytes received’ (length=80) public ‘error_data’ => array (size=0) empty protected ‘additional_data’ => array (size=0) empty
- Result 7 failed with Error:\n
- Result 8 was successful.
C:\Users\User\Local Sites\wpsynchro\app\public\wp-content\plugins\wpsynchro-rest-test.php:25: object(WP_Error)[891] public ‘errors’ => array (size=1) ‘http_request_failed’ => array (size=1) 0 => string ‘cURL error 28: Operation timed out after 5013 milliseconds with 0 bytes received’ (length=80) public ‘error_data’ => array (size=0) empty protected ‘additional_data’ => array (size=0) empty
- Result 9 failed with Error:\n
- Result 10 was successful.
C:\Users\User\Local Sites\wpsynchro\app\public\wp-content\plugins\wpsynchro-rest-test.php:25: object(WP_Error)[894] public ‘errors’ => array (size=1) ‘http_request_failed’ => array (size=1) 0 => string ‘cURL error 28: Operation timed out after 5006 milliseconds with 0 bytes received’ (length=80) public ‘error_data’ => array (size=0) empty protected ‘additional_data’ => array (size=0) empty
- Result 11 failed with Error:\n
** Removed rest of result, as it proves the point.
Hope you have time to take a look at it.
Thanks!
Brian Søgård Jensen / WP Synchro