I'm trying to get a automatic plugin updater work on localhost, I had it working at one point on a live server but for some reason mid update it gives me an error of:
An error occurred while updating Test Plugin: Download failed. A valid URL was not provided.
I've tested the URL it gives me above the error message and in the log; both download the zip file containing the plugin immediately.
The below object gets passed to the
stdClass Object ( [slug] => test-plugin.php [path] => test-plugin/test-plugin.php [name] => Test Plugin [new_version] => 2.0 [last_updated] => March 20, 2015 04:27pm [sections] => Array ( [description] => test [changelog] => <strong>test</strong> ) [download_link] => http://127.0.0.1/white/check-plugins/plugins/test-plugin.zip )
So, if I can get to the zip by visiting the URL directly, and the object seems to correspond mostly to what WP receives from other plugins, these two factors lead me to believe that the issue has something to do with localhost.
The plugin path matches the installation file:
Edit :: I can follow the URL in the error which downloads the zip file to my browser then turn around and install that zip to my
black WP plugins without a problem. Really seems like localhost.
So white is the install holding the updated plugin, black has the outdated plugin and sending the request to get the new update.
Am I missing anything in the object I'm passing? Are there any caveats to WordPress being on localhost that could affect this?