PluginProbe
ActivityPub / 7.8.2
ActivityPub v7.8.2
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
← All changes | includes/wp-admin/class-settings-fields.php +90 -164 9.2.0 → 7.8.2 View file →
@@ -9,9 +9,8 @@
9 9
10 10 use Activitypub\Blocklist_Subscriptions;
11 11 use Activitypub\Moderation;
12 12
13 -use function Activitypub\get_post_type_description;
14 13 use function Activitypub\home_host;
15 14
16 15 /**
17 16 * Class Settings_Fields.
@@ -20,9 +19,9 @@
20 19 /**
21 20 * Initialize the settings fields.
22 21 */
23 22 public static function init() {
24 - \add_action( 'load-settings_page_activitypub', array( self::class, 'register_settings_fields' ) );
23 + add_action( 'load-settings_page_activitypub', array( self::class, 'register_settings_fields' ) );
25 24 }
26 25
27 26 /**
28 27 * Register settings fields.
@@ -28,37 +27,37 @@
28 27 * Register settings fields.
29 28 */
30 29 public static function register_settings_fields() {
31 30 // Add settings sections.
32 - \add_settings_section(
31 + add_settings_section(
33 32 'activitypub_profiles',
34 - \__( 'Profiles', 'activitypub' ),
33 + __( 'Profiles', 'activitypub' ),
35 34 '__return_empty_string',
36 35 'activitypub_settings'
37 36 );
38 37
39 - \add_settings_section(
38 + add_settings_section(
40 39 'activitypub_activities',
41 - \__( 'Activities', 'activitypub' ),
40 + __( 'Activities', 'activitypub' ),
42 41 '__return_empty_string',
43 42 'activitypub_settings'
44 43 );
45 44
46 - \add_settings_section(
45 + add_settings_section(
47 46 'activitypub_general',
48 - \__( 'General', 'activitypub' ),
47 + __( 'General', 'activitypub' ),
49 48 '__return_empty_string',
50 49 'activitypub_settings'
51 50 );
52 51
53 - \add_settings_section(
52 + add_settings_section(
54 53 'activitypub_server',
55 - \__( 'Server', 'activitypub' ),
54 + __( 'Server', 'activitypub' ),
56 55 '__return_empty_string',
57 56 'activitypub_settings'
58 57 );
59 58
60 - \add_settings_section(
59 + add_settings_section(
61 60 'activitypub_moderation',
62 61 \esc_html__( 'Moderation', 'activitypub' ),
63 62 array( self::class, 'render_moderation_section_description' ),
64 63 'activitypub_settings',
@@ -68,11 +67,11 @@
68 67 )
69 68 );
70 69
71 70 // Add settings fields.
72 - \add_settings_field(
71 + add_settings_field(
73 72 'activitypub_actor_mode',
74 - \__( 'Enable profiles by type', 'activitypub' ),
73 + __( 'Enable profiles by type', 'activitypub' ),
75 74 array( self::class, 'render_actor_mode_field' ),
76 75 'activitypub_settings',
77 76 'activitypub_profiles'
78 77 );
@@ -78,11 +77,11 @@
78 77 );
79 78
80 79 $object_type = \get_option( 'activitypub_object_type', ACTIVITYPUB_DEFAULT_OBJECT_TYPE );
81 80 if ( 'note' === $object_type ) {
82 - \add_settings_field(
81 + add_settings_field(
83 82 'activitypub_custom_post_content',
84 - \__( 'Post content', 'activitypub' ),
83 + __( 'Post content', 'activitypub' ),
85 84 array( self::class, 'render_custom_post_content_field' ),
86 85 'activitypub_settings',
87 86 'activitypub_activities',
88 87 array( 'label_for' => 'activitypub_custom_post_content' )
@@ -88,11 +87,11 @@
88 87 array( 'label_for' => 'activitypub_custom_post_content' )
89 88 );
90 89 }
91 90
92 - \add_settings_field(
91 + add_settings_field(
93 92 'activitypub_max_image_attachments',
94 - \__( 'Media attachments', 'activitypub' ),
93 + __( 'Media attachments', 'activitypub' ),
95 94 array( self::class, 'render_max_image_attachments_field' ),
96 95 'activitypub_settings',
97 96 'activitypub_activities',
98 97 array( 'label_for' => 'activitypub_max_image_attachments' )
@@ -97,45 +96,27 @@
97 96 'activitypub_activities',
98 97 array( 'label_for' => 'activitypub_max_image_attachments' )
99 98 );
100 99
101 - \add_settings_field(
100 + add_settings_field(
102 101 'activitypub_support_post_types',
103 - \__( 'Supported post types', 'activitypub' ),
102 + __( 'Supported post types', 'activitypub' ),
104 103 array( self::class, 'render_support_post_types_field' ),
105 104 'activitypub_settings',
106 105 'activitypub_activities'
107 106 );
108 107
109 - \add_settings_field(
108 + add_settings_field(
110 109 'activitypub_allow_interactions',
111 - \__( 'Post interactions', 'activitypub' ),
110 + __( 'Post interactions', 'activitypub' ),
112 111 array( self::class, 'render_allow_interactions_field' ),
113 112 'activitypub_settings',
114 113 'activitypub_activities'
115 114 );
116 115
117 - \add_settings_field(
118 - 'activitypub_default_quote_policy',
119 - \__( 'Default quote policy', 'activitypub' ),
120 - array( self::class, 'render_default_quote_policy_field' ),
121 - 'activitypub_settings',
122 - 'activitypub_activities',
123 - array( 'label_for' => 'activitypub_default_quote_policy' )
124 - );
125 -
126 - \add_settings_field(
127 - 'activitypub_default_feature_policy',
128 - \__( 'Default Starter Kit policy', 'activitypub' ),
129 - array( self::class, 'render_default_feature_policy_field' ),
130 - 'activitypub_settings',
131 - 'activitypub_activities',
132 - array( 'label_for' => 'activitypub_default_feature_policy' )
133 - );
134 -
135 - \add_settings_field(
116 + add_settings_field(
136 117 'activitypub_use_hashtags',
137 - \__( 'Hashtags', 'activitypub' ),
118 + __( 'Hashtags', 'activitypub' ),
138 119 array( self::class, 'render_use_hashtags_field' ),
139 120 'activitypub_settings',
140 121 'activitypub_activities',
141 122 array( 'label_for' => 'activitypub_use_hashtags' )
@@ -140,11 +121,11 @@
140 121 'activitypub_activities',
141 122 array( 'label_for' => 'activitypub_use_hashtags' )
142 123 );
143 124
144 - \add_settings_field(
125 + add_settings_field(
145 126 'activitypub_use_opengraph',
146 - \__( 'OpenGraph', 'activitypub' ),
127 + __( 'OpenGraph', 'activitypub' ),
147 128 array( self::class, 'render_use_opengraph_field' ),
148 129 'activitypub_settings',
149 130 'activitypub_general',
150 131 array( 'label_for' => 'activitypub_use_opengraph' )
@@ -149,11 +130,11 @@
149 130 'activitypub_general',
150 131 array( 'label_for' => 'activitypub_use_opengraph' )
151 132 );
152 133
153 - \add_settings_field(
134 + add_settings_field(
154 135 'activitypub_attribution_domains',
155 - \__( 'Attribution Domains', 'activitypub' ),
136 + __( 'Attribution Domains', 'activitypub' ),
156 137 array( self::class, 'render_attribution_domains_field' ),
157 138 'activitypub_settings',
158 139 'activitypub_general',
159 140 array( 'label_for' => 'activitypub_attribution_domains' )
@@ -158,11 +139,11 @@
158 139 'activitypub_general',
159 140 array( 'label_for' => 'activitypub_attribution_domains' )
160 141 );
161 142
162 - \add_settings_field(
143 + add_settings_field(
163 144 'activitypub_relays',
164 - \__( 'Relays', 'activitypub' ),
145 + __( 'Relays', 'activitypub' ),
165 146 array( self::class, 'render_relays_field' ),
166 147 'activitypub_settings',
167 148 'activitypub_server',
168 149 array( 'label_for' => 'activitypub_relays' )
@@ -167,9 +148,9 @@
167 148 'activitypub_server',
168 149 array( 'label_for' => 'activitypub_relays' )
169 150 );
170 151
171 - \add_settings_field(
152 + add_settings_field(
172 153 'activitypub_site_blocked_domains',
173 154 \esc_html__( 'Blocked Domains', 'activitypub' ),
174 155 array( self::class, 'render_site_blocked_domains_field' ),
175 156 'activitypub_settings',
@@ -175,9 +156,9 @@
175 156 'activitypub_settings',
176 157 'activitypub_moderation'
177 158 );
178 159
179 - \add_settings_field(
160 + add_settings_field(
180 161 'activitypub_site_blocked_keywords',
181 162 \esc_html__( 'Blocked Keywords', 'activitypub' ),
182 163 array( self::class, 'render_site_blocked_keywords_field' ),
183 164 'activitypub_settings',
@@ -183,9 +164,9 @@
183 164 'activitypub_settings',
184 165 'activitypub_moderation'
185 166 );
186 167
187 - \add_settings_field(
168 + add_settings_field(
188 169 'activitypub_blocklist_subscriptions',
189 170 \esc_html__( 'Blocklist Subscriptions', 'activitypub' ),
190 171 array( self::class, 'render_blocklist_subscriptions_field' ),
191 172 'activitypub_settings',
@@ -203,54 +184,54 @@
203 184
204 185 if ( $disabled ) :
205 186 ?>
206 187 <p class="description">
207 - <?php \esc_html_e( 'âš  This setting is defined through server configuration by your blog&#8217;s administrator.', 'activitypub' ); ?>
188 + <?php esc_html_e( 'âš  This setting is defined through server configuration by your blog&#8217;s administrator.', 'activitypub' ); ?>
208 189 </p>
209 190 <?php
210 191 return;
211 192 endif;
212 193
213 - $value = \get_option( 'activitypub_actor_mode', ACTIVITYPUB_ACTOR_MODE );
194 + $value = get_option( 'activitypub_actor_mode', ACTIVITYPUB_ACTOR_MODE );
214 195 ?>
215 196 <fieldset class="actor-mode-selection">
216 197 <div class="row">
217 - <input type="radio" id="actor-mode" name="activitypub_actor_mode" value="<?php echo \esc_attr( ACTIVITYPUB_ACTOR_MODE ); ?>" <?php \checked( ACTIVITYPUB_ACTOR_MODE, $value ); ?> />
198 + <input type="radio" id="actor-mode" name="activitypub_actor_mode" value="<?php echo esc_attr( ACTIVITYPUB_ACTOR_MODE ); ?>" <?php checked( ACTIVITYPUB_ACTOR_MODE, $value ); ?> />
218 199 <div>
219 - <label for="actor-mode"><strong><?php \esc_html_e( 'Author Profiles Only', 'activitypub' ); ?></strong></label>
200 + <label for="actor-mode"><strong><?php esc_html_e( 'Author Profiles Only', 'activitypub' ); ?></strong></label>
220 201 <p class="description">
221 - <?php echo \wp_kses( \__( 'Every author on this blog (with the <code>activitypub</code> capability) gets their own ActivityPub profile.', 'activitypub' ), array( 'code' => array() ) ); ?>
202 + <?php echo wp_kses( __( 'Every author on this blog (with the <code>activitypub</code> capability) gets their own ActivityPub profile.', 'activitypub' ), array( 'code' => array() ) ); ?>
222 203 <strong>
223 204 <?php
224 - echo \wp_kses(
225 - \sprintf(
205 + echo wp_kses(
206 + sprintf(
226 207 // translators: %s is a URL.
227 - \__( 'You can add/remove the capability in the <a href="%s">user settings.</a>', 'activitypub' ),
228 - \admin_url( '/users.php' )
208 + __( 'You can add/remove the capability in the <a href="%s">user settings.</a>', 'activitypub' ),
209 + admin_url( '/users.php' )
229 210 ),
230 211 array( 'a' => array( 'href' => array() ) )
231 212 );
232 213 ?>
233 214 </strong>
234 - <?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() ) ); ?>
215 + <?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() ) ); ?>
235 216 </p>
236 217 </div>
237 218 </div>
238 219 <div class="row">
239 - <input type="radio" id="blog-mode" name="activitypub_actor_mode" value="<?php echo \esc_attr( ACTIVITYPUB_BLOG_MODE ); ?>" <?php \checked( ACTIVITYPUB_BLOG_MODE, $value ); ?> />
220 + <input type="radio" id="blog-mode" name="activitypub_actor_mode" value="<?php echo esc_attr( ACTIVITYPUB_BLOG_MODE ); ?>" <?php checked( ACTIVITYPUB_BLOG_MODE, $value ); ?> />
240 221 <div>
241 - <label for="blog-mode"><strong><?php \esc_html_e( 'Blog profile only', 'activitypub' ); ?></strong></label>
222 + <label for="blog-mode"><strong><?php esc_html_e( 'Blog profile only', 'activitypub' ); ?></strong></label>
242 223 <p class="description">
243 - <?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' ); ?>
224 + <?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' ); ?>
244 225 </p>
245 226 </div>
246 227 </div>
247 228 <div class="row">
248 - <input type="radio" id="actor-blog-mode" name="activitypub_actor_mode" value="<?php echo \esc_attr( ACTIVITYPUB_ACTOR_AND_BLOG_MODE ); ?>" <?php \checked( ACTIVITYPUB_ACTOR_AND_BLOG_MODE, $value ); ?> />
229 + <input type="radio" id="actor-blog-mode" name="activitypub_actor_mode" value="<?php echo esc_attr( ACTIVITYPUB_ACTOR_AND_BLOG_MODE ); ?>" <?php checked( ACTIVITYPUB_ACTOR_AND_BLOG_MODE, $value ); ?> />
249 230 <div>
250 - <label for="actor-blog-mode"><strong><?php \esc_html_e( 'Both author and blog profiles', 'activitypub' ); ?></strong></label>
231 + <label for="actor-blog-mode"><strong><?php esc_html_e( 'Both author and blog profiles', 'activitypub' ); ?></strong></label>
251 232 <p class="description">
252 - <?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' ); ?>
233 + <?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' ); ?>
253 234 </p>
254 235 </div>
255 236 </div>
256 237 </fieldset>
@@ -260,45 +241,24 @@
260 241 /**
261 242 * Render custom post content field.
262 243 */
263 244 public static function render_custom_post_content_field() {
264 - $switch_url = \wp_nonce_url(
265 - \add_query_arg(
266 - array(
267 - 'page' => 'activitypub',
268 - 'tab' => 'settings',
269 - 'activitypub_update_object_type' => '1',
270 - ),
271 - \admin_url( 'options-general.php' )
272 - ),
273 - 'activitypub_switch_object_type'
274 - );
245 + $value = get_option( 'activitypub_custom_post_content', ACTIVITYPUB_CUSTOM_POST_CONTENT );
275 246 ?>
276 - <p class="description">
277 - <?php \esc_html_e( 'âš  You are using the legacy template system to format your posts for the fediverse. We recommend switching to automatic mode, which intelligently chooses the best format for each post. Switching will remove this template field from the settings.', 'activitypub' ); ?>
278 - </p>
279 247 <p>
280 - <a href="<?php echo \esc_url( $switch_url ); ?>" class="button">
281 - <?php \esc_html_e( 'Switch to Automatic Mode', 'activitypub' ); ?>
282 - </a>
283 - </p>
284 - <?php
285 - $value = \get_option( 'activitypub_custom_post_content', ACTIVITYPUB_CUSTOM_POST_CONTENT );
286 - ?>
287 - <p>
288 - <textarea id="activitypub_custom_post_content" name="activitypub_custom_post_content" rows="10" cols="50" class="large-text" placeholder="<?php echo \esc_attr( ACTIVITYPUB_CUSTOM_POST_CONTENT ); ?>"><?php echo \esc_textarea( \wp_kses( $value, 'post' ) ); ?></textarea>
248 + <textarea id="activitypub_custom_post_content" name="activitypub_custom_post_content" rows="10" cols="50" class="large-text" placeholder="<?php echo esc_attr( ACTIVITYPUB_CUSTOM_POST_CONTENT ); ?>"><?php echo esc_textarea( wp_kses( $value, 'post' ) ); ?></textarea>
289 249 <details>
290 - <summary><?php \esc_html_e( 'See a list of ActivityPub Template Tags.', 'activitypub' ); ?></summary>
250 + <summary><?php esc_html_e( 'See a list of ActivityPub Template Tags.', 'activitypub' ); ?></summary>
291 251 <div class="description">
292 252 <ul>
293 - <li><code>[ap_title]</code> - <?php \esc_html_e( 'The post&#8217;s title.', 'activitypub' ); ?></li>
294 - <li><code>[ap_content]</code> - <?php \esc_html_e( 'The post&#8217;s content.', 'activitypub' ); ?></li>
295 - <li><code>[ap_excerpt]</code> - <?php \esc_html_e( 'The post&#8217;s excerpt (may be truncated).', 'activitypub' ); ?></li>
296 - <li><code>[ap_permalink]</code> - <?php \esc_html_e( 'The post&#8217;s permalink.', 'activitypub' ); ?></li>
297 - <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>
298 - <li><code>[ap_hashtags]</code> - <?php \esc_html_e( 'The post&#8217;s tags as hashtags.', 'activitypub' ); ?></li>
253 + <li><code>[ap_title]</code> - <?php esc_html_e( 'The post&#8217;s title.', 'activitypub' ); ?></li>
254 + <li><code>[ap_content]</code> - <?php esc_html_e( 'The post&#8217;s content.', 'activitypub' ); ?></li>
255 + <li><code>[ap_excerpt]</code> - <?php esc_html_e( 'The post&#8217;s excerpt (may be truncated).', 'activitypub' ); ?></li>
256 + <li><code>[ap_permalink]</code> - <?php esc_html_e( 'The post&#8217;s permalink.', 'activitypub' ); ?></li>
257 + <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>
258 + <li><code>[ap_hashtags]</code> - <?php esc_html_e( 'The post&#8217;s tags as hashtags.', 'activitypub' ); ?></li>
299 259 </ul>
300 - <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>
260 + <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>
301 261 </div>
302 262 </details>
303 263 </p>
304 264 <?php
@@ -307,18 +267,18 @@
307 267 /**
308 268 * Render max image attachments field.
309 269 */
310 270 public static function render_max_image_attachments_field() {
311 - $value = \get_option( 'activitypub_max_image_attachments', ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS );
271 + $value = get_option( 'activitypub_max_image_attachments', ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS );
312 272 ?>
313 - <input id="activitypub_max_image_attachments" value="<?php echo \esc_attr( $value ); ?>" name="activitypub_max_image_attachments" type="number" min="0" max="10" class="small-text" />
273 + <input id="activitypub_max_image_attachments" value="<?php echo esc_attr( $value ); ?>" name="activitypub_max_image_attachments" type="number" min="0" max="10" class="small-text" />
314 274 <p class="description">
315 275 <?php
316 - echo \wp_kses(
317 - \sprintf(
276 + echo wp_kses(
277 + sprintf(
318 278 // translators: %s is a number.
319 - \__( 'The number of media (images, audio, video) to attach to posts. Default: <code>%s</code>', 'activitypub' ),
320 - \esc_html( ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS )
279 + __( 'The number of media (images, audio, video) to attach to posts. Default: <code>%s</code>', 'activitypub' ),
280 + esc_html( ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS )
321 281 ),
322 282 'default'
323 283 );
324 284 ?>
@@ -324,9 +284,9 @@
324 284 ?>
325 285 </p>
326 286 <p class="description">
327 287 <em>
328 - <?php \esc_html_e( 'Note: audio and video attachments are only supported from Block Editor.', 'activitypub' ); ?>
288 + <?php esc_html_e( 'Note: audio and video attachments are only supported from Block Editor.', 'activitypub' ); ?>
329 289 </em>
330 290 </p>
331 291 <?php
332 292 }
@@ -338,16 +298,16 @@
338 298 $post_types = \get_post_types( array( 'public' => true ), 'objects' );
339 299 $supported_post_types = \get_option( 'activitypub_support_post_types', array( 'post' ) );
340 300 ?>
341 301 <fieldset>
342 - <?php \esc_html_e( 'Automatically publish items of the selected post types to the fediverse:', 'activitypub' ); ?>
302 + <?php esc_html_e( 'Automatically publish items of the selected post types to the fediverse:', 'activitypub' ); ?>
343 303 <ul>
344 304 <?php foreach ( $post_types as $post_type ) : ?>
345 305 <li>
346 - <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 \checked( \in_array( $post_type->name, $supported_post_types, true ) ); ?> />
347 - <label for="activitypub_support_post_type_<?php echo \esc_attr( $post_type->name ); ?>"><?php echo \esc_html( $post_type->label ); ?></label>
306 + <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 checked( in_array( $post_type->name, $supported_post_types, true ) ); ?> />
307 + <label for="activitypub_support_post_type_<?php echo esc_attr( $post_type->name ); ?>"><?php echo esc_html( $post_type->label ); ?></label>
348 308 <span class="description">
349 - <?php echo \esc_html( get_post_type_description( $post_type ) ); ?>
309 + <?php echo esc_html( \Activitypub\get_post_type_description( $post_type ) ); ?>
350 310 </span>
351 311 </li>
352 312 <?php endforeach; ?>
353 313 </ul>
@@ -358,35 +318,35 @@
358 318 /**
359 319 * Render allow interactions field.
360 320 */
361 321 public static function render_allow_interactions_field() {
362 - if ( \defined( 'ACTIVITYPUB_DISABLE_INCOMING_INTERACTIONS' ) && ACTIVITYPUB_DISABLE_INCOMING_INTERACTIONS ) {
322 + if ( defined( 'ACTIVITYPUB_DISABLE_INCOMING_INTERACTIONS' ) && ACTIVITYPUB_DISABLE_INCOMING_INTERACTIONS ) {
363 323 echo '<p class="description">' . \esc_html__( 'âš  This setting is defined through server configuration by your blog&#8217;s administrator.', 'activitypub' ) . '</p>';
364 324 return;
365 325 }
366 326
367 - $allow_likes = \get_option( 'activitypub_allow_likes', '1' );
368 - $allow_reposts = \get_option( 'activitypub_allow_reposts', '1' );
369 - $auto_approve = \get_option( 'activitypub_auto_approve_reactions', '0' );
327 + $allow_likes = get_option( 'activitypub_allow_likes', '1' );
328 + $allow_reposts = get_option( 'activitypub_allow_reposts', '1' );
329 + $auto_approve = get_option( 'activitypub_auto_approve_reactions', '0' );
370 330 ?>
371 331 <fieldset>
372 332 <p>
373 333 <label>
374 - <input type="checkbox" name="activitypub_allow_likes" value="1" <?php \checked( '1', $allow_likes ); ?> />
375 - <?php \esc_html_e( 'Receive likes', 'activitypub' ); ?>
334 + <input type="checkbox" name="activitypub_allow_likes" value="1" <?php checked( '1', $allow_likes ); ?> />
335 + <?php esc_html_e( 'Receive likes', 'activitypub' ); ?>
376 336 </label>
377 337 </p>
378 338 <p>
379 339 <label>
380 - <input type="checkbox" name="activitypub_allow_reposts" value="1" <?php \checked( '1', $allow_reposts ); ?> />
381 - <?php \esc_html_e( 'Receive reblogs (boosts)', 'activitypub' ); ?>
340 + <input type="checkbox" name="activitypub_allow_reposts" value="1" <?php checked( '1', $allow_reposts ); ?> />
341 + <?php esc_html_e( 'Receive reblogs (boosts)', 'activitypub' ); ?>
382 342 </label>
383 343 </p>
384 - <p class="interactions description"><?php \esc_html_e( 'Types of interactions from the Fediverse your blog should accept.', 'activitypub' ); ?></p>
344 + <p class="interactions description"><?php esc_html_e( 'Types of interactions from the Fediverse your blog should accept.', 'activitypub' ); ?></p>
385 345 <p>
386 346 <label>
387 - <input type="checkbox" name="activitypub_auto_approve_reactions" value="1" <?php \checked( '1', $auto_approve ); ?> />
388 - <?php \esc_html_e( 'Auto approve reactions', 'activitypub' ); ?>
347 + <input type="checkbox" name="activitypub_auto_approve_reactions" value="1" <?php checked( '1', $auto_approve ); ?> />
348 + <?php esc_html_e( 'Auto approve reactions', 'activitypub' ); ?>
389 349 </label>
390 350 </p>
391 351 </fieldset>
392 352 <?php
@@ -392,51 +352,17 @@
392 352 <?php
393 353 }
394 354
395 355 /**
396 - * Render default quote policy field.
397 - */
398 - public static function render_default_quote_policy_field() {
399 - $value = \get_option( 'activitypub_default_quote_policy', ACTIVITYPUB_INTERACTION_POLICY_ANYONE );
400 - ?>
401 - <select id="activitypub_default_quote_policy" name="activitypub_default_quote_policy" class="regular-text">
402 - <option value="<?php echo \esc_attr( ACTIVITYPUB_INTERACTION_POLICY_ANYONE ); ?>" <?php \selected( $value, ACTIVITYPUB_INTERACTION_POLICY_ANYONE ); ?>><?php \esc_html_e( 'Anyone', 'activitypub' ); ?></option>
403 - <option value="<?php echo \esc_attr( ACTIVITYPUB_INTERACTION_POLICY_FOLLOWERS ); ?>" <?php \selected( $value, ACTIVITYPUB_INTERACTION_POLICY_FOLLOWERS ); ?>><?php \esc_html_e( 'Followers only', 'activitypub' ); ?></option>
404 - <option value="<?php echo \esc_attr( ACTIVITYPUB_INTERACTION_POLICY_ME ); ?>" <?php \selected( $value, ACTIVITYPUB_INTERACTION_POLICY_ME ); ?>><?php \esc_html_e( 'Just me', 'activitypub' ); ?></option>
405 - </select>
406 - <p class="description">
407 - <?php \esc_html_e( 'Default setting for who can quote new posts. This can be overridden per post.', 'activitypub' ); ?>
408 - </p>
409 - <?php
410 - }
411 -
412 - /**
413 - * Render default feature policy field.
414 - */
415 - public static function render_default_feature_policy_field() {
416 - $value = \get_option( 'activitypub_default_feature_policy', ACTIVITYPUB_INTERACTION_POLICY_ME );
417 - ?>
418 - <select id="activitypub_default_feature_policy" name="activitypub_default_feature_policy" class="regular-text">
419 - <option value="<?php echo \esc_attr( ACTIVITYPUB_INTERACTION_POLICY_ANYONE ); ?>" <?php \selected( $value, ACTIVITYPUB_INTERACTION_POLICY_ANYONE ); ?>><?php \esc_html_e( 'Anyone', 'activitypub' ); ?></option>
420 - <option value="<?php echo \esc_attr( ACTIVITYPUB_INTERACTION_POLICY_FOLLOWERS ); ?>" <?php \selected( $value, ACTIVITYPUB_INTERACTION_POLICY_FOLLOWERS ); ?>><?php \esc_html_e( 'Followers only', 'activitypub' ); ?></option>
421 - <option value="<?php echo \esc_attr( ACTIVITYPUB_INTERACTION_POLICY_ME ); ?>" <?php \selected( $value, ACTIVITYPUB_INTERACTION_POLICY_ME ); ?>><?php \esc_html_e( 'Just me', 'activitypub' ); ?></option>
422 - </select>
423 - <p class="description">
424 - <?php \esc_html_e( 'Default setting for who can include this site\'s actors in a Starter Kit (also called a Starter Pack or Featured Collection).', 'activitypub' ); ?>
425 - </p>
426 - <?php
427 - }
428 -
429 - /**
430 356 * Render use hashtags field.
431 357 */
432 358 public static function render_use_hashtags_field() {
433 - $value = \get_option( 'activitypub_use_hashtags', '0' );
359 + $value = get_option( 'activitypub_use_hashtags', '1' );
434 360 ?>
435 361 <p>
436 362 <label>
437 - <input type="checkbox" id="activitypub_use_hashtags" name="activitypub_use_hashtags" value="1" <?php \checked( '1', $value ); ?> />
438 - <?php echo \wp_kses( \__( 'Add hashtags in the content as native tags and replace the <code>#tag</code> with the tag link.', 'activitypub' ), 'default' ); ?>
363 + <input type="checkbox" id="activitypub_use_hashtags" name="activitypub_use_hashtags" value="1" <?php checked( '1', $value ); ?> />
364 + <?php echo wp_kses( __( 'Add hashtags in the content as native tags and replace the <code>#tag</code> with the tag link.', 'activitypub' ), 'default' ); ?>
439 365 </label>
440 366 </p>
441 367 <?php
442 368 }
@@ -444,14 +370,14 @@
444 370 /**
445 371 * Render use OpenGraph field.
446 372 */
447 373 public static function render_use_opengraph_field() {
448 - $value = \get_option( 'activitypub_use_opengraph', '1' );
374 + $value = get_option( 'activitypub_use_opengraph', '1' );
449 375 ?>
450 376 <p>
451 377 <label>
452 - <input type="checkbox" id="activitypub_use_opengraph" name="activitypub_use_opengraph" value="1" <?php \checked( '1', $value ); ?> />
453 - <?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' ); ?>
378 + <input type="checkbox" id="activitypub_use_opengraph" name="activitypub_use_opengraph" value="1" <?php checked( '1', $value ); ?> />
379 + <?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' ); ?>
454 380 </label>
455 381 </p>
456 382 <?php
457 383 }
@@ -459,9 +385,9 @@
459 385 /**
460 386 * Render attribution domains field.
461 387 */
462 388 public static function render_attribution_domains_field() {
463 - $value = \get_option( 'activitypub_attribution_domains', home_host() );
389 + $value = get_option( 'activitypub_attribution_domains', home_host() );
464 390 ?>
465 391 <textarea
466 392 id="activitypub_attribution_domains"
467 393 name="activitypub_attribution_domains"
@@ -466,11 +392,11 @@
466 392 id="activitypub_attribution_domains"
467 393 name="activitypub_attribution_domains"
468 394 class="large-text"
469 395 cols="50" rows="5"
470 - placeholder="<?php echo \esc_attr( home_host() ); ?>"
471 - ><?php echo \esc_textarea( $value ); ?></textarea>
472 - <p class="description"><?php \esc_html_e( 'Websites allowed to credit you, one per line. Protects from false attributions.', 'activitypub' ); ?></p>
396 + placeholder="<?php echo esc_attr( home_host() ); ?>"
397 + ><?php echo esc_textarea( $value ); ?></textarea>
398 + <p class="description"><?php esc_html_e( 'Websites allowed to credit you, one per line. Protects from false attributions.', 'activitypub' ); ?></p>
473 399 <?php
474 400 }
475 401
476 402 /**
@@ -484,9 +410,9 @@
484 410 name="activitypub_relays"
485 411 class="large-text"
486 412 cols="50"
487 413 rows="5"
488 - ><?php echo \esc_textarea( \implode( PHP_EOL, $value ) ); ?></textarea>
414 + ><?php echo \esc_textarea( implode( PHP_EOL, $value ) ); ?></textarea>
489 415 <p class="description">
490 416 <?php echo \wp_kses( \__( 'A <strong>Fediverse-Relay</strong> distributes content across instances, expanding reach, engagement, and discoverability, especially for smaller instances.', 'activitypub' ), 'default' ); ?>
491 417 </p>
492 418 <p class="description">