This branch is now 2.1.8-bleeding
For customer search, join once. Performance increase.
Use `woocommerce_valid_order_statuses_for_payment` in `pay_action` too

Even though it was possible to filter the statuses in my-order.php and other places,
it was not possible in the actual pay action.
Introduce `woocommerce_valid_order_statuses_for_payment_complete` filter

Since it's possible to filter the valid order statuses for payments and cancels,
it only makes sense to be able to do the same when checking which statuses
are valid for completing a payment.
Introduce `woocommerce_thankyou_order_received_text` filter
Supply order to thankyou text filter, if available
Backorders at variation level

Added a new select metabox for variations allowing users to control
backorders at the variation level.
Might need more testing.
ref: #5351
Template cleanup
Print notices in view order template Closes #5348
[2.2] Protect admins from shop managers

Closes #5322
Change label and add description Closes #4698
Reverse calculator check Closes #5323
Merge pull request #5334 from ragulka/valid-order-statuses-improvements

Valid order statuses improvements
URL decode when viewing order attributes to prevent taxonomies not being found

Closes #5315
If billing email is not set and user ID is set, use email

Fixes #5356
Change the way order review data is appended to checkout to reduce likelihood of error

Fixes #5332
Merge pull request #5338 from ragulka/thankyou-filters

Introduce `woocommerce_thankyou_order_received_text` filter
typecast $used_by to array in case its not set. Closes #5350
Check has_file when sending order emails for downloadables

Fixes #5296
Allow saving no downloads, if unset

#5296