diff --git a/lib/Config/Populator.php b/lib/Config/Populator.php index 130de44cab..0b6a2fa3e8 100644 --- a/lib/Config/Populator.php +++ b/lib/Config/Populator.php @@ -623,11 +623,11 @@ class Populator { private function updateLastSubscribedAt() { global $wpdb; - // perform once for versions below or equal to 3.33.0 - if (version_compare($this->settings->get('db_version', '3.33.1'), '3.33.0', '>')) { + // perform once for versions below or equal to 3.41.2 + if (version_compare($this->settings->get('db_version', '3.41.3'), '3.41.2', '>')) { return false; } - $query = "UPDATE `%s` SET last_subscribed_at = GREATEST(COALESCE(confirmed_at, 0), COALESCE(created_at, 0)) WHERE status != '%s';"; + $query = "UPDATE `%s` SET last_subscribed_at = GREATEST(COALESCE(confirmed_at, 0), COALESCE(created_at, 0)) WHERE status != '%s' AND last_subscribed_at IS NULL;"; $wpdb->query(sprintf( $query, Subscriber::$_table,