Support » Plugin: iThemes Security (formerly Better WP Security) » Fatal error on Settings Page with other 2FA plugin installed

  • Resolved rgfine

    (@rgfine)


    Since 8.0 it’s not possible for me to access the settings page of ithemes security. It ends with an fatal error:

    “plugins/better-wp-security/core/modules/two-factor/providers/class.two-factor-provider.php verursacht. Error: Cannot declare class Two_Factor_Provider, because the name is already in use”

    It seems that there exist some problems if you have installed other 2FA plugins. Could you please correct this?

Viewing 15 replies - 1 through 15 (of 20 total)
  • Plugin Author Timothy Jacobs

    (@timothyblynjacobs)

    Hi @rgfine,

    I’m sorry you’re running into trouble with iThemes Security. The iThemes Security Two-Factor module and the Two-Factor plugin currently cannot both be run at the same time.

    We’re working on a fix that will be released later today or tomorrow. If you need to access the iThemes Security settings pages in the meantime. You can temporarily comment out the line 482 in better-wp-security/core/core.php.


    ITSEC_Modules::register_module( 'two-factor', "$path/modules/two-factor" );

    Thread Starter rgfine

    (@rgfine)

    HI @timothyblynjacobs

    Many thanks for the fast response and also for the temp. workaround. This helps a lot.

    Plugin Author Timothy Jacobs

    (@timothyblynjacobs)

    No problem @rgfine!

    Hello, @timothyblynjacobs

    Any update about this fix ?

    I opened a ticket support for the same reason (except that it concerns ithemes security pro).

    Thanks for the temporary workaround.

    Thread Starter rgfine

    (@rgfine)

    Hey @laboiteare, for me and the non-pro-version the problem was fixed in version 8.0.1.

    Update : The temporary workaround doesn’t work with pro version 🙁

    Fatal error: Uncaught Error: Call to a member function get_id() on null in /home/clients/xxxx/xxxx.fr/www/wp-content/plugins/ithemes-security-pro/core/modules.php:123 Stack trace: #0 /home/clients/xxxx/xxxx.fr/www/wp-content/plugins/ithemes-security-pro/ithemes-security-pro.php(69): ITSEC_Modules::register_module('pro-two-factor', '/home/clients/x...') #1 /home/clients/xxxx/xxxx.fr/www/wp-includes/class-wp-hook.php(303): itsec_pro_register_modules('') #2 /home/clients/xxxx/xxxx.fr/www/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array) #3 /home/clients/xxxx/xxxx.fr/www/wp-includes/plugin.php(470): WP_Hook->do_action(Array) #4 /home/clients/xxxx/xxxx.fr/www/wp-content/plugins/ithemes-security-pro/core/modules.php(807): do_action('itsec-register-...') #5 /home/clients/xxxx/lab in /home/clients/xxxx/xxxx.fr/www/wp-content/plugins/ithemes-security-pro/core/modules.php on line 123

    • This reply was modified 3 months, 3 weeks ago by laboiteare.

    Thanks @rgfine

    By bad : iThemes licence information had disappeared so I didn’t get the last version.

    Unfortunately, I still have this error with the latests (7.0.3) :
    Fatal error: Cannot declare class Two_Factor_Provider, because the name is already in use in /home/clients/xxx/xxx.fr/www/wp-content/plugins/ithemes-security-pro/core/modules/two-factor/providers/class.two-factor-provider.php on line 13

    @laboiteare

    According to the Pro 7.0.3 release (2021-08-10) changelog:

    Bug Fix: Unregister the iThemes Security Two-Factor module when the Two-Factor Feature Plugin is enabled.

    @laboiteare

    The bug fix only works in combination with the Two Factor plugin.
    It probably won’t work for any other conflicting 2FA plugin (if any).

    @nlpro Yes I know and this is my case, I use the same plugin.

    According to the Pro 7.0.3 release it should be fixed but I Can confirm that it still doesn’t work, like I said above 😔

    I opened a support ticket with a link to this post, so now i’m waiting for an answer froo team or from @timothyblynjacobs .

    Ok, I see.

    To rule out that the 7.0.2 -> 7.0.3 update failed, check for the code below in the ithemes-security-pro/core/core.php file:

    	/**
    	 * Checks for compatibility with existing plugins,
    	 * and disables the respective ITSEC modules if needed.
    	 */
    	public function compat_checks() {
    		// The Two-Factor feature plugin and ITSEC Two-Factor cannot be used at the same time.
    		if ( defined( 'TWO_FACTOR_VERSION' ) ) {
    	 		ITSEC_Modules::deregister_module( 'two-factor' );
    			ITSEC_Modules::deregister_module( 'pro-two-factor' );
    		}
    	}

    If that piece of code does not exist, download the 7.0.3 .zip file from iThemes Member Panel. Then delete the current wp-content/plugins/ithemes-security-pro folder and upload/extract the 7.0.3 .zip file manually(if not already). Then retry.

    For now I’m assuming the 7.0.3 release fixed the issue, but you never know 😉 Keep me posted.

    • This reply was modified 3 months, 3 weeks ago by nlpro.

    Thanks your very much for answering @nlpro. (I didn’t understand that you were part of the team)

    Actually, I can confirm you that update didn’t failed (piece of code exists in core.php). To exclude an update error, I still did a manual reinstallation, and the fatal error is still present.

    So, with 7.0.3 release and https://wordpress.org/plugins/two-factor installed, when I opened https://www.xxx.fr/wp-admin/admin.php?page=itsec-dashboard, there’s a fatal error with this error :

    PHP Fatal error: Cannot declare class Two_Factor_Provider, because the name is already in use in /home/clients/xxxx/xxxx.fr/www/wp-content/plugins/ithemes-security-pro/core/modules/two-factor/providers/class.two-factor-provider.php on line 13

    @laboiteare

    Thanks your very much for answering @nlpro. (I didn’t understand that you were part of the team)

    You’re welcome. Though I’m not part of iThemes.
    Just interested in solving issues 😉

    Ok, looks like the bug is not completely fixed in Pro.
    Do you have any of the following modules enabled:

    • User Logging
    • Trusted Devices

    It looks like the 2 Pro modules mentioned above (and the CLI module) still try to instantiate the ITSEC_Two_Factor_Helper class which performs a require_once of the core/modules/two-factor/providers/class.two-factor-provider.php file.

    None of theses modules are enabled.

    So only way to access dashboard is to disable Two Auth Plugin.

    I run a test on a second website (clean install) and it’s the same.

    But, interesting fact, in both cases, it seems that the fatal errors occurs only when we are on this page https://xxx.fr/wp-admin/admin.php?page=itsec-dashboard

    • This reply was modified 3 months, 3 weeks ago by laboiteare.
Viewing 15 replies - 1 through 15 (of 20 total)
  • You must be logged in to reply to this topic.