Wp Cerber blocking password reset link

I have two sites. I installed wp-cerber to the two sites. On the sites, I am masking the login url. I have an issue on one of the sites. On the site, I am using GravitySMTP (Custom SMTP) to send emails. Emails get sent from different parts of the app, but on the login url, the email does not get sent. I get a server error. However, if I deactivate wp_cerber or I do not use a custom login url, I get the emails with no errors.

This is the error I get below

[31-Oct-2024 16:44:06 UTC] PHP Fatal error:  Uncaught Error: Call to a member function mail() on null in /var/www/html/wp-content/plugins/gravitysmtp/includes/functions_include.php:19
Stack trace:
#0 /var/www/html/wp-includes/user.php(3315): wp_mail('kolawole@*******...', '[Sample Text...', 'Someone has req...', '')
#1 /var/www/html/wp-login.php(831): retrieve_password()
#2 /var/www/html/wp-content/plugins/wp-cerber/cerber-load.php(1017): require('/var/www/html/w...')
#3 /var/www/html/wp-content/plugins/wp-cerber/cerber-load.php(2582): cerber_wp_login_page()
#4 /var/www/html/wp-includes/class-wp-hook.php(324): {closure}('')
#5 /var/www/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#6 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#7 /var/www/html/wp-settings.php(700): do_action('init')
#8 /var/www/html/wp-config.php(113): require_once('/var/www/html/w...')
#9 /var/www/html/wp-load.php(50): require_once('/var/www/html/w...')
#10 /var/www/html/wp-blog-header.php(13): require_once('/var/www/html/w...') in /var/www/html/wp-content/plugins/gravitysmtp/includes/functions_include.php on line 19

Please what could be the matter?

Please who has an answer to this

This error points to a problem in the Gravity SMTP plugin’s functions_include.php file, specifically on line 19. In PHP, this type of error means that the code is trying to call mail() on something that’s set to null instead of an actual object. Usually, this happens when a variable isn’t properly set up before it’s used.

Why This Happens

The error occurs when WP Cerber’s Custom Login URL feature is enabled. This feature lets WordPress users customize the login URL, adding a layer of security to their WordPress. However, with Custom Login URL active, Gravity SMTP doesn’t set up its main object for handling mail correctly, leading to a fatal error when it tries to use the mail() function on an empty variable.

This issue is something that needs to be addressed by the Gravity SMTP developers. Their code should be flexible enough to handle modified login URLs, whether set by WP Cerber or any other plugin.

Unfortunately, there’s nothing that our team can do from our side to resolve this.

Here is what you can do for now:

Switch to using another SMTP plugin

OR

  1. Turn off Custom Login URL in WP Cerber, which allows Gravity SMTP to work properly.
  2. Reach out to the Gravity SMTP team and report this issue, so they can update the plugin code, making it compatible with WordPress websites that use modified login URLs.

Try enabling Defer rendering the custom login page in the Main Settings. This might help.

1 Like

My goodness. This worked. Thanks so much @Garry

1 Like