# Emergency Recovery: Fatal `array_merge()` Error on Plugin Load

## When to use this

Use this procedure if your site shows a fatal error / white screen of death and the message points to WP Cerber settings, for example:

```
Uncaught TypeError: array_merge(): Argument #1 must be of type array, bool given in cerber-settings.php
```

This happens when the plugin's settings value stored in the database (`cerber_configuration`) has become corrupted and can no longer be read, usually after a site migration, a database search-replace, or an incomplete database import.

This recovery method requires only **file access** to your site (FTP, SSH, or your hosting file manager). If you also have database access (phpMyAdmin or WP-CLI), see the simpler alternative at the end.

> **Before you start:** if possible, make a backup of `wp-config.php` and of your database. If you already have a known-good export of your WP Cerber settings, have it ready.

## What this does

Defining the `CERBER_WP_OPTIONS` constant makes WP Cerber read its settings through a different code path that does not hit the failing operation. This lets your site and the WordPress admin area load again, so you can rewrite the corrupted settings with valid data. The constant is a temporary measure and must be removed once the settings are fixed.

## Step 1. Enable the emergency mode

Open `wp-config.php` in the root folder of your WordPress installation and add the following line **above** the comment `/* That's all, stop editing! */`:

```php
define( 'CERBER_WP_OPTIONS', true );
```

Save the file and reload your site. The fatal error should be gone and you should be able to log in to the WordPress admin area.

> While this constant is active, WP Cerber runs with empty settings, which means its protection is effectively disabled. This is expected. Do not leave the site in this state longer than needed to complete the steps below.

## Step 2. Restore valid settings

You now need to overwrite the corrupted value in the database with a valid one. Choose **one** of the options below.

**Option A. Import your settings from a backup**

1. Go to **WP Cerber > Tools > Import & Export**.
2. Import your previously saved settings file.

Use this option only if the backup was created before the corruption occurred.

**Option B. Load the default settings**

1. Go to **WP Cerber > Tools**.
2. Use the option to load the default (initial) settings.

This resets WP Cerber to a clean, working configuration. You can re-adjust individual settings afterwards.

After completing Option A or B, confirm that the settings page saves and displays normally.

## Step 3. Disable the emergency mode

Once the settings have been successfully restored, remove the line you added in Step 1 from `wp-config.php`:

```php
define( 'CERBER_WP_OPTIONS', true );
```

Delete the line completely, save the file, and reload your site.

> **Important:** do not remove this line until Step 2 has completed successfully. Restoring the settings is what actually repairs the database; removing the constant beforehand will bring the fatal error back.

## Step 4. Verify

- The site loads with no fatal error, both on the front end and in the admin area.
- **WP Cerber > Main Settings** opens and shows your configuration.
- Your protection settings are active again.

If a critical issue about corrupted settings was shown on the WP Cerber dashboard, it is cleared automatically once the settings are saved.
