1a394fbe02
The function wc_orders_count() is called on every admin page. WooCommerce core uses it to count only orders with the status 'processing' and typically a site has only a few of those orders. But since wc_orders_count() calls internally wp_post_count() this means that MySQL will have to count the number of orders of all status. Thus, in a site with a significant number of orders, this query can be slow. This commit changes wc_orders_count() function to query directly the database to get the number of orders for a given status instead of using wp_post_count(). On a WooCommerce installation I manage, the old query takes about 2 seconds to run and the new query takes 0.002 seconds. |
||
---|---|---|
.github | ||
apigen | ||
assets | ||
dummy-data | ||
i18n | ||
includes | ||
templates | ||
tests | ||
.codeclimate.yml | ||
.coveralls.yml | ||
.editorconfig | ||
.gitignore | ||
.jshintrc | ||
.scrutinizer.yml | ||
.travis.yml | ||
CHANGELOG.txt | ||
Gruntfile.js | ||
README.md | ||
apigen.neon | ||
license.txt | ||
package.json | ||
phpunit.xml | ||
phpunit.xml.dist | ||
readme.txt | ||
uninstall.php | ||
woocommerce.php |
README.md
WooCommerce
Welcome to the WooCommerce repository on GitHub. Here you can browse the source, look at open issues and keep track of development. We recommend all developers to follow the WooCommerce development blog to stay up to date about everything happening in the project. You can also follow @DevelopWC on Twitter for the latest development updates.
If you are not a developer, please use the WooCommerce plugin page on WordPress.org.
Documentation
- WooCommerce Documentation
- WooCommerce Knowledge Base
- WooCommerce Code Reference
- WooCommerce REST API Docs
Support
This repository is not suitable for support. Please don't use our issue tracker for support requests, but for core WooCommerce issues only. Support can take place in the appropriate channels:
- The WooThemes premium support portal for customers who have purchased themes or extensions.
- Our community forum on wp.org which is available for all WooCommerce users.
Support requests in issues on this repository will be closed on sight.
Contributing to WooCommerce
If you have a patch, or stumbled upon an issue with WooCommerce core, you can contribute this back to the code. Please read our contributor guidelines for more information how you can do this.
If you have an idea for WooCommerce, see the Roadmap Trello board.