• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

woothemes / woocommerce / 8098
23%
master: 53%

Build:
Build:
LAST BUILD BRANCH: discount-calculation
DEFAULT BRANCH: master
Ran 15 Jul 2016 01:41PM UTC
Jobs 6
Files 141
Run time 4046min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
8098

push

travis-ci

rodrigoprimo
Cache the result of WC_Comments::wp_count_comments() in a transient

The query to count comments inside WC_Comments::wp_count_comments() is super slow when the site has a significant number of comments (for example, this query takes about 5s to run on WooCommerce.com with 70k comments) and this is a problem specially considering that this method is called on every admin page.

This commit changes WC_Comments::wp_count_comments() to store the comments count in a transient. With this change, the method will run the query to count comments only if the number of comments or their statuses had changed. Before this commit, WC_Comments::wp_count_comments() would run the database query every time a admin page was requested.

26 of 26 new or added lines in 1 file covered. (100.0%)

6538 of 28907 relevant lines covered (22.62%)

6.5 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
24
100.0
includes/class-wc-comments.php
Jobs
ID Job ID Ran Files Coverage
2 8098.2 (WP_VERSION=latest WP_MULTISITE=0) 18 Jul 2016 08:57AM UTC 0
22.11
Travis Job 8098.2
3 8098.3 (WP_VERSION=latest WP_MULTISITE=0) 18 Jul 2016 08:57AM UTC 0
22.11
Travis Job 8098.3
4 8098.4 (WP_VERSION=latest WP_MULTISITE=0) 15 Jul 2016 01:35PM UTC 0
22.11
Travis Job 8098.4
5 8098.5 (WP_VERSION=latest WP_MULTISITE=0) 18 Jul 2016 08:57AM UTC 0
22.11
Travis Job 8098.5
7 8098.7 (WP_VERSION=latest WP_MULTISITE=0) 18 Jul 2016 09:00AM UTC 0
65.26
Travis Job 8098.7
8 8098.8 (WP_VERSION=latest WP_MULTISITE=1) 18 Jul 2016 09:02AM UTC 0
22.14
Travis Job 8098.8
Source Files on build 8098
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #8098
  • 7318235f on github
  • Next Build on code-style/improve-wp-count-comments (#8099)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc