WP-CLI setup script improvements
franz-josef-kaiser opened this issue · 2 comments
franz-josef-kaiser commented
Currently there are two problems with the import shell script:
- It does assume that
wp
is installed and available. That can easily be checked up front and if not, abort gracefully, informing the user what to do. - It does not allow to run as root. In a Docker install, we have the problem that Docker containers in nearly all cases run as root, so the
--allow-root
flag should be used for thewp
command. Maybe the best would be to allow running the script with one additional argument. That could simply be a yes/no flag that is prompted andread
. - When the "WP Importer" is not present or active, it's hard to install. Maybe there should be a check if the plugin is installed.
wp ${ROOT} plugin is-installed wordpress-importer
and then prompt if the user wants to install and activate it:wp ${ROOT} plugin install wordpress-importer --activate
. - The prompt for the WordPress path could slightly be improved. As the relative directory/path might be unknown, it might be better to ask for an "absolute" path.
- When automating this, the prompt is not really nice. It would be nice to either take the argument as flag or argument, and if not present: ask for the argument during processing.
manovotny commented
Thanks for the awesome rundown!
Here's where I'm at on this...
- I didn't write the original script. It was something that was contributed to the project via a PR
- I am not a wp-cli user. I know what it is, but I've never even used it, so my experience with it is p much non-existent.
You seem to be very knowledgable and passionate about it. I'd gladly accept a PR if you'd like to address the things above.
JeffMatson commented
I addressed several of these in PR #54