Code Monkey home page Code Monkey logo

git-updater's Introduction

Git Updater

downloads downloads@latest

WordPress Tests

A simple plugin to enable automatic updates to your GitHub hosted WordPress plugins, themes, and language packs. Additional API plugins available for Bitbucket, GitLab, Gitea, and Gist.

Comprehensive information regarding Git Updater is available in the Knowledge Base.

Install the latest version here.

Description

This plugin was originally designed to simply update any GitHub hosted WordPress plugin or theme. Your plugin or theme must contain a header in the style.css header or in the plugin's header denoting the location on GitHub. The format is as follows.

GitHub Plugin URI: afragen/git-updater
GitHub Plugin URI: https://github.com/afragen/git-updater

or

GitHub Theme URI: afragen/test-child
GitHub Theme URI: https://github.com/afragen/test-child

...where the above URI leads to the owner/repository of your theme or plugin. The URI may be in the format https://github.com/<owner>/<repo> or the short format <owner>/<repo>. You do not need both. Only one Plugin or Theme URI is required. You should not include any extensions like .git.

API Plugins

API plugins for Bitbucket, GitLab, Gitea, and Gist are available. API plugins are available for a one-click install from the Add-Ons tab.

Sponsor

Purchase a license at the Git Updater Store. An unlimited yearly license is very reasonable and allows for authenticated API requests. There is an initial free trial period. After the trial period Git Updater will not be able to make authenticated API requests.

You can sponsor me on GitHub to help with continued development and support.

Slack

We now have a Slack team for Git Updater. Please click here for an invite. You will be automatically added to the #general and #support channels. Please take a look at other channels too.

Translations

If you are a polyglot I would greatly appreciate translation contributions to GlotPress for Git Updater.

git-updater's People

Contributors

1shiharat avatar afragen avatar andriiryzhkov avatar benoitchantre avatar calvintam236 avatar christophwolff avatar corneliucirlan avatar daniel-menard avatar epicfaace avatar figureone avatar fxbenard avatar garyjones avatar grappler avatar jazzsequence avatar jeffmatson avatar khromov avatar limenet avatar limikael avatar mgibbs189 avatar overclokk avatar pbiron avatar pedro-mendonca avatar robertdevore avatar ruben- avatar sc0ttkclark avatar scarstens avatar sharevb avatar shivammathur avatar szepeviktor avatar valeriosouza avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-updater's Issues

WP 3.9-beta3 update dialog popup section errors

The following errors appear when viewing the update details dialog popup in WP 3.9-beta3 and using latest version of GHU:

Notice: Undefined property: stdClass::$sections in /wp-admin/includes/plugin-install.php on line 337

Notice: Undefined property: stdClass::$sections in /wp-admin/includes/plugin-install.php on line 350

Notice: Undefined property: stdClass::$name in /wp-admin/includes/plugin-install.php on line 356

Notice: Undefined property: stdClass::$sections in /wp-admin/includes/plugin-install.php on line 359

Notice: Undefined property: stdClass::$sections in /wp-admin/includes/plugin-install.php on line 412

My readme.txt is styled according to the proper format as is also used on http://generatewp.com/plugin-readme/. If this is about the plugin header, that is formatted correctly although it's preceded by a general comment block regarding the file itself (like bbPress does):

/**
 * The Plugin
 *
 * @package Plugin
 * @subpackage Main
 *
 * @todo Fix bugs
 */

If additional details need to be provided, let me know.

Notices

Hey there!
I keep getting these notices while using the development branch:

Notice: Undefined offset: 0 in /srv/www/wordpress-default/wp-content/plugins/github-updater/includes/class-github-api.php on line 304

Notice: Trying to get property of non-object in /srv/www/wordpress-default/wp-content/plugins/github-updater/includes/class-github-api.php on line 314

Notice: Trying to get property of non-object in /srv/www/wordpress-default/wp-content/plugins/github-updater/includes/class-github-api.php on line 327

Notice: Trying to get property of non-object in /srv/www/wordpress-default/wp-content/plugins/github-updater/includes/class-github-api.php on line 328

Notice: Trying to get property of non-object in /srv/www/wordpress-default/wp-content/plugins/github-updater/includes/class-github-api.php on line 329

Notice: Trying to get property of non-object in /srv/www/wordpress-default/wp-content/plugins/github-updater/includes/class-github-api.php on line 330

Notice: Trying to get property of non-object in /srv/www/wordpress-default/wp-content/plugins/github-updater/includes/class-github-api.php on line 316

Notice: Undefined offset: 0 in /srv/www/wordpress-default/wp-content/plugins/github-updater/includes/class-github-api.php on line 304

Notice: Trying to get property of non-object in /srv/www/wordpress-default/wp-content/plugins/github-updater/includes/class-github-api.php on line 314

Notice: Trying to get property of non-object in /srv/www/wordpress-default/wp-content/plugins/github-updater/includes/class-github-api.php on line 327

Notice: Trying to get property of non-object in /srv/www/wordpress-default/wp-content/plugins/github-updater/includes/class-github-api.php on line 328

Notice: Trying to get property of non-object in /srv/www/wordpress-default/wp-content/plugins/github-updater/includes/class-github-api.php on line 329

Notice: Trying to get property of non-object in /srv/www/wordpress-default/wp-content/plugins/github-updater/includes/class-github-api.php on line 330

Notice: Trying to get property of non-object in /srv/www/wordpress-default/wp-content/plugins/github-updater/includes/class-github-api.php on line 316

I don't have time to debug right now, I try to tackle this later today.

Support language packs

At one point theme and plugin authors will be able to update translations separately to the code from WordPress.org.

I think the structure is there to do so. I would be interested if github-updater could do it. The way I see it if I update the translations branch then the translations get updated.

http://ottopress.com/2013/language-packs-101-prepwork/

Just an idea.

Allow "Git URI" or "GitHub URI" in plugins/theme headers

We already know if a script is a plugin or a theme during the update check so there is no need to specify that in the header. Alternatively, it should be possible for the plugin to define its own header key via a filter, like:

add_filter( 'github_updater_header_keys', 'my_custom_github_header_key' );

function my_custom_github_header_key( $keys ) {
    $keys[] = 'GitHub URI';

    return $keys;
}

Require PHP 5.3 or greater

In order to use the PHP Markdown Lib, uses namespaces, PHP >= 5.3 is needed.

Does this present a problem for anyone?

Version numbering

@GaryJones, if we stick with semantic versioning should next tag be 1.6.0 as the short uri is a feature not a bug fix?

Github Updater

Hi Andy,

Sorry i am posting here. As I mentioned previously, I got the updater to work with my theme, WP-Forge. The one thing I noticed is that my repository was named WP-Forge, not wp-forge. So when I updated I had two themes one called WP-Forge and one called wp-forge and there was a constant "update available" notice. So What I did was deleted the old repository and created a new one with all lower case letters. Now the updates work perfectly and everything is named properly. Thanks again for the help I appreciate it.

Incorrect branch in API call bug

There's a bug where the API call will look at the default branch (which might not be master) to find the remote version, but then the download URL is hard-coded to be the master branch.

I'll wait until #6 is committed to ease merging issues, but I already have a fix for this, by way of an improvement where the plugin author can define the branch to check and download from using a GitHub Branch: plugin header. If they don't add it, then the default branch is used in both situations.

"203 characters of unexpected output" error on activation

The plugin generated 203 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.

probably some whitespace after a ?> somewhere

Use Git-Flow

Now that the project supports GitHub Branch, it should be includes (pointing to master) in this plugin, so that it can move to a git-flow setup in the future. Git-flow basically means making all commits to the develop branch (and setting it as default within GitHub repo Settings), which leaves master as a clean version of the last released version, known to be working as intended.

GitHub Branch: master

Existing installs of this plugin will still be hard-coded to be pulling from the master.zip anyway, and once they've updated once, they'll have the GitHub Branch support that means future version checks will be to the master branch as well (instead of the default develop branch).

http://nvie.com/posts/a-successful-git-branching-model/

Global site_transient for all plugins/themes

Is it possible to create a single global site transient that adds the remote json data to an array then retrieve that array back?

This should help to scale and eliminate rate limit errors. Currently api is called for each plugin/theme

Network Activation issues

In Multisite when the plugin is activated under Network Activation, plugin updating works but theme doesn't.

Theme updating requires activation under the specific site.

Updating theme error

Hi,

I'm trying to use this plugin to work with my wordpress themes. Though the updates I make on my github files are showing on the wordpress installed themes, I keep getting the update theme notification even when there's nothing to update. And it keeps saying update to version 0.0.0

My style.css header is this

/**
 *
 * Theme Name: Janival
 * Theme URI: http://gabyferman.com
 * Description: This site was built using the Bones Development Theme.
 * Author: Gaby Ferman
 * Version: v1.0.0
 * Template Version: 1.0.0
 * Github Theme URI: https://github.com/gabyferman/wp-theme-janival
 *
 */

I've tried writing Version: 1.0.0 and Template Version: 1.0.0; also tried using just Version and not Template Version, but then the theme wouldn't update.

Do I need to add something else?

This is the link to my theme files: https://github.com/gabyferman/wp-theme-janival

Parent + child themes scenario

Hi guys.

My scenario's an updated to latest version parent theme, and a child with an available update.

Both themes say there's a new version while opening details in themes admin page (parent says the new version is the same as installed).

I did updated the child via wp-admin/update-core.php?action=do-theme-upgrade when it did show, but i was unable to do it from the theme update link (it was saying we had last version running).

Also, the plugin didn't upgrade to new version. It downgraded to the nearest version (from 2.0 to 1.9 instead of 2.0.1). Tested in 2 sites right now.

Some help? :)

Theme rollback

Theme rollback, the ability to rollback to a previous tagged release, works in WP 3.8+. It doesn't show up in WP < 3.8.

I could use some help in figuring our why or should we not worry about it?

Tagging clarification

Hi, what's the correct way to specify a tag?

An example repository has a develop branch, as well as tags 1.0.2 and 1.0.1. I want updates to be triggered based on the latest tag. Would it look like any of the following?

GitHub Plugin URI: https://github.com/username/repo
GitHub Branch: 1.0.2

or

GitHub Plugin URI: https://github.com/username/repo
Stable tag: 1.0.2

or will the plugin automatically use the newest tag?

GitHub Plugin URI: https://github.com/username/repo

GitHub theme not updating from tags

I just updated github-updater to 2.7.0.

My installed theme is version 2.4.5.3 and the latest tag is 2.4.6.

WP is showing You have version 2.4.5.3 installed. Update to 2.4.6.1-beta.

It seems as though it is not recognizing the tag and instead pulling in the master branch's latest commit.

The only header is: GitHub Theme URI: aaemnnosttv/pagelines

Am I missing something? I'm pretty sure it was working properly before.

Make the set_site_transient() $expiration value configurable

At the moment, the $expiration value is hardcoded to one hour

  set_site_transient( md5( $this->{$this->type}->repo . $file ), $remote, HOUR_IN_SECONDS );

but i my case I would like to be able to change and reduce this value so i could have more frequent updates of the plugins i've installed. It would be good to make this value a plugin parameter and provide a setting screen screen which would offer these values.

MINUTE_IN_SECONDS = 60 (seconds)
HOUR_IN_SECONDS = 60 * MINUTE_IN_SECONDS
DAY_IN_SECONDS = 24 * HOUR_IN_SECONDS
WEEK_IN_SECONDS = 7 * DAY_IN_SECONDS
YEAR_IN_SECONDS = 365 * DAY_IN_SECONDS

