0

I got this error, can someone help me with how to resolve it?

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'wp_schedule_https_detection' not found or invalid function name in C:\Users\Alex\Local Sites\proba2\app\public\wp-includes\class-wp-hook.php on line 292

Thanks in advance!!!

7
  • This means that you have a hook set up to call wp_schedule_https_detection but no actual definition of that function. If you have a recent enough WordPress, 5.7+, then it should be defined in wp-includes/https-detection.php which should be included from wp-settings.php. (And the add_action to set up the hook call in default-filters.php.) Can you check that's all set up correctly? If not it might be worth doing a manual WordPress core upgrade to replace all of your core files with a good version.
    – Rup
    Commented Apr 14, 2021 at 10:48
  • I just checked wp and it is up to date (5,7). But I don't know how to check all the functions that you said. Can you check those functions? I could send you wp-settings.php, and other files that are needed. Commented Apr 14, 2021 at 11:46
  • I meant look for function wp_schedule_https_detection() { in wp-includes/https-detection.php (line 163 I think) and require ABSPATH . WPINC . '/https-detection.php'; in wp-settings.php (line 174). But if it's easier then just compare those two files to the files in a fresh copy of 5.7.
    – Rup
    Commented Apr 14, 2021 at 11:50
  • I just checked and I found those two lines of code that you said. Commented Apr 14, 2021 at 12:07
  • OK, then you shouldn't be getting this warning any more.
    – Rup
    Commented Apr 14, 2021 at 12:25

2 Answers 2

1

This error occurs when you have an action or filter hooked to a function that doesn't exist. I believe this hook was called in the wp-includes/default-filters.php file. It looked like this:

add_action( 'init', 'wp_schedule_https_detection' );

But, in order for this to be failing, it means either 1) the function is being called from somewhere else, before its available, or 2) there's some missing code from your WordPress Core.

Now, because this question is 3 years old, this should actually be irrelevant because that function was removed from the WP Core in this change: https://core.trac.wordpress.org/browser/trunk/src/wp-includes/https-detection.php?rev=56664#L10

Feel free to mark an answer as accepted, to "close" the issue.

0

I managed to fix the issue, by checking and removing the missing function from the plugin file, as the error mentions "function 'wp_schedule_https_detection' not found or invalid function name"

Probably you are calling the function 'wp_schedule_https_detection' in your plugin file, and its missing the function in the plugin file.

The file 'class-wp-hook.php' should not be edited

1
  • This is core WordPress code though. You shouldn't be removing anything.
    – Rup
    Commented Sep 17, 2021 at 15:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.