public static function get_sideloaded_file_loc($file)
{
$upload = wp_upload_dir();
$dir = $upload['path'];
$filename = $file;
$file = parse_url($file);
$path_parts = pathinfo($file['path']);
$basename = md5($filename);
$ext = 'jpg';
if (isset($path_parts['extension'])) {
$ext = $path_parts['extension'];
}
return $dir . '/' . $basename . '.' . $ext;
}