PluginProbe
ActivityPub / 5.1.0
ActivityPub v5.1.0
9.3.1 9.3.0 9.2.2 9.2.1 9.2.0 9.1.0 9.0.2 9.0.1 9.0.0 8.3.0 8.2.1 8.2.0 8.1.1 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.2.0 1.3.0 2.0.0 2.0.1 2.1.0 2.1.1 All 160 releases
activitypub / templates / settings.php

settings.php in ActivityPub 5.1.0, at templates/settings.php

301 lines 14.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * ActivityPub settings template.
4 *
5 * @package Activitypub
6 */
7
8 ?>
9
10 <div class="activitypub-settings activitypub-settings-page hide-if-no-js">
11 <form method="post" action="options.php">
12 <?php \settings_fields( 'activitypub' ); ?>
13
14 <div class="box">
15 <h3><?php \esc_html_e( 'Profiles', 'activitypub' ); ?></h3>
16 <table class="form-table">
17 <tbody>
18 <tr>
19 <th scope="row">
20 <?php \esc_html_e( 'Enable profiles by type', 'activitypub' ); ?>
21 </th>
22 <td>
23 <p>
24 <label>
25 <input type="radio" name="activitypub_actor_mode" id="activitypub_actor_mode" value="<?php echo esc_attr( ACTIVITYPUB_ACTOR_MODE ); ?>" <?php echo \checked( ACTIVITYPUB_ACTOR_MODE, \get_option( 'activitypub_actor_mode', ACTIVITYPUB_ACTOR_MODE ) ); ?> />
26 <strong><?php \esc_html_e( 'Author Profiles Only', 'activitypub' ); ?></strong>
27 </label>
28 </p>
29 <p class="description">
30 <?php echo \wp_kses( \__( 'Every user with an account on this blog and the <code>activitypub</code> capability enabled gets their own ActivityPub profile.', 'activitypub' ), array( 'code' => array() ) ); ?>
31 <?php // translators: %s is a URL. ?>
32 <strong><?php echo \wp_kses( sprintf( \__( 'You can add/remove the capability in the <a href="%s">user settings.</a>', 'activitypub' ), admin_url( '/users.php' ) ), array( 'a' => array( 'href' => array() ) ) ); ?></strong>
33 <?php echo \wp_kses( \__( 'Select all the users you want to update, choose the method from the drop-down list and click on the "Apply" button.', 'activitypub' ), array( 'code' => array() ) ); ?>
34 </p>
35 <p>
36 <label>
37 <input type="radio" name="activitypub_actor_mode" id="activitypub_actor_mode" value="<?php echo esc_attr( ACTIVITYPUB_BLOG_MODE ); ?>" <?php echo \checked( ACTIVITYPUB_BLOG_MODE, \get_option( 'activitypub_actor_mode', ACTIVITYPUB_ACTOR_MODE ) ); ?> />
38 <strong><?php \esc_html_e( 'Blog profile only', 'activitypub' ); ?></strong>
39 </label>
40 </p>
41 <p class="description">
42 <?php \esc_html_e( 'Your blog becomes a single ActivityPub profile and every post will be published under this profile instead of the individual author profiles.', 'activitypub' ); ?>
43 </p>
44 <p>
45 <label>
46 <input type="radio" name="activitypub_actor_mode" id="activitypub_actor_mode" value="<?php echo esc_attr( ACTIVITYPUB_ACTOR_AND_BLOG_MODE ); ?>" <?php echo \checked( ACTIVITYPUB_ACTOR_AND_BLOG_MODE, \get_option( 'activitypub_actor_mode', ACTIVITYPUB_ACTOR_MODE ) ); ?> />
47 <strong><?php \esc_html_e( 'Both author and blog profiles', 'activitypub' ); ?></strong>
48 </label>
49 </p>
50 <p class="description">
51 <?php \esc_html_e( "This combines both modes. Users can be followed individually, while following the blog will show boosts of individual user's posts.", 'activitypub' ); ?>
52 </p>
53 </td>
54 </tr>
55 <?php \do_settings_fields( 'activitypub', 'user' ); ?>
56 </tbody>
57 </table>
58 </div>
59
60 <div class="box">
61 <h3><?php \esc_html_e( 'Activities', 'activitypub' ); ?></h3>
62 <table class="form-table">
63 <tbody>
64 <tr>
65 <th scope="row">
66 <?php \esc_html_e( 'Activity-Object-Type', 'activitypub' ); ?>
67 </th>
68 <td>
69 <p>
70 <label>
71 <input type="radio" name="activitypub_object_type" id="activitypub_object_type" value="wordpress-post-format" <?php echo \checked( 'wordpress-post-format', \get_option( 'activitypub_object_type', ACTIVITYPUB_DEFAULT_OBJECT_TYPE ) ); ?> />
72 <?php \esc_html_e( 'Automatic (default)', 'activitypub' ); ?>
73 -
74 <span class="description">
75 <?php \esc_html_e( 'Let the plugin choose the best possible format for you.', 'activitypub' ); ?>
76 </span>
77 </label>
78 </p>
79 <p>
80 <label for="activitypub_object_type_note">
81 <input type="radio" name="activitypub_object_type" id="activitypub_object_type_note" value="note" <?php echo \checked( 'note', \get_option( 'activitypub_object_type', ACTIVITYPUB_DEFAULT_OBJECT_TYPE ) ); ?> />
82 <?php \esc_html_e( 'Note', 'activitypub' ); ?>
83 -
84 <span class="description">
85 <?php \esc_html_e( 'Should work with most platforms.', 'activitypub' ); ?>
86 </span>
87 </label>
88 </p>
89 </td>
90 </tr>
91 <tr <?php echo 'wordpress-post-format' === \get_option( 'activitypub_object_type', ACTIVITYPUB_DEFAULT_OBJECT_TYPE ) ? 'style="display: none"' : ''; ?>>
92 <th scope="row">
93 <?php \esc_html_e( 'Post content', 'activitypub' ); ?>
94 </th>
95 <td>
96 <p><strong><?php \esc_html_e( 'These settings only apply if you use the "Note" Object-Type setting above.', 'activitypub' ); ?></strong></p>
97 <p>
98 <textarea name="activitypub_custom_post_content" id="activitypub_custom_post_content" rows="10" cols="50" class="large-text" placeholder="<?php echo wp_kses( ACTIVITYPUB_CUSTOM_POST_CONTENT, 'post' ); ?>"><?php echo esc_textarea( wp_kses( \get_option( 'activitypub_custom_post_content', ACTIVITYPUB_CUSTOM_POST_CONTENT ), 'post' ) ); ?></textarea>
99 <details>
100 <summary><?php esc_html_e( 'See a list of ActivityPub Template Tags.', 'activitypub' ); ?></summary>
101 <div class="description">
102 <ul>
103 <li><code>[ap_title]</code> - <?php \esc_html_e( 'The post&#8217;s title.', 'activitypub' ); ?></li>
104 <li><code>[ap_content]</code> - <?php \esc_html_e( 'The post&#8217;s content.', 'activitypub' ); ?></li>
105 <li><code>[ap_excerpt]</code> - <?php \esc_html_e( 'The post&#8217;s excerpt (may be truncated).', 'activitypub' ); ?></li>
106 <li><code>[ap_permalink]</code> - <?php \esc_html_e( 'The post&#8217;s permalink.', 'activitypub' ); ?></li>
107 <li><code>[ap_shortlink]</code> - <?php echo \wp_kses( \__( 'The post&#8217;s shortlink. I can recommend <a href="https://wordpress.org/plugins/hum/" target="_blank">Hum</a>.', 'activitypub' ), 'default' ); ?></li>
108 <li><code>[ap_hashtags]</code> - <?php \esc_html_e( 'The post&#8217;s tags as hashtags.', 'activitypub' ); ?></li>
109 </ul>
110 <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>
111 </div>
112 </details>
113 </p>
114 </td>
115 </tr>
116 <tr>
117 <th scope="row">
118 <?php \esc_html_e( 'Media attachments', 'activitypub' ); ?>
119 </th>
120 <td>
121 <input value="<?php echo esc_attr( \get_option( 'activitypub_max_image_attachments', ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS ) ); ?>" name="activitypub_max_image_attachments" id="activitypub_max_image_attachments" type="number" min="0" />
122 <p class="description">
123 <?php
124 echo \wp_kses(
125 \sprintf(
126 // translators: %s is a number.
127 \__( 'The number of media (images, audio, video) to attach to posts. Default: <code>%s</code>', 'activitypub' ),
128 \esc_html( ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS )
129 ),
130 'default'
131 );
132 ?>
133 </p>
134 <p class="description">
135 <em>
136 <?php
137 esc_html_e( 'Note: audio and video attachments are only supported from Block Editor.', 'activitypub' );
138 ?>
139 </em>
140 </p>
141 </td>
142 </tr>
143 <tr>
144 <th scope="row"><?php \esc_html_e( 'Supported post types', 'activitypub' ); ?></th>
145 <td>
146 <fieldset>
147 <?php \esc_html_e( 'Automatically publish items of the selected post types to the fediverse:', 'activitypub' ); ?>
148
149 <ul>
150 <?php
151 $post_types = \get_post_types( array( 'public' => true ), 'objects' );
152 $supported_post_types = (array) \get_option( 'activitypub_support_post_types', array( 'post' ) );
153
154 foreach ( $post_types as $_post_type ) :
155 ?>
156 <li>
157 <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 ) ); ?> />
158 <label for="activitypub_support_post_type_<?php echo \esc_attr( $_post_type->name ); ?>"><?php echo \esc_html( $_post_type->label ); ?></label>
159 <span class="description">
160 <?php echo \esc_html( \Activitypub\get_post_type_description( $_post_type ) ); ?>
161 </span>
162 </li>
163 <?php endforeach; ?>
164 </ul>
165 </fieldset>
166 </td>
167 </tr>
168 <tr>
169 <th scope="row">
170 <?php \esc_html_e( 'Hashtags', 'activitypub' ); ?>
171 </th>
172 <td>
173 <p>
174 <label><input type="checkbox" name="activitypub_use_hashtags" id="activitypub_use_hashtags" value="1" <?php echo \checked( '1', \get_option( 'activitypub_use_hashtags', '1' ) ); ?> /> <?php echo wp_kses( \__( 'Add hashtags in the content as native tags and replace the <code>#tag</code> with the tag link.', 'activitypub' ), 'default' ); ?></label>
175 </p>
176 </td>
177 </tr>
178 <?php \do_settings_fields( 'activitypub', 'activity' ); ?>
179 </tbody>
180 </table>
181 </div>
182 <div class="box">
183 <h3><?php \esc_html_e( 'Notifications', 'activitypub' ); ?></h3>
184 <p><?php \esc_html_e( 'Choose which notifications you want to receive. The plugin currently only supports e-mail notifications, but we will add more options in the future.', 'activitypub' ); ?></p>
185 <table class="form-table">
186 <tbody>
187 <tr>
188 <th scope="row">
189 <?php \esc_html_e( 'Type', 'activitypub' ); ?>
190 </th>
191 <th>
192 <?php \esc_html_e( 'E-Mail', 'activitypub' ); ?>
193 </th>
194 </tr>
195 <tr>
196 <td scope="row">
197 <?php \esc_html_e( 'New followers', 'activitypub' ); ?>
198 </td>
199 <td>
200 <label>
201 <input type="checkbox" name="activitypub_mailer_new_follower" id="activitypub_mailer_new_follower" value="1" <?php \checked( '1', \get_option( 'activitypub_mailer_new_follower', '0' ) ); ?> />
202 </label>
203 </td>
204 </tr>
205 <tr>
206 <td scope="row">
207 <?php \esc_html_e( 'Direct Messages', 'activitypub' ); ?>
208 </td>
209 <td>
210 <label>
211 <input type="checkbox" name="activitypub_mailer_new_dm" id="activitypub_mailer_new_dm" value="1" <?php \checked( '1', \get_option( 'activitypub_mailer_new_dm', '0' ) ); ?> />
212 </label>
213 </td>
214 </tr>
215 <?php \do_settings_fields( 'activitypub', 'security' ); ?>
216 </tbody>
217 </table>
218 </div>
219 <div class="box">
220 <h3><?php \esc_html_e( 'General', 'activitypub' ); ?></h3>
221 <table class="form-table">
222 <tbody>
223 <tr>
224 <th scope="row">
225 <?php \esc_html_e( 'OpenGraph', 'activitypub' ); ?>
226 </th>
227 <td>
228 <p>
229 <label>
230 <input type="checkbox" name="activitypub_use_opengraph" id="activitypub_use_opengraph" value="1" <?php echo \checked( '1', \get_option( 'activitypub_use_opengraph', '1' ) ); ?> />
231 <?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' ); ?>
232 </label>
233 </p>
234 <p>
235 <label for="activitypub_attribution_domains">
236 <?php esc_html_e( 'Websites allowed to credit you.', 'activitypub' ); ?>
237 </label>
238 <textarea id="activitypub_attribution_domains" name="activitypub_attribution_domains" class="large-text" cols="50" rows="5" placeholder="<?php echo \esc_textarea( \Activitypub\home_host() ); ?>"><?php echo esc_textarea( \get_option( 'activitypub_attribution_domains', \Activitypub\home_host() ) ); ?></textarea>
239 <?php esc_html_e( 'One per line. Protects from false attributions.', 'activitypub' ); ?>
240 </p>
241 </td>
242 </tr>
243 <?php \do_settings_fields( 'activitypub', 'general' ); ?>
244 <?php \do_settings_fields( 'activitypub', 'server' ); ?>
245 </tbody>
246 </table>
247 </div>
248 <div class="box">
249 <h3><?php \esc_html_e( 'Security', 'activitypub' ); ?></h3>
250 <table class="form-table">
251 <tbody>
252 <?php if ( ! defined( 'ACTIVITYPUB_AUTHORIZED_FETCH' ) ) : ?>
253 <tr>
254 <th scope="row">
255 <?php \esc_html_e( 'Authorized-Fetch', 'activitypub' ); ?>
256 </th>
257 <td>
258 <p>
259 <label>
260 <input type="checkbox" name="activitypub_authorized_fetch" id="activitypub_authorized_fetch" value="1" <?php \checked( '1', \get_option( 'activitypub_authorized_fetch', '0' ) ); ?> />
261 <?php \esc_html_e( 'Require HTTP signature authentication on ActivityPub representations of public posts and profiles.', 'activitypub' ); ?>
262 </label>
263 </p>
264 <p class="description">
265 <?php \esc_html_e( '⚠ Secure mode has its limitations, which is why it is not enabled by default. It is not fully supported by all software in the fediverse, and some features may break, especially when interacting with Mastodon servers older than version 3.0. Additionally, since it requires authentication for public content, caching is not possible, leading to higher computational costs.', 'activitypub' ); ?>
266 </p>
267 <p class="description">
268 <?php \esc_html_e( '⚠ Secure mode does not hide the HTML representations of public posts and profiles. While HTML is a less consistant format (that potentially changes often) compared to first-class ActivityPub representations or the REST API, it still poses a potential risk for content scraping.', 'activitypub' ); ?>
269 </p>
270 </td>
271 </tr>
272 <?php endif; ?>
273 <tr>
274 <th scope="row">
275 <?php \esc_html_e( 'Blocklist', 'activitypub' ); ?>
276 </th>
277 <td>
278 <p>
279 <?php
280 echo \wp_kses(
281 \sprintf(
282 // translators: %s is a URL.
283 \__( 'To block servers, add the host of the server to the "<a href="%s">Disallowed Comment Keys</a>" list.', 'activitypub' ),
284 \esc_url( \admin_url( 'options-discussion.php#disallowed_keys' ) )
285 ),
286 'default'
287 );
288 ?>
289 </p>
290 </td>
291 </tr>
292 <?php \do_settings_fields( 'activitypub', 'security' ); ?>
293 </tbody>
294 </table>
295 </div>
296 <?php \do_settings_sections( 'activitypub' ); ?>
297
298 <?php \submit_button(); ?>
299 </form>
300 </div>
301