Skip to content

Commit 8a233ed

Browse files
authored
Require Shared-Inbox (#2359)
1 parent 51cecc8 commit 8a233ed

File tree

7 files changed

+10
-83
lines changed

7 files changed

+10
-83
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: changed
3+
4+
Simplified configuration by always enabling the shared inbox and removing its separate setting, UI field, and related logic.

includes/class-options.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class Options {
1818
public static function init() {
1919
\add_filter( 'pre_option_activitypub_actor_mode', array( self::class, 'pre_option_activitypub_actor_mode' ) );
2020
\add_filter( 'pre_option_activitypub_authorized_fetch', array( self::class, 'pre_option_activitypub_authorized_fetch' ) );
21-
\add_filter( 'pre_option_activitypub_shared_inbox', array( self::class, 'pre_option_activitypub_shared_inbox' ) );
2221
\add_filter( 'pre_option_activitypub_vary_header', array( self::class, 'pre_option_activitypub_vary_header' ) );
2322

2423
\add_filter( 'pre_option_activitypub_allow_likes', array( self::class, 'maybe_disable_interactions' ) );
@@ -82,25 +81,6 @@ public static function pre_option_activitypub_authorized_fetch( $pre ) {
8281
return '0';
8382
}
8483

85-
/**
86-
* Pre-get option filter for the Shared Inbox.
87-
*
88-
* @param string $pre The pre-get option value.
89-
*
90-
* @return string If the constant is defined, return the value, otherwise return the pre-get option value.
91-
*/
92-
public static function pre_option_activitypub_shared_inbox( $pre ) {
93-
if ( ! \defined( 'ACTIVITYPUB_SHARED_INBOX_FEATURE' ) ) {
94-
return $pre;
95-
}
96-
97-
if ( ACTIVITYPUB_SHARED_INBOX_FEATURE ) {
98-
return '1';
99-
}
100-
101-
return '0';
102-
}
103-
10484
/**
10585
* Pre-get option filter for the Vary Header.
10686
*

includes/model/class-blog.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -391,15 +391,9 @@ public function get_following() {
391391
* @return string[]|null The endpoints.
392392
*/
393393
public function get_endpoints() {
394-
$endpoints = null;
395-
396-
if ( \get_option( 'activitypub_shared_inbox' ) ) {
397-
$endpoints = array(
398-
'sharedInbox' => get_rest_url_by_path( 'inbox' ),
399-
);
400-
}
401-
402-
return $endpoints;
394+
return array(
395+
'sharedInbox' => get_rest_url_by_path( 'inbox' ),
396+
);
403397
}
404398

405399
/**

includes/model/class-user.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -317,15 +317,9 @@ public function get_featured_tags() {
317317
* @return string[]|null The endpoints.
318318
*/
319319
public function get_endpoints() {
320-
$endpoints = null;
321-
322-
if ( \get_option( 'activitypub_shared_inbox' ) ) {
323-
$endpoints = array(
324-
'sharedInbox' => get_rest_url_by_path( 'inbox' ),
325-
);
326-
}
327-
328-
return $endpoints;
320+
return array(
321+
'sharedInbox' => get_rest_url_by_path( 'inbox' ),
322+
);
329323
}
330324

331325
/**

includes/wp-admin/class-advanced-settings-fields.php

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,6 @@ public static function register_advanced_fields() {
7979
array( 'label_for' => 'activitypub_following_ui' )
8080
);
8181

82-
if ( ! defined( 'ACTIVITYPUB_SHARED_INBOX_FEATURE' ) ) {
83-
\add_settings_field(
84-
'activitypub_shared_inbox',
85-
\__( 'Shared Inbox (beta)', 'activitypub' ),
86-
array( self::class, 'render_shared_inbox_field' ),
87-
'activitypub_advanced_settings',
88-
'activitypub_advanced_settings',
89-
array( 'label_for' => 'activitypub_shared_inbox' )
90-
);
91-
}
92-
9382
\add_settings_field(
9483
'activitypub_persist_inbox',
9584
\__( 'Inbox', 'activitypub' ),
@@ -224,24 +213,6 @@ public static function render_following_ui_field() {
224213
<?php
225214
}
226215

227-
/**
228-
* Render shared inbox field.
229-
*/
230-
public static function render_shared_inbox_field() {
231-
$value = \get_option( 'activitypub_shared_inbox', '0' );
232-
?>
233-
<p>
234-
<label>
235-
<input type="checkbox" id="activitypub_shared_inbox" name="activitypub_shared_inbox" value="1" <?php checked( '1', $value ); ?> />
236-
<?php \esc_html_e( 'Use a shared inbox for incoming messages.', 'activitypub' ); ?>
237-
</label>
238-
</p>
239-
<p class="description">
240-
<?php \esc_html_e( 'Allows your site to handle incoming ActivityPub messages more efficiently, especially helpful for busy or multi-user sites. This feature is still in beta and may encounter issues.', 'activitypub' ); ?>
241-
</p>
242-
<?php
243-
}
244-
245216
/**
246217
* Render inbox collection persistence field.
247218
*/

includes/wp-admin/class-health-check.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -355,12 +355,6 @@ public static function debug_information( $info ) {
355355
'private' => false,
356356
);
357357

358-
$info['activitypub']['fields']['shared_inbox'] = array(
359-
'label' => \__( 'Shared Inbox', 'activitypub' ),
360-
'value' => \esc_attr( (int) \get_option( 'activitypub_shared_inbox', '0' ) ),
361-
'private' => false,
362-
);
363-
364358
$constants = get_defined_constants( true );
365359

366360
if ( ! isset( $constants['user'] ) ) {

includes/wp-admin/class-settings.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -246,16 +246,6 @@ public static function register_settings() {
246246
)
247247
);
248248

249-
\register_setting(
250-
'activitypub_advanced',
251-
'activitypub_shared_inbox',
252-
array(
253-
'type' => 'boolean',
254-
'description' => \__( 'Enable the shared inbox.', 'activitypub' ),
255-
'default' => false,
256-
)
257-
);
258-
259249
\register_setting(
260250
'activitypub_advanced',
261251
'activitypub_persist_inbox',

0 commit comments

Comments
 (0)