Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inproper use of the wp_login_failed action (conflict with other plugins) #471

Closed
dziudek opened this issue Oct 12, 2022 · 0 comments · Fixed by #478
Closed

Inproper use of the wp_login_failed action (conflict with other plugins) #471

dziudek opened this issue Oct 12, 2022 · 0 comments · Fixed by #478

Comments

@dziudek
Copy link

dziudek commented Oct 12, 2022

Hi,

I have found a conflict between Two Factor and Publigo plugins. The problem is caused probably by improper use of the wp_login_failed action in Two Factor plugin.

As codex says - wp_login_failed uses two params:

  • username (string)
  • error (WP_Error instance)

ref. https://developer.wordpress.org/reference/hooks/wp_login_failed/

But Two Factor plugin uses only one param:

https://github.com/WordPress/two-factor/blob/master/class-two-factor-core.php#L858

And it causes a problem if somebody expects 2 params in their custom handling of the wp_login_failed action.

For Publigo it causes the following PHP error (sorry for polish logs, but as I suppose the core messages are in english):

Błąd typu E_ERROR został spowodowany w linii 56 pliku /[REDACTED]/public_html/wp-content/plugins/wp-idea/includes/events/handlers/class-auth-events-handler.php](/[REDACTED]/public_html/wp-content/plugins/wp-idea/includes/events/handlers/class-auth-events-handler.php). 
Komunikat błędu: Uncaught ArgumentCountError: Too few arguments to function bpmj\wpidea\events\handlers\Auth_Events_Handler::bpmj\wpidea\events\handlers\{closure}(), 1 passed in /[REDACTED]/public_html/wp-includes/class-wp-hook.php](/[REDACTED]/public_html/wp-includes/class-wp-hook.php) on line 307 and exactly 2 expected in /[REDACTED]/public_html/wp-content/plugins/wp-idea/includes/events/handlers/class-auth-events-handler.php:56](/[REDACTED]/public_html/wp-content/plugins/wp-idea/includes/events/handlers/class-auth-events-handler.php:56)
Stack trace:
#0 /[REDACTED]/public_html/wp-includes/class-wp-hook.php(307)](/[REDACTED]/public_html/wp-includes/class-wp-hook.php(307)): bpmj\wpidea\events\handlers\Auth_Events_Handler->bpmj\wpidea\events\handlers\{closure}('usrob')
#1 /[REDACTED]/public_html/wp-includes/class-wp-hook.php(331)](/[REDACTED]/public_html/wp-includes/class-wp-hook.php(331)): WP_Hook->apply_filters('', Array)
#2 /[REDACTED]/public_html/wp-includes/plugin.php(476)](/[REDACTED]/public_html/wp-includes/plugin.php(476)): WP_Hook->do_action(Array)
#3 /[REDACTED]/public_html/wp-content/plugins/two-factor/class-two-factor-core.php(858)](/[REDACTED]/public_html/wp-content/plugins/two-factor/class-two-factor-core.php(858)):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants