Title: Fatal error activating the plugin
Last modified: October 17, 2022

---

# Fatal error activating the plugin

 *  [NIMBADA.](https://wordpress.org/support/users/borjamerino/)
 * (@borjamerino)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-activating-the-plugin-5/)
 * After several fatal errors in file scanning and seeing that there was no way 
   to fix it, I decided to uninstall the plugin and reinstall it.
 * At that time, the plugin does not allow to activate it again due to fatal error.
 * `Fatal error: Uncaught Error: Call to undefined function iThemesSecurity\Encryption\
   sodium_crypto_aead_xchacha20poly1305_ietf_encrypt() in **************************
   wp-content/plugins/better-wp-security/core/lib/encryption/User_Encryption_Sodium.
   php:54 Stack trace: #0 **************************wp-content/plugins/better-wp-
   security/core/lib/class-itsec-lib-encryption.php(346): iThemesSecurity\Encryption\
   User_Encryption_Sodium->encrypt('test-string', 0) #1 **************************
   wp-content/plugins/better-wp-security/core/lib/class-itsec-lib-encryption.php(
   130): ITSEC_Lib_Encryption::set_test_string('MSluO2YpfDQ/e0E...') #2 **************************
   wp-content/plugins/better-wp-security/core/setup.php(148): ITSEC_Lib_Encryption::
   save_secret_key('MSluO2YpfDQ/e0E...') #3 **************************wp-content/
   plugins/better-wp-security/core/setup.php(21): ITSEC_Setup::setup_plugin_data()#
   4 **************************wp-content/plugins/better-wp-security/core/core.php(
   592): ITSEC_Setup::handle_activation() #5 **************************wp-includes/
   class-wp-hook.php(307): ITSEC_Core::handle_activation('') #6 **************************
   wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array) #7 **************************
   wp-includes/plugin.php(476): WP_Hook->do_action(Array) #8 **************************
   wp-admin/plugins.php(194): do_action('activate_better...') #9 {main} thrown in**************************
   wp-content/plugins/better-wp-security/core/lib/encryption/User_Encryption_Sodium.
   php on line 54`

Viewing 15 replies - 1 through 15 (of 24 total)

1 [2](https://wordpress.org/support/topic/fatal-error-activating-the-plugin-5/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/fatal-error-activating-the-plugin-5/page/2/?output_format=md)

 *  [nlpro](https://wordpress.org/support/users/nlpro/)
 * (@nlpro)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-activating-the-plugin-5/#post-16105413)
 * Hi NIMBADA,
 * The sodium_crypto_aead_xchacha20poly1305_ietf_encrypt() function is a PHP function
   that only exists in PHP >= 7.2.0 or PHP 8.
 * According to the iTSec plugin 8.1.3 Changelog:
 * > Important: iThemes Security now requires PHP 7.3 and WordPress 5.9 or later.
 * What PHP version is the site running on?
 * On activation the plugin actually checks the PHP version being used. So you should
   not run into any fatal errors when the PHP version requirement is not met.
 * +++++ To prevent any confusion, I’m not iThemes +++++
    -  This reply was modified 3 years, 6 months ago by [nlpro](https://wordpress.org/support/users/nlpro/).
    -  This reply was modified 3 years, 6 months ago by [nlpro](https://wordpress.org/support/users/nlpro/).
 *  Thread Starter [NIMBADA.](https://wordpress.org/support/users/borjamerino/)
 * (@borjamerino)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-activating-the-plugin-5/#post-16105485)
 * Hi!
 * In PHP we are using PHP 8.0.23 and WordPress latest version.
 * Previously we were using 7.4.30 PHP on both of them, it throws the same error.
   The same thing happens in both versions.
 *  [nlpro](https://wordpress.org/support/users/nlpro/)
 * (@nlpro)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-activating-the-plugin-5/#post-16105500)
 * Ok, it could be the **sodium** extension is not configured in your PHP env.
 * It appears that meeting the iTSec plugin PHP version requirement is no guarantee
   the sodium extension is available.
 * So to prevent any sodium related fatal errors the iTSec plugin should probably
   also check for the PHP sodium extension to be available.
    -  This reply was modified 3 years, 6 months ago by [nlpro](https://wordpress.org/support/users/nlpro/).
 *  [nlpro](https://wordpress.org/support/users/nlpro/)
 * (@nlpro)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-activating-the-plugin-5/#post-16105879)
 * @chandelierr
 * Can you confirm that the iTSec 8.1.3 release will automatically attempt to add
   the ITSEC_ENCRYPTION_KEY constant to the wp-config.php file upon plugin activation?
 * It looks like this may result in a fatal error when the PHP version requirements
   are met but the sodium PHP extension is not available/loaded.
 *  Plugin Support [chandelierrr](https://wordpress.org/support/users/shanedelierrr/)
 * (@shanedelierrr)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-activating-the-plugin-5/#post-16106266)
 * Hi [@borjamerino](https://wordpress.org/support/users/borjamerino/), thank you
   for reaching out. I have relayed this issue to our developers and will get back
   to you as soon as I receive feedback.
 * [@nlpro](https://wordpress.org/support/users/nlpro/) updating to 8.1.3 won’t 
   automatically add the ITSEC_ENCRYPTION_KEY to the wp-config.php file unless the
   user runs the Setup Encryption Key tool.
 *  Plugin Support [chandelierrr](https://wordpress.org/support/users/shanedelierrr/)
 * (@shanedelierrr)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-activating-the-plugin-5/#post-16106289)
 * [@borjamerino](https://wordpress.org/support/users/borjamerino/) would you please
   provide the ff details for the report?
    – Browser – PHP Version – WordPress Version–
   Plugin Version
 *  Thread Starter [NIMBADA.](https://wordpress.org/support/users/borjamerino/)
 * (@borjamerino)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-activating-the-plugin-5/#post-16106335)
 * Thank you very much for your help. I tried to install it in several ways, in 
   the two indicated PHP versions, and the result was the same. I can’t activate
   the plugin.
 * – Browser: Google Chrome 106.0.5249.119
    – PHP Version: 7.4.30 and 8.0.23 – WordPress
   Version: 6.0.2 – Plugin Version: Last version
 *  [nlpro](https://wordpress.org/support/users/nlpro/)
 * (@nlpro)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-activating-the-plugin-5/#post-16109279)
 * [@shanedelierrr](https://wordpress.org/support/users/shanedelierrr/)
 * > updating to 8.1.3 won’t automatically add the ITSEC_ENCRYPTION_KEY to the wp-
   > config.php file unless the user runs the Setup Encryption Key tool.
 * It sure does on activation of a **new** (non update) iTSec 8.1.3 plugin install.
    -  This reply was modified 3 years, 6 months ago by [nlpro](https://wordpress.org/support/users/nlpro/).
    -  This reply was modified 3 years, 6 months ago by [nlpro](https://wordpress.org/support/users/nlpro/).
 *  Plugin Support [chandelierrr](https://wordpress.org/support/users/shanedelierrr/)
 * (@shanedelierrr)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-activating-the-plugin-5/#post-16109708)
 * Hi [@borjamerino](https://wordpress.org/support/users/borjamerino/), would you
   please reach out to [support@ithemes.com](https://wordpress.org/support/topic/fatal-error-activating-the-plugin-5/support@ithemes.com?output_format=md)
   and mention my username, as we would like to get your Site Health Info for this
   issue?
 *  Thread Starter [NIMBADA.](https://wordpress.org/support/users/borjamerino/)
 * (@borjamerino)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-activating-the-plugin-5/#post-16109870)
 * [@shanedelierrr](https://wordpress.org/support/users/shanedelierrr/) Thank you
   very much, I just sent an email.
 *  Thread Starter [NIMBADA.](https://wordpress.org/support/users/borjamerino/)
 * (@borjamerino)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-activating-the-plugin-5/#post-16110932)
 * HI [@shanedelierrr](https://wordpress.org/support/users/shanedelierrr/)
 * The response received by email is confusing. It seems they haven’t bothered to
   read what’s going on.
 * Hi,
 * You can temporarily disable Security Pro’s features by adding the code below 
   to your wp-config.php file above the “That’s all, stop editing! Happy blogging.”
   comment. Note you’ll need to remove it to re-enable the features of Security 
   Pro.
 * define(‘ITSEC_DISABLE_MODULES’, true);
 * If entering that code does not allow you to log in then the Security plugin will
   not be the cause of the lockout. If you need assistance entering the code above
   you can see how to edit the wp-config.php file in this article.
 *  Plugin Support [chandelierrr](https://wordpress.org/support/users/shanedelierrr/)
 * (@shanedelierrr)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-activating-the-plugin-5/#post-16111118)
 * Hi [@borjamerino](https://wordpress.org/support/users/borjamerino/), thanks for
   the update. I’ve re-assigned your ticket and replied there.
 *  [nlpro](https://wordpress.org/support/users/nlpro/)
 * (@nlpro)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-activating-the-plugin-5/#post-16113685)
 * Hi NIMBADA,
 * It seems WordPress includes a sodium_compat library which kicks in when the PHP
   sodium extension is not available.
 * Assuming you don’t have the PHP sodium extension available, sodium_compat should
   prevent the fatal error from happening.
 * Oh by the way, using the PHP sodium extension is preferred due to performance.
 * Anyway, if you make any progress in solving this issue, the community would very
   much like to hear about it 😉
 *  Thread Starter [NIMBADA.](https://wordpress.org/support/users/borjamerino/)
 * (@borjamerino)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-activating-the-plugin-5/#post-16115729)
 * After the first investigations with the Ithemes support, I have this as a novelty:
 *     ```
       extension: yes
       sodium_crypto_box: yes
       sodium_crypto_box_details: internal
       compat_loaded: no
       sodium_crypto_aead_xchacha20poly1305_ietf_encrypt: no
   
       sodium support	enabled
       sodium compiled version	2.0.23
       libsodium headers version	1.0.11
       libsodium library version	1.0.11
       ```
   
 * I am not sure if everything that should be active is active.
 * For now I do not have a response from support, as soon as I know something more,
   do not doubt that I will share it.
 * Thank you very much!
    -  This reply was modified 3 years, 6 months ago by [NIMBADA.](https://wordpress.org/support/users/borjamerino/).
 *  Plugin Contributor [Timothy Jacobs](https://wordpress.org/support/users/timothyblynjacobs/)
 * (@timothyblynjacobs)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-activating-the-plugin-5/#post-16116568)
 * Hi [@borjamerino](https://wordpress.org/support/users/borjamerino/),
 * As [@nlpro](https://wordpress.org/support/users/nlpro/) mentioned, WordPress 
   does include the `sodium_compat` library which should ensure that the needed 
   PHP functions are always defined. However, the compatibilty library isn’t always
   loaded which is causing this fatal error.
 * We’ve opened a [Core Trac ticket](https://core.trac.wordpress.org/ticket/56860)
   to fix this issue. However, we’ll also be updating iThemes Security to account
   for this scenario in the next update.
 * In the meantime, you can also reach out to your hosting provider and ask them
   to update the `libsodium` library to the latest version. `v1.0.11`, what you 
   have installed, is many years outdated.

Viewing 15 replies - 1 through 15 (of 24 total)

1 [2](https://wordpress.org/support/topic/fatal-error-activating-the-plugin-5/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/fatal-error-activating-the-plugin-5/page/2/?output_format=md)

The topic ‘Fatal error activating the plugin’ is closed to new replies.

 * ![](https://ps.w.org/better-wp-security/assets/icon.svg?rev=3529351)
 * [Kadence Security – Password, Two Factor Authentication, and Brute Force Protection](https://wordpress.org/plugins/better-wp-security/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/better-wp-security/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/better-wp-security/)
 * [Active Topics](https://wordpress.org/support/plugin/better-wp-security/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/better-wp-security/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/better-wp-security/reviews/)

 * 24 replies
 * 4 participants
 * Last reply from: [nlpro](https://wordpress.org/support/users/nlpro/)
 * Last activity: [3 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-activating-the-plugin-5/page/2/#post-16255465)
 * Status: not resolved