poststatus / wptest

WP Test - The Best Tests For WordPress
GNU General Public License v3.0
944 stars 111 forks source link

WP-CLI setup script improvements #51

Closed franz-josef-kaiser closed 7 years ago

franz-josef-kaiser commented 8 years ago

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.
manovotny commented 8 years ago

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.

JeffMatson commented 7 years ago

I addressed several of these in PR #54