Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#35849 closed defect (bug) (duplicate)

Details in _deprecated_function

Reported by: sebastianpisula's profile sebastian.pisula Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

I think that notice is not enough detail:

[17-Feb-2016 07:10:18 UTC] PHP Notice:  is_comments_popup is <strong>deprecated</strong> since version 4.5 with no alternative available. in \wp-includes\functions.php on line 3610

I don't know where is source or error.

Meybe:

<?php
debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS );

will be good idea ?

I have more details where is call function:

Array
(
    [0] => Array
        (
            [file] => wp-includes\deprecated.php
            [line] => 3690
            [function] => _deprecated_function
        )

    [1] => Array
        (
            [function] => is_comments_popup
        )

    [2] => Array
        (
            [file] => wp-content\plugins\query-monitor\collectors\conditionals.php
            [line] => 81
            [function] => call_user_func
        )

    [3] => Array
        (
            [file] => wp-content\plugins\query-monitor\classes\Collectors.php
            [line] => 57
            [function] => process
            [class] => QM_Collector_Conditionals
            [type] => ->
        )

    [4] => Array
        (
            [file] => wp-content\plugins\query-monitor\classes\Dispatcher.php
            [line] => 56
            [function] => process
            [class] => QM_Collectors
            [type] => ->
        )

    [5] => Array
        (
            [file] => wp-content\plugins\query-monitor\dispatchers\Html.php
            [line] => 184
            [function] => get_outputters
            [class] => QM_Dispatcher
            [type] => ->
        )

    [6] => Array
        (
            [function] => dispatch
            [class] => QM_Dispatcher_Html
            [type] => ->
        )

    [7] => Array
        (
            [file] => wp-includes\plugin.php
            [line] => 525
            [function] => call_user_func_array
        )

    [8] => Array
        (
            [file] => wp-includes\load.php
            [line] => 637
            [function] => do_action
        )

    [9] => Array
        (
            [function] => shutdown_action_hook
        )

)

Alternative for debug_backtrace() is this script:

<?php
$e = new Exception;
$e->getTraceAsString()

In output I can see:

#0 wp-includes\deprecated.php(3690): _deprecated_function('is_comments_pop...', '4.5')
#1 [internal function]: is_comments_popup()
#2 wp-content\plugins\query-monitor\collectors\conditionals.php(81): call_user_func('is_comments_pop...')
#3 wp-content\plugins\query-monitor\classes\Collectors.php(57): QM_Collector_Conditionals->process()
#4 wp-content\plugins\query-monitor\classes\Dispatcher.php(56): QM_Collectors->process()
#5 wp-content\plugins\query-monitor\dispatchers\Html.php(184): QM_Dispatcher->get_outputters('html')
#6 [internal function]: QM_Dispatcher_Html->dispatch('')
#7 wp-includes\plugin.php(525): call_user_func_array(Array, Array)
#8 wp-includes\load.php(637): do_action('shutdown')
#9 [internal function]: shutdown_action_hook()
#10 {main}

Change History (2)

#1 @dd32
9 years ago

  • Keywords 2nd-opinion close added

The _deprecated_*() functions are designed to be fast to avoid adding extra overhead of running the full debug_backtrace() code.

Developers should use plugins such as Log Deprecated Notices to get a better insight into deprecated notices (including ones they potentially cannot see) IMHO.

#2 @ocean90
9 years ago

  • Keywords 2nd-opinion close removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #13202.

Note: See TracTickets for help on using tickets.