modified file wp-piwik

This commit is contained in:
2026-06-03 21:29:22 +00:00
committed by Gitium
parent 57bccfdbd1
commit 769efed689
2556 changed files with 368982 additions and 126264 deletions

View File

@ -0,0 +1,25 @@
<?php
/**
* ActivityPub JSON template.
*
* @package Activitypub
*/
$object = \Activitypub\Query::get_instance()->get_activitypub_object();
/**
* Fires before an ActivityPub object is generated and sent to the client.
*
* @param 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 object $object The ActivityPub object.
*/
\do_action( 'activitypub_json_post', $object );

View File

@ -0,0 +1,34 @@
<?php
/**
* Admin header template.
*
* @package Activitypub
*/
/* @var array $args Template arguments. */
$args = wp_parse_args( $args ?? array() );
?>
<div class="activitypub-settings-header">
<div class="activitypub-settings-title-section">
<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>
<?php
endforeach;
?>
</nav>
</div>
<hr class="wp-header-end">

View File

@ -0,0 +1,16 @@
<?php
/**
* ActivityPub settings template.
*
* @package Activitypub
*/
?>
<div class="activitypub-settings activitypub-settings-page hide-if-no-js">
<form method="post" action="options.php">
<?php \settings_fields( 'activitypub_advanced' ); ?>
<?php \do_settings_sections( 'activitypub_advanced_settings' ); ?>
<?php \submit_button(); ?>
</form>
</div>

View File

@ -0,0 +1,25 @@
<?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>

View File

@ -0,0 +1,16 @@
<?php
/**
* ActivityPub Blog Settings template.
*
* @package Activitypub
*/
?>
<div class="activitypub-settings activitypub-settings-page hide-if-no-js">
<form method="post" action="options.php">
<?php \settings_fields( 'activitypub_blog' ); ?>
<?php \do_settings_sections( 'activitypub_blog_settings' ); ?>
<?php \submit_button(); ?>
</form>
</div>

View File

@ -0,0 +1,49 @@
<?php
/**
* ActivityPub New DM E-Mail template.
*
* @package Activitypub
*/
use Activitypub\Collection\Actors;
use Activitypub\Embed;
/* @var array $args Template arguments. */
$args = wp_parse_args( $args ?? array() );
// Load header.
require __DIR__ . '/parts/header.php';
?>
<h1><?php esc_html_e( 'You&#8217;ve got a new message!', 'activitypub' ); ?></h1>
<p>
<?php
if ( Actors::BLOG_USER_ID === $args['user_id'] ) :
/* translators: %s: The name of the person who mentioned the blog. */
$message = __( 'Looks like someone&#8217;s reaching out! Your blog just got a direct message from %s on the Fediverse. Here&#8217;s what they said:', 'activitypub' );
else :
/* translators: %s: The name of the person who sent the message. */
$message = __( 'Looks like someone&#8217;s reaching out! You just got a direct message from %s on the Fediverse. Here&#8217;s what they said:', 'activitypub' );
endif;
printf( esc_html( $message ), '<a href="' . esc_url( $args['actor']['url'] ) . '">' . esc_html( $args['actor']['webfinger'] ) . '</a>' );
?>
</p>
<div class="embed">
<?php
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo Embed::get_html_for_object( $args['activity']['object'] );
?>
</div>
<?php
/**
* Fires at the bottom of the new direct message emails.
*
* @param array $args The template arguments.
*/
do_action( 'activitypub_new_dm_email', $args );
// Load footer.
require __DIR__ . '/parts/footer.php';

View File

@ -0,0 +1,159 @@
<?php
/**
* ActivityPub New Follower E-Mail template.
*
* @package Activitypub
*/
use Activitypub\Collection\Actors;
/* @var array $args Template arguments. */
$args = wp_parse_args( $args ?? array() );
// Load header.
require __DIR__ . '/parts/header.php';
?>
<style>
.card {
background: #fff;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.card-header {
width: 100%;
height: 120px;
background-color: #ccc;
background-size: cover;
background-position: center;
}
.card-body {
display: flex;
gap: 16px;
align-items: flex-start;
padding: 16px;
}
.card-body img {
border-radius: 50%;
width: 64px;
height: 64px;
flex-shrink: 0;
}
.card-content {
flex: 1;
}
.card-content h2 {
font-size: 18px;
margin: 0 0 4px;
}
.card-content p {
margin: 0 0 8px;
}
</style>
<h1>
<?php
if ( Actors::BLOG_USER_ID === $args['user_id'] ) :
esc_html_e( 'Your blog has a new follower!', 'activitypub' );
else :
esc_html_e( 'You have a new follower!', 'activitypub' );
endif;
?>
</h1>
<p>
<?php
if ( Actors::BLOG_USER_ID === $args['user_id'] ) :
/* translators: %s: The name of the person who mentioned the blog. */
$message = __( 'Meet your blog&#8217;s newest follower, %s. Here&#8217;s a quick look at their profile:', 'activitypub' );
else :
/* translators: %s: The name of the person who mentioned the user. */
$message = __( 'Meet your newest follower, %s. Here&#8217;s a quick look at their profile:', 'activitypub' );
endif;
printf( esc_html( $message ), '<a href="' . esc_url( $args['url'] ) . '">' . esc_html( $args['webfinger'] ) . '</a>' );
?>
</p>
<div class="card">
<?php if ( ! empty( $args['image']['url'] ) ) : ?>
<div class="card-header" style="background-image: url('<?php echo esc_url( $args['image']['url'] ); ?>');"></div>
<?php endif; ?>
<div class="card-body">
<?php if ( ! empty( $args['icon']['url'] ) ) : ?>
<img src="<?php echo esc_url( $args['icon']['url'] ); ?>" alt="<?php echo esc_attr( $args['name'] ); ?>">
<?php endif; ?>
<div class="card-content">
<h2><?php echo esc_html( $args['name'] ); ?> <small style="font-size: 14px; color: #666;"><?php echo esc_html( $args['webfinger'] ); ?></small></h2>
<?php if ( ! empty( $args['summary'] ) ) : ?>
<p><?php echo wp_kses_post( nl2br( $args['summary'] ) ); ?></p>
<?php endif; ?>
<?php if ( isset( $args['stats']['outbox'] ) || isset( $args['stats']['followers'] ) || isset( $args['stats']['following'] ) ) : ?>
<div class="card-stats" style="display: flex; gap: 16px; font-size: 14px; color: #666; margin-top: 16px;">
<?php if ( null !== $args['stats']['outbox'] ) : ?>
<div>
<?php
printf(
/* translators: %s: Number of posts */
esc_html( _n( '%s post', '%s posts', (int) $args['stats']['outbox'], 'activitypub' ) ),
'<strong>' . esc_html( number_format_i18n( $args['stats']['outbox'] ) ) . '</strong>'
);
?>
</div>
<?php endif; ?>
<?php if ( null !== $args['stats']['followers'] ) : ?>
<div>
<?php
printf(
/* translators: %s: Number of followers */
esc_html( _n( '%s follower', '%s followers', (int) $args['stats']['followers'], 'activitypub' ) ),
'<strong>' . esc_html( number_format_i18n( $args['stats']['followers'] ) ) . '</strong>'
);
?>
</div>
<?php endif; ?>
<?php if ( null !== $args['stats']['following'] ) : ?>
<div>
<?php
printf(
/* translators: %s: Number of following */
esc_html( _n( '%s following', '%s following', (int) $args['stats']['following'], 'activitypub' ) ),
'<strong>' . esc_html( number_format_i18n( $args['stats']['following'] ) ) . '</strong>'
);
?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
</div>
</div>
<p>
<a class="button" href="<?php echo esc_url( $args['url'] ); ?>">
<?php esc_html_e( 'View Profile', 'activitypub' ); ?>
</a>
</p>
<p>
<?php
printf(
/* translators: %s: URL to followers list. */
wp_kses( __( 'Visit the <a href="%s">followers list</a> to see all followers.', 'activitypub' ), array( 'a' => array( 'href' => array() ) ) ),
esc_url( admin_url( $args['admin_url'] ) )
);
?>
</p>
<?php
/**
* Fires at the bottom of the new follower email.
*
* @param array $args The actor that followed the blog.
*/
do_action( 'activitypub_new_follower_email', $args );
// Load footer.
require __DIR__ . '/parts/footer.php';

View File

@ -0,0 +1,64 @@
<?php
/**
* ActivityPub New Mention E-Mail template with styles.
*
* @package Activitypub
*/
use Activitypub\Collection\Actors;
use Activitypub\Embed;
/* @var array $args Template arguments. */
$args = wp_parse_args( $args ?? array() );
// Load header.
require __DIR__ . '/parts/header.php';
?>
<h1>
<?php
if ( Actors::BLOG_USER_ID === $args['user_id'] ) :
esc_html_e( 'Your blog was mentioned!', 'activitypub' );
else :
esc_html_e( 'You were mentioned!', 'activitypub' );
endif;
?>
</h1>
<p>
<?php
if ( Actors::BLOG_USER_ID === $args['user_id'] ) :
/* translators: %s: The name of the person who mentioned the blog. */
$message = __( 'Looks like someone&#8217;s talking about your blog! It was just mentioned by %s in a post on the Fediverse. Here&#8217;s what they said:', 'activitypub' );
else :
/* translators: %s: The name of the person who mentioned the user. */
$message = __( 'Looks like someone&#8217;s talking about you! You were just mentioned by %s in a post on the Fediverse. Here&#8217;s what they said:', 'activitypub' );
endif;
printf( esc_html( $message ), '<a href="' . esc_url( $args['actor']['url'] ) . '">' . esc_html( $args['actor']['webfinger'] ) . '</a>' );
?>
</p>
<div class="embed">
<?php
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo Embed::get_html_for_object( $args['activity']['object'] );
?>
</div>
<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
/**
* Fires at the bottom of the new mention emails.
*
* @param array $args The template arguments.
*/
do_action( 'activitypub_new_mention_email', $args );
// Load footer.
require __DIR__ . '/parts/footer.php';

View File

@ -0,0 +1,28 @@
<?php
/**
* ActivityPub E-Mail template footer.
*
* @package Activitypub
*/
/* @var array $args Template arguments. */
use Activitypub\Collection\Actors;
/* @var array $args Template arguments. */
$args = wp_parse_args( $args ?? array() );
$settings_path = 'profile.php#activitypub-notifications';
if ( Actors::BLOG_USER_ID === $args['user_id'] ) {
$settings_path = 'options-general.php?page=activitypub&tab=blog-profile#activitypub-notifications';
}
?>
<div class="footer">
<p><?php esc_html_e( 'You are receiving this emails because of your ActivityPub plugin settings.', 'activitypub' ); ?></p>
<p>
<a href="<?php echo esc_url( admin_url( $settings_path ) ); ?>">
<?php esc_html_e( 'Manage notification settings', 'activitypub' ); ?>
</a>
</p>
</div>
</div><!-- .container -->

View File

@ -0,0 +1,60 @@
<?php
/**
* ActivityPub E-Mail template header.
*
* @package Activitypub
*/
?>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 1.5;
color: #222;
background-color: #ffffff;
margin: 0;
padding: 0;
}
@media only screen and (max-width: 599px) {
body {
background-color: #f9f9f9 !important;
}
}
.container {
max-width: 600px;
margin: 20px auto;
padding: 20px;
background-color: #f9f9f9;
border-radius: 8px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
@media only screen and (max-width: 599px) {
.container {
border-radius: 0 !important;
box-shadow: none !important;
margin: 0 !important;
}
}
h1 {
font-size: 20px;
margin-bottom: 16px;
}
a.button {
display: inline-block;
background-color: #2271b1;
color: #ffffff !important;
text-decoration: none;
padding: 10px 16px;
border-radius: 4px;
font-weight: bold;
margin: 10px 0;
}
.footer {
font-size: 13px;
color: #777;
margin-top: 30px;
}
</style>
<div class="container">

View File

@ -0,0 +1,265 @@
<?php
/**
* ActivityPub Post JSON template.
*
* @package Activitypub
*/
$post = \get_post(); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
$transformer = \Activitypub\Transformer\Factory::get_transformer( $post );
if ( \is_wp_error( $transformer ) ) {
\wp_die(
esc_html( $transformer->get_error_message() ),
404
);
}
$object = $transformer->to_object();
$user = $transformer->get_actor_object();
?>
<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>
</head>
<body>
<div class="columns">
<aside class="sidebar">
<input type="search" disabled="disabled" placeholder="<?php esc_html_e( 'Search', 'activitypub' ); ?>" />
<div>
<div class="fake-image"></div>
<div>
<div class="name">
████ ██████
</div>
<div class="webfinger">
@█████@██████
</div>
</div>
</div>
<textarea rows="10" cols="50" disabled="disabled" placeholder="<?php esc_html_e( 'What\'s up', 'activitypub' ); ?>"></textarea>
</aside>
<main>
<h1 class="column-header">
Home
</h1>
<article>
<address>
<img src="<?php echo esc_url( $user->get_icon()['url'] ); ?>" alt="<?php echo esc_attr( $user->get_name() ); ?>" />
<div>
<div class="name">
<?php echo esc_html( $user->get_name() ); ?>
</div>
<div class="webfinger">
<?php echo esc_html( '@' . $user->get_webfinger() ); ?>
</div>
</div>
</address>
<div class="content">
<?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 ); ?>
</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>
<?php endif; ?>
<?php if ( $object->get_tag() ) : ?>
<div class="tags">
<?php foreach ( $object->get_tag() as $hashtag ) : ?>
<?php if ( 'Hashtag' === $hashtag['type'] ) : ?>
<a href="<?php echo esc_url( $hashtag['href'] ); ?>"><?php echo esc_html( $hashtag['name'] ); ?></a>
<?php endif; ?>
<?php endforeach; ?>
</div>
<?php endif; ?>
</article>
</main>
<aside class="sidebar">
<h1>⁂ Fediverse</h1>
<ul>
<li>████████</li>
<li>███████████</li>
<li>██████████</li>
<li>█████████</li>
<li>███████</li>
<li>████████</li>
<li>████████████</li>
<li>████████████</li>
<li>██████████</li>
<li>████████████</li>
</ul>
<hr />
<ul>
<li>███████████</li>
<li>██████████████</li>
<li>█████████</li>
</ul>
<hr />
<ul>
<li>██████████</li>
</ul>
</aside>
</div>
</body>
</html>

