updated plugin ActivityPub version 8.3.0
This commit is contained in:
@ -13,22 +13,23 @@ $args = wp_parse_args( $args ?? array() );
|
||||
<h1><?php \esc_html_e( 'ActivityPub', 'activitypub' ); ?></h1>
|
||||
</div>
|
||||
|
||||
<nav class="activitypub-settings-tabs-wrapper" aria-label="<?php \esc_attr_e( 'Secondary menu', 'activitypub' ); ?>">
|
||||
<?php
|
||||
foreach ( $args['tabs'] as $slug => $label ) :
|
||||
$url = add_query_arg(
|
||||
array( 'tab' => 'welcome' !== $slug ? $slug : false ),
|
||||
\admin_url( 'options-general.php?page=activitypub' )
|
||||
);
|
||||
?>
|
||||
|
||||
<a href="<?php echo \esc_url( $url ); ?>" class="activitypub-settings-tab <?php echo \esc_attr( $args[ $slug ] ); ?>">
|
||||
<?php echo \esc_html( $label ); ?>
|
||||
</a>
|
||||
|
||||
<div class="activitypub-settings-tabs-scroller">
|
||||
<nav class="activitypub-settings-tabs-wrapper" aria-label="<?php \esc_attr_e( 'Secondary menu', 'activitypub' ); ?>">
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
</nav>
|
||||
foreach ( $args['tabs'] as $slug => $label ) :
|
||||
$url = add_query_arg(
|
||||
array( 'tab' => 'welcome' !== $slug ? $slug : false ),
|
||||
\admin_url( 'options-general.php?page=activitypub' )
|
||||
);
|
||||
?>
|
||||
|
||||
<a href="<?php echo \esc_url( $url ); ?>" class="activitypub-settings-tab <?php echo \esc_attr( $args[ $slug ] ); ?>">
|
||||
<?php echo \esc_html( $label ); ?>
|
||||
</a>
|
||||
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="wp-header-end">
|
||||
|
||||
@ -7,6 +7,8 @@
|
||||
|
||||
?>
|
||||
|
||||
<hr class="wp-header-end">
|
||||
|
||||
<div class="activitypub-settings activitypub-settings-page hide-if-no-js">
|
||||
<form method="post" action="options.php">
|
||||
<?php \settings_fields( 'activitypub_advanced' ); ?>
|
||||
|
||||
@ -0,0 +1,72 @@
|
||||
<?php
|
||||
/**
|
||||
* Block confirmation template.
|
||||
*
|
||||
* @package Activitypub
|
||||
*/
|
||||
|
||||
use Activitypub\Collection\Actors;
|
||||
use Activitypub\Collection\Remote_Actors;
|
||||
|
||||
/* @var array $args Template arguments. */
|
||||
$args = wp_parse_args( $args ?? array() );
|
||||
|
||||
$actor_id = $args['actor_id'];
|
||||
|
||||
// Get actor and validate.
|
||||
$actor = Remote_Actors::get_actor( $actor_id );
|
||||
if ( is_wp_error( $actor ) ) {
|
||||
wp_die( \esc_html__( 'Invalid account.', 'activitypub' ), '', array( 'back_link' => true ) );
|
||||
}
|
||||
|
||||
// Prepare form URL.
|
||||
$base_url = add_query_arg(
|
||||
array(
|
||||
'action' => 'block',
|
||||
'follower' => $actor_id,
|
||||
'confirm' => 'true',
|
||||
)
|
||||
);
|
||||
|
||||
require_once ABSPATH . 'wp-admin/admin-header.php';
|
||||
?>
|
||||
<div class="wrap">
|
||||
<h1><?php esc_html_e( 'Block Account', 'activitypub' ); ?></h1>
|
||||
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: username */
|
||||
esc_html__( 'You are about to block “%s”.', 'activitypub' ),
|
||||
'<strong>' . esc_html( $actor->get_preferred_username() ) . '</strong>'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p><?php esc_html_e( 'This will:', 'activitypub' ); ?></p>
|
||||
<ul class="ul-disc">
|
||||
<li><?php esc_html_e( 'Block incoming requests from this account for you.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( 'Remove them from your followers and following lists.', 'activitypub' ); ?></li>
|
||||
</ul>
|
||||
|
||||
<form method="post" action="<?php echo esc_url( $base_url ); ?>">
|
||||
<?php wp_nonce_field( 'block-follower_' . $actor_id ); ?>
|
||||
|
||||
<p><?php esc_html_e( 'You can unblock this account later from your Blocked Actors list.', 'activitypub' ); ?></p>
|
||||
|
||||
<?php if ( current_user_can( 'manage_options' ) && get_current_screen()->id !== 'settings_page_activitypub' ) : ?>
|
||||
<p>
|
||||
<label>
|
||||
<input type="checkbox" name="site_wide" value="1" />
|
||||
<?php esc_html_e( 'Also block this account site-wide (affects all users and the blog actor).', 'activitypub' ); ?>
|
||||
</label>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<p class="submit">
|
||||
<?php submit_button( __( 'Confirm', 'activitypub' ), 'primary', 'submit', false ); ?>
|
||||
<a href="<?php echo esc_url( wp_get_referer() ); ?>" class="button"><?php esc_html_e( 'Cancel', 'activitypub' ); ?></a>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
<?php
|
||||
require_once ABSPATH . 'wp-admin/admin-footer.php';
|
||||
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
/**
|
||||
* ActivityPub Blocked Actors List template.
|
||||
*
|
||||
* @package Activitypub
|
||||
*/
|
||||
|
||||
// phpcs:disable WordPress.Security.NonceVerification.Recommended
|
||||
|
||||
/**
|
||||
* Blocked actors list table.
|
||||
*
|
||||
* @global \Activitypub\WP_Admin\Table\Blocked_Actors $blocked_actors_list_table
|
||||
*/
|
||||
global $blocked_actors_list_table;
|
||||
|
||||
$_search = \sanitize_text_field( \wp_unslash( $_REQUEST['s'] ?? '' ) );
|
||||
$_page = \sanitize_text_field( \wp_unslash( $_REQUEST['page'] ?? '' ) );
|
||||
$_tab = \sanitize_text_field( \wp_unslash( $_REQUEST['tab'] ?? '' ) );
|
||||
$_resource = \sanitize_text_field( \wp_unslash( $_REQUEST['resource'] ?? '' ) );
|
||||
|
||||
$blocked_actors_list_table->prepare_items();
|
||||
?>
|
||||
<div class="wrap">
|
||||
<h1 class="wp-heading-inline"><?php esc_html_e( 'Blocked Actors', 'activitypub' ); ?></h1>
|
||||
<?php
|
||||
if ( strlen( $_search ) ) :
|
||||
echo '<span class="subtitle">';
|
||||
/* translators: %s: Search query. */
|
||||
printf( esc_html__( 'Search results for: %s', 'activitypub' ), '<strong>' . esc_html( $_search ) . '</strong>' );
|
||||
echo '</span>';
|
||||
endif;
|
||||
?>
|
||||
|
||||
<form method="get" class="search-form wp-clearfix">
|
||||
<input type="hidden" name="page" value="<?php echo esc_attr( $_page ); ?>" />
|
||||
<input type="hidden" name="tab" value="<?php echo esc_attr( $_tab ); ?>" />
|
||||
<?php $blocked_actors_list_table->search_box( esc_html__( 'Search Blocked Actors', 'activitypub' ), 'search' ); ?>
|
||||
</form>
|
||||
|
||||
<hr class="wp-header-end">
|
||||
|
||||
<div id="col-container" class="wp-clearfix">
|
||||
<div id="col-left">
|
||||
<div class="col-wrap">
|
||||
<h2><?php echo esc_html__( 'Block Actor', 'activitypub' ); ?></h2>
|
||||
<div class="form-wrap">
|
||||
<form method="post" id="activitypub-block-form">
|
||||
<?php wp_nonce_field( 'activitypub-block-nonce' ); ?>
|
||||
<div class="form-field form-required">
|
||||
<label for="activitypub-profile" class="screen-reader-text"><?php echo esc_html__( 'Profile link', 'activitypub' ); ?></label>
|
||||
<input type="hidden" name="action" value="block" />
|
||||
<input name="activitypub-profile" id="activitypub-profile" type="text" value="<?php echo esc_attr( $_resource ); ?>" size="40" aria-required="true" class="<?php echo $_resource ? 'highlight' : ''; ?>" />
|
||||
</div>
|
||||
<?php submit_button( esc_attr__( 'Block', 'activitypub' ) ); ?>
|
||||
</form>
|
||||
|
||||
<p><?php esc_html_e( 'Try these formats:', 'activitypub' ); ?></p>
|
||||
<ul>
|
||||
<li><p><?php echo wp_kses_post( __( 'Username: <code>@username@example.com</code>', 'activitypub' ) ); ?></p></li>
|
||||
<li><p><?php echo wp_kses_post( __( 'Profile link: <code>https://example.com/@username</code>', 'activitypub' ) ); ?></p></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="col-right">
|
||||
<div class="col-wrap">
|
||||
<div class="form-wrap">
|
||||
<form method="post">
|
||||
<input type="hidden" name="page" value="<?php echo esc_attr( $_page ); ?>" />
|
||||
<input type="hidden" name="tab" value="<?php echo esc_attr( $_tab ); ?>" />
|
||||
<?php $blocked_actors_list_table->display(); ?>
|
||||
</form>
|
||||
<div class="edit-term-notes">
|
||||
<strong><?php esc_html_e( 'About Blocked Actors', 'activitypub' ); ?></strong>
|
||||
<p class="description"><?php esc_html_e( 'When you block an actor, they will not be able to interact with your content through ActivityPub. This includes replies, likes, shares, and follows.', 'activitypub' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,25 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* ActivityPub Blog Followers List template.
|
||||
*
|
||||
* @package Activitypub
|
||||
*/
|
||||
|
||||
$table = new \Activitypub\Table\Followers();
|
||||
$follower_count = $table->get_user_count();
|
||||
// translators: The follower count.
|
||||
$followers_template = _n( 'Your blog profile currently has %s follower.', 'Your blog profile currently has %s followers.', $follower_count, 'activitypub' );
|
||||
?>
|
||||
<div class="wrap activitypub-followers-page">
|
||||
<p><?php \printf( \esc_html( $followers_template ), \esc_attr( $follower_count ) ); ?></p>
|
||||
|
||||
<form method="get">
|
||||
<input type="hidden" name="page" value="activitypub" />
|
||||
<input type="hidden" name="tab" value="followers" />
|
||||
<?php
|
||||
$table->prepare_items();
|
||||
$table->search_box( 'Search', 'search' );
|
||||
$table->display();
|
||||
?>
|
||||
</form>
|
||||
</div>
|
||||
@ -7,6 +7,8 @@
|
||||
|
||||
?>
|
||||
|
||||
<hr class="wp-header-end">
|
||||
|
||||
<div class="activitypub-settings activitypub-settings-page hide-if-no-js">
|
||||
<form method="post" action="options.php">
|
||||
<?php \settings_fields( 'activitypub_blog' ); ?>
|
||||
|
||||
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/**
|
||||
* Bulk ActivityPub actor deletion confirmation template.
|
||||
*
|
||||
* @package Activitypub
|
||||
*/
|
||||
|
||||
/* @var array $args Template arguments. */
|
||||
$args = wp_parse_args( $args ?? array() );
|
||||
|
||||
$users = $args['users'] ?? array();
|
||||
$send_back = $args['send_back'] ?? '';
|
||||
|
||||
// Validate users.
|
||||
if ( empty( $users ) ) {
|
||||
wp_die( esc_html__( 'No users selected.', 'activitypub' ), '', array( 'back_link' => true ) );
|
||||
}
|
||||
|
||||
// Prepare user data for display.
|
||||
$users = get_users( array( 'include' => $users ) );
|
||||
|
||||
// If no users with ActivityPub capability, redirect back.
|
||||
if ( ! $users ) {
|
||||
wp_safe_redirect( $send_back );
|
||||
exit;
|
||||
}
|
||||
|
||||
$GLOBALS['plugin_page'] = ''; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
|
||||
require_once ABSPATH . 'wp-admin/admin-header.php';
|
||||
?>
|
||||
<div class="wrap">
|
||||
<h1><?php esc_html_e( 'Delete Users from Fediverse', 'activitypub' ); ?></h1>
|
||||
<p><?php esc_html_e( 'You’ve just removed the capability to publish to the Fediverse for the selected users, do you want to also remove them from the Fediverse?', 'activitypub' ); ?></p>
|
||||
<p><?php echo wp_kses( __( 'Fediverse deletion is optional but recommended to properly notify your followers. <strong>This action is irreversible.</strong>', 'activitypub' ), array( 'strong' => array() ) ); ?></p>
|
||||
<form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
|
||||
<?php wp_nonce_field( 'bulk-users' ); ?>
|
||||
|
||||
<input type="hidden" name="action" value="delete_actor_confirmed" />
|
||||
<input type="hidden" name="send_back" value="<?php echo esc_url( $send_back ); ?>" />
|
||||
|
||||
<div class="activitypub-user-list">
|
||||
<ul>
|
||||
<?php foreach ( $users as $user ) : ?>
|
||||
<li>
|
||||
<label>
|
||||
<input type="checkbox" name="remove_from_fediverse[]" value="<?php echo esc_attr( $user->ID ); ?>" class="fediverse-removal-checkbox" />
|
||||
<input type="hidden" name="selected_users[]" value="<?php echo esc_attr( $user->ID ); ?>" />
|
||||
<strong><?php echo esc_html( $user->display_name ); ?></strong>
|
||||
</label>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<p class="submit">
|
||||
<?php submit_button( __( 'Delete from Fediverse', 'activitypub' ), 'primary', 'submit', false ); ?>
|
||||
<a href="<?php echo esc_url( $send_back ); ?>" class="button"><?php esc_html_e( 'Skip', 'activitypub' ); ?></a>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
<?php
|
||||
require_once ABSPATH . 'wp-admin/admin-footer.php';
|
||||
@ -0,0 +1,88 @@
|
||||
<?php
|
||||
/**
|
||||
* Bulk block confirmation template.
|
||||
*
|
||||
* @package Activitypub
|
||||
*/
|
||||
|
||||
use Activitypub\Collection\Remote_Actors;
|
||||
|
||||
/* @var array $args Template arguments. */
|
||||
$args = wp_parse_args( $args ?? array() );
|
||||
|
||||
$followers = $args['followers'];
|
||||
|
||||
// Validate followers.
|
||||
if ( empty( $followers ) ) {
|
||||
wp_die( esc_html__( 'No accounts selected.', 'activitypub' ), '', array( 'back_link' => true ) );
|
||||
}
|
||||
|
||||
$follower_count = count( $followers );
|
||||
|
||||
// Prepare form URL.
|
||||
$base_url = add_query_arg(
|
||||
array(
|
||||
'action' => 'block',
|
||||
'followers' => $followers,
|
||||
'confirm' => 'true',
|
||||
)
|
||||
);
|
||||
|
||||
// Prepare follower data for display.
|
||||
$follower_data = array();
|
||||
foreach ( $followers as $follower ) {
|
||||
$actor = Remote_Actors::get_actor( $follower );
|
||||
if ( is_wp_error( $actor ) ) {
|
||||
continue;
|
||||
}
|
||||
$follower_data[] = array(
|
||||
'username' => $actor->get_preferred_username(),
|
||||
);
|
||||
}
|
||||
|
||||
require_once ABSPATH . 'wp-admin/admin-header.php';
|
||||
?>
|
||||
<div class="wrap">
|
||||
<h1><?php esc_html_e( 'Block Accounts', 'activitypub' ); ?></h1>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %d: number of followers */
|
||||
esc_html( _n( 'You are about to block %d accounts.', 'You are about to block %d accounts.', $follower_count, 'activitypub' ) ),
|
||||
esc_html( number_format_i18n( $follower_count ) )
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<ul>
|
||||
<?php foreach ( $follower_data as $follower ) : ?>
|
||||
<li><strong><?php echo esc_html( $follower['username'] ); ?></strong></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<p><?php esc_html_e( 'This will:', 'activitypub' ); ?></p>
|
||||
<ul class="ul-disc">
|
||||
<li><?php esc_html_e( 'Block incoming requests from these accounts for you.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( 'Remove them from your followers and following lists.', 'activitypub' ); ?></li>
|
||||
</ul>
|
||||
|
||||
<form method="post" action="<?php echo esc_url( $base_url ); ?>">
|
||||
<?php wp_nonce_field( 'bulk-' . $args['plural_args'] ); ?>
|
||||
|
||||
<p><?php esc_html_e( 'You can unblock these accounts later from your Blocked Actors list.', 'activitypub' ); ?></p>
|
||||
|
||||
<?php if ( current_user_can( 'manage_options' ) && get_current_screen()->id !== 'settings_page_activitypub' ) : ?>
|
||||
<p>
|
||||
<label>
|
||||
<input type="checkbox" name="site_wide" value="1" />
|
||||
<?php esc_html_e( 'Also block these accounts site-wide (affects all users and the blog actor).', 'activitypub' ); ?>
|
||||
</label>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<p class="submit">
|
||||
<?php submit_button( __( 'Confirm', 'activitypub' ), 'primary', 'submit', false ); ?>
|
||||
<a href="<?php echo esc_url( wp_get_referer() ); ?>" class="button"><?php esc_html_e( 'Cancel', 'activitypub' ); ?></a>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
<?php
|
||||
require_once ABSPATH . 'wp-admin/admin-footer.php';
|
||||
@ -18,7 +18,7 @@ require __DIR__ . '/parts/header.php';
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.card-header {
|
||||
width: 100%;
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
use Activitypub\Collection\Actors;
|
||||
use Activitypub\Embed;
|
||||
|
||||
use function Activitypub\site_supports_blocks;
|
||||
|
||||
/* @var array $args Template arguments. */
|
||||
$args = wp_parse_args( $args ?? array() );
|
||||
|
||||
@ -46,11 +48,13 @@ require __DIR__ . '/parts/header.php';
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php if ( site_supports_blocks() && ! is_plugin_active( 'classic-editor/classic-editor.php' ) ) : ?>
|
||||
<p>
|
||||
<a class="button" href="<?php echo esc_url( admin_url( 'post-new.php?in_reply_to=' . $args['activity']['object']['id'] ) ); ?>">
|
||||
<?php esc_html_e( 'Reply to the post', 'activitypub' ); ?>
|
||||
</a>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
|
||||
219
wp-content/plugins/activitypub/templates/emails/stats-report.php
Normal file
219
wp-content/plugins/activitypub/templates/emails/stats-report.php
Normal file
@ -0,0 +1,219 @@
|
||||
<?php
|
||||
/**
|
||||
* ActivityPub Stats Report E-Mail template.
|
||||
*
|
||||
* Used for both monthly and annual reports.
|
||||
* All texts are passed via $args to keep the template logic-free.
|
||||
*
|
||||
* Expected $args keys:
|
||||
* - title (string) The email heading.
|
||||
* - intro (string) The intro paragraph.
|
||||
* - closing (string) The closing paragraph.
|
||||
* - supporter_text (string) The top supporter text (HTML allowed).
|
||||
* - posts_count (int) Number of federated posts.
|
||||
* - top_posts (array) Top posts with title, url, engagement_count.
|
||||
* - top_multiplicator (array|null) Top supporter data.
|
||||
* - followers_count (int) New followers gained.
|
||||
* - followers_total (int) Total follower count.
|
||||
* - followers_start (int) Followers at period start (annual only).
|
||||
* - followers_end (int) Followers at period end (annual only).
|
||||
* - followers_text (string) The follower detail text (HTML allowed).
|
||||
* - most_active_month_name (string) Most active month (annual only).
|
||||
* - {type}_count (int) Per-engagement-type counts.
|
||||
*
|
||||
* @package Activitypub
|
||||
*/
|
||||
|
||||
use Activitypub\Statistics;
|
||||
|
||||
/* @var array $args Template arguments. */
|
||||
$args = wp_parse_args(
|
||||
$args ?? array(),
|
||||
array(
|
||||
'title' => '',
|
||||
'intro' => '',
|
||||
'closing' => '',
|
||||
'posts_count' => 0,
|
||||
'followers_count' => 0,
|
||||
'followers_total' => 0,
|
||||
'followers_net_change' => null,
|
||||
'followers_text' => '',
|
||||
'most_active_month_name' => '',
|
||||
'top_posts' => array(),
|
||||
'top_multiplicator' => null,
|
||||
'supporter_text' => '',
|
||||
'user_id' => 0,
|
||||
)
|
||||
);
|
||||
|
||||
// Get comment types for dynamic stats display.
|
||||
$comment_types = Statistics::get_comment_types_for_stats();
|
||||
|
||||
// Load header.
|
||||
require __DIR__ . '/parts/header.php';
|
||||
?>
|
||||
<style>
|
||||
.stats-grid {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
.stats-grid .stat {
|
||||
flex: 1 1 calc(50% - 6px);
|
||||
min-width: 100px;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
padding: 14px;
|
||||
text-align: center;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.stats-grid .stat-value {
|
||||
display: block;
|
||||
font-size: 28px;
|
||||
font-weight: 700;
|
||||
color: #1d2327;
|
||||
line-height: 1.2;
|
||||
}
|
||||
.stats-grid .stat-label {
|
||||
display: block;
|
||||
font-size: 13px;
|
||||
color: #50575e;
|
||||
margin-top: 4px;
|
||||
}
|
||||
.info-box {
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
padding: 16px;
|
||||
margin: 20px 0;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.info-box h3 {
|
||||
margin: 0 0 8px;
|
||||
font-size: 16px;
|
||||
color: #1d2327;
|
||||
}
|
||||
.info-box p {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
color: #50575e;
|
||||
}
|
||||
.follower-change {
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
color: #00a32a;
|
||||
margin: 4px 0 8px;
|
||||
}
|
||||
.follower-change.negative {
|
||||
color: #d63638;
|
||||
}
|
||||
.top-posts ol {
|
||||
margin: 8px 0 0;
|
||||
padding-left: 20px;
|
||||
}
|
||||
.top-posts li {
|
||||
margin: 6px 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
.top-posts a {
|
||||
color: #2271b1;
|
||||
text-decoration: none;
|
||||
}
|
||||
.top-posts .engagement {
|
||||
font-size: 12px;
|
||||
color: #50575e;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h1><?php echo esc_html( $args['title'] ); ?></h1>
|
||||
|
||||
<p><?php echo esc_html( $args['intro'] ); ?></p>
|
||||
|
||||
<div class="stats-grid">
|
||||
<div class="stat">
|
||||
<span class="stat-value"><?php echo esc_html( number_format_i18n( $args['posts_count'] ) ); ?></span>
|
||||
<span class="stat-label"><?php esc_html_e( 'Posts Federated', 'activitypub' ); ?></span>
|
||||
</div>
|
||||
<?php foreach ( $comment_types as $slug => $type_info ) : ?>
|
||||
<div class="stat">
|
||||
<span class="stat-value"><?php echo esc_html( number_format_i18n( $args[ $slug . '_count' ] ?? 0 ) ); ?></span>
|
||||
<span class="stat-label"><?php echo esc_html( $type_info['label'] ); ?></span>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<?php if ( ! empty( $args['most_active_month_name'] ) ) : ?>
|
||||
<div class="info-box">
|
||||
<h3><?php esc_html_e( 'Most Active Month', 'activitypub' ); ?></h3>
|
||||
<p><?php echo esc_html( $args['most_active_month_name'] ); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
$net_change = $args['followers_net_change'] ?? $args['followers_count'] ?? null;
|
||||
if ( null !== $net_change ) :
|
||||
$change_class = $net_change >= 0 ? '' : 'negative';
|
||||
$change_sign = $net_change >= 0 ? '+' : '';
|
||||
?>
|
||||
<div class="info-box">
|
||||
<h3><?php esc_html_e( 'Follower Growth', 'activitypub' ); ?></h3>
|
||||
<p class="follower-change <?php echo esc_attr( $change_class ); ?>">
|
||||
<?php echo esc_html( $change_sign . number_format_i18n( $net_change ) ); ?>
|
||||
</p>
|
||||
<?php if ( ! empty( $args['followers_text'] ) ) : ?>
|
||||
<p><?php echo wp_kses( $args['followers_text'], array( 'strong' => array() ) ); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! empty( $args['top_multiplicator'] ) && ! empty( $args['supporter_text'] ) ) : ?>
|
||||
<div class="info-box">
|
||||
<h3><?php esc_html_e( 'Top Supporter', 'activitypub' ); ?></h3>
|
||||
<p>
|
||||
<?php
|
||||
echo wp_kses(
|
||||
$args['supporter_text'],
|
||||
array(
|
||||
'strong' => array(),
|
||||
'a' => array( 'href' => array() ),
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! empty( $args['top_posts'] ) ) : ?>
|
||||
<div class="info-box top-posts">
|
||||
<h3><?php esc_html_e( 'Top Posts', 'activitypub' ); ?></h3>
|
||||
<ol>
|
||||
<?php foreach ( $args['top_posts'] as $top_post ) : ?>
|
||||
<li>
|
||||
<a href="<?php echo esc_url( $top_post['url'] ); ?>"><?php echo esc_html( $top_post['title'] ?: __( '(no title)', 'activitypub' ) ); ?></a>
|
||||
<span class="engagement">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: engagement count */
|
||||
esc_html__( '(%s engagements)', 'activitypub' ),
|
||||
esc_html( number_format_i18n( $top_post['engagement_count'] ?? 0 ) )
|
||||
);
|
||||
?>
|
||||
</span>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<p><?php echo esc_html( $args['closing'] ?? '' ); ?></p>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Fires at the bottom of the stats report email.
|
||||
*
|
||||
* @param array $args The stats data.
|
||||
*/
|
||||
do_action( 'activitypub_stats_report_email', $args );
|
||||
|
||||
// Load footer.
|
||||
require __DIR__ . '/parts/footer.php';
|
||||
@ -9,16 +9,18 @@
|
||||
$args = wp_parse_args(
|
||||
$args,
|
||||
array(
|
||||
'avatar_url' => '',
|
||||
'audio' => null,
|
||||
'author_name' => '',
|
||||
'author_url' => '',
|
||||
'title' => '',
|
||||
'avatar_url' => '',
|
||||
'boosts' => null,
|
||||
'content' => '',
|
||||
'favorites' => null,
|
||||
'image' => '',
|
||||
'published' => '',
|
||||
'title' => '',
|
||||
'url' => '',
|
||||
'boosts' => null,
|
||||
'favorites' => null,
|
||||
'video' => null,
|
||||
'webfinger' => '',
|
||||
)
|
||||
);
|
||||
@ -48,9 +50,19 @@ $args = wp_parse_args(
|
||||
<div class="ap-subtitle p-summary e-content"><?php echo \wp_kses_post( $args['content'] ); ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $args['image'] ) : ?>
|
||||
<div class="ap-preview">
|
||||
<img class="u-photo u-featured" src="<?php echo \esc_url( $args['image'] ); ?>" alt="" />
|
||||
<?php if ( $args['images'] ) : ?>
|
||||
<div class="ap-preview <?php echo \esc_attr( 'layout-' . count( $args['images'] ) ); ?>">
|
||||
<?php foreach ( $args['images'] as $image ) : ?>
|
||||
<img class="u-photo u-featured" src="<?php echo \esc_url( $image['url'] ); ?>" alt="<?php echo \esc_attr( $image['name'] ?? '' ); ?>" />
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php elseif ( $args['video'] ) : ?>
|
||||
<div class="ap-preview layout-1">
|
||||
<video controls class="u-photo u-featured" src="<?php echo \esc_url( $args['video']['url'] ); ?>" title="<?php echo \esc_attr( $args['video']['name'] ?? '' ); ?>"></video>
|
||||
</div>
|
||||
<?php elseif ( $args['audio'] ) : ?>
|
||||
<div class="ap-preview layout-1">
|
||||
<audio controls class="u-photo u-featured" src="<?php echo \esc_url( $args['audio']['url'] ); ?>" title="<?php echo \esc_attr( $args['audio']['name'] ?? '' ); ?>"></audio>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
50
wp-content/plugins/activitypub/templates/followers-list.php
Normal file
50
wp-content/plugins/activitypub/templates/followers-list.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* ActivityPub Followers List template.
|
||||
*
|
||||
* @package Activitypub
|
||||
*/
|
||||
|
||||
// phpcs:disable WordPress.Security.NonceVerification.Recommended
|
||||
|
||||
/**
|
||||
* Followers list table.
|
||||
*
|
||||
* @global \Activitypub\WP_Admin\Table\Followers $followers_list_table
|
||||
*/
|
||||
global $followers_list_table;
|
||||
|
||||
$_search = \sanitize_text_field( \wp_unslash( $_REQUEST['s'] ?? '' ) );
|
||||
$_page = \sanitize_text_field( \wp_unslash( $_REQUEST['page'] ?? '' ) );
|
||||
$_tab = \sanitize_text_field( \wp_unslash( $_REQUEST['tab'] ?? '' ) );
|
||||
|
||||
$followers_list_table->prepare_items();
|
||||
?>
|
||||
<div class="wrap">
|
||||
<h1 class="wp-heading-inline"><?php esc_html_e( 'Followers', 'activitypub' ); ?></h1>
|
||||
|
||||
<?php
|
||||
if ( strlen( $_search ) ) :
|
||||
echo '<span class="subtitle">';
|
||||
/* translators: %s: Search query. */
|
||||
printf( esc_html__( 'Search results for: %s', 'activitypub' ), '<strong>' . esc_html( $_search ) . '</strong>' );
|
||||
echo '</span>';
|
||||
endif;
|
||||
?>
|
||||
|
||||
<hr class="wp-header-end">
|
||||
|
||||
<?php $followers_list_table->views(); ?>
|
||||
|
||||
<form method="get">
|
||||
<input type="hidden" name="page" value="<?php echo esc_attr( $_page ); ?>" />
|
||||
<input type="hidden" name="tab" value="<?php echo esc_attr( $_tab ); ?>" />
|
||||
<?php $followers_list_table->search_box( esc_html__( 'Search Followers', 'activitypub' ), 'search' ); ?>
|
||||
</form>
|
||||
|
||||
<form method="post">
|
||||
<input type="hidden" name="page" value="<?php echo esc_attr( $_page ); ?>" />
|
||||
<input type="hidden" name="tab" value="<?php echo esc_attr( $_tab ); ?>" />
|
||||
<?php $followers_list_table->display(); ?>
|
||||
</form>
|
||||
</div>
|
||||
95
wp-content/plugins/activitypub/templates/following-list.php
Normal file
95
wp-content/plugins/activitypub/templates/following-list.php
Normal file
@ -0,0 +1,95 @@
|
||||
<?php
|
||||
/**
|
||||
* ActivityPub Following List template.
|
||||
*
|
||||
* @package Activitypub
|
||||
*/
|
||||
|
||||
// phpcs:disable WordPress.Security.NonceVerification.Recommended
|
||||
|
||||
/**
|
||||
* Following list table.
|
||||
*
|
||||
* @global \Activitypub\WP_Admin\Table\Following $following_list_table
|
||||
*/
|
||||
global $following_list_table;
|
||||
|
||||
$_search = \sanitize_text_field( \wp_unslash( $_REQUEST['s'] ?? '' ) );
|
||||
$_page = \sanitize_text_field( \wp_unslash( $_REQUEST['page'] ?? '' ) );
|
||||
$_tab = \sanitize_text_field( \wp_unslash( $_REQUEST['tab'] ?? '' ) );
|
||||
$_status = \sanitize_text_field( \wp_unslash( $_REQUEST['status'] ?? '' ) );
|
||||
$_resource = \sanitize_text_field( \wp_unslash( $_REQUEST['resource'] ?? '' ) );
|
||||
|
||||
$following_list_table->prepare_items();
|
||||
?>
|
||||
<div class="wrap">
|
||||
<h1 class="wp-heading-inline"><?php esc_html_e( 'Followings', 'activitypub' ); ?></h1>
|
||||
<?php
|
||||
if ( strlen( $_search ) ) :
|
||||
echo '<span class="subtitle">';
|
||||
/* translators: %s: Search query. */
|
||||
printf( esc_html__( 'Search results for: %s', 'activitypub' ), '<strong>' . esc_html( $_search ) . '</strong>' );
|
||||
echo '</span>';
|
||||
endif;
|
||||
?>
|
||||
|
||||
<form method="get" class="search-form wp-clearfix">
|
||||
<input type="hidden" name="page" value="<?php echo esc_attr( $_page ); ?>" />
|
||||
<input type="hidden" name="tab" value="<?php echo esc_attr( $_tab ); ?>" />
|
||||
<input type="hidden" name="status" value="<?php echo esc_attr( $_status ); ?>" />
|
||||
<?php $following_list_table->search_box( esc_html__( 'Search Followings', 'activitypub' ), 'search' ); ?>
|
||||
</form>
|
||||
|
||||
<hr class="wp-header-end">
|
||||
|
||||
<div id="col-container" class="wp-clearfix">
|
||||
<div id="col-left">
|
||||
<div class="col-wrap">
|
||||
<h2><?php echo esc_html__( 'Follow', 'activitypub' ); ?></h2>
|
||||
<div class="form-wrap">
|
||||
<form method="post" id="activitypub-follow-form">
|
||||
<?php wp_nonce_field( 'activitypub-follow-nonce' ); ?>
|
||||
<div class="form-field form-required">
|
||||
<label for="activitypub-profile" class="screen-reader-text"><?php echo esc_html__( 'Profile link', 'activitypub' ); ?></label>
|
||||
<input type="hidden" name="action" value="follow" />
|
||||
<input name="activitypub-profile" id="activitypub-profile" type="text" value="<?php echo esc_attr( $_resource ); ?>" size="40" aria-required="true" class="<?php echo $_resource ? 'highlight' : ''; ?>" />
|
||||
</div>
|
||||
<?php submit_button( esc_attr__( 'Follow', 'activitypub' ) ); ?>
|
||||
</form>
|
||||
|
||||
<p><?php echo wp_kses_post( __( 'You can follow people from other Fediverse platforms like <strong>Mastodon</strong>, <strong>Friendica</strong>, or other <strong>WordPress</strong> sites. Try these formats:', 'activitypub' ) ); ?></p>
|
||||
<ul>
|
||||
<li><p><?php echo wp_kses_post( __( 'Username: <code>@username@example.com</code>', 'activitypub' ) ); ?></p></li>
|
||||
<li><p><?php echo wp_kses_post( __( 'Profile link: <code>https://example.com/@username</code>', 'activitypub' ) ); ?></p></li>
|
||||
</ul>
|
||||
|
||||
<p><?php echo esc_html__( '(Make sure the user you’re following is part of the fediverse and supports ActivityPub)', 'activitypub' ); ?></p>
|
||||
<?php
|
||||
/**
|
||||
* Action to add custom content after the follow form.
|
||||
*
|
||||
* @since 7.3.0
|
||||
*/
|
||||
do_action( 'activitypub_post_follow_form' );
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="col-right">
|
||||
<div class="col-wrap">
|
||||
<?php $following_list_table->views(); ?>
|
||||
<div class="form-wrap">
|
||||
<form method="post">
|
||||
<input type="hidden" name="page" value="<?php echo esc_attr( $_page ); ?>" />
|
||||
<input type="hidden" name="tab" value="<?php echo esc_attr( $_tab ); ?>" />
|
||||
<?php $following_list_table->display(); ?>
|
||||
</form>
|
||||
<div class="edit-term-notes">
|
||||
<strong><?php esc_html_e( 'About Followings', 'activitypub' ); ?></strong>
|
||||
<p class="description"><?php esc_html_e( 'When you follow another author, a follow request is sent on your behalf. If you see “Pending”, it means your follow request hasn’t been accepted yet—so you aren’t following that author until they approve your request. This is a normal part of the ActivityPub protocol and helps ensure that authors have control over who follows them.', 'activitypub' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/**
|
||||
* Account Migration Help Tab template.
|
||||
*
|
||||
* @package Activitypub
|
||||
*/
|
||||
|
||||
use Activitypub\Collection\Actors;
|
||||
use Activitypub\Model\Blog;
|
||||
|
||||
use function Activitypub\user_can_activitypub;
|
||||
|
||||
if ( user_can_activitypub( get_current_user_id() ) ) {
|
||||
$webfinger = Actors::get_by_id( get_current_user_id() )->get_webfinger();
|
||||
} else {
|
||||
$webfinger = ( new Blog() )->get_webfinger();
|
||||
}
|
||||
?>
|
||||
|
||||
<h2><?php esc_html_e( 'Understanding Account Migration', 'activitypub' ); ?></h2>
|
||||
<p><?php esc_html_e( 'Account migration in the Fediverse allows you to move your identity from one platform to another while bringing your followers with you.', 'activitypub' ); ?></p>
|
||||
<p><?php esc_html_e( 'When you migrate properly, your followers are automatically redirected to follow your new account, and your old account can point people to your new one.', 'activitypub' ); ?></p>
|
||||
<p><?php esc_html_e( 'This is especially useful if you’re moving from a Mastodon instance to your WordPress site, or if you’re changing domains.', 'activitypub' ); ?></p>
|
||||
|
||||
<h2><?php esc_html_e( 'Migrating from Mastodon to WordPress', 'activitypub' ); ?></h2>
|
||||
<ol>
|
||||
<li>
|
||||
<?php
|
||||
echo wp_kses(
|
||||
sprintf(
|
||||
/* translators: %s is the URL to the profile page */
|
||||
__( 'In your WordPress profile, go to the <a href="%s">Account Aliases</a> section and add your Mastodon profile URL (e.g., <code>https://mastodon.social/@username</code>).', 'activitypub' ),
|
||||
esc_url( admin_url( 'profile.php#activitypub_blog_user_also_known_as' ) )
|
||||
),
|
||||
array_merge(
|
||||
array( 'code' => array() ),
|
||||
array(
|
||||
'a' => array(
|
||||
'href' => true,
|
||||
'target' => true,
|
||||
),
|
||||
)
|
||||
)
|
||||
);
|
||||
?>
|
||||
</li>
|
||||
<li><?php esc_html_e( 'Save your WordPress profile changes.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( 'Log in to your Mastodon account.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( 'Go to Preferences > Account > Move to a different account.', 'activitypub' ); ?></li>
|
||||
<li>
|
||||
<?php
|
||||
echo wp_kses(
|
||||
sprintf(
|
||||
/* translators: %s is the user's ActivityPub username */
|
||||
__( 'Enter your WordPress ActivityPub username (e.g., <code>%s</code>) in the “Handle of the new account” field.', 'activitypub' ),
|
||||
esc_html( $webfinger )
|
||||
),
|
||||
array( 'code' => array() )
|
||||
);
|
||||
?>
|
||||
</li>
|
||||
<li><?php esc_html_e( 'Confirm the migration in Mastodon by entering your password.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( 'Your followers will be notified and redirected to follow your WordPress account.', 'activitypub' ); ?></li>
|
||||
</ol>
|
||||
|
||||
<h2><?php esc_html_e( 'Managing Multiple Accounts', 'activitypub' ); ?></h2>
|
||||
<p><?php esc_html_e( 'If you maintain presence on multiple platforms:', 'activitypub' ); ?></p>
|
||||
<ul>
|
||||
<li><?php esc_html_e( 'Use the Account Aliases feature to link your identities.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( 'Consider which account will be your primary one.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( 'Be clear with your followers about where to find you.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( 'Remember that full migration moves your followers completely.', 'activitypub' ); ?></li>
|
||||
</ul>
|
||||
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/**
|
||||
* Core Features Help Tab template.
|
||||
*
|
||||
* @package Activitypub
|
||||
*/
|
||||
|
||||
use Activitypub\Collection\Actors;
|
||||
|
||||
use function Activitypub\user_can_activitypub;
|
||||
|
||||
$host = wp_parse_url( home_url(), PHP_URL_HOST );
|
||||
$author = 'username@' . $host;
|
||||
if ( user_can_activitypub( get_current_user_id() ) ) {
|
||||
$author = Actors::get_by_id( get_current_user_id() )->get_webfinger();
|
||||
}
|
||||
|
||||
$blog_user = 'blog@' . $host;
|
||||
if ( user_can_activitypub( Actors::BLOG_USER_ID ) ) {
|
||||
$blog_user = Actors::get_by_id( Actors::BLOG_USER_ID )->get_webfinger();
|
||||
}
|
||||
?>
|
||||
|
||||
<h2><?php esc_html_e( 'User Accounts vs. Blog Accounts', 'activitypub' ); ?></h2>
|
||||
<p><?php esc_html_e( 'Your WordPress site can participate in the Fediverse in two ways:', 'activitypub' ); ?></p>
|
||||
<ul>
|
||||
<li>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s is the user's ActivityPub username */
|
||||
esc_html__( 'Individual user accounts: Each author has their own Fediverse identity (%s).', 'activitypub' ),
|
||||
'<code>' . esc_html( $author ) . '</code>'
|
||||
);
|
||||
?>
|
||||
</li>
|
||||
<li>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s is the blog's ActivityPub username */
|
||||
esc_html__( 'Whole blog account: The blog itself has a Fediverse identity (%s).', 'activitypub' ),
|
||||
'<code>' . esc_html( $blog_user ) . '</code>'
|
||||
);
|
||||
?>
|
||||
</li>
|
||||
</ul>
|
||||
<p><?php esc_html_e( 'User accounts are best when you want each author to have their own following and identity. The blog account is simpler and works well for single-author sites or when you want all content under one identity.', 'activitypub' ); ?></p>
|
||||
|
||||
<h2><?php esc_html_e( 'Publishing to the Fediverse', 'activitypub' ); ?></h2>
|
||||
<p><?php esc_html_e( 'When you publish a post on your WordPress site, the ActivityPub plugin automatically shares it with your followers in the Fediverse. Your content appears in their feeds just like posts from other Fediverse platforms such as Mastodon or Pleroma.', 'activitypub' ); ?></p>
|
||||
<p><?php esc_html_e( 'The plugin intelligently formats your content for the Fediverse, including featured images, excerpts, and links back to your original post.', 'activitypub' ); ?></p>
|
||||
<p><?php esc_html_e( 'Before publishing, you can use the Fediverse Preview feature to see exactly how your post will appear to Fediverse users. This helps ensure your content looks great across different platforms. You can access this preview from the post editor sidebar.', 'activitypub' ); ?></p>
|
||||
|
||||
<h2><?php esc_html_e( 'Content Visibility Controls', 'activitypub' ); ?></h2>
|
||||
<p><?php esc_html_e( 'The ActivityPub plugin gives you complete control over which content is shared to the Fediverse. By default, public posts are federated while private or password-protected posts remain exclusive to your WordPress site.', 'activitypub' ); ?></p>
|
||||
<p><?php esc_html_e( 'In the WordPress editor, each post has visibility settings that determine whether it appears in the Fediverse. You can find these controls in the editor sidebar under “Fediverse > Visibility”. Options include “Public” (visible to everyone in the Fediverse), “Quiet Public” (doesn’t appear in public timelines), or “Do Not Federate” (keeps the post only on your WordPress site).', 'activitypub' ); ?></p>
|
||||
<p><?php esc_html_e( 'You can also configure global settings to control which post types (posts, pages, custom post types) are federated by default. This gives you both site-wide control and per-post flexibility to manage exactly how your content is shared.', 'activitypub' ); ?></p>
|
||||
|
||||
<h2><?php esc_html_e( 'Receiving Interactions', 'activitypub' ); ?></h2>
|
||||
<p><?php esc_html_e( 'One of the most powerful features of the ActivityPub plugin is its ability to receive and display interactions from across the Fediverse. When someone on Mastodon or another Fediverse platform comments on your post, their comment appears directly in your WordPress comments section, creating a seamless conversation between your blog and the wider Fediverse.', 'activitypub' ); ?></p>
|
||||
<p><?php esc_html_e( 'These Fediverse comments integrate naturally with your existing WordPress comment system. You can moderate them just like regular comments, and any replies you make are automatically federated back to the original commenter, maintaining the conversation thread across platforms.', 'activitypub' ); ?></p>
|
||||
<p><?php esc_html_e( 'Beyond comments, the plugin also tracks likes and shares (boosts) from Fediverse users. These interactions can provide valuable feedback and help you understand how your content is being received across the decentralized social web.', 'activitypub' ); ?></p>
|
||||
|
||||
<h2><?php esc_html_e( 'Mentions and Replies', 'activitypub' ); ?></h2>
|
||||
<p><?php echo wp_kses( __( 'The ActivityPub plugin enables true cross-platform conversations by supporting mentions and replies. When writing a post, you can mention any Fediverse user by using their full address format. For example, typing <code>@username@domain.com</code> will create a mention that notifies that user, regardless of which Fediverse platform they use.', 'activitypub' ), array( 'code' => array() ) ); ?></p>
|
||||
<p><?php echo wp_kses( __( 'Mentions use the format <code>@username@domain.com</code> and work just like mentions on other social platforms. The mentioned user receives a notification, and your post appears in their mentions timeline. This creates a direct connection between your WordPress site and users across the Fediverse.', 'activitypub' ), array( 'code' => array() ) ); ?></p>
|
||||
<p><?php esc_html_e( 'Similarly, when someone mentions your Fediverse identity in their post, you’ll receive an email notification that you can respond to with a new post. This two-way communication bridge makes your WordPress site a full participant in Fediverse conversations.', 'activitypub' ); ?></p>
|
||||
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
/**
|
||||
* Editor Blocks Help Tab template.
|
||||
*
|
||||
* @package Activitypub
|
||||
*/
|
||||
|
||||
?>
|
||||
|
||||
<h2><?php esc_html_e( 'Introduction to ActivityPub Blocks', 'activitypub' ); ?></h2>
|
||||
<p><?php esc_html_e( 'The plugin provides custom blocks for the WordPress Block Editor (Gutenberg) that enhance your Fediverse presence and make it easier to interact with the Fediverse.', 'activitypub' ); ?></p>
|
||||
|
||||
<h2><?php esc_html_e( 'Follow Me on the Fediverse', 'activitypub' ); ?></h2>
|
||||
<p><?php esc_html_e( 'This block displays your Fediverse profile so that visitors can follow you directly from your WordPress site.', 'activitypub' ); ?></p>
|
||||
<figure class="activitypub-block-screenshot">
|
||||
<img src="<?php echo esc_url( ACTIVITYPUB_PLUGIN_URL . 'assets/img/follow-me.png' ); ?>" alt="<?php esc_attr_e( 'Follow Me on the Fediverse block', 'activitypub' ); ?>" width="600" height="auto">
|
||||
<figcaption class="activitypub-screenshot-caption"><?php esc_html_e( 'The Follow Me block showing both profile information and follow button.', 'activitypub' ); ?></figcaption>
|
||||
</figure>
|
||||
<h4><?php esc_html_e( 'Usage Tips', 'activitypub' ); ?></h4>
|
||||
<p><?php esc_html_e( 'Place this block in your sidebar, footer, or about page to make it easy for visitors to follow you on the Fediverse. The button-only option works well in compact spaces, while the full profile display provides more context about your Fediverse presence.', 'activitypub' ); ?></p>
|
||||
|
||||
<h2><?php esc_html_e( 'Fediverse Followers', 'activitypub' ); ?></h2>
|
||||
<p><?php esc_html_e( 'This block displays your followers from the Fediverse on your website, showcasing your community and reach across decentralized networks.', 'activitypub' ); ?></p>
|
||||
<figure class="activitypub-block-screenshot">
|
||||
<img src="<?php echo esc_url( ACTIVITYPUB_PLUGIN_URL . 'assets/img/followers.png' ); ?>" alt="<?php esc_attr_e( 'Fediverse Followers block', 'activitypub' ); ?>" width="600" height="auto">
|
||||
<figcaption class="activitypub-screenshot-caption"><?php esc_html_e( 'The Followers block displaying a list of Fediverse followers with pagination.', 'activitypub' ); ?></figcaption>
|
||||
</figure>
|
||||
<h4><?php esc_html_e( 'Usage Tips', 'activitypub' ); ?></h4>
|
||||
<p><?php esc_html_e( 'This block works well on community pages, about pages, or sidebars. The compact style is ideal for sidebars with limited space, while the Lines style provides clear visual separation between followers in wider layouts.', 'activitypub' ); ?></p>
|
||||
<p><?php esc_html_e( 'The block includes pagination controls when you have more followers than the per-page setting, allowing visitors to browse through all your followers.', 'activitypub' ); ?></p>
|
||||
|
||||
<h2><?php esc_html_e( 'Fediverse Reactions', 'activitypub' ); ?></h2>
|
||||
<p><?php esc_html_e( 'This block displays likes and reposts from the Fediverse for your content, showing engagement metrics from across federated networks.', 'activitypub' ); ?></p>
|
||||
<figure class="activitypub-block-screenshot">
|
||||
<img src="<?php echo esc_url( ACTIVITYPUB_PLUGIN_URL . 'assets/img/reactions.png' ); ?>" alt="<?php esc_attr_e( 'Fediverse Reactions block', 'activitypub' ); ?>" width="600" height="auto">
|
||||
<figcaption class="activitypub-screenshot-caption"><?php esc_html_e( 'The Reactions block showing likes and reposts from the Fediverse.', 'activitypub' ); ?></figcaption>
|
||||
</figure>
|
||||
<h4><?php esc_html_e( 'How It Works', 'activitypub' ); ?></h4>
|
||||
<p><?php esc_html_e( 'The Reactions block dynamically fetches and displays likes and reposts (boosts) that your content receives from across the Fediverse. It updates automatically as new reactions come in, providing real-time feedback on how your content is being received.', 'activitypub' ); ?></p>
|
||||
<h4><?php esc_html_e( 'Usage Tips', 'activitypub' ); ?></h4>
|
||||
<p><?php esc_html_e( 'This block provides social proof by showing how your content is being received across the Fediverse. It works best at the end of posts or pages where it can display engagement metrics without interrupting the content flow.', 'activitypub' ); ?></p>
|
||||
|
||||
<h2><?php esc_html_e( 'Federated Reply', 'activitypub' ); ?></h2>
|
||||
<p><?php esc_html_e( 'This block allows you to respond to posts, notes, videos, and other content on the Fediverse directly within your WordPress posts.', 'activitypub' ); ?></p>
|
||||
<figure class="activitypub-block-screenshot">
|
||||
<img src="<?php echo esc_url( ACTIVITYPUB_PLUGIN_URL . 'assets/img/reply.png' ); ?>" alt="<?php esc_attr_e( 'Federated Reply block', 'activitypub' ); ?>" width="600" height="auto">
|
||||
<figcaption class="activitypub-screenshot-caption"><?php esc_html_e( 'The Federated Reply block with embedded Fediverse content and reply interface.', 'activitypub' ); ?></figcaption>
|
||||
</figure>
|
||||
<h4><?php esc_html_e( 'How It Works', 'activitypub' ); ?></h4>
|
||||
<p><?php esc_html_e( 'When you add this block to your post and provide a Fediverse URL, the plugin will:', 'activitypub' ); ?></p>
|
||||
<ol>
|
||||
<li><?php esc_html_e( 'Fetch and optionally display the original content you’re replying to.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( 'When your post is published, send your reply to the Fediverse.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( 'Create a proper threaded reply that will appear in the original post’s thread.', 'activitypub' ); ?></li>
|
||||
</ol>
|
||||
<h4><?php esc_html_e( 'Important Notes', 'activitypub' ); ?></h4>
|
||||
<p><?php esc_html_e( 'This block only works with URLs from federated social networks. URLs from non-federated platforms may not function as expected. Your reply will be published to the Fediverse when your WordPress post is published.', 'activitypub' ); ?></p>
|
||||
<h4><?php esc_html_e( 'Usage Tips', 'activitypub' ); ?></h4>
|
||||
<p><?php esc_html_e( 'Use this block to create responses to Fediverse discussions. It’s perfect for bloggers who want to participate in Fediverse conversations while maintaining their content on their own WordPress site.', 'activitypub' ); ?></p>
|
||||
<h3><?php esc_html_e( 'Reply Bookmarklet', 'activitypub' ); ?></h3>
|
||||
<p><?php esc_html_e( 'In addition to the Reply block, the ActivityPub plugin offers a Reply bookmarklet for your browser. This tool lets you quickly reply to any ActivityPub-enabled post on the web, even outside your own site. When you click the bookmarklet while viewing a post on another Fediverse site, you’ll be taken to your WordPress editor with a reply draft ready to go.', 'activitypub' ); ?></p>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: The host (domain) of the Blog. */
|
||||
esc_html__( 'To install the Reply bookmarklet, visit the Tools page in your WordPress dashboard, find the “Fediverse Bookmarklet” section, and drag the “Reply from %s” button to your bookmarks bar. You can also copy the provided code to create a new bookmark manually.', 'activitypub' ),
|
||||
esc_attr( wp_parse_url( home_url(), PHP_URL_HOST ) )
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
wp_kses(
|
||||
/* translators: %s: The Tools page URL. */
|
||||
__( 'Get the Reply bookmarklet from the <a href="%s">Tools page</a>.', 'activitypub' ),
|
||||
array(
|
||||
'a' => array(
|
||||
'href' => true,
|
||||
'target' => true,
|
||||
),
|
||||
)
|
||||
),
|
||||
esc_url( admin_url( 'tools.php' ) )
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
|
||||
<h2><?php esc_html_e( 'General Usage Instructions', 'activitypub' ); ?></h2>
|
||||
<p><?php esc_html_e( 'To use any of these blocks:', 'activitypub' ); ?></p>
|
||||
<ol>
|
||||
<li><?php esc_html_e( 'Open the Block Editor when creating or editing a post/page.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( 'Click the “+” button to add a new block.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( 'Search for “ActivityPub” or the specific block name.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( 'Select the desired block and configure its settings in the block sidebar.', 'activitypub' ); ?></li>
|
||||
</ol>
|
||||
<p><?php esc_html_e( 'These blocks help bridge the gap between your WordPress site and the Fediverse, enabling better integration and engagement with decentralized social networks.', 'activitypub' ); ?></p>
|
||||
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* Getting Started Help Tab template.
|
||||
*
|
||||
* @package Activitypub
|
||||
*/
|
||||
|
||||
?>
|
||||
|
||||
<h2><?php esc_html_e( 'What is the Fediverse?', 'activitypub' ); ?></h2>
|
||||
<p><?php esc_html_e( 'The Fediverse is a collection of social networks that talk to each other, similar to how email works between different providers. It allows people on different platforms to follow and interact with each other, regardless of which service they use.', 'activitypub' ); ?></p>
|
||||
<p><?php esc_html_e( 'Unlike traditional social media where everyone must use the same service (like Twitter or Facebook), the Fediverse lets you choose where your content lives while still reaching people across many different platforms.', 'activitypub' ); ?></p>
|
||||
<p style="position: relative; padding-top: 56.25%;">
|
||||
<iframe title="<?php echo esc_attr__( 'What is the Fediverse?', 'activitypub' ); ?>" width="100%" height="100%" src="https://framatube.org/videos/embed/9dRFC6Ya11NCVeYKn8ZhiD?subtitle=<?php echo esc_attr( substr( get_locale(), 0, 2 ) ); ?>" frameborder="0" allowfullscreen="" sandbox="allow-same-origin allow-scripts allow-popups allow-forms" style="position: absolute; inset: 0;"></iframe>
|
||||
</p>
|
||||
|
||||
<h2><?php esc_html_e( 'How WordPress fits into the Fediverse', 'activitypub' ); ?></h2>
|
||||
<p><?php esc_html_e( 'This plugin turns your WordPress blog into part of the Fediverse. When activated, your blog becomes a Fediverse “instance” that can interact with other platforms like Mastodon.', 'activitypub' ); ?></p>
|
||||
<p><?php esc_html_e( 'Your WordPress posts can be followed by people on Mastodon and other Fediverse platforms. Comments, likes, and shares from these platforms can appear on your WordPress site.', 'activitypub' ); ?></p>
|
||||
<p><?php esc_html_e( 'The plugin supports two modes: individual user accounts (each author has their own Fediverse identity) or a whole-blog account (the blog itself has a Fediverse identity).', 'activitypub' ); ?></p>
|
||||
|
||||
<h2><?php esc_html_e( 'What to expect when federating', 'activitypub' ); ?></h2>
|
||||
<p><?php esc_html_e( 'When your content federates to the Fediverse:', 'activitypub' ); ?></p>
|
||||
<ul>
|
||||
<li><?php esc_html_e( 'Your posts will appear in the feeds of people who follow you.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( 'People can comment, like, and share your posts from their Fediverse accounts.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( 'Your featured images, excerpts, and other post elements will be included.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( 'Building a following takes time, just like on any social platform.', 'activitypub' ); ?></li>
|
||||
</ul>
|
||||
<p><?php esc_html_e( 'Remember that public posts are truly public in the Fediverse - they can be seen by anyone on any connected platform.', 'activitypub' ); ?></p>
|
||||
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/**
|
||||
* Glossary Help Tab template.
|
||||
*
|
||||
* @package Activitypub
|
||||
*/
|
||||
|
||||
/* translators: %s: Link to more information */
|
||||
$info_string = __( 'For more information please visit %s.', 'activitypub' );
|
||||
$allow_html = array(
|
||||
'code' => array(),
|
||||
'a' => array(
|
||||
'href' => true,
|
||||
'target' => true,
|
||||
),
|
||||
)
|
||||
?>
|
||||
|
||||
<h2><?php esc_html_e( 'Fediverse Terminology', 'activitypub' ); ?></h2>
|
||||
<dl>
|
||||
<dt><?php esc_html_e( 'Fediverse', 'activitypub' ); ?></dt>
|
||||
<dd><?php esc_html_e( 'A network of interconnected servers using open protocols, primarily ActivityPub, allowing users from different platforms to interact with each other. The term combines “federation” and “universe”.', 'activitypub' ); ?></dd>
|
||||
<dd><?php esc_html_e( 'It is a federated social network running on free open software on a myriad of computers across the globe. Many independent servers are interconnected and allow people to interact with one another. There’s no one central site: you choose a server to register. This ensures some decentralization and sovereignty of data. Fediverse (also called Fedi) has no built-in advertisements, no tricky algorithms, no one big corporation dictating the rules. Instead we have small cozy communities of like-minded people. Welcome!', 'activitypub' ); ?></dd>
|
||||
<dd><?php printf( esc_html( $info_string ), '<a href="https://fediverse.party/" target="_blank">fediverse.party</a>' ); ?></dd>
|
||||
|
||||
<dt><?php esc_html_e( 'Federation', 'activitypub' ); ?></dt>
|
||||
<dd><?php esc_html_e( 'The process by which servers communicate with each other to share content and interactions across different platforms and instances.', 'activitypub' ); ?></dd>
|
||||
|
||||
<dt><?php esc_html_e( 'Instance', 'activitypub' ); ?></dt>
|
||||
<dd><?php esc_html_e( 'A server running Fediverse software. Your WordPress site with ActivityPub enabled becomes an instance in the Fediverse.', 'activitypub' ); ?></dd>
|
||||
|
||||
<dt><?php esc_html_e( 'Local Timeline', 'activitypub' ); ?></dt>
|
||||
<dd><?php esc_html_e( 'Content from users on the same instance. In WordPress context, this would be posts from your WordPress site.', 'activitypub' ); ?></dd>
|
||||
</dl>
|
||||
|
||||
<h2><?php esc_html_e( 'ActivityPub Concepts', 'activitypub' ); ?></h2>
|
||||
<dl>
|
||||
<dt><?php esc_html_e( 'ActivityPub', 'activitypub' ); ?></dt>
|
||||
<dd><?php esc_html_e( 'ActivityPub is a decentralized social networking protocol based on the ActivityStreams 2.0 data format. ActivityPub is an official W3C recommended standard published by the W3C Social Web Working Group. It provides a client to server API for creating, updating and deleting content, as well as a federated server to server API for delivering notifications and subscribing to content.', 'activitypub' ); ?></dd>
|
||||
|
||||
<dt><?php esc_html_e( 'Actor', 'activitypub' ); ?></dt>
|
||||
<dd><?php esc_html_e( 'An entity that can perform activities. In WordPress, actors are typically users or the blog itself.', 'activitypub' ); ?></dd>
|
||||
|
||||
<dt><?php esc_html_e( 'Activity', 'activitypub' ); ?></dt>
|
||||
<dd><?php esc_html_e( 'An action performed by an actor, such as creating a post, liking content, or following someone.', 'activitypub' ); ?></dd>
|
||||
|
||||
<dt><?php esc_html_e( 'Object', 'activitypub' ); ?></dt>
|
||||
<dd><?php esc_html_e( 'The target of an activity, such as a post, comment, or profile.', 'activitypub' ); ?></dd>
|
||||
</dl>
|
||||
|
||||
<h2><?php esc_html_e( 'WebFinger and Discovery', 'activitypub' ); ?></h2>
|
||||
<dl>
|
||||
<dt><?php esc_html_e( 'WebFinger', 'activitypub' ); ?></dt>
|
||||
<dd><?php esc_html_e( 'WebFinger is used to discover information about people or other entities on the Internet that are identified by a URI using standard Hypertext Transfer Protocol (HTTP) methods over a secure transport. A WebFinger resource returns a JavaScript Object Notation (JSON) object describing the entity that is queried. The JSON object is referred to as the JSON Resource Descriptor (JRD).', 'activitypub' ); ?></dd>
|
||||
<dd><?php esc_html_e( 'For a person, the type of information that might be discoverable via WebFinger includes a personal profile address, identity service, telephone number, or preferred avatar. For other entities on the Internet, a WebFinger resource might return JRDs containing link relations that enable a client to discover, for example, that a printer can print in color on A4 paper, the physical location of a server, or other static information.', 'activitypub' ); ?></dd>
|
||||
<dd>
|
||||
<blockquote>
|
||||
<?php echo wp_kses( __( 'On Mastodon [and other platforms], user profiles can be hosted either locally on the same website as yours, or remotely on a completely different website. The same username may be used on a different domain. Therefore, a Mastodon user’s full mention consists of both the username and the domain, in the form <code>@username@domain</code>. In practical terms, <code>@user@example.com</code> is not the same as <code>@user@example.org</code>. If the domain is not included, Mastodon will try to find a local user named <code>@username</code>. However, in order to deliver to someone over ActivityPub, the <code>@username@domain</code> mention is not enough – mentions must be translated to an HTTPS URI first, so that the remote actor’s inbox and outbox can be found.', 'activitypub' ), $allow_html ); ?>
|
||||
<cite><a href="https://docs.joinmastodon.org/spec/webfinger/" target="_blank"><?php esc_html_e( 'Mastodon Documentation', 'activitypub' ); ?></a></cite>
|
||||
</blockquote>
|
||||
</dd>
|
||||
<dd><?php printf( esc_html( $info_string ), '<a href="https://webfinger.net/" target="_blank">webfinger.net</a>' ); ?></dd>
|
||||
|
||||
<dt><?php esc_html_e( 'Handle', 'activitypub' ); ?></dt>
|
||||
<dd><?php echo wp_kses( __( 'A user’s identity in the Fediverse, formatted as <code>@username@domain.com</code>. Similar to an email address, it includes both the username and the server where the account is hosted.', 'activitypub' ), array( 'code' => array() ) ); ?></dd>
|
||||
|
||||
<dt><?php esc_html_e( 'NodeInfo', 'activitypub' ); ?></dt>
|
||||
<dd><?php esc_html_e( 'A standardized way of exposing metadata about a server running one of the distributed social networks. It helps with compatibility and discovery between different Fediverse platforms.', 'activitypub' ); ?></dd>
|
||||
<dd><?php printf( esc_html( $info_string ), '<a href="https://nodeinfo.diaspora.software/" target="_blank">nodeinfo.diaspora.software</a>' ); ?></dd>
|
||||
</dl>
|
||||
|
||||
<h2><?php esc_html_e( 'WordPress-Specific Terms', 'activitypub' ); ?></h2>
|
||||
<dl>
|
||||
<dt><?php esc_html_e( 'Template Tags', 'activitypub' ); ?></dt>
|
||||
<dd><?php esc_html_e( 'Shortcodes used in the ActivityPub plugin to customize how content appears when federated to the Fediverse.', 'activitypub' ); ?></dd>
|
||||
<dt><?php esc_html_e( 'Federation Settings', 'activitypub' ); ?></dt>
|
||||
<dd><?php esc_html_e( 'Configuration options that control how WordPress content is shared with the Fediverse.', 'activitypub' ); ?></dd>
|
||||
</dl>
|
||||
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Resources Help Tab template.
|
||||
*
|
||||
* @package Activitypub
|
||||
*/
|
||||
|
||||
$anchor_html = array(
|
||||
'a' => array(
|
||||
'href' => true,
|
||||
'target' => true,
|
||||
),
|
||||
);
|
||||
?>
|
||||
|
||||
<h2><?php esc_html_e( 'Official Resources', 'activitypub' ); ?></h2>
|
||||
<ul>
|
||||
<li><?php echo wp_kses( __( '<a href="https://wordpress.org/plugins/activitypub/" target="_blank">WordPress.org Plugin Page</a> - Official plugin listing with documentation.', 'activitypub' ), $anchor_html ); ?></li>
|
||||
<li><?php echo wp_kses( __( '<a href="https://github.com/automattic/wordpress-activitypub" target="_blank">GitHub Repository</a> - Source code and development.', 'activitypub' ), $anchor_html ); ?></li>
|
||||
<li><?php echo wp_kses( __( '<a href="https://github.com/automattic/wordpress-activitypub/releases" target="_blank">Release Notes</a> - Latest changes and updates.', 'activitypub' ), $anchor_html ); ?></li>
|
||||
</ul>
|
||||
|
||||
<h2><?php esc_html_e( 'Community Support', 'activitypub' ); ?></h2>
|
||||
<ul>
|
||||
<li><?php echo wp_kses( __( '<a href="https://wordpress.org/support/plugin/activitypub/" target="_blank">WordPress.org Support Forums</a> - Get help from the community.', 'activitypub' ), $anchor_html ); ?></li>
|
||||
<li><?php echo wp_kses( __( '<a href="https://github.com/automattic/wordpress-activitypub/issues" target="_blank">GitHub Issues</a> - Report bugs or suggest features.', 'activitypub' ), $anchor_html ); ?></li>
|
||||
</ul>
|
||||
|
||||
<h2><?php esc_html_e( 'Complementary Plugins', 'activitypub' ); ?></h2>
|
||||
<ul>
|
||||
<li><?php echo wp_kses( __( '<a href="https://wordpress.org/plugins/hum/" target="_blank">Hum</a> - Enhance shortlinks for better sharing.', 'activitypub' ), $anchor_html ); ?></li>
|
||||
<li><?php echo wp_kses( __( '<a href="https://wordpress.org/plugins/webmention/" target="_blank">Webmention</a> - Add Webmention support for additional interactions.', 'activitypub' ), $anchor_html ); ?></li>
|
||||
</ul>
|
||||
|
||||
<h2><?php esc_html_e( 'Fediverse Resources', 'activitypub' ); ?></h2>
|
||||
<ul>
|
||||
<li><?php echo wp_kses( __( '<a href="https://fediverse.party/" target="_blank">Fediverse.Party</a> - Introduction to the Fediverse and its platforms.', 'activitypub' ), $anchor_html ); ?></li>
|
||||
<li><?php echo wp_kses( __( '<a href="https://joinmastodon.org/" target="_blank">Join Mastodon</a> - Information about Mastodon, a popular Fediverse platform.', 'activitypub' ), $anchor_html ); ?></li>
|
||||
<li><?php echo wp_kses( __( '<a href="https://w3c.github.io/activitypub/" target="_blank">ActivityPub Specification</a> - The official W3C specification.', 'activitypub' ), $anchor_html ); ?></li>
|
||||
</ul>
|
||||
|
||||
<h2><?php esc_html_e( 'Further Reading', 'activitypub' ); ?></h2>
|
||||
<ul>
|
||||
<li><?php echo wp_kses( __( '<a href="https://indieweb.org/" target="_blank">IndieWeb</a> - Movement focused on owning your content and identity online.', 'activitypub' ), $anchor_html ); ?></li>
|
||||
<li><?php echo wp_kses( __( '<a href="https://webfinger.net/" target="_blank">WebFinger Protocol</a> - More information about WebFinger.', 'activitypub' ), $anchor_html ); ?></li>
|
||||
</ul>
|
||||
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* Template Tags Help Tab template.
|
||||
*
|
||||
* @package Activitypub
|
||||
*/
|
||||
|
||||
$code_html = array( 'code' => array() );
|
||||
$anchor_html = array(
|
||||
'a' => array(
|
||||
'href' => true,
|
||||
'target' => true,
|
||||
),
|
||||
);
|
||||
?>
|
||||
|
||||
<h2><?php esc_html_e( 'What are Template Tags?', 'activitypub' ); ?></h2>
|
||||
<p><?php esc_html_e( 'Template Tags let you control how your content appears in the Fediverse. They work as shortcodes within your post content templates, allowing you to customize what information is included and how it’s formatted.', 'activitypub' ); ?></p>
|
||||
|
||||
<h2><?php esc_html_e( 'Content Tags', 'activitypub' ); ?></h2>
|
||||
<dl>
|
||||
<dt><code>[ap_title]</code></dt>
|
||||
<dd><?php esc_html_e( 'The post’s title.', 'activitypub' ); ?></dd>
|
||||
<dt><code>[ap_content apply_filters="yes"]</code></dt>
|
||||
<dd><?php echo wp_kses( __( 'The post’s content. With <code>apply_filters</code> you can decide if filters (<code>apply_filters( \'the_content\', $content )</code>) should be applied or not (default is <code>yes</code>). The values can be <code>yes</code> or <code>no</code>. <code>apply_filters</code> attribute is optional.', 'activitypub' ), $code_html ); ?></dd>
|
||||
<dt><code>[ap_excerpt length="400"]</code></dt>
|
||||
<dd><?php echo wp_kses( __( 'The post’s excerpt (uses <code>the_excerpt</code> if that is set). If no excerpt is provided, will truncate at <code>length</code> (optional, default = 400).', 'activitypub' ), $code_html ); ?></dd>
|
||||
<dt><code>[ap_image type="full"]</code></dt>
|
||||
<dd><?php echo wp_kses( __( 'The URL for the post’s featured image, defaults to full size. The type attribute can be any of the following: <code>thumbnail</code>, <code>medium</code>, <code>large</code>, <code>full</code>. <code>type</code> attribute is optional.', 'activitypub' ), $code_html ); ?></dd>
|
||||
</dl>
|
||||
|
||||
<h2><?php esc_html_e( 'Link and Permalink Tags', 'activitypub' ); ?></h2>
|
||||
<dl>
|
||||
<dt><code>[ap_permalink type="url"]</code></dt>
|
||||
<dd><?php echo wp_kses( __( 'The post’s permalink. <code>type</code> can be either: <code>url</code> or <code>html</code> (an <code><a /></code> tag). <code>type</code> attribute is optional.', 'activitypub' ), array_merge( $code_html, $anchor_html ) ); ?></dd>
|
||||
<dt><code>[ap_shortlink type="url"]</code></dt>
|
||||
<dd><?php echo wp_kses( __( 'The post’s shortlink. <code>type</code> can be either <code>url</code> or <code>html</code> (an <code><a /></code> tag). I can recommend <a href="https://wordpress.org/plugins/hum/" target="_blank">Hum</a>, to prettify the Shortlinks. <code>type</code> attribute is optional.', 'activitypub' ), array_merge( $code_html, $anchor_html ) ); ?></dd>
|
||||
</dl>
|
||||
|
||||
<h2><?php esc_html_e( 'Metadata Tags', 'activitypub' ); ?></h2>
|
||||
<dl>
|
||||
<dt><code>[ap_hashtags]</code></dt>
|
||||
<dd><?php esc_html_e( 'The post’s tags as hashtags.', 'activitypub' ); ?></dd>
|
||||
<dt><code>[ap_author]</code></dt>
|
||||
<dd><?php esc_html_e( 'The author’s name.', 'activitypub' ); ?></dd>
|
||||
<dt><code>[ap_authorurl]</code></dt>
|
||||
<dd><?php esc_html_e( 'The URL to the author’s profile page.', 'activitypub' ); ?></dd>
|
||||
<dt><code>[ap_date]</code></dt>
|
||||
<dd><?php esc_html_e( 'The post’s date.', 'activitypub' ); ?></dd>
|
||||
<dt><code>[ap_time]</code></dt>
|
||||
<dd><?php esc_html_e( 'The post’s time.', 'activitypub' ); ?></dd>
|
||||
<dt><code>[ap_datetime]</code></dt>
|
||||
<dd><?php esc_html_e( 'The post’s date/time formated as "date @ time".', 'activitypub' ); ?></dd>
|
||||
</dl>
|
||||
|
||||
<h2><?php esc_html_e( 'Site Information Tags', 'activitypub' ); ?></h2>
|
||||
<dl>
|
||||
<dt><code>[ap_blogurl]</code></dt>
|
||||
<dd><?php esc_html_e( 'The URL to the site.', 'activitypub' ); ?></dd>
|
||||
<dt><code>[ap_blogname]</code></dt>
|
||||
<dd><?php esc_html_e( 'The name of the site.', 'activitypub' ); ?></dd>
|
||||
<dt><code>[ap_blogdesc]</code></dt>
|
||||
<dd><?php esc_html_e( 'The description of the site.', 'activitypub' ); ?></dd>
|
||||
</dl>
|
||||
|
||||
<p><?php esc_html_e( 'You may also use any Shortcode normally available to you on your site, however be aware that Shortcodes may significantly increase the size of your content depending on what they do.', 'activitypub' ); ?></p>
|
||||
<p><?php echo wp_kses( __( '<a href="https://github.com/automattic/wordpress-activitypub/issues/new" target="_blank">Let us know</a> if you miss a Template Tag.', 'activitypub' ), $anchor_html ); ?></p>
|
||||
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* Troubleshooting Help Tab template.
|
||||
*
|
||||
* @package Activitypub
|
||||
*/
|
||||
|
||||
$anchor_html = array(
|
||||
'a' => array(
|
||||
'href' => true,
|
||||
'target' => true,
|
||||
),
|
||||
);
|
||||
?>
|
||||
|
||||
<h2><?php esc_html_e( 'Common Issues and Solutions', 'activitypub' ); ?></h2>
|
||||
<dl>
|
||||
<dt><?php esc_html_e( 'My posts aren’t appearing in the Fediverse', 'activitypub' ); ?></dt>
|
||||
<dd><?php esc_html_e( 'Check that federation is enabled for your user or blog, verify the post type is set to be federated, and ensure the post is public. Also verify that your site is accessible from the public internet.', 'activitypub' ); ?></dd>
|
||||
<dt><?php esc_html_e( 'Fediverse users can’t follow my account', 'activitypub' ); ?></dt>
|
||||
<dd><?php esc_html_e( 'Make sure your WebFinger endpoint is accessible. Try searching for your full username (user@yourdomain.com) from a Fediverse account. Check that your server allows the necessary API requests.', 'activitypub' ); ?></dd>
|
||||
<dt><?php esc_html_e( 'Images aren’t displaying properly', 'activitypub' ); ?></dt>
|
||||
<dd><?php esc_html_e( 'Verify that your images are publicly accessible. Check image size limits on the receiving platforms. Consider using different image sizes in your templates.', 'activitypub' ); ?></dd>
|
||||
<dt><?php esc_html_e( 'Comments from the Fediverse aren’t showing up', 'activitypub' ); ?></dt>
|
||||
<dd><?php esc_html_e( 'Check your WordPress comment moderation settings. Verify that your inbox endpoint is accessible. Look for any error messages in your logs.', 'activitypub' ); ?></dd>
|
||||
</dl>
|
||||
|
||||
<h2><?php esc_html_e( 'Debugging Federation Issues', 'activitypub' ); ?></h2>
|
||||
<p><?php esc_html_e( 'To verify your WordPress site is properly federating:', 'activitypub' ); ?></p>
|
||||
<ol>
|
||||
<li><?php esc_html_e( 'Test your WebFinger endpoint by visiting yourdomain.com/.well-known/webfinger?resource=acct:username@yourdomain.com.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( 'Check that your ActivityPub endpoints are accessible.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( 'Try following your account from a Fediverse account.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( 'Publish a test post and verify it appears for followers.', 'activitypub' ); ?></li>
|
||||
</ol>
|
||||
|
||||
<h2><?php esc_html_e( 'Understanding Error Messages', 'activitypub' ); ?></h2>
|
||||
<p><?php esc_html_e( 'Common error messages you might encounter:', 'activitypub' ); ?></p>
|
||||
<ul>
|
||||
<li><?php esc_html_e( 'WebFinger resource not found: Your WebFinger endpoint isn’t configured correctly or the username doesn’t exist.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( 'Unable to deliver to inbox: The receiving server couldn’t be reached or rejected the message.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( 'Signature verification failed: Authentication issues between servers.', 'activitypub' ); ?></li>
|
||||
</ul>
|
||||
|
||||
<h2><?php esc_html_e( 'Getting Help', 'activitypub' ); ?></h2>
|
||||
<p><?php esc_html_e( 'If you’re still having issues:', 'activitypub' ); ?></p>
|
||||
<ul>
|
||||
<li><?php echo wp_kses( __( 'Check the <a href="https://wordpress.org/support/plugin/activitypub/" target="_blank">support forum</a> for similar issues.', 'activitypub' ), $anchor_html ); ?></li>
|
||||
<li><?php echo wp_kses( __( 'Report bugs on <a href="https://github.com/automattic/wordpress-activitypub/issues" target="_blank">GitHub</a> with detailed information.', 'activitypub' ), $anchor_html ); ?></li>
|
||||
<li><?php esc_html_e( 'Include your WordPress and PHP versions, along with any error messages when seeking help.', 'activitypub' ); ?></li>
|
||||
</ul>
|
||||
50
wp-content/plugins/activitypub/templates/help-tab/users.php
Normal file
50
wp-content/plugins/activitypub/templates/help-tab/users.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* Users Help Tab template.
|
||||
*
|
||||
* @package Activitypub
|
||||
*/
|
||||
|
||||
?>
|
||||
<h2><?php esc_html_e( 'Managing ActivityPub Capabilities', 'activitypub' ); ?></h2>
|
||||
|
||||
<p><?php esc_html_e( 'Use the bulk actions on this page to control which users have access to ActivityPub features:', 'activitypub' ); ?></p>
|
||||
|
||||
<ol>
|
||||
<li><?php esc_html_e( 'Select the users you want to update by checking the boxes next to their names.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( 'In the “Bulk Actions” dropdown, choose:', 'activitypub' ); ?>
|
||||
<ul>
|
||||
<li><?php esc_html_e( '“Enable for ActivityPub” to grant ActivityPub capabilities.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( '“Disable for ActivityPub” to remove ActivityPub capabilities.', 'activitypub' ); ?></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><?php esc_html_e( 'Click “Apply” to save your changes.', 'activitypub' ); ?></li>
|
||||
</ol>
|
||||
|
||||
<h3><?php esc_html_e( 'What are ActivityPub Capabilities?', 'activitypub' ); ?></h3>
|
||||
|
||||
<p><?php esc_html_e( 'The ActivityPub capability allows a user to:', 'activitypub' ); ?></p>
|
||||
|
||||
<ul>
|
||||
<li><?php esc_html_e( 'Have an individual ActivityPub profile that can be followed from other Fediverse platforms.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( 'Publish content to the Fediverse automatically when posting on your WordPress site.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( 'Manage followers and interactions from Fediverse users.', 'activitypub' ); ?></li>
|
||||
<li><?php esc_html_e( 'Access ActivityPub-specific settings and features.', 'activitypub' ); ?></li>
|
||||
</ul>
|
||||
|
||||
<h3><?php esc_html_e( 'Default Behavior', 'activitypub' ); ?></h3>
|
||||
|
||||
<p><?php esc_html_e( 'By default, users who can publish posts are automatically granted ActivityPub capabilities. You can override this default behavior using the bulk edit options described above.', 'activitypub' ); ?></p>
|
||||
|
||||
<p><em>
|
||||
<?php
|
||||
printf(
|
||||
wp_kses(
|
||||
/* translators: %s: URL to ActivityPub settings */
|
||||
__( 'Note: If <a href="%s">“Blog profile only” mode</a> is enabled (where the site acts as a single ActivityPub profile), individual user capabilities do not affect ActivityPub functionality. All content is published under the blog’s profile.', 'activitypub' ),
|
||||
array( 'a' => array( 'href' => true ) )
|
||||
),
|
||||
esc_url( admin_url( 'options-general.php?page=activitypub&tab=settings' ) )
|
||||
);
|
||||
?>
|
||||
</em></p>
|
||||
132
wp-content/plugins/activitypub/templates/oauth-authorize.php
Normal file
132
wp-content/plugins/activitypub/templates/oauth-authorize.php
Normal file
@ -0,0 +1,132 @@
|
||||
<?php
|
||||
/**
|
||||
* OAuth Authorization Consent Form Template.
|
||||
*
|
||||
* @package Activitypub
|
||||
*
|
||||
* Variables available (passed via include from class-server.php):
|
||||
* @var WP_User $current_user The current logged-in user.
|
||||
* @var array $scopes Array of requested scopes.
|
||||
* @var Activitypub\OAuth\Client $client The client object.
|
||||
* @var array $authorize_params OAuth request parameters (client_id, redirect_uri, scope, state, code_challenge, code_challenge_method).
|
||||
* @var string $form_url The form action URL.
|
||||
*/
|
||||
|
||||
// phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable -- Variables passed via include.
|
||||
|
||||
use Activitypub\OAuth\Scope;
|
||||
|
||||
// Use WordPress login page header.
|
||||
$login_errors = new WP_Error();
|
||||
|
||||
if ( empty( $authorize_params['code_challenge'] ) ) {
|
||||
$login_errors->add(
|
||||
'pkce_missing',
|
||||
__( '<strong>Warning:</strong> This client does not support PKCE. The connection may be less secure.', 'activitypub' ),
|
||||
'message'
|
||||
);
|
||||
}
|
||||
|
||||
login_header(
|
||||
/* translators: %s: Client name */
|
||||
sprintf( __( 'Authorize %s', 'activitypub' ), esc_html( $client->get_display_name() ) ),
|
||||
'',
|
||||
$login_errors
|
||||
);
|
||||
?>
|
||||
|
||||
<form method="post" action="<?php echo esc_url( $form_url ); ?>">
|
||||
<div class="activitypub-oauth-client">
|
||||
<p>
|
||||
<strong>
|
||||
<?php
|
||||
$client_link_url = $client->get_link_url();
|
||||
$client_display = esc_html( $client->get_display_name() );
|
||||
$client_label = $client_link_url
|
||||
? sprintf( '<a href="%s" target="_blank">%s</a>', esc_url( $client_link_url ), $client_display )
|
||||
: $client_display;
|
||||
|
||||
echo wp_kses(
|
||||
sprintf(
|
||||
/* translators: %s: Client name or ID */
|
||||
__( '%s wants to access your account.', 'activitypub' ),
|
||||
$client_label
|
||||
),
|
||||
array(
|
||||
'a' => array(
|
||||
'href' => array(),
|
||||
'target' => array(),
|
||||
),
|
||||
)
|
||||
);
|
||||
?>
|
||||
</strong>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="activitypub-oauth-user" style="background: #f6f7f7; padding: 15px; border-radius: 4px; margin: 20px 0;">
|
||||
<?php echo get_avatar( $current_user->ID, 48 ); ?>
|
||||
<p>
|
||||
<?php
|
||||
echo wp_kses(
|
||||
sprintf(
|
||||
/* translators: 1: User display name, 2: User login */
|
||||
__( 'Logged in as %1$s (%2$s). You can revoke access at any time.', 'activitypub' ),
|
||||
'<strong>' . esc_html( $current_user->display_name ) . '</strong>',
|
||||
esc_html( $current_user->user_login )
|
||||
),
|
||||
array( 'strong' => array() )
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php if ( ! empty( $scopes ) ) : ?>
|
||||
<div class="activitypub-oauth-scopes" style="margin: 20px 0;">
|
||||
<h3><?php esc_html_e( 'Permissions requested:', 'activitypub' ); ?></h3>
|
||||
<ul style="margin: 0; padding: 0 0 0 20px;">
|
||||
<?php foreach ( $scopes as $scope_name ) : ?>
|
||||
<li>
|
||||
<strong><?php echo esc_html( $scope_name ); ?></strong>
|
||||
<?php
|
||||
$description = Scope::get_description( $scope_name );
|
||||
if ( $description ) {
|
||||
echo ' – ' . esc_html( $description );
|
||||
}
|
||||
?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="activitypub-oauth-redirect" style="background: #f0f6fc; padding: 10px 15px; border-radius: 4px; margin: 20px 0; font-size: 13px;">
|
||||
<?php
|
||||
echo wp_kses(
|
||||
sprintf(
|
||||
/* translators: %s: Redirect URI */
|
||||
__( 'You will be redirected to %s after authorization.', 'activitypub' ),
|
||||
'<code>' . esc_html( $authorize_params['redirect_uri'] ) . '</code>'
|
||||
),
|
||||
array( 'code' => array() )
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php wp_nonce_field( 'activitypub_oauth_authorize' ); ?>
|
||||
<?php foreach ( $authorize_params as $param_name => $param_value ) : ?>
|
||||
<input type="hidden" name="<?php echo esc_attr( $param_name ); ?>" value="<?php echo esc_attr( $param_value ); ?>" />
|
||||
<?php endforeach; ?>
|
||||
|
||||
<p class="submit" style="display: flex; gap: 10px;">
|
||||
<button type="submit" name="approve" value="1" class="button button-primary button-large">
|
||||
<?php esc_html_e( 'Authorize', 'activitypub' ); ?>
|
||||
</button>
|
||||
<button type="submit" name="deny" value="1" class="button button-large">
|
||||
<?php esc_html_e( 'Cancel', 'activitypub' ); ?>
|
||||
</button>
|
||||
</p>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
login_footer();
|
||||
33
wp-content/plugins/activitypub/templates/oauth-error.php
Normal file
33
wp-content/plugins/activitypub/templates/oauth-error.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* OAuth Authorization Error Template.
|
||||
*
|
||||
* Renders a styled error page using WordPress login page chrome,
|
||||
* consistent with the consent form in oauth-authorize.php.
|
||||
*
|
||||
* @package Activitypub
|
||||
*
|
||||
* Variables available (passed via include from class-server.php):
|
||||
* @var string $error_message The error message to display.
|
||||
*/
|
||||
|
||||
// phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable -- Variables passed via include.
|
||||
|
||||
$login_errors = new WP_Error(
|
||||
'oauth_error',
|
||||
esc_html( $error_message )
|
||||
);
|
||||
|
||||
login_header(
|
||||
esc_html__( 'Authorization Error', 'activitypub' ),
|
||||
'',
|
||||
$login_errors
|
||||
);
|
||||
?>
|
||||
|
||||
<p style="margin-top: 20px; text-align: center;">
|
||||
<a href="<?php echo esc_url( home_url() ); ?>"><?php esc_html_e( 'Go to homepage', 'activitypub' ); ?></a>
|
||||
</p>
|
||||
|
||||
<?php
|
||||
login_footer();
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* ActivityPub Post JSON template.
|
||||
* ActivityPub Post Preview template.
|
||||
*
|
||||
* @package Activitypub
|
||||
*/
|
||||
@ -15,166 +15,42 @@ if ( \is_wp_error( $transformer ) ) {
|
||||
);
|
||||
}
|
||||
|
||||
\wp_register_style( 'activitypub-post-preview', ACTIVITYPUB_PLUGIN_URL . '/assets/css/activitypub-post-preview.css', array(), ACTIVITYPUB_PLUGIN_VERSION );
|
||||
|
||||
$object = $transformer->to_object();
|
||||
$user = $transformer->get_actor_object();
|
||||
|
||||
$has_images = false;
|
||||
$video = false;
|
||||
$audio = false;
|
||||
$layout = 'layout-1';
|
||||
|
||||
foreach ( $object->get_attachment() as $attachment ) {
|
||||
if ( isset( $attachment['mediaType'] ) ) {
|
||||
$media_type = strtok( $attachment['mediaType'], '/' );
|
||||
|
||||
switch ( $media_type ) {
|
||||
case 'image':
|
||||
$has_images = true;
|
||||
$layout = 'layout-' . count( wp_list_filter( $object->get_attachment(), array( 'type' => 'Image' ) ) );
|
||||
break 2;
|
||||
case 'video':
|
||||
$video = $attachment;
|
||||
break 2;
|
||||
case 'audio':
|
||||
$audio = $attachment;
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title><?php echo esc_html( $object->get_name() ); ?></title>
|
||||
<style>
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||
font-size: 1em;
|
||||
line-height: 1.5;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.columns {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
margin: 0 auto;
|
||||
max-width: 1200px;
|
||||
}
|
||||
.sidebar {
|
||||
flex: 1;
|
||||
padding: 1em;
|
||||
max-width: 285px;
|
||||
}
|
||||
.sidebar input[type="search"],
|
||||
.sidebar textarea {
|
||||
background-color: #f6f6f6;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
box-sizing: border-box;
|
||||
color: #333;
|
||||
display: block;
|
||||
font-size: 1em;
|
||||
margin-bottom: 1em;
|
||||
padding: 0.5em;
|
||||
width: 100%;
|
||||
}
|
||||
.sidebar > div,
|
||||
main address {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
margin-bottom: 1em;
|
||||
font-style: normal;
|
||||
}
|
||||
main address .name,
|
||||
main address .webfinger {
|
||||
color: #000;
|
||||
}
|
||||
.name {
|
||||
color: #ccc;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
}
|
||||
.webfinger {
|
||||
color: #ccc;
|
||||
font-size: 0.8em;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
margin-top: 0.5em;
|
||||
}
|
||||
address img, .sidebar .fake-image {
|
||||
border-radius: 8px;
|
||||
margin-right: 1em;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
background-color: #333;
|
||||
}
|
||||
main {
|
||||
flex: 1;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
background-color: #fff;
|
||||
margin: 1em;
|
||||
max-width: 600px;
|
||||
}
|
||||
main p {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
.sidebar h1 {
|
||||
font-size: 1.5em;
|
||||
margin-bottom: 1em;
|
||||
margin-top: 0;
|
||||
padding: 5px 10px;
|
||||
border-radius: 4px;
|
||||
background-color: #6364ff;
|
||||
color: #fff;
|
||||
display: inline-block;
|
||||
}
|
||||
hr {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
border-top: 1px solid #ccc;
|
||||
flex: 0 0 auto;
|
||||
margin: 10px 0;
|
||||
}
|
||||
.sidebar ul {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
}
|
||||
.sidebar ul li {
|
||||
padding: 5px;
|
||||
color: #ccc;
|
||||
}
|
||||
main article {
|
||||
padding: 1em;
|
||||
}
|
||||
main .content {
|
||||
margin: 1em 0;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
main .content h2 {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
main .attachments {
|
||||
border-radius: 8px;
|
||||
box-sizing: border-box;
|
||||
display: grid;
|
||||
gap: 2px;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
grid-template-rows: auto;
|
||||
margin: 20px 0;
|
||||
min-height: 64px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
main .attachments img {
|
||||
max-width: 100%;
|
||||
height: 100%;
|
||||
margin: 1em 0;
|
||||
display: inline-block;
|
||||
object-fit: cover;
|
||||
overflow: hidden;
|
||||
}
|
||||
main .tags a {
|
||||
background-color: #f6f6f6;
|
||||
border-radius: 4px;
|
||||
color: #333;
|
||||
display: inline-block;
|
||||
margin-right: 0.5em;
|
||||
padding: 0.5em;
|
||||
text-decoration: none;
|
||||
}
|
||||
main .tags a:hover {
|
||||
background-color: #e6e6e6;
|
||||
text-decoration: underline;
|
||||
}
|
||||
main .column-header {
|
||||
font-size: 1.5em;
|
||||
margin: 0;
|
||||
padding: 5px 10px;
|
||||
border-bottom: 1px solid #ccc;
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style>
|
||||
<?php wp_print_styles( 'activitypub-post-preview' ); ?>
|
||||
</head>
|
||||
<body>
|
||||
<div class="columns">
|
||||
@ -213,15 +89,36 @@ $user = $transformer->get_actor_object();
|
||||
<?php if ( 'Article' === $object->get_type() && $object->get_name() ) : ?>
|
||||
<h2><?php echo esc_html( $object->get_name() ); ?></h2>
|
||||
<?php endif; ?>
|
||||
<?php echo wp_kses( 'Article' === $object->get_type() ? $object->get_summary() : $object->get_content(), ACTIVITYPUB_MASTODON_HTML_SANITIZER ); ?>
|
||||
<?php
|
||||
$content_to_display = 'Article' === $object->get_type() ? $object->get_summary() : $object->get_content();
|
||||
|
||||
// Avoid captions making it through wp_kses.
|
||||
$content_to_display = preg_replace( '/<figure.*?>.*?<\/figure>/s', '', $content_to_display );
|
||||
|
||||
echo wp_kses( $content_to_display, ACTIVITYPUB_MASTODON_HTML_SANITIZER );
|
||||
?>
|
||||
</div>
|
||||
<?php if ( $object->get_attachment() ) : ?>
|
||||
<div class="attachments">
|
||||
<?php foreach ( $object->get_attachment() as $attachment ) : ?>
|
||||
<?php if ( 'Image' === $attachment['type'] ) : ?>
|
||||
<img src="<?php echo esc_url( $attachment['url'] ); ?>" alt="<?php echo esc_attr( $attachment['name'] ?? '' ); ?>" />
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
<div class="attachments <?php echo \esc_attr( $layout ); ?>">
|
||||
<?php
|
||||
if ( $has_images ) :
|
||||
foreach ( $object->get_attachment() as $attachment ) :
|
||||
if ( 'Image' === $attachment['type'] ) :
|
||||
?>
|
||||
<img src="<?php echo esc_url( $attachment['url'] ); ?>" alt="<?php echo esc_attr( $attachment['name'] ?? '' ); ?>" />
|
||||
<?php
|
||||
endif;
|
||||
endforeach;
|
||||
elseif ( $video ) :
|
||||
?>
|
||||
<video controls src="<?php echo esc_url( $video['url'] ); ?>" title="<?php echo esc_attr( $video['name'] ?? '' ); ?>"></video>
|
||||
<?php
|
||||
elseif ( $audio ) :
|
||||
?>
|
||||
<audio controls src="<?php echo esc_url( $audio['url'] ); ?>" title="<?php echo esc_attr( $audio['name'] ?? '' ); ?>"></audio>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ( $object->get_tag() ) : ?>
|
||||
|
||||
@ -7,6 +7,8 @@
|
||||
|
||||
?>
|
||||
|
||||
<hr class="wp-header-end">
|
||||
|
||||
<div class="activitypub-settings activitypub-settings-page hide-if-no-js">
|
||||
<form method="post" action="options.php">
|
||||
<?php \settings_fields( 'activitypub' ); ?>
|
||||
|
||||
51
wp-content/plugins/activitypub/templates/tombstone-json.php
Normal file
51
wp-content/plugins/activitypub/templates/tombstone-json.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* Tombstone JSON template.
|
||||
*
|
||||
* @package Activitypub
|
||||
*/
|
||||
|
||||
use Activitypub\Activity\Base_Object;
|
||||
use Activitypub\Query;
|
||||
use Activitypub\Transformer\Factory;
|
||||
|
||||
$query = Query::get_instance();
|
||||
$queried_object = $query->get_queried_object();
|
||||
$object = null;
|
||||
|
||||
// For soft-deleted posts, use the transformer to create a full Tombstone.
|
||||
if ( $queried_object ) {
|
||||
/**
|
||||
* The transformer for the queried object.
|
||||
*
|
||||
* @var \Activitypub\Transformer\Post|\WP_Error $transformer
|
||||
*/
|
||||
$transformer = Factory::get_transformer( $queried_object );
|
||||
if ( $transformer && ! \is_wp_error( $transformer ) ) {
|
||||
$object = $transformer->to_tombstone();
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback for permanently deleted posts.
|
||||
if ( ! $object ) {
|
||||
$object = new Base_Object();
|
||||
$object->set_id( $query->get_request_url() );
|
||||
$object->set_type( 'Tombstone' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires before an ActivityPub object is generated and sent to the client.
|
||||
*
|
||||
* @param Activitypub\Activity\Base_Object $object The ActivityPub object.
|
||||
*/
|
||||
\do_action( 'activitypub_json_pre', $object );
|
||||
|
||||
\header( 'Content-Type: application/activity+json' );
|
||||
echo $object->to_json(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
|
||||
/**
|
||||
* Fires after an ActivityPub object is generated and sent to the client.
|
||||
*
|
||||
* @param Activitypub\Activity\Base_Object $object The ActivityPub object.
|
||||
*/
|
||||
\do_action( 'activitypub_json_post', $object );
|
||||
@ -1,26 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* ActivityPub User Followers List template.
|
||||
*
|
||||
* @package Activitypub
|
||||
*/
|
||||
|
||||
$follower_count = \Activitypub\Collection\Followers::count_followers( \get_current_user_id() );
|
||||
// translators: The follower count.
|
||||
$followers_template = _n( 'Your author profile currently has %s follower.', 'Your author profile currently has %s followers.', $follower_count, 'activitypub' );
|
||||
?>
|
||||
<div class="wrap">
|
||||
<h1><?php \esc_html_e( 'Author Followers', 'activitypub' ); ?></h1>
|
||||
<p><?php \printf( \esc_html( $followers_template ), \esc_attr( $follower_count ) ); ?></p>
|
||||
|
||||
<?php $table = new \Activitypub\Table\Followers(); ?>
|
||||
|
||||
<form method="get">
|
||||
<input type="hidden" name="page" value="activitypub-followers-list" />
|
||||
<?php
|
||||
$table->prepare_items();
|
||||
$table->search_box( 'Search', 'search' );
|
||||
$table->display();
|
||||
?>
|
||||
</form>
|
||||
</div>
|
||||
@ -5,8 +5,16 @@
|
||||
* @package Activitypub
|
||||
*/
|
||||
|
||||
wp_enqueue_style(
|
||||
'activitypub-welcome',
|
||||
plugins_url( 'assets/css/activitypub-welcome.css', ACTIVITYPUB_PLUGIN_FILE ),
|
||||
array(),
|
||||
ACTIVITYPUB_PLUGIN_VERSION
|
||||
);
|
||||
?>
|
||||
|
||||
<hr class="wp-header-end">
|
||||
|
||||
<div class="activitypub-settings activitypub-welcome-page hide-if-no-js">
|
||||
<?php do_settings_sections( 'activitypub_welcome' ); ?>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user