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

Links to single plugin PHP file should work with plugin install #233

Open
schlessera opened this issue Jun 2, 2020 · 1 comment
Open

Comments

@schlessera
Copy link
Member

When using wp plugin install <URL>, WP-CLI currently assumes that the URL is pointing to a ZIP file of a plugin.

This command should also work with a URL to a single PHP plugin file, so that it can for example directly install plugins from GitHub Gists:

Example of such a command that should just work:

wp plugin install --activate https://gist.githubusercontent.com/westonruter/dec7d190060732e29a09751ab99cc549/raw/d55866c2fc82ab16f8909ce73fc89986ab28d727/pwa-manifest-short-name.php

/cc @westonruter (whose numerous Gist plugins make me want to implement the above)

@westonruter
Copy link

What about if a Gist URL is provided, like: https://gist.github.com/westonruter/dec7d190060732e29a09751ab99cc549

I'd expect that to just work. It should fetch the ZIP for the Gist, determine the slug of the plugin from the name of the plugin file, and then create a directory for that plugin using the slug. The content of the Gist can then go in there. This is important because Gists are not limited to single files. For example: https://gist.github.com/westonruter/26667d26ea34ef8e9f5e1053a747c73f

The above is what the GitHub Updater plugin is doing: afragen/git-updater#881 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants