Title: WordPress Critical Error + Invalid Code
Last modified: October 20, 2022

---

# WordPress Critical Error + Invalid Code

 *  Resolved [ruen06](https://wordpress.org/support/users/ruen06/)
 * (@ruen06)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/wordpress-critical-error-invalid-code/)
 * I face the same issue in this topic. [https://wordpress.org/support/topic/big-issue-error-invalid-verification-code-critical/](https://wordpress.org/support/topic/big-issue-error-invalid-verification-code-critical/)
 * I am using Defender Pro. If Defender Pro is enabled, after logging in with the
   code, it shows the error ‘There has been a critical error on …’
 * If I disabled Defender Pro, the code is always invalid. So I have no choice but
   to disable your plugin.
 * This is the PHP error recorded:
 *     ```
       [19-Oct-2022 01:12:30 UTC] PHP Fatal error: Uncaught Exception: Invalid characters in the base32 string. in /var/web/site/public_html/wp-content/plugins/wp-2fa/includes/classes/Authenticator/class-authentication.php:291
   
       PHP Stacktrace:
       /var/web/site/public_html/wp-content/plugins/wp-2fa/includes/classes/Authenticator/class-authentication.php(255): WP2FA\Authenticator\Authentication::base32_decode('\x1F\x11\x98\xC4\xCE\xEAC\t\xEB\x98\x90\x1C\v[\xB4...')
       /var/web/site/public_html/wp-content/plugins/wp-2fa/includes/classes/Authenticator/class-authentication.php(234): WP2FA\Authenticator\Authentication::calc_totp('\x1F\x11\x98\xC4\xCE\xEAC\t\xEB\x98\x90\x1C\v[\xB4...', 55538065)
       /var/web/site/public_html/wp-content/plugins/wp-2fa/includes/classes/Authenticator/class-login.php(903): WP2FA\Authenticator\Authentication::is_valid_authcode('\x1F\x11\x98\xC4\xCE\xEAC\t\xEB\x98\x90\x1C\v[\xB4...', '050330')
       /var/web/site/public_html/wp-content/plugins/wp-2fa/includes/classes/Authenticator/class-login.php(719): WP2FA\Authenticator\Login::validate_totp_aut in /var/web/site/public_html/wp-content/plugins/wp-2fa/includes/classes/Authenticator/class-authentication.php on line 291
       ```
   

Viewing 4 replies - 16 through 19 (of 19 total)

[←](https://wordpress.org/support/topic/wordpress-critical-error-invalid-code/?output_format=md)
[1](https://wordpress.org/support/topic/wordpress-critical-error-invalid-code/?output_format=md)
2

 *  Thread Starter [ruen06](https://wordpress.org/support/users/ruen06/)
 * (@ruen06)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/wordpress-critical-error-invalid-code/page/2/#post-16291159)
 * > Having said that, can you run a quick test? If you reset the 2FA setup for 
   > a user, can you please confirm it if works then for a few days?
 * yes, works for some time
 *  Plugin Contributor [robertabela](https://wordpress.org/support/users/robert681/)
 * (@robert681)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/wordpress-critical-error-invalid-code/page/2/#post-16291289)
 * Thanks for the update. We can confirm it is the same issue then. A fix will be
   included for this in the upcoming update of the plugin. Basically the plugin 
   will create its own private key in the wp-config.php file instead of using the
   WordPress salts.
 * Thank you very much for your patience and cooperation. Should you have any more
   questions, please do not hesitate to ask.
 * Have a great day.
 *  Thread Starter [ruen06](https://wordpress.org/support/users/ruen06/)
 * (@ruen06)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/wordpress-critical-error-invalid-code/page/2/#post-16664028)
 * I still face this issue. When will your team fix this?
 *  Plugin Contributor [robertabela](https://wordpress.org/support/users/robert681/)
 * (@robert681)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/wordpress-critical-error-invalid-code/page/2/#post-16668966)
 * Hello [@ruen06](https://wordpress.org/support/users/ruen06/)
 * We have applied a fix for this issue in update 2.4.0, which was released quite
   a few months ago. However, since third party plugins would have already changed
   the salt keys etc, you still have to reconfigure 2FA for the user in question.
 * So please instruct all users who are encountering this issue to reconfigure 2FA.
   Once 2FA is reconfigured, this will no longer happen.
 * I hope the above helps. Please let us know if you need any additional help.
 * Have a great day.

Viewing 4 replies - 16 through 19 (of 19 total)

[←](https://wordpress.org/support/topic/wordpress-critical-error-invalid-code/?output_format=md)
[1](https://wordpress.org/support/topic/wordpress-critical-error-invalid-code/?output_format=md)
2

The topic ‘WordPress Critical Error + Invalid Code’ is closed to new replies.

 * ![](https://ps.w.org/wp-2fa/assets/icon-256x256.png?rev=2961533)
 * [WP 2FA - Two-factor authentication for WordPress](https://wordpress.org/plugins/wp-2fa/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-2fa/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-2fa/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-2fa/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-2fa/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-2fa/reviews/)

 * 27 replies
 * 2 participants
 * Last reply from: [robertabela](https://wordpress.org/support/users/robert681/)
 * Last activity: [3 years, 1 month ago](https://wordpress.org/support/topic/wordpress-critical-error-invalid-code/page/2/#post-16668966)
 * Status: resolved