admin管理员组文章数量:1406924
I hope this question is not too broad or not the right format. But the subject at hand is one of the vaguest: debugging.
For the TLDR crowd out there, the actual question is in bold in the 'What I am missing' section :)
Context:
I have to debug a weird occurrence on a large woocommerce WP site that I have not built, and that uses around 40-ish plugins, most of which are woocommerce add-ons.
I cannot go the plugin deactivation route because (1) the site is a production site and we cannot mess with active plugins for too long (2) the bug is impossible to reproduce reliably for tests as we do not understand what triggers it yet and (3) we need to work on the live install to log the bug, which means that at this point, we have to sit and wait...
The bug:
In rare occurrences of an order completion (we do not know the trigger yet), a woocommerce product (not the same, rather random) is renamed 'Cart' (that is, its post_title is modified) somewhere during the checkout process, where multiple plugins have a say (most notably one that generates a tracking number, but also an abandoned cart recovery plugin, payment gateways, product variations plugins etc...)
What I have working for me right now:
- The error logs (which show nothing because no error is thrown)
- A debugging log filled by a function I hooked to 'post_updated' and that will log some data (post id, before title, after title, date modified) when a title changes and the post type is 'product'
What I am missing:
So my little logging function is very useful to record ALL occurrences of a product title change during save/update.
BUT, this is where my question(s) arises:
- If I log a backtrace, I get
functions.php
, which is where I declared my little debugging function - I want to know more about what functions are modifying the post data during checkout : are there hooks or known methods for climbing up the responsibility chain in a PHP app like WordPress?
- There are so many hooks around the
wp_post_update
process, but most only give away similar info (generic$post_before
, generic$post_after
,$post_id
...) -> is there a particular one that I am missing, that would allow a more significant trace of events between the moment a checkout starts and the moment it ends?
I apologize if the question is not really SE format, of if it's too broad a scope but narrow a context? But consider it is more about DEBUGGING methods and ways to get information from wp hooks than it is about a woocommerce bug :)
本文标签:
版权声明:本文标题:hooks - Debug a WP install: how to find which functions write post updates during a process (a woocommerce checkout in my case) 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744979107a2635704.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论