Skip to content
This repository was archived by the owner on Jun 15, 2022. It is now read-only.

Commit 3da3411

Browse files
committed
Merge branch 'release/1.0.0-rc1'
2 parents 1c79a68 + 39009dc commit 3da3411

27 files changed

+4119
-1184
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
5+
---
6+
7+
**Describe the bug**
8+
A clear and concise description of what the bug is.
9+
10+
**To Reproduce**
11+
Steps to reproduce the behavior:
12+
1. Go to '...'
13+
2. Click on '....'
14+
3. Scroll down to '....'
15+
4. See error
16+
17+
**Expected behavior**
18+
A clear and concise description of what you expected to happen.
19+
20+
**Screenshots**
21+
If applicable, add screenshots to help explain your problem.
22+
23+
**Versions**
24+
- WordPress version
25+
- WooCommerce version
26+
- Plugin version [e.g. "1.0.0 (Beta 3)" or "develop @ 027c6aa"]
27+
28+
**Additional context**
29+
Add any other context about the problem here.

.travis.yml

Lines changed: 42 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,43 @@ cache:
99
directories:
1010
- $HOME/.composer/cache
1111

12+
php:
13+
- 7.2
14+
- 7.1
15+
- 7.0
16+
17+
env:
18+
- WP_VERSION=latest WC_VERSION=latest
19+
- WP_VERSION=latest WC_VERSION=3.4.5
20+
- WP_VERSION=latest WC_VERSION=3.3.5
21+
- WP_VERSION=latest WC_VERSION=3.2.6
22+
1223
matrix:
1324
fast_finish: true
1425
include:
15-
- php: 7.2
16-
env: WP_VERSION=trunk WP_MULTISITE=0 WC_VERSION=latest RUN_PHPCS=1
17-
- php: 7.2
18-
env: WP_VERSION=trunk WP_MULTISITE=1 WC_VERSION=latest
19-
- php: 7.1
20-
env: WP_VERSION=latest WP_MULTISITE=0 WC_VERSION=latest
21-
- php: 7.1
22-
env: WP_VERSION=latest WP_MULTISITE=0 WC_VERSION=3.2.6
23-
- php: 7.0
24-
env: WP_VERSION=latest WP_MULTISITE=0 WC_VERSION=latest
25-
26-
# The following WooCommerce core test currently fails in multisite, with or without this
27-
# plugin being active:
28-
#
29-
# PHP 7.2, WP_VERSION=trunk WP_MULTISITE=1 WC_VERSION=latest
30-
# - WC_Tests_Setup_Functions::test_wizard_in_cart_payment_gateways()
31-
#
32-
# PHP 7.1, WP_VERSION=latest WP_MULTISITE=0 WC_VERSION=3.2.6
33-
# - WC_Tests_CRUD_Orders::test_get_billing_email
34-
allow_failures:
35-
- php: 7.2
36-
env: WP_VERSION=trunk WP_MULTISITE=1 WC_VERSION=latest
26+
- name: Coding Standards
27+
php: 7.2
28+
env: WP_VERSION=trunk WC_VERSION=latest RUN_PHPCS=1
29+
# Generate code coverage from PHP 7.1.
30+
- name: Code Coverage
31+
php: 7.2
32+
env: WP_VERSION=latest WP_MULTISITE=0 WC_VERSION=latest RUN_CODE_COVERAGE=1
3733

34+
allow_failures:
35+
- name: Code Coverage
36+
php: 7.2
37+
env: WP_VERSION=latest WP_MULTISITE=0 WC_VERSION=latest RUN_CODE_COVERAGE=1
3838

3939
before_script:
4040
- export PATH="$HOME/.composer/vendor/bin:$PATH"
41-
- phpenv config-rm xdebug.ini
41+
- |
42+
if [[ ${RUN_CODE_COVERAGE} ]]; then
43+
wget https://github.com/php-coveralls/php-coveralls/releases/download/v1.0.0/coveralls.phar
44+
chmod +x coveralls.phar
45+
mkdir -p build/logs
46+
else
47+
phpenv config-rm xdebug.ini
48+
fi
4249
- |
4350
if [[ ${GITHUB_AUTH_TOKEN} != '' ]]; then
4451
composer config -g github-oauth.github.com $GITHUB_AUTH_TOKEN
@@ -48,8 +55,19 @@ before_script:
4855
- composer install --prefer-source
4956

