| @@ -392,8 +392,9 @@ | ||
| 392 | 392 | |
| 393 | 393 | $xprofile = $user->xprofile; |
| 394 | 394 | // Let's sync the cover photo and avatar |
| 395 | 395 | if (!$xprofile->hasCustomAvatar()) { |
| 396 | + /** @phpstan-ignore argument.type (BuddyPress overrides get_avatar_url with different signature; WP stub doesn't match BP variant) */ | |
| 396 | 397 | $avatar = get_avatar_url($user->ID, 'full', true); |
| 397 | 398 | |
| 398 | 399 | $coverPhoto = bp_attachments_get_attachment( |
| 399 | 400 | 'url', |
| @@ -620,8 +621,26 @@ | ||
| 620 | 621 | } |
| 621 | 622 | |
| 622 | 623 | public static function deleteCurrentData() |
| 623 | 624 | { |
| 625 | + // Capture an audit context before the wipe so this destructive erasure of member PII is | |
| 626 | + // traceable (who/when/how much) and downstream modules can purge remote copies. | |
| 627 | + $auditContext = [ | |
| 628 | + 'user_id' => get_current_user_id(), | |
| 629 | + 'timestamp' => current_time('mysql'), | |
| 630 | + 'counts' => [ | |
| 631 | + 'feeds' => \FluentCommunity\App\Models\Feed::count(), | |
| 632 | + 'comments' => \FluentCommunity\App\Models\Comment::count(), | |
| 633 | + 'reactions' => \FluentCommunity\App\Models\Reaction::count(), | |
| 634 | + 'media' => \FluentCommunity\App\Models\Media::count(), | |
| 635 | + 'activities' => \FluentCommunity\App\Models\Activity::count(), | |
| 636 | + 'profiles' => \FluentCommunity\App\Models\XProfile::count(), | |
| 637 | + 'spaces' => \FluentCommunity\App\Models\Space::where('type', 'community')->count(), | |
| 638 | + ], | |
| 639 | + ]; | |
| 640 | + | |
| 641 | + do_action('fluent_community/migration/before_delete_current_data', $auditContext); | |
| 642 | + | |
| 624 | 643 | // delete the folder in uploads folder fluent-community with php please |
| 625 | 644 | $uploadDir = wp_upload_dir(); |
| 626 | 645 | $fcomDir = $uploadDir['basedir'] . '/fluent-community'; |
| 627 | 646 | if (is_dir($fcomDir)) { |
| @@ -645,8 +664,10 @@ | ||
| 645 | 664 | delete_option('_bp_fcom_group_maps'); |
| 646 | 665 | delete_option('_bp_fcom_last_post_id'); |
| 647 | 666 | delete_option('_bp_fcom_last_user_id'); |
| 648 | 667 | delete_option('_bp_fcom_last_migrated_member_id'); |
| 668 | + | |
| 669 | + do_action('fluent_community/migration/after_delete_current_data', $auditContext); | |
| 649 | 670 | } |
| 650 | 671 | |
| 651 | 672 | public static function getFcomSpaceIdByGroupId($bbGroupId) |
| 652 | 673 | { |