@@ -263,27 +263,55 @@ public static function is_webfinger_endpoint_accessible() {
263
263
* @return array The filtered information
264
264
*/
265
265
public static function debug_information ( $ info ) {
266
+ $ info ['activitypub ' ] = array (
267
+ 'label ' => \__ ( 'ActivityPub ' , 'activitypub ' ),
268
+ 'fields ' => array (),
269
+ );
270
+
266
271
$ actor = Actors::get_by_id ( \get_current_user_id () );
267
272
268
- $ info ['activitypub ' ] = array (
269
- 'label ' => __ ( 'ActivityPub ' , 'activitypub ' ),
270
- 'fields ' => array (
271
- 'webfinger ' => array (
272
- 'label ' => __ ( 'WebFinger Resource ' , 'activitypub ' ),
273
- 'value ' => Webfinger::get_user_resource ( wp_get_current_user ()->ID ),
274
- 'private ' => false ,
275
- ),
276
- 'author_url ' => array (
277
- 'label ' => __ ( 'Author URL ' , 'activitypub ' ),
278
- 'value ' => $ actor ->get_url (),
279
- 'private ' => false ,
280
- ),
281
- 'author_id ' => array (
282
- 'label ' => __ ( 'Author ID ' , 'activitypub ' ),
283
- 'value ' => $ actor ->get_id (),
284
- 'private ' => false ,
285
- ),
286
- ),
273
+ if ( $ actor && ! is_wp_error ( $ actor ) ) {
274
+ $ info ['activitypub ' ]['fields ' ]['webfinger ' ] = array (
275
+ 'label ' => \__ ( 'WebFinger Resource ' , 'activitypub ' ),
276
+ 'value ' => Webfinger::get_user_resource ( wp_get_current_user ()->ID ),
277
+ 'private ' => false ,
278
+ );
279
+
280
+ $ info ['activitypub ' ]['fields ' ]['author_url ' ] = array (
281
+ 'label ' => \__ ( 'Author URL ' , 'activitypub ' ),
282
+ 'value ' => $ actor ->get_url (),
283
+ 'private ' => false ,
284
+ );
285
+
286
+ $ info ['activitypub ' ]['fields ' ]['author_id ' ] = array (
287
+ 'label ' => \__ ( 'Author ID ' , 'activitypub ' ),
288
+ 'value ' => $ actor ->get_id (),
289
+ 'private ' => false ,
290
+ );
291
+ }
292
+
293
+ $ info ['activitypub ' ]['fields ' ]['actor_mode ' ] = array (
294
+ 'label ' => \__ ( 'Actor Mode ' , 'activitypub ' ),
295
+ 'value ' => \esc_attr ( \get_option ( 'activitypub_actor_mode ' ) ),
296
+ 'private ' => false ,
297
+ );
298
+
299
+ $ info ['activitypub ' ]['fields ' ]['object_type ' ] = array (
300
+ 'label ' => \__ ( 'Object Type ' , 'activitypub ' ),
301
+ 'value ' => \esc_attr ( \get_option ( 'activitypub_object_type ' ) ),
302
+ 'private ' => false ,
303
+ );
304
+
305
+ $ info ['activitypub ' ]['fields ' ]['post_template ' ] = array (
306
+ 'label ' => \__ ( 'Post Template ' , 'activitypub ' ),
307
+ 'value ' => \esc_attr ( \get_option ( 'activitypub_custom_post_content ' , ACTIVITYPUB_CUSTOM_POST_CONTENT ) ),
308
+ 'private ' => false ,
309
+ );
310
+
311
+ $ info ['activitypub ' ]['fields ' ]['authorized_fetch ' ] = array (
312
+ 'label ' => \__ ( 'Authorized Fetch ' , 'activitypub ' ),
313
+ 'value ' => \esc_attr ( (int ) \get_option ( 'activitypub_authorized_fetch ' , '0 ' ) ),
314
+ 'private ' => false ,
287
315
);
288
316
289
317
$ consts = get_defined_constants ( true );
@@ -298,7 +326,7 @@ public static function debug_information( $info ) {
298
326
}
299
327
300
328
$ info ['activitypub ' ]['fields ' ][ $ key ] = array (
301
- 'label ' => esc_attr ( $ key ),
329
+ 'label ' => \ esc_attr ( $ key ),
302
330
'value ' => Sanitize::constant_value ( $ value ),
303
331
'private ' => false ,
304
332
);
0 commit comments