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.
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
I called my hoster today and he told my that my hosting package doesn't include any cron tasks. The error appears from the WordPress files. Could the database also produce these errors?
Yes! It's stored in the database inside the table wp_options , under the option_name cron.
I compared an older version of the database with the current one, but couldn't find anything suspicious. Do you have any other suggestions what I could do now?
the thing would be, when u installed the new site, did you imported the old database? Probably you could make a new one, and import the data of the old one via the Wordpress Importer, and not importing it directly from the old DB The other option is that a plugin is causing the issue (which i doubt), so disable plugins til the error is gone. Besides those 2 options I can't think in anything else
So @Mario , was this issue solved? It's always good to choose a "valid" answer as a solution.