Skip to content

Commit d3c4644

Browse files
committed
Fix. Users. Edit the deletion of a non-checkable user
1 parent 44e7561 commit d3c4644

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

  • lib/Cleantalk/ApbctWP/FindSpam/ListTable

lib/Cleantalk/ApbctWP/FindSpam/ListTable/Users.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -293,15 +293,21 @@ public function removeSpam($ids)
293293
foreach ( $ids as $id ) {
294294
$user_id = (int)sanitize_key($id);
295295

296-
// Only act on users that were marked as spam by CleanTalk
297-
if ( ! delete_user_meta($user_id, 'ct_marked_as_spam') ) {
296+
// Check if user was marked as spam or as bad (without IP/email)
297+
$is_marked_spam = delete_user_meta($user_id, 'ct_marked_as_spam');
298+
$is_bad_user = delete_user_meta($user_id, 'ct_bad');
299+
300+
// Only act on users that were marked by CleanTalk
301+
if ( ! $is_marked_spam && ! $is_bad_user ) {
298302
continue;
299303
}
300304

301-
//Send feedback
302-
$hash = get_user_meta($user_id, 'ct_hash', true);
303-
if ( $hash ) {
304-
ct_feedback($hash, 0);
305+
//Send feedback (only for spam-marked users)
306+
if ( $is_marked_spam ) {
307+
$hash = get_user_meta($user_id, 'ct_hash', true);
308+
if ( $hash ) {
309+
ct_feedback($hash, 0);
310+
}
305311
}
306312

307313
//Delete user and posts

0 commit comments

Comments
 (0)