aaemnnosttv / wp-cli-login-command

Log in to WordPress with secure passwordless magic links.
https://aaemnnost.tv/wp-cli-commands/login/
MIT License
294 stars 47 forks source link

Allow companion plugin to be used as must-use plugin #14

Closed viktorix closed 6 years ago

viktorix commented 7 years ago

To prevent accidental deletion of the companion plugin, it would be nice to be able to place it inside "mu-plugins" folder. I tried manually moving it there, but it's not being recognized and WP-CLI asks for companion plugin to be installed.

Maybe simply passing --mu to let WP-CLI know where to look for companion plugin.

Thanks!

aaemnnosttv commented 7 years ago

Thanks for the suggestion @viktorix. This could already be done if you were installing the plugin with Composer by overriding the install path for the package.

I'll see if there's a good way to implement this with the command.

austinginder commented 6 years ago

Looking over the code for the new mu-plugin feature, it appears this still relies on wp-cli-login-command wp package to be installed. My ideal would be a standalone mu-plugin which I could deploy to remote sites as needed. My use case is with Anchor Hosting where I manage a lot of WordPress sites. It would great if I could give my myself & customers a quick login link without requiring the wp package. Packages unfortunately don't yet persist with WP Engine's SSH. However I can easily upload a single file mu-plugin which in theory could allow for both wp login cli and the magic links.

After playing around with the code it looks like it is possible to just combine all of the needed classes into one really nasty single php file. I might just do that for my use case.

aaemnnosttv commented 6 years ago

You might be able to include the package as a local dependency rather than installed globally via wp-cli. I hear you on the single file drop-in although I don't think that's a need for most users of the package. You might consider forking it and modifying for your needs. I would be open to considering PR too if the solution wasn't nasty :)

austinginder commented 6 years ago

Hmm so it looks like One Time Login will do preciously just that with a simple plugin install. Going to use that rather then taking your beautiful code and muddy it up.

aaemnnosttv commented 6 years ago

Haha, thanks. I plan for v2 to be primarily housed in a plugin, but not sure exactly when I'll get to that 😄

Cheers!