@@ -63,8 +63,8 @@ public static function meta_boxes( $object, $box ) {
63
63
/**
64
64
* Add comment-type as column in WP-Admin
65
65
*
66
- * @param array $column the column to implement
67
- * @param int $comment_id the comment id
66
+ * @param array $column The column to implement.
67
+ * @param int $comment_id The comment id.
68
68
*/
69
69
public static function manage_comments_custom_column ( $ column , $ comment_id ) {
70
70
if ( 'comment_type ' !== $ column ) {
@@ -74,16 +74,25 @@ public static function manage_comments_custom_column( $column, $comment_id ) {
74
74
}
75
75
76
76
/**
77
- * Add bulk option to bulk comment handler
77
+ * Add bulk option to bulk comment handler.
78
+ *
79
+ * @param array $bulk_actions The bulk actions.
80
+ *
81
+ * @return array The bulk actions.
78
82
*/
79
83
public static function bulk_comment_actions ( $ bulk_actions ) {
80
84
$ bulk_actions ['refresh_webmention ' ] = __ ( 'Refresh Webmention ' , 'webmention ' );
81
85
return $ bulk_actions ;
82
86
}
83
87
84
88
/**
85
- * Add bulk action handler to comments
89
+ * Add bulk action handler to comments.
90
+ *
91
+ * @param string $redirect_to The redirect URL.
92
+ * @param string $doaction The action to perform.
93
+ * @param array $comment_ids The comment IDs.
86
94
*
95
+ * @return string The redirect URL.
87
96
*/
88
97
public static function bulk_comment_action_handler ( $ redirect_to , $ doaction , $ comment_ids ) {
89
98
if ( 'refresh_webmention ' !== $ doaction ) {
@@ -98,12 +107,12 @@ public static function bulk_comment_action_handler( $redirect_to, $doaction, $co
98
107
}
99
108
100
109
/**
101
- * Add an action link
110
+ * Add an action link.
102
111
*
103
- * @param array $links the settings links
104
- * @param string $file the plugin filename
112
+ * @param array $links The settings links.
113
+ * @param string $file The plugin filename.
105
114
*
106
- * @return array the filtered array
115
+ * @return array The filtered array.
107
116
*/
108
117
public static function plugin_action_links ( $ links , $ file ) {
109
118
if ( stripos ( $ file , 'webmention ' ) === false || ! function_exists ( 'admin_url ' ) ) {
@@ -120,12 +129,12 @@ public static function plugin_action_links( $links, $file ) {
120
129
}
121
130
122
131
/**
123
- * Add a plugin meta link
132
+ * Add a plugin meta link.
124
133
*
125
- * @param array $links the settings links
126
- * @param string $file the plugin filename
134
+ * @param array $links The settings links.
135
+ * @param string $file The plugin filename.
127
136
*
128
- * @return array the filtered array
137
+ * @return array The filtered array.
129
138
*/
130
139
public static function plugin_row_meta ( $ links , $ file ) {
131
140
if ( stripos ( $ file , 'webmention ' ) === false || ! function_exists ( 'admin_url ' ) ) {
@@ -175,16 +184,26 @@ public static function comment_types_dropdown( $types ) {
175
184
}
176
185
177
186
/**
178
- * Add comment-type as column in WP-Admin
187
+ * Add comment-type as column in WP-Admin.
188
+ *
189
+ * @param array $columns The list of column names.
179
190
*
180
- * @param array $columns the list of column names
191
+ * @return array The filtered columns.
181
192
*/
182
193
public static function comment_columns ( $ columns ) {
183
194
$ columns ['comment_type ' ] = esc_html__ ( 'Comment-Type ' , 'webmention ' );
184
195
185
196
return $ columns ;
186
197
}
187
198
199
+ /**
200
+ * Add comment-type as column in WP-Admin.
201
+ *
202
+ * @param array $actions The actions.
203
+ * @param object $comment The comment object.
204
+ *
205
+ * @return array The filtered actions.
206
+ */
188
207
public static function comment_row_actions ( $ actions , $ comment ) {
189
208
$ query = array (
190
209
'_wpnonce ' => wp_create_nonce ( "approve-comment_ $ comment ->comment_ID " ),
@@ -213,6 +232,11 @@ public static function comment_row_actions( $actions, $comment ) {
213
232
return $ actions ;
214
233
}
215
234
235
+ /**
236
+ * Add a webmention approve domain.
237
+ *
238
+ * @param string $host The host.
239
+ */
216
240
public static function add_webmention_approve_domain ( $ host ) {
217
241
$ approvelist = get_webmention_approve_domains ();
218
242
$ approvelist [] = $ host ;
@@ -221,6 +245,11 @@ public static function add_webmention_approve_domain( $host ) {
221
245
update_option ( 'webmention_approve_domains ' , $ approvelist );
222
246
}
223
247
248
+ /**
249
+ * Transition to approve list.
250
+ *
251
+ * @param object $comment The comment object.
252
+ */
224
253
public static function transition_to_approvelist ( $ comment ) {
225
254
if ( ! current_user_can ( 'moderate_comments ' ) ) {
226
255
return ;
@@ -267,9 +296,7 @@ public static function admin_menu() {
267
296
* Load settings page
268
297
*/
269
298
public static function settings_page () {
270
- require_once __DIR__ . '/class-upgrade.php ' ;
271
- \Webmention \Upgrade::maybe_upgrade ();
272
- \Webmention \remove_semantic_linkbacks ();
299
+ Upgrade::maybe_upgrade ();
273
300
274
301
add_thickbox ();
275
302
wp_enqueue_script ( 'plugin-install ' );
@@ -326,6 +353,9 @@ public static function add_help_tab() {
326
353
);
327
354
}
328
355
356
+ /**
357
+ * Register settings.
358
+ */
329
359
public static function register_settings () {
330
360
register_setting (
331
361
'webmention ' ,
@@ -450,7 +480,7 @@ public static function register_settings() {
450
480
}
451
481
452
482
/**
453
- * Add recommended privacy content
483
+ * Add recommended privacy content.
454
484
*/
455
485
public static function add_privacy_policy_content () {
456
486
$ content =
0 commit comments