= '2.0' ) { $nodeinfo['protocols'][] = 'activitypub'; } else { $nodeinfo['protocols']['inbound'][] = 'activitypub'; $nodeinfo['protocols']['outbound'][] = 'activitypub'; } $nodeinfo['usage']['users'] = array( 'total' => get_total_users(), 'activeMonth' => get_active_users( '1 month ago' ), 'activeHalfyear' => get_active_users( '6 month ago' ), ); return $nodeinfo; } /** * Extend NodeInfo2 data * * @param array $nodeinfo NodeInfo2 data * * @return array The extended array */ public static function nodeinfo2_data( $nodeinfo ) { $nodeinfo['protocols'][] = 'activitypub'; $nodeinfo['usage']['users'] = array( 'total' => get_total_users(), 'activeMonth' => get_active_users( '1 month ago' ), 'activeHalfyear' => get_active_users( '6 month ago' ), ); return $nodeinfo; } /** * Extend the well-known nodeinfo data * * @param array $data The well-known nodeinfo data * * @return array The extended array */ public static function add_wellknown_nodeinfo_data( $data ) { $data['links'][] = array( 'rel' => 'https://www.w3.org/ns/activitystreams#Application', 'href' => get_rest_url_by_path( 'application' ), ); return $data; } }