Skip to content

Remove Friendship functionality#515

Merged
akirk merged 13 commits intomainfrom
remove-friendship-functionality
Mar 20, 2026
Merged

Remove Friendship functionality#515
akirk merged 13 commits intomainfrom
remove-friendship-functionality

Conversation

@akirk
Copy link
Copy Markdown
Owner

@akirk akirk commented May 1, 2025

This removes the WordPress to WordPress "Friendship" functionality. We will focus on RSS and ActivityPub subscriptions, see #514.

Screenshot 2025-05-01 at 11 17 49

This removes a lot of code and complexity.

@akirk akirk mentioned this pull request May 1, 2025
@akirk akirk added the 4.0 label May 1, 2025
@akirk akirk force-pushed the remove-friendship-functionality branch from 11d2998 to 9894a39 Compare May 1, 2025 09:16
@akirk akirk changed the title WIP Remove Friendship functionality Remove Friendship functionality May 1, 2025
@akirk akirk added this to the 4.0 milestone May 1, 2025
Base automatically changed from friends-4.0 to main October 25, 2025 14:44
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 4, 2026

Test this PR in WordPress Playground

You can test this pull request directly in WordPress Playground:

Launch WordPress Playground

This will install and activate the plugin with the changes from this PR.

akirk added 8 commits March 5, 2026 11:34
- Register convert_friend_users_to_subscriptions batched migration
- Simplify role setup to subscription-only; remove friend/acquaintance
- Remove multi-cap checks replaced by single has_cap('subscription')
- Remove make_friend(), convert_to_user(), dead convert_to_user call
- Remove WP_User_Query role lookups from all_subscriptions/search/starred
- Simplify multi-cap guards to single has_cap('subscription') check
- Remove convert-to-user/convert-from-user GET handlers and UI links
- Remove get_friend_roles() method (checked for cap that no longer exists)
- Remove friends_default_friend_role option (no longer read anywhere)
- Remove role_friend/role_acquaintance JS vars
- Replace role__in WP_User_Query with User_Query::all_subscriptions()
- Simplify edit-friend.php Type row to always show Virtual User
- Simplify friends-list.php unfriend action (always Unfriend, not Delete)
- Remove followed_by assignment based on friend cap (always false)
The friend role was removed in this branch; update the test setup
to use the subscription role so tests pass.
- Replace "as a friend" with "subscribe to" for the first-subscription CTA
- Simplify "extend your network" to mention only subscriptions and Fediverse
- When ActivityPub is not installed, mention Fediverse following as a possibility
- Remove the automatic status bullet point (feature removed)
- Show ActivityPub and EMA plugins as installed with settings link when active
@akirk akirk marked this pull request as ready for review March 5, 2026 11:56
@akirk akirk force-pushed the remove-friendship-functionality branch from d00b3be to 3548729 Compare March 5, 2026 11:56
akirk added 5 commits March 9, 2026 09:07
User::create() now always delegates to Subscription::create(), removing
the legacy code path that created WP user-backed subscriptions. Tests are
updated to use Subscription objects: post queries use
modify_get_posts_args_by_author(), user options use the friend object's
methods, and user lookups use User::get_user_by_id().
…nd optimize with bulk SQL

The migration was only targeting friend/acquaintance roles but sites may already
have users with the subscription role. Also replaces the slow per-post
wp_update_post loop with bulk INSERT/UPDATE queries for dramatically faster
conversion of users with many posts.
Use array_fill with implode to build placeholders inline instead of
interpolating a variable, satisfying both wpdb->prepare() placeholder
counting and PHPCS rules.
The direct $wpdb UPDATE doesn't invalidate WordPress post object caches,
so subsequent get_post() calls return stale post_author values. Query
affected post IDs first and clean their caches after the update.
@akirk akirk merged commit 742517e into main Mar 20, 2026
25 checks passed
@akirk akirk deleted the remove-friendship-functionality branch March 20, 2026 07:55
akirk added a commit that referenced this pull request Mar 26, 2026
The Add Friend page was accidentally removed in #515 (Remove Friendship
functionality). The intent was to move it to the frontend (#516), but
until that lands, the admin page is needed. All links throughout the
plugin still point to admin.php?page=add-friend, causing an access
denied error.

Restores the page as subscription-only (no friendship request flow).
@akirk akirk mentioned this pull request Mar 26, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant