From cb5f8c2b33dc913d11c321989a2fd0d368856f81 Mon Sep 17 00:00:00 2001 From: Lae <30905719+mlaetitia@users.noreply.github.com> Date: Fri, 13 Nov 2026 11:37:41 +0000 Subject: [PATCH] Match junk supporters whatever their author, since clones rewrite author 0 to 1. Co-Authored-By: Claude Opus 5.5 --- .../osi-supporter-cleanup/osi-supporter-cleanup.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mu-plugins/osi-supporter-cleanup/osi-supporter-cleanup.php b/mu-plugins/osi-supporter-cleanup/osi-supporter-cleanup.php index 5ca2221..b1adc10 100644 --- a/mu-plugins/osi-supporter-cleanup/osi-supporter-cleanup.php +++ b/mu-plugins/osi-supporter-cleanup/osi-supporter-cleanup.php @@ -16,7 +16,7 @@ class OSI_Supporter_Cleanup_Command extends WP_CLI_Command { /** - * Trashes, or deletes, anonymous, never-edited supporter posts with no endorsement type, link or logo, in batches. + * Trashes, or deletes, never-edited supporter posts with no endorsement type, link or logo, in batches. * * ## OPTIONS * @@ -128,7 +128,7 @@ public function __invoke( array $args, array $assoc_args ): void { } /** - * Fetch the next batch of anonymous, never-edited supporter IDs with no endorsement type, link or logo. + * Fetch the next batch of never-edited supporter IDs with no endorsement type, link or logo. * The endorsement form always sends a type, so a submission without one came from another form. * * @param string $status Post status to search. @@ -145,7 +145,7 @@ private function get_candidates( string $status, int $last_id, int $size, bool $ $ids = $wpdb->get_col( $wpdb->prepare( "SELECT p.ID FROM {$wpdb->posts} p - WHERE p.post_type = 'supporter' AND p.post_status = %s AND p.post_author = 0 AND p.ID < %d + WHERE p.post_type = 'supporter' AND p.post_status = %s AND p.ID < %d AND NOT EXISTS ( SELECT 1 FROM {$wpdb->postmeta} m WHERE m.post_id = p.ID AND m.meta_key IN ( 'endorsement_type', 'link', '_thumbnail_id', '_edit_last' ) AND TRIM( m.meta_value ) NOT IN ( '', '0' ) @@ -160,7 +160,7 @@ private function get_candidates( string $status, int $last_id, int $size, bool $ $ids = $wpdb->get_col( $wpdb->prepare( "SELECT p.ID FROM {$wpdb->posts} p - WHERE p.post_type = 'supporter' AND p.post_status = %s AND p.post_author = 0 AND p.ID > %d + WHERE p.post_type = 'supporter' AND p.post_status = %s AND p.ID > %d AND NOT EXISTS ( SELECT 1 FROM {$wpdb->postmeta} m WHERE m.post_id = p.ID AND m.meta_key IN ( 'endorsement_type', 'link', '_thumbnail_id', '_edit_last' ) AND TRIM( m.meta_value ) NOT IN ( '', '0' )