$session_id, 'started_at' => time() ]; if ( false === get_option( $key ) ) { add_option( $key, $row, '', 'no' ); } else { update_option( $key, $row ); } } /** * Clear a user's active import handle (on a terminal complete/failed/revert). * * @param int $user_id * @return void */ public static function clear( int $user_id ): void { delete_option( self::key( $user_id ) ); } /** * @param int $user_id * @return string */ private static function key( int $user_id ): string { return self::OPTION_PREFIX . $user_id; } }