Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions github-plugin-updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
20 changes: 20 additions & 0 deletions readme-orig.md
Original file line number Diff line number Diff line change
@@ -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.
21 changes: 1 addition & 20 deletions readme.md
Original file line number Diff line number Diff line change
@@ -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.
This plugin has been rolled into the afragen/github-updater repository. This repository is no longer actively updated.