Skip to content

Commit c0a5b88

Browse files
authored
Merge branch 'trunk' into refactor/reorganize-integrations
2 parents f117668 + 09b020a commit c0a5b88

File tree

63 files changed

+4690
-1209
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+4690
-1209
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: minor
2+
Type: added
3+
4+
Add unified attachment processor for handling ActivityPub media imports from both remote URLs and local files, with automatic media block generation and Classic Editor support.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: minor
2+
Type: changed
3+
4+
Refactored avatar handling into a new system that stores and manages avatars per remote actor, improving reliability and preparing for future caching support.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: minor
2+
Type: changed
3+
4+
Improved inbox performance by batching and deduplicating activities, reducing redundant processing and improving handling during high activity periods.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: minor
2+
Type: changed
3+
4+
Refactored activity handling to support multiple recipients per activity, allowing posts and interactions to be linked to several local users at once.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: changed
3+
4+
Simplify follow() API return types to int|WP_Error for better predictability.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fixed
3+
4+
Fix Following table error message to display user input instead of empty string when webfinger lookup fails.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: minor
2+
Type: changed
3+
4+
Improved Classic Editor integration by adding better media handling and full test coverage for attachments, permissions, and metadata.

.github/workflows/format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Checkout code
1414
uses: actions/checkout@v5
1515
with:
16-
ref: ${{ github.event.pull_request.head.sha }}
16+
ref: ${{ github.event.pull_request.head.ref }}
1717

1818
- name: Setup Node.js
1919
uses: actions/setup-node@v6

activitypub.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ function rest_init() {
6969
*/
7070
function plugin_init() {
7171
\add_action( 'init', array( __NAMESPACE__ . '\Activitypub', 'init' ) );
72+
\add_action( 'init', array( __NAMESPACE__ . '\Attachments', 'init' ) );
73+
\add_action( 'init', array( __NAMESPACE__ . '\Avatars', 'init' ) );
7274
\add_action( 'init', array( __NAMESPACE__ . '\Comment', 'init' ) );
7375
\add_action( 'init', array( __NAMESPACE__ . '\Dispatcher', 'init' ) );
7476
\add_action( 'init', array( __NAMESPACE__ . '\Embed', 'init' ) );

includes/class-activitypub.php

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ public static function init() {
2323
\add_action( 'init', array( self::class, 'theme_compat' ), 11 );
2424
\add_action( 'init', array( self::class, 'register_user_meta' ), 11 );
2525

26-
\add_filter( 'pre_get_avatar_data', array( self::class, 'pre_get_avatar_data' ), 11, 2 );
27-
2826
\add_action( 'wp_trash_post', array( self::class, 'trash_post' ), 1 );
2927
\add_action( 'untrash_post', array( self::class, 'untrash_post' ), 1 );
3028

@@ -90,56 +88,6 @@ public static function uninstall() {
9088
Options::delete();
9189
}
9290

93-
/**
94-
* Replaces the default avatar.
95-
*
96-
* @param array $args Arguments passed to get_avatar_data(), after processing.
97-
* @param int|string|object $id_or_email A user ID, email address, or comment object.
98-
*
99-
* @return array $args
100-
*/
101-
public static function pre_get_avatar_data( $args, $id_or_email ) {
102-
if (
103-
! $id_or_email instanceof \WP_Comment ||
104-
! isset( $id_or_email->comment_type ) ||
105-
$id_or_email->user_id
106-
) {
107-
return $args;
108-
}
109-
110-
/**
111-
* Filter allowed comment types for avatars.
112-
*
113-
* @param array $allowed_comment_types Array of allowed comment types.
114-
*/
115-
$allowed_comment_types = \apply_filters( 'get_avatar_comment_types', array( 'comment' ) );
116-
if ( ! \in_array( $id_or_email->comment_type ?: 'comment', $allowed_comment_types, true ) ) { // phpcs:ignore Universal.Operators.DisallowShortTernary
117-
return $args;
118-
}
119-
120-
// Check if comment has an avatar.
121-
$avatar = \get_comment_meta( $id_or_email->comment_ID, 'avatar_url', true );
122-
123-
if ( $avatar ) {
124-
if ( empty( $args['class'] ) ) {
125-
$args['class'] = array();
126-
} elseif ( \is_string( $args['class'] ) ) {
127-
$args['class'] = \explode( ' ', $args['class'] );
128-
}
129-
130-
/** This filter is documented in wp-includes/link-template.php */
131-
$args['url'] = \apply_filters( 'get_avatar_url', $avatar, $id_or_email, $args );
132-
$args['class'][] = 'avatar';
133-
$args['class'][] = 'avatar-activitypub';
134-
$args['class'][] = 'avatar-' . (int) $args['size'];
135-
$args['class'][] = 'photo';
136-
$args['class'][] = 'u-photo';
137-
$args['class'] = \array_unique( $args['class'] );
138-
}
139-
140-
return $args;
141-
}
142-
14391
/**
14492
* Store permalink in meta, to send delete Activity.
14593
*

0 commit comments

Comments
 (0)