وردپرس
Conflict with User Switching plugin
Testing this plugin on a site with the User Switching plugin installed throws the following error when visiting a link with the autologin enabled:
2024/02/18 06:14:04 [error] 39262#39262: *32635 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Undefined constant "USER_SWITCHING_SECURE_COOKIE" in /www/public/wp-content/plugins/user-switching/user-switching.php:1356
Stack trace:
#0 /www/public/wp-content/plugins/user-switching/user-switching.php(1291): user_switching_get_auth_cookie()
#1 /www/public/wp-includes/class-wp-hook.php(326): user_switching_clear_olduser_cookie('testclient@spru...')
#2 /www/public/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#3 /www/public/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#4 /www/public/wp-content/plugins/bh-wp-autologin-urls/src/wp-includes/class-login.php(166): do_action('wp_login', 'testclient@spru...', Object(WP_User))
#5 /www/public/wp-includes/class-wp-hook.php(324): BrianHenryIE\WP_Autologin_URLs\WP_Includes\Login->process(155)
....
I patched the /src/wp-includes/class-login.php file with a small patch below within the process method that solves the issue in the short term.
// Compatibility with User Switching plugin.
if ( function_exists( 'user_switching_get_auth_cookie' ) && ! defined( 'USER_SWITCHING_SECURE_COOKIE' ) ) {
define( 'USER_SWITCHING_SECURE_COOKIE', false );
}
مشاهده پاسخ های این مطلب
———————————————
این مطلب از سایت انجمن وردپرس گردآوری شده است و کلیه حقوق مطلق به انجمن وردپرس می باشد در صورت مغایرت و یا بروز مشکل اطلاع دهید تا حذف گردد
منبع: انجمن وردپرس