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 , 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.

Have fun!

Remember to update the passwords and roles of imported users.

Success: Finished importing from ./theme-unit-test-data.xml file.
Downloading install package from
Unpacking the package...
Installing the theme...
Theme installed successfully.
Activating 'spacious'...
Success: Switched to 'Spacious' theme.
Found 37 images to regenerate.
Regenerated thumbnails for "spectacles" (ID 1692).
Regenerated thumbnails for "dsc20050315_145007_132" (ID 1691).

(process omitted by shin, it regenerates many many images)

Regenerated thumbnails for "dsc20050727_091048_222" (ID 616).
Regenerated thumbnails for "canola2" (ID 611).
Success: Finished regenerating all images.

Leave a Reply