diff --git a/templates/followers-list.php b/templates/followers-list.php
index 46d5485..aa86c39 100644
--- a/templates/followers-list.php
+++ b/templates/followers-list.php
@@ -1,7 +1,7 @@
-
+
-
+
diff --git a/templates/json-author.php b/templates/json-author.php
index 9f2c3b0..2228871 100644
--- a/templates/json-author.php
+++ b/templates/json-author.php
@@ -1,43 +1,43 @@
{'@context'} = \Activitypub\get_context();
-$json->id = get_author_posts_url( $author_id );
+$json->id = \get_author_posts_url( $author_id );
$json->type = 'Person';
-$json->name = get_the_author_meta( 'display_name', $author_id );
-$json->summary = html_entity_decode(
- get_the_author_meta( 'description', $author_id ),
+$json->name = \get_the_author_meta( 'display_name', $author_id );
+$json->summary = \html_entity_decode(
+ \get_the_author_meta( 'description', $author_id ),
ENT_QUOTES,
'UTF-8'
);
-$json->preferredUsername = get_the_author_meta( 'login', $author_id ); // phpcs:ignore
-$json->url = get_author_posts_url( $author_id );
+$json->preferredUsername = \get_the_author_meta( 'login', $author_id ); // phpcs:ignore
+$json->url = \get_author_posts_url( $author_id );
$json->icon = array(
'type' => 'Image',
- 'url' => get_avatar_url( $author_id, array( 'size' => 120 ) ),
+ 'url' => \get_avatar_url( $author_id, array( 'size' => 120 ) ),
);
-if ( has_header_image() ) {
+if ( \has_header_image() ) {
$json->image = array(
'type' => 'Image',
- 'url' => get_header_image(),
+ 'url' => \get_header_image(),
);
}
-$json->inbox = get_rest_url( null, "/activitypub/1.0/users/$author_id/inbox" );
-$json->outbox = get_rest_url( null, "/activitypub/1.0/users/$author_id/outbox" );
-$json->followers = get_rest_url( null, "/activitypub/1.0/users/$author_id/followers" );
-$json->following = get_rest_url( null, "/activitypub/1.0/users/$author_id/following" );
+$json->inbox = \get_rest_url( null, "/activitypub/1.0/users/$author_id/inbox" );
+$json->outbox = \get_rest_url( null, "/activitypub/1.0/users/$author_id/outbox" );
+$json->followers = \get_rest_url( null, "/activitypub/1.0/users/$author_id/followers" );
+$json->following = \get_rest_url( null, "/activitypub/1.0/users/$author_id/following" );
-$json->manuallyApprovesFollowers = apply_filters( 'activitypub_json_manually_approves_followers', __return_false() ); // phpcs:ignore
+$json->manuallyApprovesFollowers = \apply_filters( 'activitypub_json_manually_approves_followers', __return_false() ); // phpcs:ignore
// phpcs:ignore
$json->publicKey = array(
- 'id' => get_author_posts_url( $author_id ) . '#main-key',
- 'owner' => get_author_posts_url( $author_id ),
- 'publicKeyPem' => trim( \Activitypub\Signature::get_public_key( $author_id ) ),
+ 'id' => \get_author_posts_url( $author_id ) . '#main-key',
+ 'owner' => \get_author_posts_url( $author_id ),
+ 'publicKeyPem' => \trim( \Activitypub\Signature::get_public_key( $author_id ) ),
);
$json->tag = array();
@@ -46,8 +46,8 @@ $json->attachment = array();
$json->attachment[] = array(
'type' => 'PropertyValue',
'name' => __( 'Blog', 'activitypub' ),
- 'value' => html_entity_decode(
- '
' . wp_parse_url( home_url( '/' ), PHP_URL_HOST ) . '',
+ 'value' => \html_entity_decode(
+ '
' . \wp_parse_url( \home_url( '/' ), PHP_URL_HOST ) . '',
ENT_QUOTES,
'UTF-8'
),
@@ -56,19 +56,19 @@ $json->attachment[] = array(
$json->attachment[] = array(
'type' => 'PropertyValue',
'name' => __( 'Profile', 'activitypub' ),
- 'value' => html_entity_decode(
- '
' . wp_parse_url( get_author_posts_url( $author_id ), PHP_URL_HOST ) . '',
+ 'value' => \html_entity_decode(
+ '
' . \wp_parse_url( \get_author_posts_url( $author_id ), PHP_URL_HOST ) . '',
ENT_QUOTES,
'UTF-8'
),
);
-if ( get_the_author_meta( 'user_url', $author_id ) ) {
+if ( \get_the_author_meta( 'user_url', $author_id ) ) {
$json->attachment[] = array(
'type' => 'PropertyValue',
'name' => __( 'Website', 'activitypub' ),
- 'value' => html_entity_decode(
- '
' . wp_parse_url( get_the_author_meta( 'user_url', $author_id ), PHP_URL_HOST ) . '',
+ 'value' => \html_entity_decode(
+ '
' . \wp_parse_url( \get_the_author_meta( 'user_url', $author_id ), PHP_URL_HOST ) . '',
ENT_QUOTES,
'UTF-8'
),
@@ -76,20 +76,20 @@ if ( get_the_author_meta( 'user_url', $author_id ) ) {
}
//$json->endpoints = array(
-// 'sharedInbox' => get_rest_url( null, '/activitypub/1.0/inbox' ),
+// 'sharedInbox' => \get_rest_url( null, '/activitypub/1.0/inbox' ),
//);
// filter output
-$json = apply_filters( 'activitypub_json_author_array', $json );
+$json = \apply_filters( 'activitypub_json_author_array', $json );
/*
* Action triggerd prior to the ActivityPub profile being created and sent to the client
*/
-do_action( 'activitypub_json_author_pre' );
+\do_action( 'activitypub_json_author_pre' );
$options = 0;
// JSON_PRETTY_PRINT added in PHP 5.4
-if ( get_query_var( 'pretty' ) ) {
+if ( \get_query_var( 'pretty' ) ) {
$options |= JSON_PRETTY_PRINT; // phpcs:ignore
}
@@ -100,12 +100,12 @@ $options |= JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_QUOT;
*
* @param int $options The current options flags
*/
-$options = apply_filters( 'activitypub_json_author_options', $options );
+$options = \apply_filters( 'activitypub_json_author_options', $options );
-header( 'Content-Type: application/activity+json' );
-echo wp_json_encode( $json, $options );
+\header( 'Content-Type: application/activity+json' );
+echo \wp_json_encode( $json, $options );
/*
* Action triggerd after the ActivityPub profile has been created and sent to the client
*/
-do_action( 'activitypub_json_author_post' );
+\do_action( 'activitypub_json_author_post' );
diff --git a/templates/json-post.php b/templates/json-post.php
index 8ab028e..04f683f 100644
--- a/templates/json-post.php
+++ b/templates/json-post.php
@@ -1,20 +1,20 @@
\Activitypub\get_context() ), $activitypub_post->to_array() );
+$json = \array_merge( array( '@context' => \Activitypub\get_context() ), $activitypub_post->to_array() );
// filter output
-$json = apply_filters( 'activitypub_json_post_array', $json );
+$json = \apply_filters( 'activitypub_json_post_array', $json );
/*
* Action triggerd prior to the ActivityPub profile being created and sent to the client
*/
-do_action( 'activitypub_json_post_pre' );
+\do_action( 'activitypub_json_post_pre' );
$options = 0;
// JSON_PRETTY_PRINT added in PHP 5.4
-if ( get_query_var( 'pretty' ) ) {
+if ( \get_query_var( 'pretty' ) ) {
$options |= JSON_PRETTY_PRINT; // phpcs:ignore
}
@@ -25,12 +25,12 @@ $options |= JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_QUOT;
*
* @param int $options The current options flags
*/
-$options = apply_filters( 'activitypub_json_post_options', $options );
+$options = \apply_filters( 'activitypub_json_post_options', $options );
-header( 'Content-Type: application/activity+json' );
-echo wp_json_encode( $json, $options );
+\header( 'Content-Type: application/activity+json' );
+echo \wp_json_encode( $json, $options );
/*
* Action triggerd after the ActivityPub profile has been created and sent to the client
*/
-do_action( 'activitypub_json_post_post' );
+\do_action( 'activitypub_json_post_post' );
diff --git a/templates/settings.php b/templates/settings.php
index 4d124e4..93f1d75 100644
--- a/templates/settings.php
+++ b/templates/settings.php
@@ -1,14 +1,14 @@