| @@ -45,9 +45,9 @@ | ||
| 45 | 45 | /** |
| 46 | 46 | * @return bool true if just initialized. |
| 47 | 47 | */ |
| 48 | 48 | private static function maybe_initialize() { |
| 49 | - if ( ! isset( self::$instance ) ) { | |
| 49 | + if ( empty( self::$instance ) ) { | |
| 50 | 50 | self::$instance = new self(); |
| 51 | 51 | return true; |
| 52 | 52 | } |
| 53 | 53 | return false; |
| @@ -218,9 +218,9 @@ | ||
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | // We don't have a secret, so let's generate one. |
| 221 | 221 | $secret_key = is_callable( 'sodium_crypto_secretbox_keygen' ) ? sodium_crypto_secretbox_keygen() : wp_generate_password( 32, true, true ); |
| 222 | - add_option( 'frm_form_state_key', base64_encode( $secret_key ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode | |
| 222 | + update_option( 'frm_form_state_key', base64_encode( $secret_key ), 'no' ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode | |
| 223 | 223 | |
| 224 | 224 | return $secret_key; |
| 225 | 225 | } |
| 226 | 226 | } |