poststatus/wptest

WP-CLI setup script improvements

franz-josef-kaiser opened this issue · 2 comments

Currently there are two problems with the import shell script:

  1. 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.
  2. 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 the wp 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 and read.
  3. 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.
  4. 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.
  5. 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.

Thanks for the awesome rundown!

Here's where I'm at on this...

  1. I didn't write the original script. It was something that was contributed to the project via a PR
  2. 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.

I addressed several of these in PR #54