afragen / git-updater

This WP plugin will update GitHub, Bitbucket, GitLab, and Gitea hosted plugins and themes
https://git-updater.com
MIT License
3.18k stars 462 forks source link

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

Closed kasparsd closed 10 years ago

kasparsd commented 10 years ago

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;
}
afragen commented 10 years ago

I can see a case for adding GitHub URI in addition to GitHub Plugin URI for plugins as the most common use case for this plugin is in updating plugins. But I'd like a lot more input from others explaining why they'd need it.

However, the current format does provide for a more explicit notation as anyone looking at it knows what it is in its own context. WordPress format uses Plugin URI and Theme URI and so the claim that we already know if a script is a plugin or a theme would be like asking WP to change its format to be URI as we already know the context.

If the idea is to make it compatible with other updating plugins, I think there are potentially more problems if both updaters are active.

If the idea is that you're testing multiple updating plugins, you can have both headers in your plugin without any problem.

@GaryJones any thoughts on this?

GaryJones commented 10 years ago

I don't think it's worth complicating the GHU plugin just to allow authors to save 6-7 characters. This is often set up in a boilerplate anyway.

kasparsd commented 10 years ago

Thanks for looking into this @afragen and @GaryJones! I do understand your reasoning. How about adding a filter then?

afragen commented 10 years ago

@kasparsd I guess the same question applies, why? I'm not sure there's much of a use case for defining your own headers. If there is I'm open to it.

scarstens commented 10 years ago

I agree with Andy. In fact, I think its bad practice to remove the words "plugin" and "theme" as they indicate WHERE the files are supposed to be updated/installed. I would close as declined.

afragen commented 10 years ago

Thanks for your input Seth.