Skip to content
Advertisement

WordPress regularly produces errors for cron.php, class-wp-hook.php and update.php

For a customer I set up a website in WordPress. The site got hacked and infected with malicious code, so I’ve re-uploaded all WordPress files and the files for the theme, changed all passwords, installed a security plugin and run several virus scans to remove every line of code, that was suspicious. The site worked normally after doing this, but now I get the following error:

Warning: Cannot call assert() with string argument dynamically in /mnt/web107/d1/74/58360774/htdocs/wp-includes/cron.php on line 1 Warning: call_user_func_array() expects parameter 1 to be a valid callback,
function 'wp_cron' not found or invalid function name in /mnt/web107/d1/74/58360774/htdocs/wp-includes/class-wp-hook.php on line 286
Fatal error: Uncaught Error: Call to undefined function wp_next_scheduled() in /mnt/web107/d1/74/58360774/htdocs/wp-includes/update.php:710 Stack trace: #0 /mnt/web107/d1/74/58360774/htdocs/wp-includes/class-wp-hook.php(286): wp_schedule_update_checks('')
#1 /mnt/web107/d1/74/58360774/htdocs/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
#2 /mnt/web107/d1/74/58360774/htdocs/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
#3 /mnt/web107/d1/74/58360774/htdocs/wp-settings.php(450): do_action('init') 
#4 /mnt/web107/d1/74/58360774/htdocs/wp-config.php(126): require_once('/mnt/web107/d1/...')
#5 /mnt/web107/d1/74/58360774/htdocs/wp-load.php(37): require_once('/mnt/web107/d1/...')
#6 /mnt/web107/d1/74/58360774/htdocs/wp-blog-header.php(13): require_once('/mnt/web107/d1/...')
#7 /mnt/web107/d1/74/58360774/htdocs/index.php(22): require('/mnt/web107/d1/...')
#8 {main} thrown in /mnt/web107/d1/74/58360774/htdocs/wp-includes/update.php on line 710 

The strange thing is, when the errors appear, I only need to re-upload all the WordPress core files and the website works properly for a few weeks again, but then the errors reappear.

Can someone explain me what causes these errors and how to fix them? I googled the errors but couldn’t find a fix.

Advertisement

Answer

Check your server’s cron tasks, it must be something there that tries to execute something, and that’s whats causing the error.

Sorry for not being more specific but every hosting company has his own panel.

Regards, Daniel

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement