Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lite / embeddable version? #348

Closed
mgibbs189 opened this issue Jan 22, 2016 · 14 comments
Closed

Lite / embeddable version? #348

mgibbs189 opened this issue Jan 22, 2016 · 14 comments
Labels

Comments

@mgibbs189
Copy link
Contributor

Hey Andy,

Just wondering if you've considered adding an embeddable version of this plugin?

I'm currently using GHU for quite a few plugins hosted on public GitHub repos. I recommend that users install GHU to get automatic updates, but most users don't actually install it. It'd be awesome to be able to bundle this with any plugin so that updating happens automatically. Pseudocode below.

if ( ! function_exists( 'GHU' ) ) {
    include( PATH_TO_GITHUB_UPDATER_EMBED_FILE );
}

GHU()->register_plugin( array(
    'Plugin Path' => 'github_updater/github_updater.php',
    'GitHub Plugin URI' => 'https://github.com/afragen/github-updater',
    'GitHub Branch' => 'master',
) );
@afragen
Copy link
Owner

afragen commented Jan 22, 2016

Hey Matt,

@royboy789 has asked about this too.

My biggest issue is having that embedded code be updated when it changes.

It begs the question of what do you think would be better?

A lite embeddable version or something that automatically downloads and installs GHU if it's not already installed something like TGMPA https://github.com/TGMPA/TGM-Plugin-Activation
Bear in mind I think TGMPA is moving towards a plugin too.

Thoughts?

@afragen
Copy link
Owner

afragen commented Jan 22, 2016

We could create a drop-in class that would check to see if GHU is present and active. If not it would install and activate.

@mgibbs189
Copy link
Contributor Author

@afragen A notifier / updater class (like TGMPA) would be an awesome solution too.

@afragen
Copy link
Owner

afragen commented Jan 23, 2016

I've been playing around this evening and I have a small class that should be able to install and activate GHU if it's not present. Once I get it working better I'll put it up. Should be tomorrow.

TGMPA is moving towards being a plugin and looking at the discussion regarding TGMPA as a feature plugin, it was mentioned that dependencies should be added and activated without user interaction. TGMPA/TGM-Plugin-Activation#447

We probably should add a notification that the plugin is being installed as a dependency for the other plugin.

@afragen
Copy link
Owner

afragen commented Jan 23, 2016

Hey Matt, a question.

Do you think something more universal to install one or more plugin dependencies or just stick to GHU?

I think we could make something reasonably simple that could use a json encoded file as input.

@mgibbs189
Copy link
Contributor Author

I'd love to see a small lib that works like TGMPA, but only for the GitHub updater plugin. E.g. it notifies users to install it, via an admin notice.

@mgibbs189
Copy link
Contributor Author

I don't even think it would necessarily need to install GHU for them.

It would check if GHU is active. If not active, it'd show an admin notice containing either (A) an "Install plugin" link, or (B) a link to download the GHU zip.

This admin notice could presumably be dismissed temporarily (e.g. for a week), but not permanently.

@afragen
Copy link
Owner

afragen commented Jan 23, 2016

So here's what I've done. https://github.com/afragen/wp-install-dependencies

There's an example plugin and a drop-in folder with a class and json package file for config. I make several assumptions, among them that the dependencies are needed and must be active.

There's still an issue with some install info but I'm not sure how to get rid of it.

There is essentially no user interaction except to activate your plugin. Currently the class only works on plugin pages.

It's been a fun morning. 👍

BTW, dependencies can be on GitHub, Bitbucket, or GitLab and can be private on all but Bitbucket.

@mgibbs189
Copy link
Contributor Author

Andy, this looks great! A few suggestions:

  1. Some users might not want plugins to be installed automatically. In each item's JSON settings, what are your thoughts on supporting an (optional) confirm setting? If it exists and is set to TRUE, the user will need to confirm installation (by clicking an "Install" link within an admin notice).
{
  "github-updater": {
    "name": "GitHub Updater",
    "slug": "github-updater/github-updater.php",
    "git": "github",
    "uri": "https://github.com/afragen/github-updater",
    "branch": "master",
    "confirm": true,
    "token":null
  }
}
  1. If this gets used by multiple plugins, there will need to be a way for each plugin to modify $config. Maybe something like:
$config = apply_filters( 'wpid_register_dependencies', $config );

@afragen
Copy link
Owner

afragen commented Jan 23, 2016

Matt,

Let's take the discussion over to the other repo and reference back here.

afragen/wp-dependency-installer#1

@robertdevore
Copy link
Contributor

Not sure if all discussion about this is at the new repo, but I wanted to give a 👍 to this idea. Would be happy to help in any way I can.

@afragen
Copy link
Owner

afragen commented Feb 2, 2016

Take look over there. The master branch basically will install and activate any plugins passed in the included json config. The js-install branch is an effort to have optional install plugins and have them install and activate using JS like how Matt did in his single purpose installer.

I could really use some help getting this to work. Currently, I think we've gotten it located under the plugin requiring the dependencies.

All help is welcome.

@robertdevore
Copy link
Contributor

Cool. I'll check it out soon and see if there's anything I can offer to help. I'll be using this for all WordPress theme projects going forward, so this idea definitely interests me.

@afragen
Copy link
Owner

afragen commented Mar 16, 2016

@afragen afragen closed this as completed Mar 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants