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

Commit

Permalink
Merge branch 'release/1.0.0-rc1'
Browse files Browse the repository at this point in the history
  • Loading branch information
stevegrunwell committed Sep 25, 2018
2 parents 1c79a68 + 39009dc commit 3da3411
Show file tree
Hide file tree
Showing 27 changed files with 4,119 additions and 1,184 deletions.
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/Bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Bug report
about: Create a report to help us improve

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Versions**
- WordPress version
- WooCommerce version
- Plugin version [e.g. "1.0.0 (Beta 3)" or "develop @ 027c6aa"]

**Additional context**
Add any other context about the problem here.
66 changes: 42 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,43 @@ cache:
directories:
- $HOME/.composer/cache

php:
- 7.2
- 7.1
- 7.0

env:
- WP_VERSION=latest WC_VERSION=latest
- WP_VERSION=latest WC_VERSION=3.4.5
- WP_VERSION=latest WC_VERSION=3.3.5
- WP_VERSION=latest WC_VERSION=3.2.6

matrix:
fast_finish: true
include:
- php: 7.2
env: WP_VERSION=trunk WP_MULTISITE=0 WC_VERSION=latest RUN_PHPCS=1
- php: 7.2
env: WP_VERSION=trunk WP_MULTISITE=1 WC_VERSION=latest
- php: 7.1
env: WP_VERSION=latest WP_MULTISITE=0 WC_VERSION=latest
- php: 7.1
env: WP_VERSION=latest WP_MULTISITE=0 WC_VERSION=3.2.6
- php: 7.0
env: WP_VERSION=latest WP_MULTISITE=0 WC_VERSION=latest

# The following WooCommerce core test currently fails in multisite, with or without this
# plugin being active:
#
# PHP 7.2, WP_VERSION=trunk WP_MULTISITE=1 WC_VERSION=latest
# - WC_Tests_Setup_Functions::test_wizard_in_cart_payment_gateways()
#
# PHP 7.1, WP_VERSION=latest WP_MULTISITE=0 WC_VERSION=3.2.6
# - WC_Tests_CRUD_Orders::test_get_billing_email
allow_failures:
- php: 7.2
env: WP_VERSION=trunk WP_MULTISITE=1 WC_VERSION=latest
- name: Coding Standards
php: 7.2
env: WP_VERSION=trunk WC_VERSION=latest RUN_PHPCS=1
# Generate code coverage from PHP 7.1.
- name: Code Coverage
php: 7.2
env: WP_VERSION=latest WP_MULTISITE=0 WC_VERSION=latest RUN_CODE_COVERAGE=1

allow_failures:
- name: Code Coverage
php: 7.2
env: WP_VERSION=latest WP_MULTISITE=0 WC_VERSION=latest RUN_CODE_COVERAGE=1

before_script:
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- phpenv config-rm xdebug.ini
- |
if [[ ${RUN_CODE_COVERAGE} ]]; then
wget https://github.com/php-coveralls/php-coveralls/releases/download/v1.0.0/coveralls.phar
chmod +x coveralls.phar
mkdir -p build/logs
else
phpenv config-rm xdebug.ini
fi
- |
if [[ ${GITHUB_AUTH_TOKEN} != '' ]]; then
composer config -g github-oauth.github.com $GITHUB_AUTH_TOKEN
Expand All @@ -48,8 +55,19 @@ before_script:
- composer install --prefer-source

script:
- phpunit
- |
if [[ ${RUN_CODE_COVERAGE} ]]; then
./vendor/bin/phpunit --coverage-clover build/logs/clover.xml
else
./vendor/bin/phpunit
fi
- |
if [[ ${RUN_PHPCS} == 1 ]]; then
./vendor/bin/phpcs
fi
after_success:
- |
if [[ ${RUN_CODE_COVERAGE} ]]; then
travis_retry php coveralls.phar
fi
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Version 1.0.0 (Release Candidate)] - 2018-09-25

* Major refactoring of the WP-CLI migration commands ([#61], [#79], [#81]).
* Database table optimizations ([#65], props @raunak-gupta).
* Prevent duplicate IDs when saving orders and refunds ([#64]).
* Ensure that order refunds are also stored in the custom orders table ([#52]).
* Ensure the custom orders table is registered within WooCommerce ([#50]).
* Resolve issue in CLI importer where a `false` value from `wc_get_order()` could cause a fatal error ([#43] & [#46], props @zacscott).
* Fix bug where orders with the same post date could be handled in the wrong order during migration ([#84]).
* Prevent customer notes from being deleted during migration ([#82]).
* Bump the "WC tested up to" version to 3.5.0 ([#80]).
* Major refactoring within the plugin test suite ([#51], [#53], [#60], [#72], [#78]).
* 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).

[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.

## [Version 1.0.0 (Beta 3)] - 2018-01-23

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


[Unreleased]: https://github.com/liquidweb/woocommerce-order-tables/compare/master...develop
[Version 1.0.0 (Release Candidate)]: https://github.com/liquidweb/woocommerce-order-tables/releases/tag/v1.0.0-rc1
[Version 1.0.0 (Beta 3)]: https://github.com/liquidweb/woocommerce-order-tables/releases/tag/v1.0.0-beta.3
[Version 1.0.0 (Beta 2)]: https://github.com/liquidweb/woocommerce-order-tables/releases/tag/v1.0.0-beta.2
[Version 1.0.0 (Beta 1)]: https://github.com/liquidweb/woocommerce-order-tables/releases/tag/v1.0.0-beta.1
Expand All @@ -46,3 +63,20 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
[#35]: https://github.com/liquidweb/woocommerce-order-tables/pull/35
[#36]: https://github.com/liquidweb/woocommerce-order-tables/pull/36
[#38]: https://github.com/liquidweb/woocommerce-order-tables/pull/38
[#43]: https://github.com/liquidweb/woocommerce-order-tables/issues/43
[#46]: https://github.com/liquidweb/woocommerce-order-tables/pull/46
[#50]: https://github.com/liquidweb/woocommerce-order-tables/pull/50
[#51]: https://github.com/liquidweb/woocommerce-order-tables/pull/51
[#52]: https://github.com/liquidweb/woocommerce-order-tables/pull/52
[#53]: https://github.com/liquidweb/woocommerce-order-tables/pull/53
[#60]: https://github.com/liquidweb/woocommerce-order-tables/pull/60
[#61]: https://github.com/liquidweb/woocommerce-order-tables/pull/61
[#64]: https://github.com/liquidweb/woocommerce-order-tables/pull/64
[#65]: https://github.com/liquidweb/woocommerce-order-tables/pull/65
[#72]: https://github.com/liquidweb/woocommerce-order-tables/pull/72
[#78]: https://github.com/liquidweb/woocommerce-order-tables/pull/78
[#79]: https://github.com/liquidweb/woocommerce-order-tables/pull/79
[#80]: https://github.com/liquidweb/woocommerce-order-tables/pull/80
[#81]: https://github.com/liquidweb/woocommerce-order-tables/pull/81
[#82]: https://github.com/liquidweb/woocommerce-order-tables/pull/82
[#84]: https://github.com/liquidweb/woocommerce-order-tables/pull/84
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ When submitting pull requests, please include relevant tests for your new featur

#### Test coverage

[![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)

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:

```sh
Expand Down
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# WooCommerce Custom Orders Table

[![Build Status](https://travis-ci.org/liquidweb/woocommerce-custom-orders-table.svg?branch=develop)](https://travis-ci.org/liquidweb/woocommerce-custom-orders-table)
[![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)

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.

Expand Down Expand Up @@ -31,24 +32,28 @@ The easiest way to accomplish this is via [WP-CLI](http://wp-cli.org/), and the
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:

```
$ wp wc-order-table count
$ wp wc orders-table count
```

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

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

```
$ wp wc-order-table migrate
$ wp wc orders-table migrate
```

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.
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.

**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!

#### Options

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


Expand All @@ -57,18 +62,16 @@ Orders are queried in batches (determined via the `--batch-size` option) in orde
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.

```
$ wp wc-order-table backfill
$ wp wc orders-table backfill
```

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!

#### Options

<dl>
<dt>batch-size</dt>
<dd>The number of orders to process in each batch. Default is 1000 orders.</dd>
<dt>batch</dt>
<dd>The batch number to start from when migrating data. Default is 1.</dd>
<dt>--batch-size=&lt;size&gt;</dt>
<dd>The number of orders to process in each batch. Default is 100 orders per batch.</dd>
</dl>

## Contributing
Expand Down
16 changes: 9 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,15 @@
"description": "Store WooCommerce order data in a custom table for improved performance",
"type": "wordpress-plugin",
"license": "GPL-2.0-only",
"repositories": [
{
"type": "vcs",
"url": "https://github.com/liquidweb/woocommerce"
}
],
"require-dev": {
"php": "^7.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
"phpunit/phpunit": "6.2.3",
"wimg/php-compatibility": "^8.1",
"woocommerce/woocommerce": "dev-feature/more-order-tests",
"woocommerce/woocommerce": "dev-master",
"woocommerce/woocommerce-git-hooks": "*",
"woocommerce/woocommerce-sniffs": "^0.0.1",
"wp-cli/wp-cli": "^2.0",
"wp-coding-standards/wpcs": "^0.14"
},
"autoload-dev": {
Expand Down Expand Up @@ -44,6 +40,12 @@
"phpunit --testsuite=plugin --coverage-html=tests/coverage"
]
},
"config": {
"sort-packages": true,
"platform": {
"php": "7.0"
}
},
"extra": {
"installer-paths": {
"vendor/{$vendor}/{$name}": [
Expand Down
Loading

0 comments on commit 3da3411

Please sign in to comment.