admin管理员组文章数量:1277886
Couple of days ago I was checking the size of my database and I was amazed on how huge it is. The most weird thing for me is that my site is not using comments, and still the wp_comment table is more 27MB. When I took a look inside I saw this for example - a comment from Woocommerce saying this in the content - Order status changed from Pending Payment to Proce... or this IPN payment completed.
Now I use many plugins on the site, but I`m still not sure why orders status should be in wp_comments. Also in the backend of WordPress, there are zero comments in spam, approved or trash...
What shall I do? Shall I remove all comments there? I thought Wordpress is writing in the orders tables for this purposes...
Couple of days ago I was checking the size of my database and I was amazed on how huge it is. The most weird thing for me is that my site is not using comments, and still the wp_comment table is more 27MB. When I took a look inside I saw this for example - a comment from Woocommerce saying this in the content - Order status changed from Pending Payment to Proce... or this IPN payment completed.
Now I use many plugins on the site, but I`m still not sure why orders status should be in wp_comments. Also in the backend of WordPress, there are zero comments in spam, approved or trash...
What shall I do? Shall I remove all comments there? I thought Wordpress is writing in the orders tables for this purposes...
Share Improve this question asked Jan 29, 2018 at 13:43 Droid SheepDroid Sheep 811 silver badge7 bronze badges 1- 1 Reviews and Order Notes are stored as comments. WooCommerce automatically creates order notes for things like status changes. – Jacob Peattie Commented Jan 29, 2018 at 14:09
2 Answers
Reset to default 1Oh, that is double offtopic, but for the sake of helping other people which might wonder the same about EDD and maybe other plugins, the reason is because wordpress core to not have any easy support for hierarchy between CPTs except for comments being under posts. As orders are "belonging" to specific products it makes a simple hack to emulate such a relationship by using comments.
Why not just store order in separate table? because on wordpress which is one of the biggest wordpress hosters in the world plugins are not allowed to create new table, therefor WC and EDD had to come up with some hack.
What should you do? probably nothing, why do you even look at the DB in the first place? Checking out the architecture of code is something you should do before putting it on production. After it was running for a while it becomes too late to think about alternatives.
That is just the way WordPress "forces" plugins like WooCommerce to work. But some people frustrated with the performance impact of this have developed this plugin to make WooCommerce use custom tables, properly indexed. Give it a go in a test environment first.
本文标签: databaseWhy is Woocommerce writing in my wpcomment table
版权声明:本文标题:database - Why is Woocommerce writing in my wp_comment table? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741262369a2367864.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论