Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 有人能帮我修一下吗?未捕获错误:存在对成员函数的调用()_Php_Wordpress - Fatal编程技术网

Php 有人能帮我修一下吗?未捕获错误:存在对成员函数的调用()

Php 有人能帮我修一下吗?未捕获错误:存在对成员函数的调用(),php,wordpress,Php,Wordpress,我在我的网站上安装了wordpress,我有一个插件,可以从xenforo获取用户名并导入它们。一些用户已经在wordpress上创建,现在这些用户如果尝试登录就会出现此错误。有人能帮我写这段代码吗 Uncaught Error: Call to a member function exists() on string in /home/xxx/public_html/blog/wp- includes/user.php on line 1365 clean_user_cache() wp-i

我在我的网站上安装了wordpress,我有一个插件,可以从xenforo获取用户名并导入它们。一些用户已经在wordpress上创建,现在这些用户如果尝试登录就会出现此错误。有人能帮我写这段代码吗

Uncaught Error: Call to a member function exists() on string in /home/xxx/public_html/blog/wp- 
includes/user.php on line 1365
clean_user_cache()
wp-includes/pluggable.php:2532
wp_set_password()
wp-content/plugins/xpress-forum-user-bridge/src/Filter/Authenticate.php:107
createUser()
wp-content/plugins/xpress-forum-user-bridge/src/Filter/Authenticate.php:94
authenticate()
wp-includes/class-wp-hook.php:288
apply_filters()
wp-includes/plugin.php:206
apply_filters()
wp-includes/pluggable.php:539
wp_authenticate()
wp-includes/user.php:95
wp_signon()
wp-login.php:1187
下面是来自插件的Authenticate.php

    public static function authenticate($user, $login, $password)
    {
        if (get_option('xpress_lite_auth_with_xf', false) && $login && $password) {
            if ($user instanceof \WP_User) {
                return $user;
            }

            $apiClient = self::apiClient();

            if (!$apiClient) {
                return $user;
            }

            try {
                $xfUser = $apiClient->xf->auth->auth($login, $password);
            } catch (AbstractRequestException $e) {
                return $user;
            } catch (XFApiException $e) {
                return $user;
            }

            if ($xfUser) {
                return self::createUser($xfUser, $password, $login);
            }
        }

        return $user;
    }

    protected static function createUser($xfUser, $password, $login)
    {
        if ($xfUser->email) {
            $emailUser = get_user_by('email', $xfUser->email);

            if ($emailUser) {
                wp_set_password($emailUser->ID, $password);
                return $emailUser;
            }
        }

        $nameUser = get_user_by('login', $xfUser->username);
        if ($nameUser) {
            $newName = $xfUser->email;
        } else {
            $newName = $xfUser->username;
        }

        $userId = wp_create_user($newName, $password, $xfUser->email);
        return get_user_by('ID', $userId);
    }


}


将FS_方法添加到wp-config.php解决了这些问题

// worked
define('FS_METHOD','direct');
起初,我使用FTP用户路径,但锁定用户对子目录的访问再次中断,因为插件始终请求绝对路径。在我的例子中,即使在配置中添加路径也没有帮助

// updating paths did not help
define( 'FTP_BASE', '/path/to/wordpress/' );
define( 'FTP_CONTENT_DIR', '/path/to/wordpress/wp-content/' );
define( 'FTP_PLUGIN_DIR ', '/path/to/wordpress/wp-content/plugins/' );
define( 'FTP_USER', 'username' );
define( 'FTP_PASS', 'password' );
define( 'FTP_HOST', 'ftp.example.org' );
define( 'FTP_SSL', false );

谢谢…这对我不起作用,但我可能应该做更多的事情?重新安装它?我想,需要检查live页面,因为它需要设置PHP和系统/服务器设置。