When a site is protected with basic authentication the following notice is thrown:
Warning: getimagesize(https://staging.kerteza.com/wp-content/uploads/2019/04/Kerteza-logo-small-web-RGB_250px.png): failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized in /sites/staging.kerteza.web-004.appsaloon.be/files/wp-content/plugins/tco-white-label/functions/enqueue/styles.php on line 26
I went through the source code and the function getimagesize() is called on the url which of course can not be reached due to the basic authentication.
This can be solved by passing the path to the function getimagesize() instead, since the image path isn’t available in the code where getimagesize() is called.
To change the url to the path, you could use the following snippet:
$upload_dir_info = wp_get_upload_dir();
$some_url_in_uploads = str_replace( $upload_dir_info[‘baseurl’], $upload_dir_info[‘basedir’], $some_url_in_uploads );
A lot of our customers work on staging sites which we sync to their production sites, hence the basic authentication.
Would be great if this could be fixed.
Thanks in advance.