File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -90,8 +90,7 @@ function ( $default_params ) {
9090 if (empty ($ currentMode )) {
9191 update_option ('monei_apikey_mode ' , 'test ' ); // Default to test if both exist
9292 }
93- $ this ->cleanup_legacy_keys ($ default_params );
94- return $ default_params ;
93+ return $ this ->cleanup_legacy_keys ($ default_params );
9594 }
9695
9796 // Scenario 2 & 3: Partial new keys exist - try to complete them
@@ -146,15 +145,21 @@ function ( $default_params ) {
146145
147146 // Clean up legacy keys if we did any migration
148147 if ($ needsMigration ) {
149- $ this ->cleanup_legacy_keys ($ default_params );
148+ $ default_params = $ this ->cleanup_legacy_keys ($ default_params );
150149 }
151150
152151 return $ default_params ;
153152 },
154153 10
155154 );
156155 }
157- function cleanup_legacy_keys ($ settings_array ) {
156+ /**
157+ * Clean up legacy API keys from both standalone options and settings array.
158+ *
159+ * @param array $settings_array The settings array to clean
160+ * @return array The cleaned settings array
161+ */
162+ private function cleanup_legacy_keys ($ settings_array ) {
158163 // Remove legacy standalone options
159164 delete_option ('monei_apikey ' );
160165 delete_option ('monei_accountid ' );
You can’t perform that action at this time.
0 commit comments