Hello Kapars,
Even after 5 years this script works like charm.
but i got a question i protected archive folders with basic access authentication with htaceess. i do have stored logins in my .htpasswd. and i am able to get update details from secured folder by adding this header in wp_remote_post

'headers' => array(
          'Authorization' => 'Basic ' . base64_encode(sprintf('%s:%s',
 'username', 'password'))
      )

But when click to update it comes with
Download failed. Authorization Required

i am not sure where its lacking, can you help ?

Thank you very much.
Amit