WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#13202 closed enhancement (wontfix)

deprecated function warning improvement

Reported by: hakre Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

Knee-deep in tests I ran over this:

Since PHP 4.3 we have a nice function called debug_backtrace() that can improve the message thrown out in _deprecated_function() a lot by adding information about the context (e.g. file and line) where a deprecated function was originally called.

In conjunction with WP_DEBUG a real time saver. Simple and smooth. Patch is against fresh trunk.

Example output after patch:


Notice: get_settings is deprecated since version 2.1! Use get_option() instead. Called in file wp-content/themes/oldtheme/functions.php on line 5.


Since we're globally in testing these days I can only suggest to give this a shot and put this ticket 3.0 out of the standard order. If a core dev is not confident with that, please put on a later version.

Attachments (1)

13202.patch (1.6 KB) - added by hakre 5 years ago.

Download all attachments as: .zip

Change History (4)

@hakre5 years ago

comment:1 @nacin5 years ago

  • Milestone 3.0 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Some people run WP_DEBUG on production servers. A plugin can easily hook in and do this, we won't be adding the performance hit into core though.

comment:2 @hakre5 years ago

  • Keywords dev-feedback removed

Well I dunno wether performance is a real issue here. I think about adding that functionality to an error reporter component then. Thanks for taking the look into it.

Note: See TracTickets for help on using tickets.