View File

@ -0,0 +1,81 @@
<?php
/**
* Reply embed template.
*
* @package Activitypub
*/
/* @var array $args Template arguments. */
$args = wp_parse_args(
$args,
array(
'avatar_url' => '',
'author_name' => '',
'author_url' => '',
'title' => '',
'content' => '',
'image' => '',
'published' => '',
'url' => '',
'boosts' => null,
'favorites' => null,
'webfinger' => '',
)
);
\wp_enqueue_style( 'activitypub-embed', ACTIVITYPUB_PLUGIN_URL . 'assets/css/activitypub-embed.css', array(), ACTIVITYPUB_PLUGIN_VERSION );
?>
<div class="activitypub-embed u-in-reply-to h-cite">
<div class="activitypub-embed-header p-author h-card">
<?php if ( $args['avatar_url'] ) : ?>
<img class="u-photo" src="<?php echo \esc_url( $args['avatar_url'] ); ?>" alt="" />
<?php endif; ?>
<div class="activitypub-embed-header-text">
<h2 class="p-name"><?php echo \esc_html( $args['author_name'] ); ?></h2>
<?php if ( $args['author_url'] ) : ?>
<a href="<?php echo \esc_url( $args['author_url'] ); ?>" class="ap-account u-url"><?php echo \esc_html( $args['webfinger'] ?? $args['author_url'] ); ?></a>
<?php endif; ?>
</div>
</div>
<div class="activitypub-embed-content">
<?php if ( $args['title'] ) : ?>
<h3 class="ap-title p-name"><?php echo \esc_html( $args['title'] ); ?></h3>
<?php endif; ?>
<?php if ( $args['content'] ) : ?>
<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="" />
</div>
<?php endif; ?>
</div>
<div class="activitypub-embed-meta">
<?php if ( $args['published'] ) : ?>
<a href="<?php echo \esc_url( $args['url'] ); ?>" class="ap-stat ap-date dt-published u-in-reply-to"><?php echo \esc_html( $args['published'] ); ?></a>
<?php endif; ?>
<?php if ( null !== $args['boosts'] ) : ?>
<span class="ap-stat">
<?php
/* translators: %s: number of boosts */
printf( \esc_html__( '%s boosts', 'activitypub' ), '<strong>' . \esc_html( \number_format_i18n( $args['boosts'] ) ) . '</strong>' );
?>
</span>
<?php endif; ?>
<?php if ( null !== $args['favorites'] ) : ?>
<span class="ap-stat">
<?php
/* translators: %s: number of favorites */
printf( \esc_html__( '%s favorites', 'activitypub' ), '<strong>' . \esc_html( \number_format_i18n( $args['favorites'] ) ) . '</strong>' );
?>
</span>
<?php endif; ?>
</div>
</div>

View File

@ -0,0 +1,16 @@
<?php
/**
* ActivityPub settings template.
*
* @package Activitypub
*/
?>
<div class="activitypub-settings activitypub-settings-page hide-if-no-js">
<form method="post" action="options.php">
<?php \settings_fields( 'activitypub' ); ?>
<?php \do_settings_sections( 'activitypub_settings' ); ?>
<?php \submit_button(); ?>
</form>
</div>

