Comment quotes slashed
After running the importer, all apostrophes and quotes in comments had visible slashes inserted beforehand.
Very strange; we call wp_slash(), however this is immediately undone instead wp_insert_comment()...
Can you share your import file (or just a single comment from it)?
(Also, is this for new comments, or comments being updated?)
All comments. Calling wp_slash is incorrect - the line immediately before:
$comment = wp_filter_comment( $comment );
runs pre_comment_content, which has a default kses filter which adds slashes, thus the double escaping.
Ah WordPress, you continue to disappoint me. This may be additionally stripping a layer of slashes in that case, if wp_filter_comment expects slashed data.
I think you may have misunderstood - wp_filter_comment takes the raw data and does all the slashing for you already. So there's no need for wp_slash in the plugin - remove that, and everything works perfectly.
This replicates the core logic, which calls wp_filter_comment and passes the result to wp_insert_comment without an extra wp_slash.
From memory, internally wp_filter_comment calls wp_kses_filter, which runs addslashes( wp_kses( stripslashes( $data ) ) ), so my guess is that we need to add slashes before wp_filter_comment, and then not add them later. (Again, this is from memory, I'll check when I'm at my desk.)
The existing importer potentially has this bug too: https://core.trac.wordpress.org/ticket/35839