[wp-trac] [WordPress Trac] #38183: Add hooks to be run before and after each callback

WordPress Trac noreply at wordpress.org
Mon Jul 21 16:27:40 UTC 2025


#38183: Add hooks to be run before and after each callback
------------------------------------------+-----------------------------
 Reporter:  pento                         |       Owner:  (none)
     Type:  enhancement                   |      Status:  new
 Priority:  normal                        |   Milestone:  Future Release
Component:  Plugins                       |     Version:
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:  performance
------------------------------------------+-----------------------------
Changes (by johnjamesjacoby):

 * keywords:  needs-patch needs-unit-tests 2nd-opinion => needs-patch needs-
     unit-tests
 * focuses:   => performance


Comment:

 I think this is a great idea.

 > What kind of performance impact would they have? If there are no
 callbacks registered to these hooks, there should ideally be no
 performance impact.

 Likely near-zero impact.

 > Should they be WP_DEBUG only? This would discourage plugins from abusing
 them on production systems - they would only be used if the site admin
 explicitly sets the site to debugging mode.

 I think not having them be `WP_DEBUG`-only allows tricky problems to be
 investigated in production environments, where they are the most likely to
 be noticed.

 > Dealing with recursion is fun, should they provide any helpers for
 indicating recursion level, or is it up to the code hooking into them to
 handle that?

 Up to the code hooking in, I think.

 @johnbillion were you implement this in Query Monitor?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/38183#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list