appease the linter
This commit is contained in:
parent
0d7a833056
commit
9edad5270d
|
@ -38,9 +38,9 @@ Please take a moment to review the [project readme](https://github.com/woocommer
|
||||||
- Before pushing commits to GitHub, check your code against our code standards. For PHP code in the WooCommerce Core project you can do this by running `pnpm --filter=woocommerce run lint:php:changes:branch`.
|
- Before pushing commits to GitHub, check your code against our code standards. For PHP code in the WooCommerce Core project you can do this by running `pnpm --filter=woocommerce run lint:php:changes:branch`.
|
||||||
- Whenever possible, please fix pre-existing code standards errors in code that you change.
|
- Whenever possible, please fix pre-existing code standards errors in code that you change.
|
||||||
- Please consider adding appropriate tests related to your change if applicable such as unit, API and E2E tests. You can check the following guides for this purpose:
|
- Please consider adding appropriate tests related to your change if applicable such as unit, API and E2E tests. You can check the following guides for this purpose:
|
||||||
- [Writing unit tests](https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/tests/README.md#guide-for-writing-unit-tests).
|
- [Writing unit tests](https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/tests/README.md#guide-for-writing-unit-tests).
|
||||||
- [Writing API tests](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce/tests/api-core-tests#guide-for-writing-api-tests).
|
- [Writing API tests](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce/tests/api-core-tests#guide-for-writing-api-tests).
|
||||||
- [Writing E2E tests](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce/tests/e2e-pw#guide-for-writing-e2e-tests).
|
- [Writing E2E tests](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce/tests/e2e-pw#guide-for-writing-e2e-tests).
|
||||||
- Ensure you use LF line endings in your code editor. Use [EditorConfig](http://editorconfig.org/) if your editor supports it so that indentation, line endings and other settings are auto configured.
|
- Ensure you use LF line endings in your code editor. Use [EditorConfig](http://editorconfig.org/) if your editor supports it so that indentation, line endings and other settings are auto configured.
|
||||||
- When committing, reference your issue number (#1234) and include a note about the fix.
|
- When committing, reference your issue number (#1234) and include a note about the fix.
|
||||||
- Ensure that your code supports the minimum supported versions of PHP and WordPress; this is shown at the top of the `readme.txt` file.
|
- Ensure that your code supports the minimum supported versions of PHP and WordPress; this is shown at the top of the `readme.txt` file.
|
||||||
|
|
|
@ -21,7 +21,7 @@ Our most critical targets are:
|
||||||
|
|
||||||
For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic).
|
For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic).
|
||||||
|
|
||||||
_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._
|
Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress).
|
||||||
|
|
||||||
## Guidelines
|
## Guidelines
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ We're committed to working with security researchers to resolve the vulnerabilit
|
||||||
* Pen-testing Production:
|
* Pen-testing Production:
|
||||||
* Please **setup a local environment** instead whenever possible. Most of our code is open source (see above).
|
* Please **setup a local environment** instead whenever possible. Most of our code is open source (see above).
|
||||||
* If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC.
|
* If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC.
|
||||||
* **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels.
|
* **Don't automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels.
|
||||||
* To be eligible for a bounty, please follow all of these guidelines.
|
* To be eligible for a bounty, please follow all of these guidelines.
|
||||||
* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability.
|
* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability.
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,9 @@ This package contains the automated end-to-end tests for WooCommerce.
|
||||||
- [Pre-requisites](#pre-requisites)
|
- [Pre-requisites](#pre-requisites)
|
||||||
- [Setting up core tests](#setting-up-core-tests)
|
- [Setting up core tests](#setting-up-core-tests)
|
||||||
- [Test functions](#test-functions)
|
- [Test functions](#test-functions)
|
||||||
- [Activation and setup](#activation-and-setup)
|
- [Activation and setup](#activation-and-setup)
|
||||||
- [Merchant](#merchant)
|
- [Merchant](#merchant)
|
||||||
- [Shopper](#shopper)
|
- [Shopper](#shopper)
|
||||||
- [Contributing a new test](#contributing-a-new-test)
|
- [Contributing a new test](#contributing-a-new-test)
|
||||||
|
|
||||||
## Pre-requisites
|
## Pre-requisites
|
||||||
|
@ -27,13 +27,14 @@ Version 0.2.0 added a test installer that will populate the `tests/e2e/specs` fo
|
||||||
- Install the e2e-environment `npm install @woocommerce/e2e-environment --save-dev`
|
- Install the e2e-environment `npm install @woocommerce/e2e-environment --save-dev`
|
||||||
- Run the installer `npx wc-e2e install @woocommerce/e2e-core-tests`
|
- Run the installer `npx wc-e2e install @woocommerce/e2e-core-tests`
|
||||||
- Merge the sample configuration files:
|
- Merge the sample configuration files:
|
||||||
- `tests/e2e/docker/woocommerce.e2e-core-tests.sh` => `initialize.sh`
|
- `tests/e2e/docker/woocommerce.e2e-core-tests.sh` => `initialize.sh`
|
||||||
- `tests/e2e/config/default-woocommerce.e2e-core-tests.json` => `default.json`
|
- `tests/e2e/config/default-woocommerce.e2e-core-tests.json` => `default.json`
|
||||||
|
|
||||||
#### Version 0.1.X or other test runner
|
#### Version 0.1.X or other test runner
|
||||||
|
|
||||||
- Create the folder `tests/e2e/specs` in your repository if it does not exist.
|
- Create the folder `tests/e2e/specs` in your repository if it does not exist.
|
||||||
- To add a core test to your test suite, create a new `.test.js` file within `tests/e2e/specs` . Example code to run all the shopper tests:
|
- To add a core test to your test suite, create a new `.test.js` file within `tests/e2e/specs` . Example code to run all the shopper tests:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
|
||||||
const { runShopperTests } = require( '@woocommerce/e2e-core-tests' );
|
const { runShopperTests } = require( '@woocommerce/e2e-core-tests' );
|
||||||
|
@ -54,71 +55,72 @@ The functions to access the core tests are:
|
||||||
### Activation and setup
|
### Activation and setup
|
||||||
|
|
||||||
- `runSetupOnboardingTests` - Run all setup and onboarding tests
|
- `runSetupOnboardingTests` - Run all setup and onboarding tests
|
||||||
- `runActivationTest` - Merchant can activate WooCommerce
|
- `runActivationTest` - Merchant can activate WooCommerce
|
||||||
- `runOnboardingFlowTest` - Merchant can complete onboarding flow
|
- `runOnboardingFlowTest` - Merchant can complete onboarding flow
|
||||||
- `runTaskListTest` - Merchant can complete onboarding task list
|
- `runTaskListTest` - Merchant can complete onboarding task list
|
||||||
- `runInitialStoreSettingsTest` - Merchant can complete initial settings
|
- `runInitialStoreSettingsTest` - Merchant can complete initial settings
|
||||||
|
|
||||||
### Merchant
|
### Merchant
|
||||||
|
|
||||||
- `runMerchantTests` - Run all merchant tests
|
- `runMerchantTests` - Run all merchant tests
|
||||||
- `runAddShippingClassesTest` - Merchant can create shipping classes and let shopper test them
|
- `runAddShippingClassesTest` - Merchant can create shipping classes and let shopper test them
|
||||||
- `runAddNewShippingZoneTest` - Merchant can create shipping zones and let shopper test them
|
- `runAddNewShippingZoneTest` - Merchant can create shipping zones and let shopper test them
|
||||||
- `runAddSimpleProductTest` - Merchant can create a simple product
|
- `runAddSimpleProductTest` - Merchant can create a simple product
|
||||||
- `runAddVariableProductTest` - Merchant can create a variable product
|
- `runAddVariableProductTest` - Merchant can create a variable product
|
||||||
- `runCreateCouponTest` - Merchant can create coupon
|
- `runCreateCouponTest` - Merchant can create coupon
|
||||||
- `runCreateOrderTest` - Merchant can create order
|
- `runCreateOrderTest` - Merchant can create order
|
||||||
- `runMerchantOrdersCustomerPaymentPage` - Merchant can visit the customer payment page
|
- `runMerchantOrdersCustomerPaymentPage` - Merchant can visit the customer payment page
|
||||||
- `runMerchantOrderEmailsTest` - Merchant can receive order emails and resend emails by Order Actions
|
- `runMerchantOrderEmailsTest` - Merchant can receive order emails and resend emails by Order Actions
|
||||||
- `runEditOrderTest` - Merchant can edit an order in the dashboard
|
- `runEditOrderTest` - Merchant can edit an order in the dashboard
|
||||||
- `runOrderStatusFilterTest` - Merchant can filter orders by order status
|
- `runOrderStatusFilterTest` - Merchant can filter orders by order status
|
||||||
- `runOrderRefundTest` - Merchant can refund an order
|
- `runOrderRefundTest` - Merchant can refund an order
|
||||||
- `runOrderApplyCouponTest` - Merchant can apply a coupon to an order
|
- `runOrderApplyCouponTest` - Merchant can apply a coupon to an order
|
||||||
- `runOrderSearchingTest` - Merchant can search for order via different terms
|
- `runOrderSearchingTest` - Merchant can search for order via different terms
|
||||||
- `runProductEditDetailsTest` - Merchant can edit an existing product
|
- `runProductEditDetailsTest` - Merchant can edit an existing product
|
||||||
- `runProductSearchTest` - Merchant can search for a product and view it
|
- `runProductSearchTest` - Merchant can search for a product and view it
|
||||||
- `runProductSettingsTest` - Merchant can update product settings
|
- `runProductSettingsTest` - Merchant can update product settings
|
||||||
- `runTaxSettingsTest` - Merchant can update tax settings
|
- `runTaxSettingsTest` - Merchant can update tax settings
|
||||||
- `runUpdateGeneralSettingsTest` - Merchant can update general settings
|
- `runUpdateGeneralSettingsTest` - Merchant can update general settings
|
||||||
- `runMerchantOrderEmailsTest` - Merchant can receive order emails and resend emails by Order Actions
|
- `runMerchantOrderEmailsTest` - Merchant can receive order emails and resend emails by Order Actions
|
||||||
- `runAnalyticsPageLoadsTest` - Merchant can load and see all pages in Analytics
|
- `runAnalyticsPageLoadsTest` - Merchant can load and see all pages in Analytics
|
||||||
- `runImportProductsTest` - Merchant can import products via CSV file
|
- `runImportProductsTest` - Merchant can import products via CSV file
|
||||||
- `runInitiateWccomConnectionTest` - Merchant can initiate connection to Woo.com
|
- `runInitiateWccomConnectionTest` - Merchant can initiate connection to Woo.com
|
||||||
- `runAdminPageLoadTests` - Merchant can load pages from the WP Admin sidebar
|
- `runAdminPageLoadTests` - Merchant can load pages from the WP Admin sidebar
|
||||||
|
|
||||||
### Shopper
|
### Shopper
|
||||||
|
|
||||||
- `runShopperTests` - Run all shopper tests
|
- `runShopperTests` - Run all shopper tests
|
||||||
- `runCartApplyCouponsTest` - Shopper can use coupons on cart
|
- `runCartApplyCouponsTest` - Shopper can use coupons on cart
|
||||||
- `runCartPageTest` - Shopper can view and update cart
|
- `runCartPageTest` - Shopper can view and update cart
|
||||||
- `runCheckoutApplyCouponsTest` - Shopper can use coupons on checkout
|
- `runCheckoutApplyCouponsTest` - Shopper can use coupons on checkout
|
||||||
- `runCheckoutPageTest` - Shopper can complete checkout
|
- `runCheckoutPageTest` - Shopper can complete checkout
|
||||||
- `runMyAccountPageTest` - Shopper can access my account page
|
- `runMyAccountPageTest` - Shopper can access my account page
|
||||||
- `runMyAccountPayOrderTest` - Shopper can pay for their order in My Account
|
- `runMyAccountPayOrderTest` - Shopper can pay for their order in My Account
|
||||||
- `runProductBrowseSearchSortTest` - Shopper can browse, search & sort products
|
- `runProductBrowseSearchSortTest` - Shopper can browse, search & sort products
|
||||||
- `runSingleProductPageTest` - Shopper can view single product page in many variations (simple, variable, grouped)
|
- `runSingleProductPageTest` - Shopper can view single product page in many variations (simple, variable, grouped)
|
||||||
- `runVariableProductUpdateTest` - Shopper can view and update variations on a variable product
|
- `runVariableProductUpdateTest` - Shopper can view and update variations on a variable product
|
||||||
- `runCheckoutCreateAccountTest` - Shopper can create an account during checkout
|
- `runCheckoutCreateAccountTest` - Shopper can create an account during checkout
|
||||||
- `runCheckoutLoginAccountTest` - Shopper can login to an account during checkout
|
- `runCheckoutLoginAccountTest` - Shopper can login to an account during checkout
|
||||||
- `runMyAccountCreateAccountTest` - Shopper can create an account via my account page
|
- `runMyAccountCreateAccountTest` - Shopper can create an account via my account page
|
||||||
- `runCartCalculateShippingTest` - Shopper can calculate shipping in the cart
|
- `runCartCalculateShippingTest` - Shopper can calculate shipping in the cart
|
||||||
- `runCartRedirectionTest` - Shopper is redirected to the cart page after adding to cart
|
- `runCartRedirectionTest` - Shopper is redirected to the cart page after adding to cart
|
||||||
- `runOrderEmailReceivingTest` - Shopper can receive an email for his order
|
- `runOrderEmailReceivingTest` - Shopper can receive an email for his order
|
||||||
- `runCartAndCheckoutConsistentShippingTest` - Shopper gets consistent shipping information on cart and checkout pages
|
- `runCartAndCheckoutConsistentShippingTest` - Shopper gets consistent shipping information on cart and checkout pages
|
||||||
|
|
||||||
### REST API
|
### REST API
|
||||||
|
|
||||||
- `runApiTests` - Run all API tests
|
- `runApiTests` - Run all API tests
|
||||||
- `runExternalProductAPITest` - Can create, read, and delete an external product
|
- `runExternalProductAPITest` - Can create, read, and delete an external product
|
||||||
- `runGroupedProductAPITest` - Can create, read, and delete a grouped product
|
- `runGroupedProductAPITest` - Can create, read, and delete a grouped product
|
||||||
- `runVariableProductAPITest` - Can create, read, and delete a variable product and its variations
|
- `runVariableProductAPITest` - Can create, read, and delete a variable product and its variations
|
||||||
- `runCouponApiTest` - Can create, read, and delete a coupon
|
- `runCouponApiTest` - Can create, read, and delete a coupon
|
||||||
- `runOrderApiTest` - Can create, read, and delete an order
|
- `runOrderApiTest` - Can create, read, and delete an order
|
||||||
|
|
||||||
## Contributing a new test
|
## Contributing a new test
|
||||||
|
|
||||||
- In your branch create a new `example-test-name.test.js` under the appropriate folder in the [`specs`](specs) directory.
|
- In your branch create a new `example-test-name.test.js` under the appropriate folder in the [`specs`](specs) directory.
|
||||||
- Jest does not allow its global functions to be accessed outside the jest environment. To allow the test code to be published in a package import any jest global functions used in your test
|
- Jest does not allow its global functions to be accessed outside the jest environment. To allow the test code to be published in a package import any jest global functions used in your test.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const {
|
const {
|
||||||
it,
|
it,
|
||||||
|
@ -126,7 +128,9 @@ const {
|
||||||
beforeAll,
|
beforeAll,
|
||||||
} = require( '@jest/globals' );
|
} = require( '@jest/globals' );
|
||||||
```
|
```
|
||||||
|
|
||||||
- Wrap your test in a function and export it
|
- Wrap your test in a function and export it
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const runExampleTestName = () => {
|
const runExampleTestName = () => {
|
||||||
describe('Example test', () => {
|
describe('Example test', () => {
|
||||||
|
@ -143,7 +147,9 @@ const runExampleTestName = () => {
|
||||||
|
|
||||||
module.exports = runExampleTestName;
|
module.exports = runExampleTestName;
|
||||||
```
|
```
|
||||||
|
|
||||||
- Add your test to [`specs/index.js`](specs/index.js)
|
- Add your test to [`specs/index.js`](specs/index.js)
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const runExampleTestName = require( './grouping/example-test-name.test' );
|
const runExampleTestName = require( './grouping/example-test-name.test' );
|
||||||
// ...
|
// ...
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
Activity Panel Inbox
|
# Activity Panel Inbox
|
||||||
====================
|
|
||||||
|
|
||||||
Right now, installing and activating WooCommerce and a few extensions quickly results in a cascade of notices vying for the store administrator’s attention (and pushing whatever wp-admin content they were trying to get to on a page down, way down.)
|
Right now, installing and activating WooCommerce and a few extensions quickly results in a cascade of notices vying for the store administrator’s attention (and pushing whatever wp-admin content they were trying to get to on a page down, way down.)
|
||||||
|
|
||||||
|
@ -19,14 +18,15 @@ But unlike today’s notices, this part of the UI will be reserved for “priori
|
||||||
|
|
||||||
The second category is what we’re focusing on in this example - and what we expect the vast majority of extension developers will want to extend - we call it the “Activity Panel Inbox.” It will look something like this:
|
The second category is what we’re focusing on in this example - and what we expect the vast majority of extension developers will want to extend - we call it the “Activity Panel Inbox.” It will look something like this:
|
||||||
|
|
||||||
<img src="images/activity-panel-inbox.png" width="400" title="Activity Panel Inbox" alt="Activity Panel Inbox" />
|
![Activity Panel Inbox](images/activity-panel-inbox.png)
|
||||||
|
|
||||||
This section is dedicated to informational content coming from multiple sources such as WooCommerce core, Woo.com Subscription management, extensions activity and store achievements. This section was also envisioned to display more insightful content in the future, e.g. content that could help with the day to day tasks of managing and optimizing a store.
|
This section is dedicated to informational content coming from multiple sources such as WooCommerce core, Woo.com Subscription management, extensions activity and store achievements. This section was also envisioned to display more insightful content in the future, e.g. content that could help with the day to day tasks of managing and optimizing a store.
|
||||||
|
|
||||||
Each notice or “note” has a type represented by an icon (Gridicon), a title, content, a timestamp and one or two actions (action title + link).
|
Each notice or “note” has a type represented by an icon (Gridicon), a title, content, a timestamp and one or two actions (action title + link).
|
||||||
|
|
||||||
### Inbox Design Constraints and Best Practices
|
### Inbox Design Constraints and Best Practices
|
||||||
Extensions can add their own notes via the data stores we’ll be covering below, but first... some constraints...
|
|
||||||
|
Extensions can add their own notes via the data stores we’ll be covering below, but first: some constraints.
|
||||||
|
|
||||||
There are some constraints extensions should follow when working with the inbox:
|
There are some constraints extensions should follow when working with the inbox:
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,8 @@ Here is a link: [Woo.com](https://woo.com).
|
||||||
|
|
||||||
![An image](https://picsum.photos/200/300 'This is an image.')
|
![An image](https://picsum.photos/200/300 'This is an image.')
|
||||||
|
|
||||||
```
|
```shell
|
||||||
$ cd /path/to/woocommerce-docs
|
cd /path/to/woocommerce-docs
|
||||||
```
|
```
|
||||||
|
|
||||||
> This is a blockquote.
|
> This is a blockquote.
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
title: Some frontmatter
|
title: Some frontmatter
|
||||||
---
|
---
|
||||||
|
|
||||||
# Heading 1
|
# Heading 1 {{< mdl-disable "<!-- markdownlint-disable MD025 -->" >}}
|
||||||
|
|
||||||
## Heading 2
|
## Heading 2
|
||||||
|
|
||||||
|
@ -30,8 +30,8 @@ Here is a link: [Woo.com](https://woo.com).
|
||||||
|
|
||||||
![An image](https://picsum.photos/200/300 'This is an image.')
|
![An image](https://picsum.photos/200/300 'This is an image.')
|
||||||
|
|
||||||
```
|
```shell
|
||||||
$ cd /path/to/woocommerce-docs
|
cd /path/to/woocommerce-docs
|
||||||
```
|
```
|
||||||
|
|
||||||
> This is a blockquote.
|
> This is a blockquote.
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
<p align="center"><a href="https://woo.com/"><img src="https://woo.com/wp-content/themes/woo/images/logo-woocommerce@2x.png" alt="WooCommerce"></a></p>
|
# [![WooCommerce](https://woo.com/wp-content/themes/woo/images/logo-woocommerce@2x.png 'WooCommerce')](https://woo.com/)
|
||||||
|
|
||||||
<p align="center">
|
[![License](https://poser.pugx.org/woocommerce/woocommerce/license 'License')](https://packagist.org/packages/woocommerce/woocommerce)
|
||||||
<a href="https://packagist.org/packages/woocommerce/woocommerce"><img src="https://poser.pugx.org/woocommerce/woocommerce/license" alt="license"></a>
|
![WordPress.org downloads](https://img.shields.io/wordpress/plugin/dt/woocommerce.svg 'WordPress.org downloads')
|
||||||
<img src="https://img.shields.io/wordpress/plugin/dt/woocommerce.svg" alt="WordPress.org downloads">
|
![WordPress.org rating](https://img.shields.io/wordpress/plugin/r/woocommerce.svg 'WordPress.org rating')
|
||||||
<img src="https://img.shields.io/wordpress/plugin/r/woocommerce.svg" alt="WordPress.org rating">
|
[![Build Status](https://github.com/woocommerce/woocommerce/actions/workflows/ci.yml/badge.svg?branch=trunk 'Build Status')](https://github.com/woocommerce/woocommerce/actions/workflows/ci.yml)
|
||||||
<a href="https://github.com/woocommerce/woocommerce/actions/workflows/ci.yml"><img src="https://github.com/woocommerce/woocommerce/actions/workflows/ci.yml/badge.svg?branch=trunk" alt="Build Status"></a>
|
[![codecov](https://codecov.io/gh/woocommerce/woocommerce/branch/trunk/graph/badge.svg 'codecov')](https://codecov.io/gh/woocommerce/woocommerce)
|
||||||
<a href="https://codecov.io/gh/woocommerce/woocommerce"><img src="https://codecov.io/gh/woocommerce/woocommerce/branch/trunk/graph/badge.svg" alt="codecov"></a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
This is the WooCommerce Core plugin. Here you can browse the source and keep track of development. We recommend all developers to follow the [WooCommerce development blog](https://woocommerce.wordpress.com/) to stay up to date about everything happening in the project. You can also [follow @DevelopWC](https://twitter.com/DevelopWC) on Twitter for the latest development updates.
|
This is the WooCommerce Core plugin. Here you can browse the source and keep track of development. We recommend all developers to follow the [WooCommerce development blog](https://woocommerce.wordpress.com/) to stay up to date about everything happening in the project. You can also [follow @DevelopWC](https://twitter.com/DevelopWC) on Twitter for the latest development updates.
|
||||||
|
|
||||||
|
@ -25,7 +23,7 @@ cd plugins/woocommerce
|
||||||
pnpm -- wp-env start
|
pnpm -- wp-env start
|
||||||
```
|
```
|
||||||
|
|
||||||
You should now be able to visit http://localhost:8888/ and access WooCommerce environment.
|
You should now be able to visit `http://localhost:8888/` and access WooCommerce environment.
|
||||||
|
|
||||||
## Building Components
|
## Building Components
|
||||||
|
|
||||||
|
@ -72,10 +70,12 @@ pnpm --filter=woocommerce/client/admin ts:check
|
||||||
```
|
```
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
* [WooCommerce Documentation](https://woo.com/)
|
* [WooCommerce Documentation](https://woo.com/)
|
||||||
* [WooCommerce Developer Documentation](https://github.com/woocommerce/woocommerce/wiki)
|
* [WooCommerce Developer Documentation](https://github.com/woocommerce/woocommerce/wiki)
|
||||||
* [WooCommerce Code Reference](https://woo.com/wc-apidocs/)
|
* [WooCommerce Code Reference](https://woo.com/wc-apidocs/)
|
||||||
* [WooCommerce REST API Docs](https://woocommerce.github.io/woocommerce-rest-api-docs/)
|
* [WooCommerce REST API Docs](https://woocommerce.github.io/woocommerce-rest-api-docs/)
|
||||||
|
|
||||||
## Reporting Security Issues
|
## Reporting Security Issues
|
||||||
|
|
||||||
To disclose a security issue to our team, [please submit a report via HackerOne here](https://hackerone.com/automattic/).
|
To disclose a security issue to our team, [please submit a report via HackerOne here](https://hackerone.com/automattic/).
|
||||||
|
|
|
@ -8,19 +8,13 @@ You need Composer to use the packages. If you don't have it installed, go and ch
|
||||||
|
|
||||||
## Developing new packages
|
## Developing new packages
|
||||||
|
|
||||||
To create a package and/or feature plugin for core, you can base your plugin on the example package here:
|
To create a package and/or feature plugin for core, you can base your plugin on [the example package here](https://github.com/woocommerce/woocommerce-example-package).
|
||||||
|
|
||||||
https://github.com/woocommerce/woocommerce-example-package
|
|
||||||
|
|
||||||
Packages require a Package class which inits the package and returns version information, and Packages also require that you use the `jetpack-autoloader` package which prevents version conflicts should the same package be used by multiple plugins at once. This is shown in the example package above.
|
Packages require a Package class which inits the package and returns version information, and Packages also require that you use the `jetpack-autoloader` package which prevents version conflicts should the same package be used by multiple plugins at once. This is shown in the example package above.
|
||||||
|
|
||||||
## Publishing a package
|
## Publishing a package
|
||||||
|
|
||||||
Your package should be published to Packagist. For example:
|
Your package should be published to Packagist ([example](https://packagist.org/packages/woocommerce/woocommerce-example-package)). The package name in this case is `woocommerce/woocommerce-example-package`.
|
||||||
|
|
||||||
https://packagist.org/packages/woocommerce/woocommerce-example-package
|
|
||||||
|
|
||||||
The package name in this case is `woocommerce/woocommerce-example-package`.
|
|
||||||
|
|
||||||
## Including packages in core
|
## Including packages in core
|
||||||
|
|
||||||
|
@ -47,7 +41,7 @@ Edit `composer.json` in the root directory and add the package and package versi
|
||||||
|
|
||||||
Next, if your package contains user translatable strings you'll need to edit `bin/package-update.sh` and instruct it to change your package textdomain to the `woocommerce` textdomain. For example:
|
Next, if your package contains user translatable strings you'll need to edit `bin/package-update.sh` and instruct it to change your package textdomain to the `woocommerce` textdomain. For example:
|
||||||
|
|
||||||
```
|
```shell
|
||||||
find ./packages/woocommerce-example-package -iname '*.php' -exec sed -i.bak -e "s/, 'woocommerce-example-package'/, 'woocommerce'/g" {} \;
|
find ./packages/woocommerce-example-package -iname '*.php' -exec sed -i.bak -e "s/, 'woocommerce-example-package'/, 'woocommerce'/g" {} \;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -67,7 +61,7 @@ You can add tests to ensure your package is loaded to the WooCommerce unit-tests
|
||||||
|
|
||||||
Once you have defined your package requirements, run
|
Once you have defined your package requirements, run
|
||||||
|
|
||||||
```
|
```shell
|
||||||
composer install
|
composer install
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue