最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

plugins - Call to undefined function get_userdata in user.php

programmeradmin2浏览0评论

My website error log is full of

[lsapi:error] [...] Backend fatal error: PHP Fatal error:  
Call to undefined function get_userdata() 
in /home/.../public_html/wp-includes/user.php on line 460

... and the site does not load (blank page, no source).

The only changes that were recently made are Wordpress and plugin updates (I don't know which ones and when); no programming of any kind.

This answer made me suspect that a plugin did override get_userdata, but a recursive search for function get_userdata in the wp-content\plugins folder (after downloading the entire site through FTP) finds nothing (even a manual inspection for all instances of get_userdata finds only function calls, no definitions).

wp_settings.php seems OK, relevant part:

// Load active plugins.
foreach ( wp_get_active_and_valid_plugins() as $plugin ) {
    wp_register_plugin_realpath( $plugin );
    include_once( $plugin );
}
unset( $plugin );

// Load pluggable functions.
require( ABSPATH . WPINC . '/pluggable.php' );
require( ABSPATH . WPINC . '/pluggable-deprecated.php' );

// Set internal encoding.
wp_set_internal_encoding();

Maybe I can use this 7 year old hack in user.php, but that looks weird. Why would I have to patch Wordpress files?

Of course, my primary suspects are still the plugins. I selectively disabled all plugins with this trick, renaming the plugin folder names.

Then, after renaming them back, the site was suddenly accessible again, so was the WP login.

These plugin folder names were:

admin-language
akismet
backupwordpress
broken-link-checker
contact-form-7
flatbook-custom-posts
google-analytics-dashboard-for-wp
gravityforms
mollie-forms
pronamic-ideal

Update Of course the site 'suddenly' worked: I notice in the control panel that all plugins are deactivated (the text Activate is available).

If I now activate Gravityforms, the site hangs again. So I know this is the culprit, but where do I go from here?

My website error log is full of

[lsapi:error] [...] Backend fatal error: PHP Fatal error:  
Call to undefined function get_userdata() 
in /home/.../public_html/wp-includes/user.php on line 460

... and the site does not load (blank page, no source).

The only changes that were recently made are Wordpress and plugin updates (I don't know which ones and when); no programming of any kind.

This answer made me suspect that a plugin did override get_userdata, but a recursive search for function get_userdata in the wp-content\plugins folder (after downloading the entire site through FTP) finds nothing (even a manual inspection for all instances of get_userdata finds only function calls, no definitions).

wp_settings.php seems OK, relevant part:

// Load active plugins.
foreach ( wp_get_active_and_valid_plugins() as $plugin ) {
    wp_register_plugin_realpath( $plugin );
    include_once( $plugin );
}
unset( $plugin );

// Load pluggable functions.
require( ABSPATH . WPINC . '/pluggable.php' );
require( ABSPATH . WPINC . '/pluggable-deprecated.php' );

// Set internal encoding.
wp_set_internal_encoding();

Maybe I can use this 7 year old hack in user.php, but that looks weird. Why would I have to patch Wordpress files?

Of course, my primary suspects are still the plugins. I selectively disabled all plugins with this trick, renaming the plugin folder names.

Then, after renaming them back, the site was suddenly accessible again, so was the WP login.

These plugin folder names were:

admin-language
akismet
backupwordpress
broken-link-checker
contact-form-7
flatbook-custom-posts
google-analytics-dashboard-for-wp
gravityforms
mollie-forms
pronamic-ideal

Update Of course the site 'suddenly' worked: I notice in the control panel that all plugins are deactivated (the text Activate is available).

If I now activate Gravityforms, the site hangs again. So I know this is the culprit, but where do I go from here?

Share Improve this question edited Feb 23, 2022 at 17:36 Jan Doggen asked Jun 11, 2018 at 19:33 Jan DoggenJan Doggen 16911 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

Well, it was a plugin after all. Since several activated plugins seemed to trigger the error, I thought What is a common plugin here?

It turns out that admin-language was the culprit. With hindsight, that may no be a surprise: that page says:

This plugin hasn’t been tested with the latest 3 major releases of WordPress. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

发布评论

评论列表(0)

  1. 暂无评论