Try this new version. Replace this query line ~1430 (original version)
$q1 = $wpdb->get_results("SELECT
M.id,
M.sender,
M.recipient,
M.date,
M.read,
U.ID
FROM
".$wpdb->prefix."rencontre_msg M,
".$wpdb->prefix."users U
WHERE
(M.recipient='".$current_user->user_login."' and
M.deleted!=1 and
U.user_login=M.sender)
or
(M.sender='".$current_user->user_login."' and
M.deleted!=2 and
U.user_login=M.recipient)
ORDER BY M.date DESC"); // delete=1 : supp par dest - delete=2 : supp par writter
with this new code :
$q1 = $wpdb->get_results("SELECT
M.id,
M.sender,
M.recipient,
M.date,
M.read,
U.ID
FROM
".$wpdb->prefix."rencontre_msg M,
".$wpdb->prefix."users U
WHERE
U.user_login=M.sender and
M.recipient='".$current_user->user_login."' and
M.deleted!=1");
$q2 = $wpdb->get_results("SELECT
M.id,
M.sender,
M.recipient,
M.date,
M.read,
U.ID
FROM
".$wpdb->prefix."rencontre_msg M,
".$wpdb->prefix."users U
WHERE
U.user_login=M.recipient and
M.sender='".$current_user->user_login."' and
M.deleted!=2");
$q1 = array_merge($q1,$q2);
usort($q1, function($a,$b){return strcmp($b->date,$a->date);});
echo "*********Count result : ".count($q1);