View File

@ -0,0 +1,78 @@
<?php
/**
* Toolbox template.
*
* @package Activitypub
*/
?>
<div class="card activitypub" id="activitypub">
<h2><?php esc_html_e( 'Fediverse Bookmarklet ⁂', 'activitypub' ); ?></h2>
<p>
<?php esc_html_e( 'This lightweight bookmarklet makes it simple to reply to content on any webpage that supports ActivityPub, enhancing your interaction on the fediverse.', 'activitypub' ); ?>
</p>
<form>
<h3><?php esc_html_e( 'Install Bookmarklet', 'activitypub' ); ?></h3>
<p><?php esc_html_e( 'Drag and drop this button to your browsers bookmark bar or save this bookmarklet to reply to posts on other websites from your blog! When visiting a post on another site, click the bookmarklet to start a reply.', 'activitypub' ); ?></p>
<p class="activitypub-bookmarklet-wrapper">
<a class="activitypub-bookmarklet button" onclick="return false;" href="<?php echo esc_attr( \Activitypub\get_reply_intent_js() ); ?>" style="cursor: grab;">
<?php // translators: The host (domain) of the Blog. ?>
<?php printf( esc_html__( 'Reply from %s', 'activitypub' ), esc_attr( \wp_parse_url( \home_url(), PHP_URL_HOST ) ) ); ?>
</a>
</p>
<div class="activitypub-code-wrap clear" id="activitypub-code-wrap">
<p id="activitypub-code-desc">
<?php esc_html_e( 'Or copy the following code and create a new bookmark. Paste the code into the new bookmark&#8217;s URL field.', 'activitypub' ); ?>
</p>
<p>
<textarea id="activitypub-bookmarklet-code" class="large-text activitypub-code" rows="5" readonly="readonly" aria-labelledby="activitypub-code-desc"><?php echo esc_textarea( \Activitypub\get_reply_intent_js() ); ?></textarea>
</p>
<p><span class="dashicons dashicons-clipboard"></span> <a href="javascript:;" class="copy-activitypub-bookmarklet-code" style="cursor: copy;"><?php esc_html_e( 'Copy to clipboard', 'activitypub' ); ?></a></p>
</div>
<script>
jQuery( document ).ready( function( $ ) {
var $copyActivitypubBookmarkletCode = $( '.copy-activitypub-bookmarklet-code' );
$copyActivitypubBookmarkletCode.on( 'click', function( event ) {
// Get the text field.
var copyText = document.getElementById("activitypub-bookmarklet-code");
// Select the text field.
copyText.select();
copyText.setSelectionRange(0, 99999); // For mobile devices.
// Copy the text inside the text field.
navigator.clipboard.writeText(copyText.value);
});
});
</script>
</form>
<h3><?php esc_html_e( 'Reply Intent', 'activitypub' ); ?></h3>
<p><?php esc_html_e( 'The Reply Intent makes it easy for you to compose and post a Reply to your audience from a link on the Fediverse (Mastodon, Pixelfed, ...).', 'activitypub' ); ?></p>
<h4><?php esc_html_e( 'URL', 'activitypub' ); ?></h4>
<p><code><?php echo esc_url( \admin_url( 'post-new.php' ) ); ?></code></p>
<h4><?php esc_html_e( 'Query parameters', 'activitypub' ); ?></h4>
<table class="wp-list-table widefat fixed striped table-view-list">
<thead>
<tr>
<th>
<?php esc_html_e( 'Parameter', 'activitypub' ); ?>
</th>
<th>
<?php esc_html_e( 'Description', 'activitypub' ); ?>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>in_reply_to</td>
<td><?php esc_html_e( 'The URL of the content you want to reply to.', 'activitypub' ); ?></td>
</tr>
<tr>
<td>post_type</td>
<td><?php esc_html_e( 'The Post-Type you want to use for replies.', 'activitypub' ); ?></td>
</tr>
</tbody>
</table>
<p><?php esc_html_e( 'There might be more query parameters in the future.', 'activitypub' ); ?></p>
</div>

View File

@ -0,0 +1,26 @@
<?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>

View File

@ -0,0 +1,12 @@
<?php
/**
* ActivityPub Welcome template.
*
* @package Activitypub
*/
?>
<div class="activitypub-settings activitypub-welcome-page hide-if-no-js">
<?php do_settings_sections( 'activitypub_welcome' ); ?>
</div>