PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.7.0
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.7.0
1.7.0 1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 All 50 releases
← All changes | app/Models/Customer.php +6 -18 1.6.6 → 1.7.0 View file →
@@ -160,28 +160,16 @@
160 160 return trim("{$fname} {$lname}");
161 161 }
162 162
163 163 /**
164 - * Accessor method to get the user's avatar URL using their email,
165 - * with a size of 100x100 pixels.
166 - *
167 - * @return string
164 + * The customer's avatar URL: their uploaded photo when one is set,
165 + * otherwise the WordPress avatar by user id or email. Empty when the
166 + * customer has no avatar of their own — every display site falls back
167 + * to a placeholder icon rather than Gravatar's stock image.
168 168 */
169 - public function getPhotoAttribute()
169 + public function getPhotoAttribute(): string
170 170 {
171 - // Get the custom photo URL from user meta using the user_id of this instance
172 - $customPhotoUrl = get_user_meta($this->user_id, 'fc_customer_photo_url', true);
173 -
174 - // Sanitize the customer photo URL
175 - $customPhotoUrl = esc_url($customPhotoUrl ?? '');
176 -
177 - // Return the custom photo URL if it exists, otherwise fallback to Gravatar
178 - if (!empty($customPhotoUrl)) {
179 - return $customPhotoUrl;
180 - }
181 -
182 - // Fallback to Gravatar if no customer avatar is set and sanitize the Gravatar URL
183 - return esc_url(get_avatar_url($this->email, ['size' => 100]));
171 + return Helper::getUserAvatarUrl($this->user_id, $this->email);
184 172 }
185 173
186 174 /**
187 175 * Accessor method to get the country's name with country code,