The default value for the parameter would remain as HOUR_IN_SECONDS.

A way to exclude certain files?

This plugin replaces every file in the theme with the version of the same file in GitHub, and unfortunately that means that wipes out any changes that a person has made to the theme. Would it be possible to define certain files that would be retained when an update is performed? Perhaps via something similar to a .gitignore file?

Call to undefined function fb() in latest develop

I installed the latest develop branch and then attempted to go to my 'Edit Themes' screen, but got the PHP fatal error:

Fatal error: Call to undefined function fb() in .../wp-content/plugins/github-updater-develop/includes/class-theme-updater.php on line 201

Does this work when I host my plugin at wordpress.org at the same time?

I think I had this working in the past but I am not sure.

I am trying this with my ARVE plugin. I manually set the version very low to trigger the update, the update info dialog then is from the plugin and not the native WordPress. But it not detects the CHANGES.md in my repo and and shows the version 4.5.3 that I have hosted on wp.org even it I have version 4.5.5 tagged here on Github.

I want to use Github for alpha/beta versions but at the same time wp.org for stable versions. So that as soon as the user installs the updater he/she will get the beta versions of my plugin.

Is this possible?

Updating changes plugin folder name

Hi again @afragen.

My $boss discovered today a bug while updating one of our plugins (it was working until this new 4.4.5 release), where after updating to the latest version, the plugin folder name renamed itself (from abn-admanager to abn).

Al the feedback in the admin area was ok, and also the plugin was activated correctly in my DEV site after updating. Anyway my $boss says in some other sites it was deactivated because no plugin file was found on the correct route (and makes sense).

I can just replicate the folder name bug, no headers changed...
So maybe we're doing something wrong?

I'm giving you access to the repo as always. ;)
Many thanks in advance.

update pulls from master based on version in code

Problem is that most WP developers are used to developing "staging" code in the master branch. Why? Because thats how WP has us do it in the WP.org SVN repo. You do not want the "default" update code to ever pull from the master branch. Bad practice.

Possible Security Issue - Private Theme Repos

I noticed in the documentation that to update themes hosted in private repository you have to place a Github access token with full read permissions or the username and password for your Bitbucket account into a comment in style.css. Is there currently any way within the plugin to remove this sensitive information before delivering style.css to a website visitor?

For reference: http://developer.github.com/v3/oauth/#scopes

Gitlab implementation

Gitlab is the most widespread open-source alternative to github and it can be self-hosted.
Integrating Gutlab support for both private and open repositories would mean that we'll be able to use our own servers for updates instead of relying to 3rd party services.

Gitlab has a pretty open API http://api.gitlab.org/repositories.html and it tries to emulate the way github works in many ways.

If you install gitlab to use on your own organization you'll see that in many ways it is better and more versatile than github, so it only makes sense to use it for our private repos (hosting gitlab on a VPS is way cheaper than a github premium account).

Allow short URI

When you've got a line such as:

GitHub Plugin URI: https://github.com/GaryJones/my-plugin

...the https://github.com/ bit is basically redundant, since we know it's going to be that already. We should do a check for this string at the start of the value, and add it in if it's missing (though I'm not sure we need the full URI anyway - just the owner and repo name) - that would then allow a shorter URI in the plugin header tags of:

GitHub Plugin URI: GaryJones/my-plugin

Update theme page

Bring theme updating on par with plugin updating, in terms of changelog. Add rollback feature. Need to hook into after_theme_row_{stylesheet}

Fatal error: Cannot use object of type WP_Error as array

I just got the following error message (see below) on /wp-admin/update-core.php admin page when I was about to display this page for performing plugin updates - some of Gravity Forms & Add-Ons, plus some from wordpress.org. Currently there were no plugins from GitHub.com amongst those for update:

Fatal error: Cannot use object of type WP_Error as array in /my/path/to/wp-content/plugins/github-updater/includes/class-plugin-updater.php on line 79

GitHub Updater was in latest version v2.6.1 active.

Thanks, Dave :)

time to get new version

hi.. i just discovered this plugin thank you!!

just asking: how much time does it take for github to make a new version available?

i'm using the "check again" button.. and also cleared the transient:

update wp_options set option_value='' where option_name='_site_transient_update_plugins';

now it seems to tale at least 15 minutes.. is it normal?

thank you!

PS: i'm using this in a development environment.. so we need the updates to go up faster than in a production one

Support force-check for finding available updates?

On my installation I'm guessing it does not when clicking the 'Check Again' button on the update-core.php page, which reloads the page with the force-check=1 param. Is their another way to fast force updates or should it be working already? Or can the GitHub Timeout plugin header have a value lower than 1?

Force the custom rollback/beta version updater to appear all the time

I have found use cases (especially in periods of many quick commits) where it is useful to have the version updater since the theme or plugin you are working on doesn't detect a version change that quickly.

Instead of having either the updater appear or the rollback appear, have the rollback appear all the time.

image

Create a base updater class

There's a couple of methods that both the updater classes use, so to reduce duplicate code, it would make sense to have a base updater class that the plugin and theme classes both extend.

Non-github-hosted repos?

Does this work with non-GitHub hosted repositories (bitbucket, assembla, private repos, etc...)?

Multisite Errors

I am getting these in the dashboard:

Notice: Undefined property: stdClass::$url in /srv/www/wordpress-develop/src/wp-content/plugins/github-updater/includes/class-github-api.php on line 140

Notice: Undefined variable: ref in /srv/www/wordpress-develop/src/wp-content/plugins/github-updater/includes/class-github-api.php on line 142

Notice: Undefined offset: 0 in /srv/www/wordpress-develop/src/wp-content/plugins/github-updater/includes/class-github-api.php on line 291

Notice: Trying to get property of non-object in /srv/www/wordpress-develop/src/wp-content/plugins/github-updater/includes/class-github-api.php on line 301

Notice: Trying to get property of non-object in /srv/www/wordpress-develop/src/wp-content/plugins/github-updater/includes/class-github-api.php on line 314

Notice: Trying to get property of non-object in /srv/www/wordpress-develop/src/wp-content/plugins/github-updater/includes/class-github-api.php on line 315

Notice: Trying to get property of non-object in /srv/www/wordpress-develop/src/wp-content/plugins/github-updater/includes/class-github-api.php on line 316

Notice: Trying to get property of non-object in /srv/www/wordpress-develop/src/wp-content/plugins/github-updater/includes/class-github-api.php on line 317

Notice: Trying to get property of non-object in /srv/www/wordpress-develop/src/wp-content/plugins/github-updater/includes/class-github-api.php on line 303

Improve update available screen

github-updater

It would be good if we could amend that View version ... details link to bring up something relevant e.g. CHANGES.md in the relevant branch.

It would also be good if we could populate that Compatibility with WordPress ... value as well, perhaps reading a particular string in the README.md.

For both, we could fall back to looking for the relevant section in the readme.txt file, if it exists.

GitHub Access Token

Hello,

Would the authors be open to a screen/setting where end users can add their own personal access token? GitHub often throttles unauthenticated API requests and I do not wish to share my personal access token with the world in my theme. I think a better option is to allow end users to optionally save their own personal token through a screen utilizing the settings API. This doesn't have to be required since GitHub does not block all unauthenticated requests.

If a theme/plugin already has the "GitHub Access Token" specified, I think that should be used instead of this end user token setting. That might come up if a specific credential is needed to access a specific private repository.

If you agree, let me know if you would like me to help. I really appreciate the work you have done here and the plugin is a big help for hosting my theme on GitHub.

Dan Flippo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.