From f6096706dfba077b13dd3e91687cb4e949ed50b5 Mon Sep 17 00:00:00 2001 From: Derrick Koo Date: Tue, 18 Feb 2025 12:28:06 -0700 Subject: [PATCH] fix(esp-sync): broken CLI sync command (#3762) --- includes/cli/class-ras-esp-sync.php | 2 ++ includes/reader-activation/sync/class-esp-sync.php | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/includes/cli/class-ras-esp-sync.php b/includes/cli/class-ras-esp-sync.php index 78e0a77d77..907c1e8ea2 100644 --- a/includes/cli/class-ras-esp-sync.php +++ b/includes/cli/class-ras-esp-sync.php @@ -178,6 +178,8 @@ private static function sync_contacts( $config ) { $result->get_error_message() ) ); + } elseif ( ! empty( static::$results ) ) { + static::$results['processed']++; } } } diff --git a/includes/reader-activation/sync/class-esp-sync.php b/includes/reader-activation/sync/class-esp-sync.php index ad9dc30f82..b802767e7b 100644 --- a/includes/reader-activation/sync/class-esp-sync.php +++ b/includes/reader-activation/sync/class-esp-sync.php @@ -238,12 +238,9 @@ public static function sync_contact( $user_id_or_order, $is_dry_run = false ) { // Translators: %1$s is the status and %2$s is the contact's email address. __( '%1$s contact data for %2$s.', 'newspack-plugin' ), $is_dry_run ? __( 'Would sync', 'newspack-plugin' ) : __( 'Synced', 'newspack-plugin' ), - $customer->get_email() + $contact['email'] ) ); - if ( ! empty( static::$results ) ) { - static::$results['processed']++; - } } return $result;