Get The Caller (Plugin / Theme / Core) For All actions & Hook in WordPress
As I said in my comment to the question, you can use the PHP internal ReflectionFunction class to get the filename of the callable. The below code should be a good start to help you. It needs more logic for determining the callbacks and most of that should be abstracted out of the Monitor class … Read more