Skip to content

Latest commit

 

History

History
61 lines (38 loc) · 4.38 KB

CONTRIBUTING.md

File metadata and controls

61 lines (38 loc) · 4.38 KB

Contributing to WooCommerce Admin

Hi! Thank you for your interest in contributing to WooCommerce Admin. We appreciate it.

There are many ways to contribute – reporting bugs, adding translations, feature suggestions, and fixing bugs.

Reporting Bugs, Asking Questions, Sending Suggestions

Open a GitHub issue, that's all. If you have write access, add any appropriate labels.

If you're filing a bug, specific steps to reproduce are always helpful. Please include what you expected to see and what happened instead.

Localizing WooCommerce Admin

To translate WooCommerce Admin in your locale or language, select your locale here and translate Development (which contains the plugin's string) and/or Development Readme (please translate what you see in the Details tab of the plugin page).

A Global Translation Editor (GTE) or Project Translation Editor (PTE) with suitable rights will process your translations in due time.

Language packs are automatically generated once 95% of the plugin's strings are translated and approved for a locale.

Testing translations in development without language packs

  1. Export the translations strings as a .po file from the translate.wordpress.org project.
  2. Rename .po file to the following format: woocommerce-admin-xx_YY.po (Where xx_YY is your locale, like it_IT)
  3. Use WP-CLI to generate needed JSON files for JavaScript-based strings: wp i18n make-json [.po file here] --no-purge
  4. Move .po and .json files to /wp-content/languages/plugins.

We're Here To Help

We encourage you to ask for help. We want your first experience with WooCommerce Admin to be a good one, so don't be shy. If you're wondering why something is the way it is, or how a decision was made, you can tag issues with [Type] Question or prefix them with “Question:”

Contributing Code

If you're a first-time code contributor to the repository, here's a quick guide to get started:

  1. Fork the repo to your own account.
  2. Clone your fork into the wp-content/plugins directory of your preferred WordPress development environment.
  3. Don't forget to create a branch to keep your changes. (git checkout -b add/my-cool-thing).
  4. From the woocommerce-admin plugin directory, build with npm install and npm start.
  5. Visit your dev environment in the browser to enable the WooCommerce Admin plugin and try it out.

Tips:

  • Try to keep each PR small (around 200-250 lines or less, if you can), and having multiple very small commits in each PR is preferable to one larger commit (especially if the PR is larger).
  • Don't combine code formatting changes with meaningful ones. If there's formatting work that needs to be done en masse, do it all in one PR, then open another one for meaningful code changes.
  • Add unit tests to your PR for better code coverage and review.

After you've made your updates, you're ready to commit:

  1. Run a complete build via npm run build.
  2. Do a composer install to ensure PHP dependencies can run on the pre-commit hook.
  3. Create your commit. Write a descriptive, but short first line (e.g. "Reports: Reticulate the splines"), and add more details below. If your commit addresses a github issue, reference it by number here (e.g. "This commit fixes issue #123 by reticulating all the splines.")
  4. Push the branch up to your local fork, then create a PR via the GitHub web interface.

License

WooCommerce Admin is licensed under GNU General Public License v3 (or later).

All materials contributed should be compatible with the GPLv3. This means that if you own the material, you agree to license it under the GPLv3 license. If you are contributing code that is not your own, such as adding a component from another Open Source project, or adding an npm package, you need to make sure you follow these steps:

  1. Check that the code has a license. If you can't find one, you can try to contact the original author and get permission to use, or ask them to release under a compatible Open Source license.
  2. Check the license is compatible with GPLv3, note that the Apache 2.0 license is not compatible.