Title: Fatal error &#8220;Unknown format specifier&#8221;
Last modified: November 29, 2022

---

# Fatal error “Unknown format specifier”

 *  Resolved [4a4b](https://wordpress.org/support/users/4a4b/)
 * (@4a4b)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-unknown-format-specifier/)
 * After an update to PHP 8.0 a user got a fatal error:
 *     ```
       [29-Nov-2022 08:05:42 UTC] PHP Fatal error:  Uncaught ValueError: Unknown format specifier " " in /html/wordpress/wp-content/plugins/wp-2fa/includes/classes/class-wp2fa.php:525
       Stack trace:
       #0 /html/wordpress/wp-content/plugins/wp-2fa/includes/classes/class-wp2fa.php(525): sprintf('...', '...', '...')
       #1 /html/wordpress/wp-content/plugins/wp-2fa/includes/classes/Admin/class-setup-wizard.php(569): WP2FA\WP2FA::get_wp2fa_email_templates('...')
       #2 /html/wordpress/wp-content/plugins/wp-2fa/includes/classes/Authenticator/class-login.php(928): WP2FA\Admin\Setup_Wizard::send_authentication_setup_email(65)
       #3 /html/wordpress/wp-content/plugins/wp-2fa/includes/classes/Authenticator/class-login.php(428): WP2FA\Authenticator\Login::email_authentication_page(Object(WP_User))
       #4 /html/wordpress/wp-content/plugins/wp-2fa/includes/classes/Authenticator/class-login.php(326): WP2FA\Authenticator\Login::login_html(Object(WP_User), '...', '...')
       #5 /html/wordpress/wp-content/plugins/wp-2fa/includes/classes/Authenticator/class-login.php(169): WP2FA\Authenticator\Login::show_two_factor_login(Object(WP_User))
       #6 /html/wordpress/wp-content/plugins/wp-2fa/includes/classes/Authenticator/class-login.php(99): WP2FA\Authenticator\Login::clear_session_and_show_2fa_form(Object(WP_User))
       #7 /html/wordpress/wp-includes/class-wp-hook.php(307): WP2FA\Authenticator\Login::wp_login('...', Object(WP_User))
       #8 /html/wordpress/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
       #9 /html/wordpress/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
       #10 /html/wordpress/wp-includes/user.php(110): do_action('...', '...', Object(WP_User))
       #11 /html/wordpress/wp-login.php(1221): wp_signon(Array, true)
       #12 {main}
         thrown in /html/wordpress/wp-content/plugins/wp-2fa/includes/classes/class-wp2fa.php on line 525
       ```
   
 * I could not replicate the problem with my own account. After a downgrade to PHP
   7.4.33 the user was able again to login.
 * The site is part of a multisite installation
 * WordPress: 6.0.3
    WP 2FA: 2.3.0 Custom Theme
    -  This topic was modified 3 years, 6 months ago by [4a4b](https://wordpress.org/support/users/4a4b/).

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Contributor [robertabela](https://wordpress.org/support/users/robert681/)
 * (@robert681)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-unknown-format-specifier/#post-16251100)
 * Hello [@4a4b](https://wordpress.org/support/users/4a4b/)
 * Thank you very much for using our plugin. I am sorry to read about your issue.
   Can you please answer the below questions so we can better understand the context
   of the issue?
 * 1) When you upgraded to PHP 8, were there other users who have encountered the
   same problem?
 * 2) Since you did not encounter the same problem with your account, can you highlight
   the differences between your account and the account of the other user?
 * 3) At what stage is the error reported? Is it reported when they try to log in,
   or when they are doing something else?
 * 4) Do you have a staging environment on which this can be easily reproduced? 
   If yes, can you reproduce it each time?
 * Looking forward to hearing from you.
 *  Thread Starter [4a4b](https://wordpress.org/support/users/4a4b/)
 * (@4a4b)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-unknown-format-specifier/#post-16251752)
 * Hi [@robert681](https://wordpress.org/support/users/robert681/)
 * > 1) When you upgraded to PHP 8, were there other users who have encountered 
   > the same problem?
 * It was only one user
 * > 2) Since you did not encounter the same problem with your account, can you 
   > highlight the differences between your account and the account of the other
   > user?
 * The other user is the only one who has choosen the method to get the 2FA code
   by email.
 * > 3) At what stage is the error reported? Is it reported when they try to log
   > in, or when they are doing something else?
 * I found the corresponding entry in the access log – the user obviously tried 
   to log in:
 * `***.***.***.*** - - [29/Nov/2022:09:05:13 +0100] "POST /wp-login.php HTTP/2.0"
   500 8623 "https://example.com/wp-login.php" "Mozilla/5.0 (Windows NT 10.0; Win64;
   x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36" example.
   com`
 * > 4) Do you have a staging environment on which this can be easily reproduced?
   > If yes, can you reproduce it each time?
 * I have tested it now on a testing environment: I could reproduce the error 500
   on PHP 8.0 with a user that has selected the method “one-time codes via email”.
 *  Plugin Contributor [robertabela](https://wordpress.org/support/users/robert681/)
 * (@robert681)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-unknown-format-specifier/#post-16267839)
 * Sorry for the delay on this one [@4a4b](https://wordpress.org/support/users/4a4b/)
 * Thank you for the detail. We will set up a test environment and test this and
   include a fix in the next update.
 * Please let us know if there is anything else we can do for you at the moment.
 * Thank you for your patience and cooperation.
 *  [coodeis](https://wordpress.org/support/users/xkouhiax/)
 * (@xkouhiax)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-unknown-format-specifier/#post-16368942)
 * Can confirm PHP8.x incompatibility. Got quite similar error:
 *     ```wp-block-code
       PHP Fatal error:  Uncaught ValueError: Missing format specifier at end of string in /var/www/patmos/wp-content/plugins/wp-2fa/includes/classes/Utils/class-date-time-utils.php:63
       ```
   
 * [@robert681](https://wordpress.org/support/users/robert681/) PHP 7.4 is EOL.
    -  This reply was modified 3 years, 4 months ago by [coodeis](https://wordpress.org/support/users/xkouhiax/).
 *  Plugin Contributor [robertabela](https://wordpress.org/support/users/robert681/)
 * (@robert681)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-unknown-format-specifier/#post-16369777)
 * Hello [@xkouhiax](https://wordpress.org/support/users/xkouhiax/)
 * Thank you for posting on this forum. If you have encountered any issues and needs
   support from us, please open your own forum thread, as per these forums’ guidelines.
 * Thank you for your understanding and cooperation.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Fatal error “Unknown format specifier”’ 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/)

 * 8 replies
 * 3 participants
 * Last reply from: [robertabela](https://wordpress.org/support/users/robert681/)
 * Last activity: [3 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-unknown-format-specifier/#post-16369777)
 * Status: resolved