5057
script:
51-
- phpunit
58+
- |
59+
if [[ ${RUN_CODE_COVERAGE} ]]; then
60+
./vendor/bin/phpunit --coverage-clover build/logs/clover.xml
61+
else
62+
./vendor/bin/phpunit
63+
fi
5264
- |
5365
if [[ ${RUN_PHPCS} == 1 ]]; then
5466
./vendor/bin/phpcs
5567
fi
68+
69+
after_success:
70+
- |
71+
if [[ ${RUN_CODE_COVERAGE} ]]; then
72+
travis_retry php coveralls.phar
73+
fi

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## [Version 1.0.0 (Release Candidate)] - 2018-09-25
9+
10+
* Major refactoring of the WP-CLI migration commands ([#61], [#79], [#81]).
11+
* Database table optimizations ([#65], props @raunak-gupta).
12+
* Prevent duplicate IDs when saving orders and refunds ([#64]).
13+
* Ensure that order refunds are also stored in the custom orders table ([#52]).
14+
* Ensure the custom orders table is registered within WooCommerce ([#50]).
15+
* Resolve issue in CLI importer where a `false` value from `wc_get_order()` could cause a fatal error ([#43] & [#46], props @zacscott).
16+
* Fix bug where orders with the same post date could be handled in the wrong order during migration ([#84]).
17+
* Prevent customer notes from being deleted during migration ([#82]).
18+
* Bump the "WC tested up to" version to 3.5.0 ([#80]).
19+
* Major refactoring within the plugin test suite ([#51], [#53], [#60], [#72], [#78]).
20+
* Prevent Travis CI from using PHPUnit 7.0 [until the WordPress core test suite can support it, too](https://core.trac.wordpress.org/ticket/43218).
21+
22+
[This release also restores the repo development history](https://github.com/liquidweb/woocommerce-custom-orders-table/pull/63) prior to [Version 1.0.0 (Beta 1)], ensuring that the team @Mindsize is credited appropriately for their work.
23+
824
## [Version 1.0.0 (Beta 3)] - 2018-01-23
925

1026
* Plugin test suite now extends the WooCommerce core test suite, ensuring WooCommerce behaves as expected when the plugin is active ([#26]).
@@ -32,6 +48,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
3248

3349

3450
[Unreleased]: https://github.com/liquidweb/woocommerce-order-tables/compare/master...develop
51+
[Version 1.0.0 (Release Candidate)]: https://github.com/liquidweb/woocommerce-order-tables/releases/tag/v1.0.0-rc1
3552
[Version 1.0.0 (Beta 3)]: https://github.com/liquidweb/woocommerce-order-tables/releases/tag/v1.0.0-beta.3
3653
[Version 1.0.0 (Beta 2)]: https://github.com/liquidweb/woocommerce-order-tables/releases/tag/v1.0.0-beta.2
3754
[Version 1.0.0 (Beta 1)]: https://github.com/liquidweb/woocommerce-order-tables/releases/tag/v1.0.0-beta.1
@@ -46,3 +63,20 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
4663
[#35]: https://github.com/liquidweb/woocommerce-order-tables/pull/35
4764
[#36]: https://github.com/liquidweb/woocommerce-order-tables/pull/36
4865
[#38]: https://github.com/liquidweb/woocommerce-order-tables/pull/38
66+
[#43]: https://github.com/liquidweb/woocommerce-order-tables/issues/43
67+
[#46]: https://github.com/liquidweb/woocommerce-order-tables/pull/46
68+
[#50]: https://github.com/liquidweb/woocommerce-order-tables/pull/50
69+
[#51]: https://github.com/liquidweb/woocommerce-order-tables/pull/51
70+
[#52]: https://github.com/liquidweb/woocommerce-order-tables/pull/52
71+
[#53]: https://github.com/liquidweb/woocommerce-order-tables/pull/53
72+
[#60]: https://github.com/liquidweb/woocommerce-order-tables/pull/60
73+
[#61]: https://github.com/liquidweb/woocommerce-order-tables/pull/61
74+
[#64]: https://github.com/liquidweb/woocommerce-order-tables/pull/64
75+
[#65]: https://github.com/liquidweb/woocommerce-order-tables/pull/65
76+
[#72]: https://github.com/liquidweb/woocommerce-order-tables/pull/72
77+
[#78]: https://github.com/liquidweb/woocommerce-order-tables/pull/78
78+
[#79]: https://github.com/liquidweb/woocommerce-order-tables/pull/79
79+
[#80]: https://github.com/liquidweb/woocommerce-order-tables/pull/80
80+
[#81]: https://github.com/liquidweb/woocommerce-order-tables/pull/81
81+
[#82]: https://github.com/liquidweb/woocommerce-order-tables/pull/82
82+
[#84]: https://github.com/liquidweb/woocommerce-order-tables/pull/84

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ When submitting pull requests, please include relevant tests for your new featur
5656

5757
#### Test coverage
5858

59+
[![Coverage Status](https://coveralls.io/repos/github/liquidweb/woocommerce-custom-orders-table/badge.svg?branch=develop)](https://coveralls.io/github/liquidweb/woocommerce-custom-orders-table?branch=develop)
60+
5961
To generate a code coverage report (test coverage percentage as well as areas of untested or under-tested code that could pose risk), you run the following:
6062

6163
```sh

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# WooCommerce Custom Orders Table
22

33
[![Build Status](https://travis-ci.org/liquidweb/woocommerce-custom-orders-table.svg?branch=develop)](https://travis-ci.org/liquidweb/woocommerce-custom-orders-table)
4+
[![Coverage Status](https://coveralls.io/repos/github/liquidweb/woocommerce-custom-orders-table/badge.svg?branch=feature%2Fcode-coverage)](https://coveralls.io/github/liquidweb/woocommerce-custom-orders-table?branch=feature%2Fcode-coverage)
45

56
This plugin improves WooCommerce performance by introducing a custom table to hold all of the most common order information in a single, properly-indexed location.
67

@@ -31,24 +32,28 @@ The easiest way to accomplish this is via [WP-CLI](http://wp-cli.org/), and the
3132
If you'd like to see the number of orders that have yet to be moved into the orders table, you can quickly retrieve this value with the `count` command:
3233

3334
```
34-
$ wp wc-order-table count
35+
$ wp wc orders-table count
3536
```
3637

3738
### Migrate order data from post meta to the orders table
3839

3940
The `migrate` command will flatten the most common post meta values for WooCommerce orders into a flat database table, optimized for performance.
4041

4142
```
42-
$ wp wc-order-table migrate
43+
$ wp wc orders-table migrate
4344
```
4445

45-
Orders are queried in batches (determined via the `--batch-size` option) in order to reduce the memory footprint of the command (e.g. "only retrieve {$size} orders at a time). Some environments may require a lower value than the default of 1000.
46+
Orders are queried in batches (determined via the `--batch-size` option) in order to reduce the memory footprint of the command (e.g. "only retrieve `$size` orders at a time"). Some environments may require a lower value than the default of 100.
47+
48+
**Please note** that `migrate` will delete the original order post meta rows after a successful migration. If you want to preserve these, include the `--save-post-meta` flag!
4649

4750
#### Options
4851

4952
<dl>
50-
<dt>batch-size</dt>
51-
<dd>The number of orders to process in each batch. Default is 1000 orders.</dd>
53+
<dt>--batch-size=&lt;size&gt;</dt>
54+
<dd>The number of orders to process in each batch. Default is 100 orders per batch.</dd>
55+
<dt>--save-post-meta</dt>
56+
<dd>Preserve the original post meta after a successful migration. Default behavior is to clean up post meta.</dd>
5257
</dl>
5358

5459

@@ -57,18 +62,16 @@ Orders are queried in batches (determined via the `--batch-size` option) in orde
5762
If you require the post meta fields to be present (or are removing the custom orders table plugin), you may rollback the migration at any time with the `backfill` command.
5863

5964
```
60-
$ wp wc-order-table backfill
65+
$ wp wc orders-table backfill
6166
```
6267

6368
This command does the opposite of `migrate`, looping through the orders table and saving each column into the corresponding post meta key. Be aware that this may dramatically increase the size of your post meta table!
6469

6570
#### Options
6671

6772
<dl>
68-
<dt>batch-size</dt>
69-
<dd>The number of orders to process in each batch. Default is 1000 orders.</dd>
70-
<dt>batch</dt>
71-
<dd>The batch number to start from when migrating data. Default is 1.</dd>
73+
<dt>--batch-size=&lt;size&gt;</dt>
74+
<dd>The number of orders to process in each batch. Default is 100 orders per batch.</dd>
7275
</dl>
7376

7477
## Contributing

composer.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,15 @@
33
"description": "Store WooCommerce order data in a custom table for improved performance",
44
"type": "wordpress-plugin",
55
"license": "GPL-2.0-only",
6-
"repositories": [
7-
{
8-
"type": "vcs",
9-
"url": "https://github.com/liquidweb/woocommerce"
10-
}
11-
],
126
"require-dev": {
137
"php": "^7.0",
148
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
9+
"phpunit/phpunit": "6.2.3",
1510
"wimg/php-compatibility": "^8.1",
16-
"woocommerce/woocommerce": "dev-feature/more-order-tests",
11+
"woocommerce/woocommerce": "dev-master",
1712
"woocommerce/woocommerce-git-hooks": "*",
1813
"woocommerce/woocommerce-sniffs": "^0.0.1",
14+
"wp-cli/wp-cli": "^2.0",
1915
"wp-coding-standards/wpcs": "^0.14"
2016
},
2117
"autoload-dev": {
@@ -44,6 +40,12 @@
4440
"phpunit --testsuite=plugin --coverage-html=tests/coverage"
4541
]
4642
},
43+
"config": {
44+
"sort-packages": true,
45+
"platform": {
46+
"php": "7.0"
47+
}
48+
},
4749
"extra": {
4850
"installer-paths": {
4951
"vendor/{$vendor}/{$name}": [

0 commit comments

Comments
 (0)