diff --git a/github-plugin-updater.php b/github-plugin-updater.php index 7b2cfca..be3d47b 100644 --- a/github-plugin-updater.php +++ b/github-plugin-updater.php @@ -119,13 +119,13 @@ protected function get_api_url( $endpoint ) { * @since 1.0 */ protected function get_remote_info() { - $remote = get_site_transient( __CLASS__ . ':remote' ); + $remote = get_site_transient( __CLASS__ . ':remote' . $this->config->repo ); if ( ! $remote ) { $remote = $this->api( '/repos/:owner/:repo/contents/' . basename( $this->config->slug ) ); if ( $remote ) - set_site_transient( __CLASS__ . ':remote', $remote, 60 * 60 ); + set_site_transient( __CLASS__ . ':remote' . $this->config->repo, $remote, 60 * 60 ); } return $remote; diff --git a/readme-orig.md b/readme-orig.md new file mode 100644 index 0000000..6019d05 --- /dev/null +++ b/readme-orig.md @@ -0,0 +1,20 @@ +This is still a working draft.... + +How does this plugin work? +========================== + +The challenge I faced when updating a plugin from GitHub was the naming of the zipball archive. When extracted the foldername is not of your choice. +But I do like to think that you should be able to dictate the foldername of your plugin. So after some research I came up with the solution to download +the zipball, open it with the native php ZipArchive (WordPress uses this as well), rename the folder, save the zipball and offer that as the download. +To achieve this I had to let de update-url point to wp-admin where I supply the name of the github repo and the cookie required to login to wp-admin. +The admin_init hook will then take over and sets headers equal to that of a zipball from GitHub and sends the zipball, then cleans it up. + +Now, though my research was pretty extensive (for my doing at least), I am not completely sure this is the best approach. So I any feedback is most welcome. + +Other than that, this structure will allows a pretty native WordPress plugin update experience. We should be able to: + +* Supply extra information before updating +* The plugin author can support this plugin directly or the end-user can add any repo to the functions.php +* Adding a GUI is also very possible and if this plugin is good in what it claims to do, it will be added + +Again, any feedback and testing on various platforms/ configurations is very welcome. \ No newline at end of file diff --git a/readme.md b/readme.md index 6019d05..47a8c35 100644 --- a/readme.md +++ b/readme.md @@ -1,20 +1 @@ -This is still a working draft.... - -How does this plugin work? -========================== - -The challenge I faced when updating a plugin from GitHub was the naming of the zipball archive. When extracted the foldername is not of your choice. -But I do like to think that you should be able to dictate the foldername of your plugin. So after some research I came up with the solution to download -the zipball, open it with the native php ZipArchive (WordPress uses this as well), rename the folder, save the zipball and offer that as the download. -To achieve this I had to let de update-url point to wp-admin where I supply the name of the github repo and the cookie required to login to wp-admin. -The admin_init hook will then take over and sets headers equal to that of a zipball from GitHub and sends the zipball, then cleans it up. - -Now, though my research was pretty extensive (for my doing at least), I am not completely sure this is the best approach. So I any feedback is most welcome. - -Other than that, this structure will allows a pretty native WordPress plugin update experience. We should be able to: - -* Supply extra information before updating -* The plugin author can support this plugin directly or the end-user can add any repo to the functions.php -* Adding a GUI is also very possible and if this plugin is good in what it claims to do, it will be added - -Again, any feedback and testing on various platforms/ configurations is very welcome. \ No newline at end of file +This plugin has been rolled into the afragen/github-updater repository. This repository is no longer actively updated. \ No newline at end of file