diff --git a/includes/class-application.php b/includes/class-application.php index 6be6cf8..966c500 100644 --- a/includes/class-application.php +++ b/includes/class-application.php @@ -34,7 +34,7 @@ class Application { return array_unique( array_filter( $follower_inboxes_all ) ); } - public static function known_users() { + public static function known_commenters() { // at this point we just need known_commenters // this could get expensive though, eventually it would make sense // to schedule an add comment_author_url on Follow to a known_users site option @@ -49,11 +49,11 @@ class Application { ) ); $comment_query = new WP_Comment_Query( $args ); - $known_users_all = []; + $known_commenters_all = []; foreach ( $comment_query->comments as $user ) { - $known_users_all[] = $user->comment_author_url; + $known_commenters_all[] = $user->comment_author_url; } - return array_unique( array_filter( $known_users_all ) ); + return array_unique( array_filter( $known_commenters_all ) ); } public static function is_actor_delete_request( $request ) { @@ -64,9 +64,9 @@ class Application { return false; } - public static function is_known_actor( $request ) { + public static function is_known_commenter( $request ) { $json = $request->get_params( 'JSON' ); - if ( in_array( $json['actor'], self::known_users() ) ) { + if ( in_array( $json['actor'], self::known_commenters() ) ) { return $json['actor']; } return false; diff --git a/includes/rest/class-server.php b/includes/rest/class-server.php index 8e1b13d..3854040 100644 --- a/includes/rest/class-server.php +++ b/includes/rest/class-server.php @@ -110,7 +110,7 @@ class Server { if ( 'GET' !== $request->get_method() ) { if ( Application::is_actor_delete_request( $request ) ) { - if ( ! Application::is_known_actor( $request ) ) { + if ( ! Application::is_known_commenter( $request ) ) { return $response; } } @@ -119,7 +119,7 @@ class Server { if ( \is_wp_error( $verified_request ) ) { $error_code = $verified_request->get_error_code(); if ( Application::is_actor_delete_request( $request ) && '404' === $error_code ) { - $actor = Application::is_known_actor( $request ); + $actor = Application::is_known_commenter( $request ); if ( wp_http_validate_url( $actor ) ) { \wp_schedule_single_event( \time(),