| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * @package FireBox |
| 4 | - * @version 3.1.8 Free | |
| 4 | + * @version 3.1.14 Free | |
| 5 | 5 | * |
| 6 | 6 | * @author FirePlugins <[email protected]> |
| 7 | 7 | * @link https://www.fireplugins.com |
| 8 | 8 | * @copyright Copyright © 2026 FirePlugins All Rights Reserved |
| @@ -32,9 +32,9 @@ | ||
| 32 | 32 | const settings_name = 'firebox_settings'; |
| 33 | 33 | |
| 34 | 34 | public function __construct() |
| 35 | 35 | { |
| 36 | - add_action('update_option_firebox_settings', [$this, 'after_update_settings'], 10, 3); | |
| 36 | + add_action('update_option_firebox_settings', [$this, 'after_update_settings'], 10, 2); | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 40 | * Render the page content |
| @@ -173,9 +173,12 @@ | ||
| 173 | 173 | $stored_settings = get_option('firebox_settings', []); |
| 174 | 174 | $stored_settings = is_array($stored_settings) ? $stored_settings : []; |
| 175 | 175 | foreach (\FireBox\Core\Helpers\Integrations::getSettingsKeys() as $key) |
| 176 | 176 | { |
| 177 | - if (!array_key_exists($key, $input) && isset($stored_settings[$key])) | |
| 177 | + // Only a stored credential is worth carrying over. The keys are | |
| 178 | + // seeded empty at install, and copying those in would add a blank | |
| 179 | + // entry for every integration the site never connected. | |
| 180 | + if (!array_key_exists($key, $input) && !empty($stored_settings[$key])) | |
| 178 | 181 | { |
| 179 | 182 | $input[$key] = $stored_settings[$key]; |
| 180 | 183 | } |
| 181 | 184 | } |
| @@ -194,8 +197,13 @@ | ||
| 194 | 197 | * @return bool |
| 195 | 198 | */ |
| 196 | 199 | private function isAllowedProgrammaticSettingsUpdate() |
| 197 | 200 | { |
| 201 | + if (!wp_doing_ajax()) | |
| 202 | + { | |
| 203 | + return false; | |
| 204 | + } | |
| 205 | + | |
| 198 | 206 | $action = isset($_REQUEST['action']) ? sanitize_key(wp_unslash($_REQUEST['action'])) : ''; |
| 199 | 207 | |
| 200 | 208 | if ($action === '') |
| 201 | 209 | { |