updated plugin ActivityPub version 3.3.3

This commit is contained in:
2024-10-09 12:44:17 +00:00
committed by Gitium
parent fb4b27bbc6
commit c54fa007bd
106 changed files with 7070 additions and 2918 deletions

View File

@ -1,11 +1,15 @@
<?php
/**
* ActivityPub settings template.
*
* @package Activitypub
*/
\load_template(
__DIR__ . '/admin-header.php',
true,
array(
'settings' => 'active',
'welcome' => '',
'followers' => '',
'settings' => 'active',
)
);
?>
@ -26,7 +30,7 @@
<p>
<label>
<input type="checkbox" name="activitypub_enable_users" id="activitypub_enable_users" value="1" <?php echo \checked( '1', \get_option( 'activitypub_enable_users', '1' ) ); ?> />
<?php \esc_html_e( 'Enable authors', 'activitypub' ); ?>
<?php \esc_html_e( 'Enable Author-Profiles', 'activitypub' ); ?>
</label>
</p>
<p class="description">
@ -38,7 +42,7 @@
<p>
<label>
<input type="checkbox" name="activitypub_enable_blog_user" id="activitypub_enable_blog_user" value="1" <?php echo \checked( '1', \get_option( 'activitypub_enable_blog_user', '0' ) ); ?> />
<?php \esc_html_e( 'Enable blog', 'activitypub' ); ?>
<?php \esc_html_e( 'Enable Blog-Profile', 'activitypub' ); ?>
</label>
</p>
<p class="description">
@ -46,25 +50,6 @@
</p>
</td>
</tr>
<tr>
<th scope="row">
<?php \esc_html_e( 'Change blog profile ID', 'activitypub' ); ?>
</th>
<td>
<label for="activitypub_blog_user_identifier">
<input class="blog-user-identifier" name="activitypub_blog_user_identifier" id="activitypub_blog_user_identifier" type="text" value="<?php echo esc_attr( \get_option( 'activitypub_blog_user_identifier', \Activitypub\Model\Blog::get_default_username() ) ); ?>" />
@<?php echo esc_html( \wp_parse_url( \home_url(), PHP_URL_HOST ) ); ?>
</label>
<p class="description">
<?php \esc_html_e( 'This profile name will federate all posts written on your blog, regardless of the author who posted it.', 'activitypub' ); ?>
</p>
<p>
<strong>
<?php \esc_html_e( 'Please avoid using an existing authors name as the blog profile ID. Fediverse platforms might use caching and this could break the functionality completely.', 'activitypub' ); ?>
</strong>
</p>
</td>
</tr>
</tbody>
</table>
@ -103,8 +88,7 @@
</td>
</tr>
<?php // phpcs:ignore Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace ?>
<tr <?php if ( 'wordpress-post-format' === \get_option( 'activitypub_object_type', ACTIVITYPUB_DEFAULT_OBJECT_TYPE ) ) { echo 'style="display: none"'; } ?>>
<tr <?php echo 'wordpress-post-format' === \get_option( 'activitypub_object_type', ACTIVITYPUB_DEFAULT_OBJECT_TYPE ) ? 'style="display: none"' : ''; ?>>
<th scope="row">
<?php \esc_html_e( 'Post content', 'activitypub' ); ?>
</th>
@ -156,12 +140,12 @@
<summary><?php esc_html_e( 'See a list of ActivityPub Template Tags.', 'activitypub' ); ?></summary>
<div class="description">
<ul>
<li><code>[ap_title]</code> - <?php \esc_html_e( 'The post\'s title.', 'activitypub' ); ?></li>
<li><code>[ap_content]</code> - <?php \esc_html_e( 'The post\'s content.', 'activitypub' ); ?></li>
<li><code>[ap_excerpt]</code> - <?php \esc_html_e( 'The post\'s excerpt (may be truncated).', 'activitypub' ); ?></li>
<li><code>[ap_permalink]</code> - <?php \esc_html_e( 'The post\'s permalink.', 'activitypub' ); ?></li>
<li><code>[ap_shortlink]</code> - <?php echo \wp_kses( \__( 'The post\'s shortlink. I can recommend <a href="https://wordpress.org/plugins/hum/" target="_blank">Hum</a>.', 'activitypub' ), 'default' ); ?></li>
<li><code>[ap_hashtags]</code> - <?php \esc_html_e( 'The post\'s tags as hashtags.', 'activitypub' ); ?></li>
<li><code>[ap_title]</code> - <?php \esc_html_e( 'The post&#8217;s title.', 'activitypub' ); ?></li>
<li><code>[ap_content]</code> - <?php \esc_html_e( 'The post&#8217;s content.', 'activitypub' ); ?></li>
<li><code>[ap_excerpt]</code> - <?php \esc_html_e( 'The post&#8217;s excerpt (may be truncated).', 'activitypub' ); ?></li>
<li><code>[ap_permalink]</code> - <?php \esc_html_e( 'The post&#8217;s permalink.', 'activitypub' ); ?></li>
<li><code>[ap_shortlink]</code> - <?php echo \wp_kses( \__( 'The pos&#8217;s shortlink. I can recommend <a href="https://wordpress.org/plugins/hum/" target="_blank">Hum</a>.', 'activitypub' ), 'default' ); ?></li>
<li><code>[ap_hashtags]</code> - <?php \esc_html_e( 'The post&#8217;s tags as hashtags.', 'activitypub' ); ?></li>
</ul>
<p><?php \esc_html_e( 'You can find the full list with all possible attributes in the help section on the top-right of the screen.', 'activitypub' ); ?></p>
</div>
@ -179,7 +163,7 @@
<?php
echo \wp_kses(
\sprintf(
// translators:
// translators: %s is a number.
\__( 'The number of media (images, audio, video) to attach to posts. Default: <code>%s</code>', 'activitypub' ),
\esc_html( ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS )
),
@ -202,19 +186,21 @@
<fieldset>
<?php \esc_html_e( 'Automatically publish items of the selected post types to the fediverse:', 'activitypub' ); ?>
<?php $post_types = \get_post_types( array( 'public' => true ), 'objects' ); ?>
<?php $support_post_types = \get_option( 'activitypub_support_post_types', array( 'post' ) ) ? \get_option( 'activitypub_support_post_types', array( 'post' ) ) : array(); ?>
<ul>
<?php // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited ?>
<?php foreach ( $post_types as $post_type ) { ?>
<?php
$post_types = \get_post_types( array( 'public' => true ), 'objects' );
$supported_post_types = (array) \get_option( 'activitypub_support_post_types', array( 'post' ) );
foreach ( $post_types as $_post_type ) :
?>
<li>
<input type="checkbox" id="activitypub_support_post_type_<?php echo \esc_attr( $post_type->name ); ?>" name="activitypub_support_post_types[]" value="<?php echo \esc_attr( $post_type->name ); ?>" <?php echo \checked( \in_array( $post_type->name, $support_post_types, true ) ); ?> />
<label for="activitypub_support_post_type_<?php echo \esc_attr( $post_type->name ); ?>"><?php echo \esc_html( $post_type->label ); ?></label>
<input type="checkbox" id="activitypub_support_post_type_<?php echo \esc_attr( $_post_type->name ); ?>" name="activitypub_support_post_types[]" value="<?php echo \esc_attr( $_post_type->name ); ?>" <?php echo \checked( \in_array( $_post_type->name, $supported_post_types, true ) ); ?> />
<label for="activitypub_support_post_type_<?php echo \esc_attr( $_post_type->name ); ?>"><?php echo \esc_html( $_post_type->label ); ?></label>
<span class="description">
<?php echo \esc_html( \Activitypub\get_post_type_description( $post_type ) ); ?>
<?php echo \esc_html( \Activitypub\get_post_type_description( $_post_type ) ); ?>
</span>
</li>
<?php } ?>
<?php endforeach; ?>
</ul>
</fieldset>
</td>
@ -236,21 +222,31 @@
</div>
<div class="box">
<h3><?php \esc_html_e( 'Server', 'activitypub' ); ?></h3>
<h3><?php \esc_html_e( 'General', 'activitypub' ); ?></h3>
<table class="form-table">
<tbody>
<tr>
<th scope="row">
<?php \esc_html_e( 'OpenGraph', 'activitypub' ); ?>
</th>
<td>
<p>
<label><input type="checkbox" name="activitypub_use_opengraph" id="activitypub_use_opengraph" value="1" <?php echo \checked( '1', \get_option( 'activitypub_use_opengraph', '1' ) ); ?> /> <?php echo wp_kses( \__( 'Automatically add <code>&lt;meta name="fediverse:creator" /&gt;</code> tags for Authors and the Blog-User. You can read more about the feature on the <a href="https://blog.joinmastodon.org/2024/07/highlighting-journalism-on-mastodon/" target="_blank">Mastodon Blog</a>.', 'activitypub' ), 'post' ); ?></label>
</p>
</td>
</tr>
<tr>
<th scope="row">
<?php \esc_html_e( 'Blocklist', 'activitypub' ); ?>
</th>
<td>
<p class="description">
<p>
<?php
echo \wp_kses(
\sprintf(
// translators: %s is a URL.
\__( 'To block servers, add the host of the server to the "<a href="%s">Disallowed Comment Keys</a>" list.', 'activitypub' ),
\esc_attr( \admin_url( 'options-discussion.php#disallowed_keys' ) )
\esc_url( \admin_url( 'options-discussion.php#disallowed_keys' ) )
),
'default'
);
@ -260,7 +256,7 @@
</tr>
</tbody>
</table>
<?php \do_settings_fields( 'activitypub', 'general' ); ?>
<?php \do_settings_fields( 'activitypub', 'server' ); ?>
</div>
<?php \do_settings_sections( 'activitypub' ); ?>