Update relevant files due to L2->L0 policy change for minimum required versions. (https://github.com/woocommerce/woocommerce-blocks/pull/4484)
* update README files with version requirements * update phpcs config * update default environment for tests locally * update workflows to only test against versions matching new policy * update plugin header for new version policy * restore older WP version support in E2E tests and PHPCS I realized that we might still want to test against L2 WP versions in our E2E tests until those tests can be moved to WC core. While the feature plugin is L0, we still need to support L2 for existing features that are already surfaced in the WooCommerce plugin package. Also with PHPCS if there are fixes to older things in the codebase, we will need to preserve the usage of L2 friendly (back-compat) code. * add detection of Woo Core version to bootstrap * update version used in phpunit tests * add links to version policy update post * restore 5.5.1 for Woo Core version Getting errors with 5.5.2 - not sure what's going on but might be the tag isn't available as expected for 5.5.2 maybe? * switch to hardcoded version header reference PHPUNIT was tripping on this for some reason. * remove older WP version e2e test workflows * fix phpunit tests for new woo test suite Woo Core now uses a container and has some mocks that are used in some legacy test helpers. * remove explicit set WOO_VERSION for phpunit tests. This should default to latest for the GH workflow runs. * Update release PR template. Add some explicit instructions around updating required WP and WC versions at time of release. * use latest WOO_VERSION in .env * some improvements to reduce the things needing updated * remove extraneous code * Add some more checklist items to release PR templates * remove unnecessary conditional * remove is-dismissible css classes * Improve clarity of error messaging * Update README.md Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com> * remove checklist items about versions for patch releases Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
This commit is contained in:
parent
651495467f
commit
5ebbd41220
|
@ -12,5 +12,5 @@ WORDPRESS_TITLE=WooCommerce Core E2E Test Suite
|
||||||
WORDPRESS_LOGIN=admin
|
WORDPRESS_LOGIN=admin
|
||||||
WORDPRESS_PASSWORD=password
|
WORDPRESS_PASSWORD=password
|
||||||
WORDPRESS_EMAIL=admin@woocommercecoree2etestsuite.com
|
WORDPRESS_EMAIL=admin@woocommercecoree2etestsuite.com
|
||||||
WP_VERSION=5.4
|
WP_VERSION=latest
|
||||||
WOO_VERSION=5.3.0
|
WOO_VERSION=latest
|
||||||
|
|
|
@ -8,8 +8,6 @@ The release pull request has been created! This checklist is a guide to follow f
|
||||||
* [ ] Add the version and date to the changelog section within `readme.txt`, e.g. `= {{version}} - YYYY-MM-DD =`
|
* [ ] Add the version and date to the changelog section within `readme.txt`, e.g. `= {{version}} - YYYY-MM-DD =`
|
||||||
* [ ] Copy the changelog from the pull request description above into this new section
|
* [ ] Copy the changelog from the pull request description above into this new section
|
||||||
* [ ] Update compatibility sections (if applicable). __Note:__ Do not change the stable tag or plugin version; this is automated.
|
* [ ] Update compatibility sections (if applicable). __Note:__ Do not change the stable tag or plugin version; this is automated.
|
||||||
* [ ] Update _Requires at least_, _Tested up to_, and _Requires PHP_ sections at the top of `readme.txt`.
|
|
||||||
* [ ] Update _Requires at least_, _Requires PHP_, _WC requires at least_, and _WC tested up to_ at the top of `woocommerce-gutenberg-products-block.php`
|
|
||||||
* [ ] Push above changes to the release branch.
|
* [ ] Push above changes to the release branch.
|
||||||
|
|
||||||
## Write Testing Notes
|
## Write Testing Notes
|
||||||
|
@ -20,7 +18,7 @@ Additionally, make sure to differentiate between things in the testing notes tha
|
||||||
|
|
||||||
* [ ] Run `npm ci`
|
* [ ] Run `npm ci`
|
||||||
* [ ] Run `npm run package-plugin:deploy`. This will create a zip of the current branch build locally.
|
* [ ] Run `npm run package-plugin:deploy`. This will create a zip of the current branch build locally.
|
||||||
* [ ] Create testing notes for the release. You can usually go through the pull requests linked in the changelog and grab testing notes from each pull.
|
* [ ] Create testing notes for the release. You can usually go through the pull requests linked in the changelog and grab testing notes from each pull.
|
||||||
* [ ] Add the notes to `docs/testing/releases`
|
* [ ] Add the notes to `docs/testing/releases`
|
||||||
* [ ] Update the `docs/testing/releases/README.md` file index.
|
* [ ] Update the `docs/testing/releases/README.md` file index.
|
||||||
* [ ] Copy a link to the release zip you created earlier into the testing notes. To generate the link you can upload the zip as an attachment in a GitHub comment and then just copy the path (without publishing the comment).
|
* [ ] Copy a link to the release zip you created earlier into the testing notes. To generate the link you can upload the zip as an attachment in a GitHub comment and then just copy the path (without publishing the comment).
|
||||||
|
|
|
@ -3,13 +3,14 @@ The release pull request has been created! This checklist is a guide to follow f
|
||||||
* [ ] Checkout the release branch locally.
|
* [ ] Checkout the release branch locally.
|
||||||
|
|
||||||
## Initial Preparation
|
## Initial Preparation
|
||||||
|
|
||||||
* [ ] Add the changelog to `readme.txt`
|
* [ ] Add the changelog to `readme.txt`
|
||||||
* [ ] Add the version and date to the changelog section within `readme.txt`, e.g. `= {{version}} - YYYY-MM-DD =`
|
* [ ] Add the version and date to the changelog section within `readme.txt`, e.g. `= {{version}} - YYYY-MM-DD =`
|
||||||
* [ ] Copy the changelog from the pull request description above into this new section
|
* [ ] Copy the changelog from the pull request description above into this new section
|
||||||
* [ ] Update compatibility sections (if applicable). __Note:__ Do not change the stable tag or plugin version; this is automated.
|
* [ ] Update compatibility sections (if applicable). __Note:__ Do not change the stable tag or plugin version; this is automated.
|
||||||
* [ ] Update _Requires at least_, _Tested up to_, and _Requires PHP_ sections at the top of `readme.txt`.
|
* [ ] Update _Requires at least_, _Tested up to_, and _Requires PHP_ sections at the top of `readme.txt`. Note, this should also be the latest WordPress version available at time of release.
|
||||||
* [ ] Update _Requires at least_, _Requires PHP_, _WC requires at least_, and _WC tested up to_ at the top of `woocommerce-gutenberg-products-block.php`
|
* [ ] Update _Requires at least_, _Requires PHP_, _WC requires at least_, and _WC tested up to_ at the top of `woocommerce-gutenberg-products-block.php`. Note, this should include requiring the latest WP and WC versions at the time of the plugin release.
|
||||||
|
* [ ] If necessary, update the value of `$minimum_wp_version` at the top of the `woocommerce-gutenberg-products-block.php` file to the latest available version of WordPress.
|
||||||
|
* [ ] If necessary, update the `phpcs.xml` file to reference the minimum WP version supported by **WooCommerce Core**. It would be this line: `<config name="minimum_supported_wp_version" value="5.6" />`.
|
||||||
* [ ] Push above changes to the release branch.
|
* [ ] Push above changes to the release branch.
|
||||||
|
|
||||||
## Write Testing Notes
|
## Write Testing Notes
|
||||||
|
@ -21,7 +22,7 @@ Additionally, make sure to differentiate between things in the testing notes tha
|
||||||
* [ ] Run `npm ci`
|
* [ ] Run `npm ci`
|
||||||
* [ ] Run `npm run package-plugin:deploy`. This will create a zip of the current branch build locally.
|
* [ ] Run `npm run package-plugin:deploy`. This will create a zip of the current branch build locally.
|
||||||
* Note: The zip file is functionally equivalent to what gets released except the version bump.
|
* Note: The zip file is functionally equivalent to what gets released except the version bump.
|
||||||
* [ ] Create testing notes for the release. You can usually go through the pull requests linked in the changelog and grab testing notes from each pull.
|
* [ ] Create testing notes for the release. You can usually go through the pull requests linked in the changelog and grab testing notes from each pull.
|
||||||
* [ ] Add the notes to `docs/testing/releases`
|
* [ ] Add the notes to `docs/testing/releases`
|
||||||
* [ ] Update the `docs/testing/releases/README.md` file index.
|
* [ ] Update the `docs/testing/releases/README.md` file index.
|
||||||
* [ ] Copy a link to the release zip you created earlier into the testing notes. To generate the link you can upload the zip as an attachment in a GitHub comment and then just copy the path (without publishing the comment).
|
* [ ] Copy a link to the release zip you created earlier into the testing notes. To generate the link you can upload the zip as an attachment in a GitHub comment and then just copy the path (without publishing the comment).
|
||||||
|
@ -52,7 +53,7 @@ Additionally, make sure to differentiate between things in the testing notes tha
|
||||||
* [ ] Execute `npm run deploy`
|
* [ ] Execute `npm run deploy`
|
||||||
* The script will ask you to enter the version number to tag. Please enter the version we're releasing right now. Do not publish any dev tags as a release.
|
* The script will ask you to enter the version number to tag. Please enter the version we're releasing right now. Do not publish any dev tags as a release.
|
||||||
* Note: the script automatically updates version numbers on Github (commits on your behalf).
|
* Note: the script automatically updates version numbers on Github (commits on your behalf).
|
||||||
* **ALERT**: This script will ask you if this release will be deployed to WordPress.org. You should answer yes for this release even if it is a pre-release.
|
* **ALERT**: This script will ask you if this release will be deployed to WordPress.org. You should answer yes for this release even if it is a pre-release.
|
||||||
* A GitHub release will automatically be created and this will trigger a workflow that automatically deploys the plugin to WordPress.org.
|
* A GitHub release will automatically be created and this will trigger a workflow that automatically deploys the plugin to WordPress.org.
|
||||||
* [ ] Edit the [GitHub release](https://github.com/woocommerce/woocommerce-gutenberg-products-block/releases) and copy changelog into the release notes. Ensure there is a release with the correct version, the one you entered above.
|
* [ ] Edit the [GitHub release](https://github.com/woocommerce/woocommerce-gutenberg-products-block/releases) and copy changelog into the release notes. Ensure there is a release with the correct version, the one you entered above.
|
||||||
* [ ] The `#team-rubik` slack instance will be notified about the progress with the WordPress.org deploy. Watch for that. If anything goes wrong, an error will be reported and you can followup via the GitHub actions tab and the log for that workflow.
|
* [ ] The `#team-rubik` slack instance will be notified about the progress with the WordPress.org deploy. Watch for that. If anything goes wrong, an error will be reported and you can followup via the GitHub actions tab and the log for that workflow.
|
||||||
|
|
|
@ -58,8 +58,8 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
composer install
|
composer install
|
||||||
|
|
||||||
JSE2ETestsWP57Gutenberg:
|
JSE2EWithGutenberg:
|
||||||
name: JavaScipt E2E Tests (WP 5.7 with Gutenberg plugin)
|
name: JavaScript E2E Tests (WP latest with Gutenberg plugin)
|
||||||
needs: Setup
|
needs: Setup
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
@ -113,10 +113,9 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
composer install
|
composer install
|
||||||
|
|
||||||
- name: E2E Tests (WP 5.7 with Gutenberg plugin)
|
- name: E2E Tests (WP latest with Gutenberg plugin)
|
||||||
env:
|
env:
|
||||||
WOOCOMMERCE_BLOCKS_PHASE: 3
|
WOOCOMMERCE_BLOCKS_PHASE: 3
|
||||||
WP_VERSION: 5.7-branch
|
|
||||||
run: |
|
run: |
|
||||||
chmod -R 767 ./ #needed for permissions issues
|
chmod -R 767 ./ #needed for permissions issues
|
||||||
JSON='{"plugins": ["https://downloads.wordpress.org/plugin/woocommerce.latest-stable.zip","https://github.com/WP-API/Basic-Auth/archive/master.zip","https://downloads.wordpress.org/plugin/gutenberg.latest-stable.zip", "."] }'
|
JSON='{"plugins": ["https://downloads.wordpress.org/plugin/woocommerce.latest-stable.zip","https://github.com/WP-API/Basic-Auth/archive/master.zip","https://downloads.wordpress.org/plugin/gutenberg.latest-stable.zip", "."] }'
|
||||||
|
@ -125,8 +124,8 @@ jobs:
|
||||||
npm run wp-env clean all
|
npm run wp-env clean all
|
||||||
npm run test:e2e
|
npm run test:e2e
|
||||||
|
|
||||||
JSE2ETestsWP57:
|
JSE2ETests:
|
||||||
name: JavaScipt E2E Tests (WP 5.7)
|
name: JavaScript E2E Tests (latest)
|
||||||
needs: Setup
|
needs: Setup
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
@ -180,143 +179,10 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
composer install
|
composer install
|
||||||
|
|
||||||
- name: E2E Tests (WP 5.7)
|
- name: E2E Tests (WP latest)
|
||||||
env:
|
env:
|
||||||
WOOCOMMERCE_BLOCKS_PHASE: 3
|
WOOCOMMERCE_BLOCKS_PHASE: 3
|
||||||
WP_VERSION: 5.7-branch
|
|
||||||
run: |
|
run: |
|
||||||
npm run wp-env start
|
npm run wp-env start
|
||||||
npm run wp-env clean all
|
npm run wp-env clean all
|
||||||
npm run test:e2e
|
npm run test:e2e
|
||||||
|
|
||||||
JSE2ETestsWP56:
|
|
||||||
name: JavaScipt E2E Tests (WP 5.6)
|
|
||||||
needs: Setup
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Cache node modules
|
|
||||||
uses: actions/cache@v2
|
|
||||||
env:
|
|
||||||
cache-name: cache-node-modules
|
|
||||||
with:
|
|
||||||
# npm cache files are stored in `~/.npm` on Linux/macOS
|
|
||||||
path: ~/.npm
|
|
||||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-build-${{ env.cache-name }}-
|
|
||||||
${{ runner.os }}-build-
|
|
||||||
${{ runner.os }}-
|
|
||||||
|
|
||||||
- name: Use Node.js 14.x
|
|
||||||
uses: actions/setup-node@v1
|
|
||||||
with:
|
|
||||||
node-version: 14.x
|
|
||||||
|
|
||||||
- name: Npm install and build
|
|
||||||
run: |
|
|
||||||
npm ci
|
|
||||||
FORCE_REDUCED_MOTION=true npm run build:e2e-test
|
|
||||||
|
|
||||||
- name: blocks.ini setup
|
|
||||||
run: |
|
|
||||||
echo -e 'woocommerce_blocks_phase = 3\nwoocommerce_blocks_env = tests' > blocks.ini
|
|
||||||
- name: Get Composer Cache Directory
|
|
||||||
id: composer-cache
|
|
||||||
run: |
|
|
||||||
echo "::set-output name=dir::$(composer config cache-files-dir)"
|
|
||||||
- uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: ${{ steps.composer-cache.outputs.dir }}
|
|
||||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-composer-
|
|
||||||
|
|
||||||
- name: Set up PHP
|
|
||||||
uses: shivammathur/setup-php@v2
|
|
||||||
with:
|
|
||||||
php-version: 7.4
|
|
||||||
coverage: none
|
|
||||||
tools: composer
|
|
||||||
|
|
||||||
- name: Composer install
|
|
||||||
run: |
|
|
||||||
composer install
|
|
||||||
|
|
||||||
- name: E2E Tests (WP 5.6)
|
|
||||||
env:
|
|
||||||
WOOCOMMERCE_BLOCKS_PHASE: 3
|
|
||||||
WP_VERSION: 5.6-branch
|
|
||||||
run: |
|
|
||||||
JSON='{"core": "WordPress/WordPress#'"$WP_VERSION"'"}'
|
|
||||||
echo $JSON > .wp-env.override.json
|
|
||||||
npm run wp-env start
|
|
||||||
npm run wp-env clean all
|
|
||||||
npm run test:e2e
|
|
||||||
|
|
||||||
JSE2ETestsWP55:
|
|
||||||
name: JavaScipt E2E Tests (WP 5.5)
|
|
||||||
needs: Setup
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Cache node modules
|
|
||||||
uses: actions/cache@v2
|
|
||||||
env:
|
|
||||||
cache-name: cache-node-modules
|
|
||||||
with:
|
|
||||||
# npm cache files are stored in `~/.npm` on Linux/macOS
|
|
||||||
path: ~/.npm
|
|
||||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-build-${{ env.cache-name }}-
|
|
||||||
${{ runner.os }}-build-
|
|
||||||
${{ runner.os }}-
|
|
||||||
|
|
||||||
- name: Use Node.js 14.x
|
|
||||||
uses: actions/setup-node@v1
|
|
||||||
with:
|
|
||||||
node-version: 14.x
|
|
||||||
|
|
||||||
- name: Npm install and build
|
|
||||||
run: |
|
|
||||||
npm ci
|
|
||||||
FORCE_REDUCED_MOTION=true npm run build:e2e-test
|
|
||||||
|
|
||||||
- name: blocks.ini setup
|
|
||||||
run: |
|
|
||||||
echo -e 'woocommerce_blocks_phase = 3\nwoocommerce_blocks_env = tests' > blocks.ini
|
|
||||||
- name: Get Composer Cache Directory
|
|
||||||
id: composer-cache
|
|
||||||
run: |
|
|
||||||
echo "::set-output name=dir::$(composer config cache-files-dir)"
|
|
||||||
- uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: ${{ steps.composer-cache.outputs.dir }}
|
|
||||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-composer-
|
|
||||||
|
|
||||||
- name: Set up PHP
|
|
||||||
uses: shivammathur/setup-php@v2
|
|
||||||
with:
|
|
||||||
php-version: 7.4
|
|
||||||
coverage: none
|
|
||||||
tools: composer
|
|
||||||
|
|
||||||
- name: Composer install
|
|
||||||
run: |
|
|
||||||
composer install
|
|
||||||
|
|
||||||
- name: E2E Tests (WP 5.5)
|
|
||||||
env:
|
|
||||||
WOOCOMMERCE_BLOCKS_PHASE: 3
|
|
||||||
WP_VERSION: 5.5-branch
|
|
||||||
run: |
|
|
||||||
JSON='{"core": "WordPress/WordPress#'"$WP_VERSION"'"}'
|
|
||||||
echo $JSON > .wp-env.override.json
|
|
||||||
npm run wp-env start
|
|
||||||
npm run wp-env clean all
|
|
||||||
npm run test:e2e
|
|
||||||
|
|
|
@ -94,8 +94,6 @@ jobs:
|
||||||
echo -e 'woocommerce_blocks_phase = 3\nwoocommerce_blocks_env = tests' > blocks.ini
|
echo -e 'woocommerce_blocks_phase = 3\nwoocommerce_blocks_env = tests' > blocks.ini
|
||||||
|
|
||||||
- name: Run PHP Unit tests
|
- name: Run PHP Unit tests
|
||||||
env:
|
|
||||||
WOO_VERSION: 5.3.0
|
|
||||||
run: |
|
run: |
|
||||||
npm run phpunit
|
npm run phpunit
|
||||||
|
|
||||||
|
|
|
@ -17,11 +17,10 @@ Use this plugin if you want access to the bleeding edge of available blocks for
|
||||||
|
|
||||||
- [Documentation](#documentation)
|
- [Documentation](#documentation)
|
||||||
- [Code Documentation](#code-documentation)
|
- [Code Documentation](#code-documentation)
|
||||||
- [Contributing](#contributing)
|
|
||||||
- [Installing the plugin version](#installing-the-plugin-version)
|
- [Installing the plugin version](#installing-the-plugin-version)
|
||||||
- [Installing the development version](#installing-the-development-version)
|
- [Installing the development version](#installing-the-development-version)
|
||||||
- [Getting started with block development](#getting-started-with-block-development)
|
- [Getting started with block development](#getting-started-with-block-development)
|
||||||
- [Vision for the Feature](#vision-for-the-feature)
|
- [Long-term vision](#long-term-vision)
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
|
@ -40,19 +39,16 @@ If you want to see what we're working on for future versions, or want to help ou
|
||||||
|
|
||||||
We release a new version of WooCommerce Blocks onto WordPress.org every few weeks, which can be used as an easier way to preview the features.
|
We release a new version of WooCommerce Blocks onto WordPress.org every few weeks, which can be used as an easier way to preview the features.
|
||||||
|
|
||||||
> Note: The plugin follows a policy of supporting the "L2" strategy for version support. What this means is that the plugin will support the most recent two minor versions of WordPress, and the most recent two minor versions of WooCommerce core at the time of a release.
|
> Note: The plugin follows a policy of supporting the "L0" strategy for version support. What this means is that the plugin will require the most recent version of WordPress, and the most recent version of WooCommerce core at the time of a release. You can read more about [this policy here](https://developer.woocommerce.com/?p=9998).
|
||||||
>
|
>
|
||||||
> That means if the latest version of WooCommerce is 4.3 at the time of a release, then our minimum version requirements for WooCommerce core would be 4.1+.
|
|
||||||
>
|
|
||||||
> We **recommend** you always keep WordPress and WooCommerce core up to date in order to ensure your store is running with the most recent fixes and enhancements to help your store be successful.
|
|
||||||
|
|
||||||
1. Make sure you have WordPress 5.4+ and WooCommerce 4.3+
|
1. Make sure you have the latest available versions of WordPress and WooCommerce on your site.
|
||||||
2. The plugin version is available on WordPress.org. [Download the plugin version here.](https://wordpress.org/plugins/woo-gutenberg-products-block/)
|
2. The plugin version is available on WordPress.org. [Download the plugin version here.](https://wordpress.org/plugins/woo-gutenberg-products-block/)
|
||||||
3. Activate the plugin.
|
3. Activate the plugin.
|
||||||
|
|
||||||
## Installing the development version
|
## Installing the development version
|
||||||
|
|
||||||
1. Make sure you have WordPress 5.4+ and WooCommerce 4.3+
|
1. Make sure you have the latest versions of WordPress and WooCommerce on your site.
|
||||||
2. Get a copy of this plugin using the green "Clone or download" button on the right.
|
2. Get a copy of this plugin using the green "Clone or download" button on the right.
|
||||||
3. `npm install` to install the dependencies.
|
3. `npm install` to install the dependencies.
|
||||||
4. `composer install` to install core dependencies.
|
4. `composer install` to install core dependencies.
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<exclude-pattern>languages/woo-gutenberg-products-block.php</exclude-pattern>
|
<exclude-pattern>languages/woo-gutenberg-products-block.php</exclude-pattern>
|
||||||
|
|
||||||
<!-- Configs -->
|
<!-- Configs -->
|
||||||
<config name="minimum_supported_wp_version" value="4.7" />
|
<config name="minimum_supported_wp_version" value="5.6" />
|
||||||
<config name="testVersion" value="7.0-" />
|
<config name="testVersion" value="7.0-" />
|
||||||
|
|
||||||
<!-- Rules -->
|
<!-- Rules -->
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
=== WooCommerce Blocks ===
|
=== WooCommerce Blocks ===
|
||||||
Contributors: automattic, woocommerce, claudiulodro, tiagonoronha, jameskoster, ryelle, levinmedia, aljullu, mikejolley, nerrad, joshuawold, assassinateur, haszari
|
Contributors: automattic, woocommerce, claudiulodro, tiagonoronha, jameskoster, ryelle, levinmedia, aljullu, mikejolley, nerrad, joshuawold, assassinateur, haszari
|
||||||
Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks
|
Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks
|
||||||
Requires at least: 5.5
|
Requires at least: 5.8
|
||||||
Tested up to: 5.8
|
Tested up to: 5.8
|
||||||
Requires PHP: 7.0
|
Requires PHP: 7.0
|
||||||
Stable tag: 5.6.0-dev
|
Stable tag: 5.6.0-dev
|
||||||
|
@ -44,8 +44,7 @@ Use this plugin if you want access to the bleeding edge of available blocks for
|
||||||
|
|
||||||
= Minimum Requirements =
|
= Minimum Requirements =
|
||||||
|
|
||||||
* WordPress 5.5 or greater
|
* Latest release versions of WordPress and WooCommerce ([read more here](https://developer.woocommerce.com/?p=9998))
|
||||||
* WooCommerce 4.3 or greater
|
|
||||||
* PHP version 7.0 or greater (PHP 7.4 or greater is recommended)
|
* PHP version 7.0 or greater (PHP 7.4 or greater is recommended)
|
||||||
* MySQL version 5.6 or greater
|
* MySQL version 5.6 or greater
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,31 @@ class Bootstrap {
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
protected function has_core_dependencies() {
|
protected function has_core_dependencies() {
|
||||||
return class_exists( 'WooCommerce' ) && function_exists( 'register_block_type' );
|
$has_needed_dependencies = class_exists( 'WooCommerce' );
|
||||||
|
if ( $has_needed_dependencies ) {
|
||||||
|
$plugin_data = \get_file_data(
|
||||||
|
$this->package->get_path( 'woocommerce-gutenberg-products-block.php' ),
|
||||||
|
[
|
||||||
|
'RequiredWCVersion' => 'WC requires at least',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
if ( isset( $plugin_data['RequiredWCVersion'] ) && version_compare( \WC()->version, $plugin_data['RequiredWCVersion'], '<' ) ) {
|
||||||
|
$has_needed_dependencies = false;
|
||||||
|
add_action(
|
||||||
|
'admin_notices',
|
||||||
|
function() {
|
||||||
|
if ( should_display_compatibility_notices() ) {
|
||||||
|
?>
|
||||||
|
<div class="notice notice-error">
|
||||||
|
<p><?php esc_html_e( 'The WooCommerce Blocks feature plugin requires a more recent version of WooCommerce and has been paused. Please update WooCommerce to the latest version to continue enjoying WooCommerce Blocks.', 'woo-gutenberg-products-block' ); ?></p>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $has_needed_dependencies;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
use Automattic\WooCommerce\Proxies\LegacyProxy;
|
||||||
|
use Automattic\WooCommerce\Testing\Tools\DependencyManagement\MockableLegacyProxy;
|
||||||
/**
|
/**
|
||||||
* PHPUnit bootstrap file
|
* PHPUnit bootstrap file
|
||||||
*
|
*
|
||||||
|
@ -83,6 +85,35 @@ function wc_test_includes() {
|
||||||
require_once $wc_tests_framework_base_dir . '/framework/helpers/class-wc-helper-settings.php';
|
require_once $wc_tests_framework_base_dir . '/framework/helpers/class-wc-helper-settings.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Re-initialize the dependency injection engine.
|
||||||
|
*
|
||||||
|
* The dependency injection engine has been already initialized as part of the Woo initialization, but we need
|
||||||
|
* to replace the registered read-only container with a fully configurable one for testing.
|
||||||
|
* To this end we hack a bit and use reflection to grab the underlying container that the read-only one stores
|
||||||
|
* in a private property.
|
||||||
|
*
|
||||||
|
* Additionally, we replace the legacy/function proxies with mockable versions to easily replace anything
|
||||||
|
* in tests as appropriate.
|
||||||
|
*
|
||||||
|
* @throws \Exception The Container class doesn't have a 'container' property.
|
||||||
|
*/
|
||||||
|
function wc_blocks_initialize_dependency_injection() {
|
||||||
|
try {
|
||||||
|
$inner_container_property = new \ReflectionProperty( \Automattic\WooCommerce\Container::class, 'container' );
|
||||||
|
} catch ( ReflectionException $ex ) {
|
||||||
|
throw new \Exception( "Error when trying to get the private 'container' property from the " . \Automattic\WooCommerce\Container::class . ' class using reflection during unit testing bootstrap, has the property been removed or renamed?' );
|
||||||
|
}
|
||||||
|
|
||||||
|
$inner_container_property->setAccessible( true );
|
||||||
|
$inner_container = $inner_container_property->getValue( wc_get_container() );
|
||||||
|
|
||||||
|
$inner_container->replace( LegacyProxy::class, MockableLegacyProxy::class );
|
||||||
|
$inner_container->reset_all_resolved();
|
||||||
|
|
||||||
|
$GLOBALS['wc_container'] = $inner_container;
|
||||||
|
}
|
||||||
|
|
||||||
function wc_load_core() {
|
function wc_load_core() {
|
||||||
define( 'WC_TAX_ROUNDING_MODE', 'auto' );
|
define( 'WC_TAX_ROUNDING_MODE', 'auto' );
|
||||||
define( 'WC_USE_TRANSACTIONS', false );
|
define( 'WC_USE_TRANSACTIONS', false );
|
||||||
|
@ -119,3 +150,4 @@ tests_add_filter( 'setup_theme', 'wc_install_core' );
|
||||||
// Start up the WP testing environment.
|
// Start up the WP testing environment.
|
||||||
require $_tests_dir . '/includes/bootstrap.php';
|
require $_tests_dir . '/includes/bootstrap.php';
|
||||||
wc_test_includes();
|
wc_test_includes();
|
||||||
|
wc_blocks_initialize_dependency_injection();
|
||||||
|
|
|
@ -7,9 +7,9 @@
|
||||||
* Author: Automattic
|
* Author: Automattic
|
||||||
* Author URI: https://woocommerce.com
|
* Author URI: https://woocommerce.com
|
||||||
* Text Domain: woo-gutenberg-products-block
|
* Text Domain: woo-gutenberg-products-block
|
||||||
* Requires at least: 5.5
|
* Requires at least: 5.8
|
||||||
* Requires PHP: 7.0
|
* Requires PHP: 7.0
|
||||||
* WC requires at least: 5.2
|
* WC requires at least: 5.5
|
||||||
* WC tested up to: 5.5
|
* WC tested up to: 5.5
|
||||||
*
|
*
|
||||||
* @package WooCommerce\Blocks
|
* @package WooCommerce\Blocks
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
defined( 'ABSPATH' ) || exit;
|
defined( 'ABSPATH' ) || exit;
|
||||||
|
|
||||||
$minimum_wp_version = '5.5';
|
$minimum_wp_version = '5.8';
|
||||||
|
|
||||||
if ( ! defined( 'WC_BLOCKS_IS_FEATURE_PLUGIN' ) ) {
|
if ( ! defined( 'WC_BLOCKS_IS_FEATURE_PLUGIN' ) ) {
|
||||||
define( 'WC_BLOCKS_IS_FEATURE_PLUGIN', true );
|
define( 'WC_BLOCKS_IS_FEATURE_PLUGIN', true );
|
||||||
|
@ -54,8 +54,8 @@ if ( version_compare( $GLOBALS['wp_version'], $minimum_wp_version, '<' ) ) {
|
||||||
function woocommerce_blocks_admin_unsupported_wp_notice() {
|
function woocommerce_blocks_admin_unsupported_wp_notice() {
|
||||||
if ( should_display_compatibility_notices() ) {
|
if ( should_display_compatibility_notices() ) {
|
||||||
?>
|
?>
|
||||||
<div class="notice notice-error is-dismissible">
|
<div class="notice notice-error">
|
||||||
<p><?php esc_html_e( 'WooCommerce Blocks requires a more recent version of WordPress and has been paused. Please update WordPress to continue enjoying WooCommerce Blocks.', 'woo-gutenberg-products-block' ); ?></p>
|
<p><?php esc_html_e( 'The WooCommerce Blocks feature plugin requires a more recent version of WordPress and has been paused. Please update WordPress to continue enjoying WooCommerce Blocks.', 'woo-gutenberg-products-block' ); ?></p>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue