# \[Solved\] Fatal error with User mail verification

**URL:** https://meta.discourse.org/t/solved-fatal-error-with-user-mail-verification/90495
**Category:** WordPress
**Created:** [June 22, 2018, 3:52pm UTC](https://meta.discourse.org/t/solved-fatal-error-with-user-mail-verification/90495 "2018-06-22T15:52:20Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Evapy](https://avatars.discourse-cdn.com/v4/letter/e/a8b319/32.png) [@Evapy](https://meta.discourse.org/u/Evapy)
#### Post date: [June 22, 2018, 3:52pm UTC](https://meta.discourse.org/t/solved-fatal-error-with-user-mail-verification/90495/1 "2018-06-22T15:52:20Z")

</div>

edit : I’d like to override the discourse’s email verification process… is that doable ? I’m using WP-Discourse obviously

Hey guys, I’m trying to mix Memberpress and User Verification (for email verifying) to prevent Discourse from sending another email for validating. (Is that clear ? Probably not lmao)

But when the user signup on wordpress and validates his email, an error appears. Do you have any idea on what I should do to prevent that from happening ? Thank you

Error =

` **Fatal error** : Uncaught ArgumentCountError: Too few arguments to function WPDiscourse\WordPressEmailVerification\WordPressEmailVerification::verify_email_after_login(), 1 passed in /home/----/public_html/wp-includes/class-wp-hook.php on line 286 and exactly 2 expected in /home/----/public_html/wp-content/plugins/wp-discourse/lib/wordpress-email-verification.php:128 Stack trace: #0 /home/----/public_html/wp-includes/class-wp-hook.php(286): WPDiscourse\WordPressEmailVerification\WordPressEmailVerification-&gt;verify_email_after_login('----') #1 /home/----/public_html/wp-includes/class-wp-hook.php(310): WP_Hook-&gt;apply_filters('', Array) #2 /home/----/public_html/wp-includes/plugin.php(453): WP_Hook-&gt;do_action(Array) #3 /home/----/public_html/wp-content/plugins/user-verification/includes/functions.php(514): do_action('wp_login', '----') #4 /home/----/public_html/wp-includes/class-wp-hook.php(286): user_verification_auto_login('') #5 /home/----/public_html/wp-includes/class-wp-hook.php(310) in **/home/----/public_html/wp-content/plugins/wp-discourse/lib/wordpress-email-verification.php** on line **128** `

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [June 22, 2018, 4:00pm UTC](https://meta.discourse.org/t/solved-fatal-error-with-user-mail-verification/90495/2 "2018-06-22T16:00:06Z")

</div>

> [@Evapy](#):
>
> But when the user signup on wordpress and validates his email, an error appears. Do you have any idea on what I should do to prevent that from happening ?

Have you altered the plugin’s code?

---

<div class="post-metadata">

### Author: ![Evapy](https://avatars.discourse-cdn.com/v4/letter/e/a8b319/32.png) [@Evapy](https://meta.discourse.org/u/Evapy)
#### Post date: [June 22, 2018, 4:56pm UTC](https://meta.discourse.org/t/solved-fatal-error-with-user-mail-verification/90495/3 "2018-06-22T16:56:12Z")

</div>

I didn’t touch any plugin code

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [June 22, 2018, 5:02pm UTC](https://meta.discourse.org/t/solved-fatal-error-with-user-mail-verification/90495/4 "2018-06-22T17:02:50Z")

</div>

Are you calling the function `verify_email_after_login` from somewhere? It is not meant to be called directly. It shouldn’t be possible for that function to receive too few arguments. It is called by the `wp_login` action. That action passes two arguments to the function - `$username` and `$user`.

---

<div class="post-metadata">

### Author: ![Evapy](https://avatars.discourse-cdn.com/v4/letter/e/a8b319/32.png) [@Evapy](https://meta.discourse.org/u/Evapy)
#### Post date: [June 22, 2018, 5:03pm UTC](https://meta.discourse.org/t/solved-fatal-error-with-user-mail-verification/90495/5 "2018-06-22T17:03:36Z")

</div>

Mhh the plugin UserVerification uses the variable $user\_name instead of $username, do you think it can provokes a bug ?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [June 22, 2018, 5:06pm UTC](https://meta.discourse.org/t/solved-fatal-error-with-user-mail-verification/90495/6 "2018-06-22T17:06:32Z")

</div>

No, changing the variable name won’t have an effect. What is the UserVerification plugin? I can take a look at it.

---

<div class="post-metadata">

### Author: ![Evapy](https://avatars.discourse-cdn.com/v4/letter/e/a8b319/32.png) [@Evapy](https://meta.discourse.org/u/Evapy)
#### Post date: [June 22, 2018, 5:08pm UTC](https://meta.discourse.org/t/solved-fatal-error-with-user-mail-verification/90495/7 "2018-06-22T17:08:49Z")

</div>

Oh that’d be great thank you, here’s the link : [User Verification by PickPlugins – Extension WordPress | WordPress.org Français](https://fr.wordpress.org/plugins/user-verification/) I have the free version

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [June 22, 2018, 5:19pm UTC](https://meta.discourse.org/t/solved-fatal-error-with-user-mail-verification/90495/8 "2018-06-22T17:19:08Z")

</div>

That plugin calls the `wp_login` action but only passes the username as a variable.

```plaintext
do_action( 'wp_login', $user->user_login );

```

This will break any other plugin that is correctly hooking into the action.

It should be calling it like this:

```plaintext
do_action( 'wp_login', $user->user_login, $user );

```

---

<div class="post-metadata">

### Author: ![Evapy](https://avatars.discourse-cdn.com/v4/letter/e/a8b319/32.png) [@Evapy](https://meta.discourse.org/u/Evapy)
#### Post date: [June 23, 2018, 6:56pm UTC](https://meta.discourse.org/t/solved-fatal-error-with-user-mail-verification/90495/9 "2018-06-23T18:56:25Z")

</div>

Yes sir it worked, thanks a lot !
