Getting a whole new ThemeReview environment in 1 minute using wp-cli.

I was at #wcsf14 and at theme review team table in contributor day room 🙂

Every time I begin a new theme review, I need to set up a whole new environment, ideally. People seems to do reviews in same install, same database only changing the theme.

After reading http://www.chipbennett.net/2011/04/20/a-guide-to-reviewing-themes-for-the-wordpress-theme-repository/ , I created this script with wp-cli commands.

What this script does is:

  1. drop all database tables
  2. install WordPress with long blog name, url, loginname, password and email
  3. core update
  4. install plugins to activate
  5. install plugins to install without activation
  6. update all plugins
  7. update all themes
  8. set the blogdescription very long
  9. set posts_per_page, thread_comments and other options to appropriate values
  10. download the theme unit test data and import it
  11. install the theme you review this time
  12. regenerate all the medias
  13. set permalink structure and generate .htaccess

How to use

save the gist script above as newreview and command below

$ ./newreview <theme-zip-url>

Generating .htaccess in step.13 requires a wp-cli.yml in your WP directory with a line apache_modules: - mod_rewrite. If you already have an .htaccess file, you don’t need to have this yml file.

This is meant to be used on your local server so please don’t put it on remote servers.

This is what you get when you run the script.