Closed chxzqw closed 6 years ago
Hi Sid,
You say that your wp_comments is empty, but I can see in your status report that
wp_comments: Data: 0.02MB + Index: 0.09MB
which shows that most likely there are some rows in the wp_comments
table.
WooCommerce also uses wp_comments to store order notes and webhook_delivery notes, so maybe those are not correctly filtered out when the comments are displayed in your installation in case there is some conflict with other plugins. Can you please check if the table wp_comments is really empty?
Additionally, it looks like the number of comments is cached in a transient. Can you please try to Clear transients and see if the problem gets solved (in admin, WooCommerce > Status > Tools > Clear transients)?
Last, I can see you're using WPML Multilingual CMS
plugin, which might be filtering out comments in other languages, so that might also be a reason why you see no comments in your admin, even though they are probably somewhere in the database.
However, I could not reproduce this issue on a clean WordPress with WooCommerce installation, so I will close this ticket now. Feel free to create a new ticket if you find out this is a WooCommerce bug.
Hi Peter,
Thank you for your time reading my post.
I didn't notice that the status report says that wp_comments
has got some 'hidden' data usage however I am sure that wp_comments
table is empty. Below is the screenshot from phpmyadmin
.
I have just tried both the 2 'Clear transients' from WooCommerce status tools page but no luck.
I am already aware of that WPML plugins could cause the issue. However as long as WooCommerce is activated, the wrong count appears, while WooCommerce is deactivated, the count is gone and it doesn't matter WPML plugins are activated or not. So I think it relates to WooCommerce.
This site is just immigrated from other VPS and I used duplicator to do the job, which might cause the issue?
Any help is appreciated.
Hi,
Have you tried it the other way around, i.e. to disable all plugins and then only have WooCommerce enabled to see if this still happens?
In addition, you can try to install a very useful plugin called Query Monitor and check how your queries to wp_comments look like.
E.g. you can then check how your queries look like when calling get_pending_comments_num()
or wp_count_comments()
(I would compare the query when you get the correct vs incorrect result):
Hi just let you know I finally sort it out.
It was caused by a wc transient entry in wp_options, which can't be cleared by from WooCommerce status page.
The issue is gone after I manually deleted it. Thanks again for any help and the monitor plugin. Much appreciated.
Thanks for letting us know, I wrongly assumed that it would be cleared by the Clear transient
button.
@mikejolley probably low prio, but should we maybe add comment transients to the list of cleared transients?
@peterfabian Yeah please add that to the whitelist.
Nothing worked for me. Disabling WooCommerce correctly restores the comment counts.
Cleared all transients as per the WooCommerce Status - no effect.
Cleared out the value of _transients_wc_count_comments
- no effect.
I had to also clear out the value of _transient_as_comment_count
and it finally worked.
So far I've had this issue on two completely different WP sites running WooCommerce. One was fixed by using the Clear Transient buttons in WooCommerce and the other required my editing the wp_options
table as per procedure above.
I wish WooCommerce would finally fix this issue!
Awesome!! thank you, I am doing a mammoth data sync between and old site and a new site... was looking for this.
im still having this issue with _transient_as_comment_count
In my case (WP 5.6x) changing the value(s) of _transient_as_comment_count in DB didn't work. Adding new POST comment corrected both "All" and "Pending" comments count.
In my case (WP 5.6x) changing the value(s) of _transient_as_comment_count in DB didn't work. Adding new POST comment corrected both "All" and "Pending" comments count.
Same, fixed it by adding a new comment, thanks!
Prerequisites
master
branch of WooCommerce on Github (this is not the same version as on WordPress.org!)Steps to reproduce the issue
Expected/actual behavior
The comments count should show zero as there is no records in wp_comments and relative data tables, or at least it should display the existing comments.
Isolating the problem
WordPress Environment
Screenshot