Title: Fatal error: PHP8.2
Last modified: January 5, 2024

---

# Fatal error: PHP8.2

 *  [paulroberts](https://wordpress.org/support/users/paulroberts/)
 * (@paulroberts)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-php8-2/)
 * I am getting this error on the users page.
 * Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must
   be of type array, null given in /wp-content/plugins/wordfence/modules/login-security/
   classes/controller/permissions.php:443 Stack trace: #0 /wp-content/plugins/wordfence/
   modules/login-security/classes/controller/permissions.php(443): array_key_exists()#
   1 /wp-content/plugins/wordfence/modules/login-security/classes/controller/users.
   php(191): WordfenceLS\Controller_Permissions->does_user_have_multisite_capability()#
   2 /wp-content/plugins/wordfence/modules/login-security/classes/controller/users.
   php(653): WordfenceLS\Controller_Users->can_activate_2fa() #3 /wp-includes/class-
   wp-hook.php(324): WordfenceLS\Controller_Users->_user_row_actions() #4 /wp-includes/
   plugin.php(205): WP_Hook->apply_filters() #5 /wp-admin/includes/class-wp-users-
   list-table.php(520): apply_filters() #6 /wp-admin/includes/class-wp-users-list-
   table.php(415): WP_Users_List_Table->single_row() #7 /wp-admin/includes/class-
   wp-list-table.php(1709): WP_Users_List_Table->display_rows() #8 /wp-admin/includes/
   class-wp-list-table.php(1636): WP_List_Table->display_rows_or_placeholder() #
   9 /wp-admin/users.php(814): WP_List_Table->display() #10 {main} thrown in /wp-
   content/plugins/wordfence/modules/login-security/classes/controller/permissions.
   php on line 443
   There has been a critical error on this website.
    -  This topic was modified 2 years, 4 months ago by [paulroberts](https://wordpress.org/support/users/paulroberts/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffatal-error-php8-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [wfpeter](https://wordpress.org/support/users/wfpeter/)
 * (@wfpeter)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-php8-2/#post-17327150)
 * Hi [@paulroberts](https://wordpress.org/support/users/paulroberts/), thanks for
   providing the error.
 * Is this site part of a multisite installation, and if so is it the main site?
   Have you enabled 2FA or reCAPTCHA for any accounts outside of the user page, 
   such as your admin account directly from **Wordfence > Login Security**?
 * Also are you using a fresh installation of Wordfence, or have you been using 
   it for longer? Either way, are you on version 7.11.1 right now?
 * Many thanks,
   Peter.
 *  [kognetiks](https://wordpress.org/support/users/kognetiks/)
 * (@kognetiks)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-php8-2/#post-17335045)
 * [11-Jan-2024 09:41:10 UTC] PHP Fatal error: Uncaught Error: Call to undefined
   function WordfenceLS\get_current_site() in /home/…OMITTED…/…OMITTED….com/wp-content/
   plugins/wordfence/modules/login-security/classes/controller/permissions.php:128
   
   Stack trace: 0 /home/…OMITTED…/…OMITTED….com/wp-includes/class-wp-hook.php(324):
   WordfenceLS\Controller_Permissions->_role_sync_cron() 1 /home/…OMITTED…/…OMITTED….
   com/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(”, Array) 2 /home/…
   OMITTED…/…OMITTED….com/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
   3 /home/…OMITTED…/…OMITTED….com/wp-cron.php(191): do_action_ref_array(‘wordfence_ls_ro…’,
   Array) 4 {main}
 * thrown in /home/…OMITTED…/…OMITTED….com/wp-content/plugins/wordfence/modules/
   login-security/classes/controller/permissions.php on line 128
   I’ve encountered
   a similar problem with get_current_site() and permissions.php file on lines 128.
   Background: Wordfence had been working perfectly. A while back I transitioned
   to a multi-site installation with plans for more than one site on the server,
   however, decided not to do that so removed multi-site. The site is running fine
   with no problems after downgrade to single site. Note sure that this problem 
   is related to that or not.The get_current_site() makes me think that Wordfence
   still thinks this is a multi-site install. What might the fix be?
 * BTW, I’ve tried uninstalling and reinstalling the Wordfence plugin, but that 
   hasn’t resovled the issue.
 * PHP Version: **8.3.0**
   WordPress Version: **6.4.2**WordPress Language Code: **
   en_US**
    -  This reply was modified 2 years, 4 months ago by [kognetiks](https://wordpress.org/support/users/kognetiks/).
    -  This reply was modified 2 years, 4 months ago by [kognetiks](https://wordpress.org/support/users/kognetiks/).
 *  [kognetiks](https://wordpress.org/support/users/kognetiks/)
 * (@kognetiks)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-php8-2/#post-17336692)
 * Line 128 refers to             $network_id = get_current_site()->id;
 * Reverting from multi-site to single-site might be the root cuase.
 * How do we get this fixed?
 * I just deleted the wordfence_ls_role_sync_cron which might help/hurt?
 *  Thread Starter [paulroberts](https://wordpress.org/support/users/paulroberts/)
 * (@paulroberts)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-php8-2/#post-17338942)
 * it is multi site install
 * >Have you enabled 2FA or reCAPTCHA
 * Don’t think so, I have had to disable wordfence as users can’t log in
    -  This reply was modified 2 years, 4 months ago by [paulroberts](https://wordpress.org/support/users/paulroberts/).
 *  [kognetiks](https://wordpress.org/support/users/kognetiks/)
 * (@kognetiks)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-php8-2/#post-17339537)
 * Deleting the wordfence_ls_role_sync_cron cron job seems to have resolved the 
   issue. But not knowing exactly what this does, what else might it affect.
 *  Thread Starter [paulroberts](https://wordpress.org/support/users/paulroberts/)
 * (@paulroberts)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-php8-2/#post-17339840)
 * Wordfence Security – Anti-virus, Firewall and Malware Scan
 * Version 7.11.1
 * i get the error on wp-admin/users.php
 * and users get it on login page.
    -  This reply was modified 2 years, 4 months ago by [paulroberts](https://wordpress.org/support/users/paulroberts/).
 *  Thread Starter [paulroberts](https://wordpress.org/support/users/paulroberts/)
 * (@paulroberts)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-php8-2/#post-17374528)
 * Do you plan on fixing this it been 2 weeks, 6 days  without the plugin working?
 *  [scott8035](https://wordpress.org/support/users/scott8035/)
 * (@scott8035)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-php8-2/#post-17526895)
 * I’m receiving the same/similar error: “PHP Fatal error: Uncaught Error: Call 
   to undefined function WordfenceLS\get_current_site()”. This site was exported
   from a multi-site install and was converted with plugin “Prime Mover Pro”.
 *  Thread Starter [paulroberts](https://wordpress.org/support/users/paulroberts/)
 * (@paulroberts)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-php8-2/#post-17681990)
 * this is still an issue, do you plan on fixing it?
 * > Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must
   > be of type array, null given in httpdocs/wp-content/plugins/wordfence/modules/
   > login-security/classes/controller/permissions.php:443 Stack trace: #0 httpdocs/
   > wp-content/plugins/wordfence/modules/login-security/classes/controller/permissions.
   > php(443): array_key_exists() #1 httpdocs/wp-content/plugins/wordfence/modules/
   > login-security/classes/controller/users.php(195): WordfenceLS\Controller_Permissions-
   > >does_user_have_multisite_capability() #2 httpdocs/wp-content/plugins/wordfence/
   > modules/login-security/classes/controller/users.php(656): WordfenceLS\Controller_Users-
   > >can_activate_2fa() #3 httpdocs/wp-includes/class-wp-hook.php(324): WordfenceLS\
   > Controller_Users->_user_row_actions() #4 httpdocs/wp-includes/plugin.php(205):
   > WP_Hook->apply_filters() #5 httpdocs/wp-admin/includes/class-wp-users-list-
   > table.php(520): apply_filters() #6 httpdocs/wp-admin/includes/class-wp-users-
   > list-table.php(415): WP_Users_List_Table->single_row() #7 httpdocs/wp-admin/
   > includes/class-wp-list-table.php(1706): WP_Users_List_Table->display_rows()#
   > 8 httpdocs/wp-admin/includes/class-wp-list-table.php(1633): WP_List_Table->
   > display_rows_or_placeholder() #9 httpdocs/wp-admin/users.php(814): WP_List_Table-
   > >display() #10 {main} thrown in httpdocs/wp-content/plugins/wordfence/modules/
   > login-security/classes/controller/permissions.php on line 443

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

The topic ‘Fatal error: PHP8.2’ is closed to new replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

## Tags

 * [fatal error](https://wordpress.org/support/topic-tag/fatal-error/)
 * [multi-site](https://wordpress.org/support/topic-tag/multi-site/)
 * [uncaught error](https://wordpress.org/support/topic-tag/uncaught-error/)

 * 9 replies
 * 4 participants
 * Last reply from: [paulroberts](https://wordpress.org/support/users/paulroberts/)
 * Last activity: [2 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-php8-2/#post-17681990)
 * Status: not resolved