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/model/class-blog.php +9 -48 8.2.07.8.2 View file →
@@ -92,9 +92,9 @@
92 92
93 93 $permalink = \get_option( 'activitypub_use_permalink_as_id_for_blog', false );
94 94
95 95 if ( $permalink ) {
96 - return \esc_url( \home_url( '/@' . $this->get_preferred_username() ) );
96 + return \esc_url( \trailingslashit( get_home_url() ) . '@' . $this->get_preferred_username() );
97 97 }
98 98
99 99 return \add_query_arg( 'author', $this->_id, \home_url( '/' ) );
100 100 }
@@ -275,46 +275,23 @@
275 275 *
276 276 * @return string The published date.
277 277 */
278 278 public function get_published() {
279 - $published = \get_option( 'activitypub_blog_published' );
280 -
281 - if ( $published ) {
282 - return $published;
283 - }
284 -
285 - // Backfill from the first federated post.
286 - $first_federated = new \WP_Query(
279 + $first_post = new \WP_Query(
287 280 array(
288 - 'orderby' => 'date',
289 - 'order' => 'ASC',
290 - 'posts_per_page' => 1,
291 - 'post_status' => 'publish',
292 - 'no_found_rows' => true,
293 - 'ignore_sticky_posts' => true,
294 - 'update_post_meta_cache' => false,
295 - 'update_post_term_cache' => false,
296 - // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query
297 - 'meta_query' => array(
298 - array(
299 - 'key' => 'activitypub_status',
300 - 'compare' => 'EXISTS',
301 - ),
302 - ),
281 + 'orderby' => 'date',
282 + 'order' => 'ASC',
283 + 'number' => 1,
303 284 )
304 285 );
305 286
306 - if ( ! empty( $first_federated->posts[0] ) ) {
307 - $time = \strtotime( $first_federated->posts[0]->post_date_gmt );
287 + if ( ! empty( $first_post->posts[0] ) ) {
288 + $time = \strtotime( $first_post->posts[0]->post_date_gmt );
308 289 } else {
309 290 $time = \time();
310 291 }
311 292
312 - $published = \gmdate( ACTIVITYPUB_DATE_TIME_RFC3339, $time );
313 -
314 - \update_option( 'activitypub_blog_published', $published, false );
315 -
316 - return $published;
293 + return \gmdate( ACTIVITYPUB_DATE_TIME_RFC3339, $time );
317 294 }
318 295
319 296 /**
320 297 * Get the canonical URL.
@@ -419,14 +396,9 @@
419 396 * @return string[]|null The endpoints.
420 397 */
421 398 public function get_endpoints() {
422 399 return array(
423 - 'sharedInbox' => get_rest_url_by_path( 'inbox' ),
424 - 'oauthAuthorizationEndpoint' => get_rest_url_by_path( 'oauth/authorize' ),
425 - 'oauthTokenEndpoint' => get_rest_url_by_path( 'oauth/token' ),
426 - 'oauthRegistrationEndpoint' => get_rest_url_by_path( 'oauth/clients' ),
427 - 'proxyUrl' => get_rest_url_by_path( 'proxy' ),
428 - 'proxyEventStream' => get_rest_url_by_path( 'proxy/stream' ),
400 + 'sharedInbox' => get_rest_url_by_path( 'inbox' ),
429 401 );
430 402 }
431 403
432 404 /**
@@ -435,19 +407,8 @@
435 407 * @return string The Webfinger-Identifier.
436 408 */
437 409 public function get_webfinger() {
438 410 return $this->get_preferred_username() . '@' . \wp_parse_url( \home_url(), \PHP_URL_HOST );
439 - }
440 -
441 - /**
442 - * Returns the Liked API endpoint.
443 - *
444 - * @since 8.1.0
445 - *
446 - * @return string The Liked endpoint.
447 - */
448 - public function get_liked() {
449 - return get_rest_url_by_path( sprintf( 'actors/%d/liked', $this->get__id() ) );
450 411 }
451 412
452 413 /**
453 414 * Returns the Featured-API-Endpoint.