wp_remote_request() returned error is ignored
-
I have a copy of our live site setup in a local virtual machine for testing. My /etc/hosts file is overridden for the domain. After spending much time troubleshooting why this plugin wasn’t purging (no purge requests showing in varnishlog), I realized the request was being sent to the live domain since the VM didn’t also have /etc/hosts configured. After modifying the VM’s /etc/hosts I finally see the PURGE requests coming in.
I think it’d be good if the call to wp_remote_request() actually checked its return response code for a 200 code. This could save time with troubleshooting basic issues. Possibly instead of saying “Varnish cache purged!” every time, show an error if something other than 200 was received.
The topic ‘wp_remote_request() returned error is ignored’ is closed to new replies.