I appreciate you taking the initiative to contribute to this project!

Development

To setup a development environment for code contributions, follow instructions below. Execution of the extension is done within a dockerized environment (only tested under Linux). Editing can still be done outside of docker as the current directory is mounted into the docker environment.

Place wp-cli binary in the bin folder. According to current documentation from WP-CLI you would want to do something like:

   cd bin
   curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
   chmod +x wp-cli.phar
   mv wp-cli.phar wp

Create a docker environment and bring it up like this:

   docker-compose up -d

Enter your dev environment and create a fresh wordpress installation to test against

   docker exec -ti wpsec-phpcli /bin/bash

Install composer and run

   php composer.phar install
   mkdir testsite && cd testsite
   wp core download
   wp core config --dbname=database --dbuser=user --dbpass=password --dbhost=wpsec-mysql
   wp core install --url=http://localhost --title=testsite --admin_user=admin --admin_password=admin --admin_email=mail@mail.com --skip-email

Running

   wp wp-sec check

Running testsuite

   vendor/bin/behat --strict

Reporting a bug

Think you’ve found a bug? We’d love for you to help us get it fixed.

Before you create a new issue, you should search existing issues to see if there’s an existing resolution to it, or if it’s already been fixed in a newer version.

Once you’ve done a bit of searching and discovered there isn’t an open or fixed issue for your bug, please create a new issue with the following:

  1. What you were doing (e.g. "When I run wp post list").
  2. What you saw (e.g. "I see a fatal about a class being undefined.").
  3. What you expected to see (e.g. "I expected to see the list of posts.")

Include as much detail as you can, and clear steps to reproduce if possible.

Creating a pull request

Want to contribute a new feature? Please first open a new issue to discuss whether the feature is a good fit for the project.

Once you've decided to commit the time to seeing your pull request through, please follow our guidelines for creating a pull request to make sure it's a pleasant experience:

  1. Create a feature branch for each contribution.
  2. Submit your pull request early for feedback.
  3. Include functional tests with your changes. Read the WP-CLI documentation for an introduction.
  4. Follow the PSR-2 Coding Standards.