From 5a3dd4cf212788e70801840263e6abf7fdf44ad7 Mon Sep 17 00:00:00 2001 From: Lai Power Date: Sun, 22 Oct 2023 22:20:53 +0000 Subject: [PATCH] updated plugin `ActivityPub` version 1.0.7 --- wp-content/plugins/activitypub/.distignore | 3 + wp-content/plugins/activitypub/LICENSE | 1 + .../plugins/activitypub/activitypub.php | 266 ++++--- .../assets/css/activitypub-admin.css | 68 +- .../plugins/activitypub/assets/img/mp.jpg | Bin 0 -> 3337 bytes .../activitypub/assets/img/wp-logo.png | Bin 0 -> 11836 bytes .../activitypub/build/follow-me/block.json | 47 ++ .../build/follow-me/index.asset.php | 1 + .../activitypub/build/follow-me/index.js | 1 + .../build/follow-me/style-index.css | 1 + .../build/follow-me/view.asset.php | 1 + .../activitypub/build/follow-me/view.js | 1 + .../activitypub/build/followers/block.json | 57 ++ .../build/followers/index.asset.php | 1 + .../activitypub/build/followers/index.js | 3 + .../build/followers/style-view.css | 1 + .../build/followers/view.asset.php | 1 + .../activitypub/build/followers/view.js | 3 + .../includes/activity/class-activity.php | 223 ++++++ .../includes/activity/class-actor.php | 139 ++++ .../includes/activity/class-base-object.php | 678 ++++++++++++++++++ .../includes/class-activity-dispatcher.php | 134 ++-- .../includes/class-activitypub.php | 271 +++++-- .../activitypub/includes/class-admin.php | 151 +++- .../activitypub/includes/class-blocks.php | 151 ++++ .../activitypub/includes/class-debug.php | 5 +- .../activitypub/includes/class-hashtag.php | 76 +- .../includes/class-health-check.php | 151 +++- .../activitypub/includes/class-http.php | 111 +++ .../activitypub/includes/class-mention.php | 136 +++- .../activitypub/includes/class-migration.php | 179 +++++ .../activitypub/includes/class-scheduler.php | 169 +++++ .../activitypub/includes/class-shortcodes.php | 319 ++++---- .../activitypub/includes/class-signature.php | 436 ++++++++++- .../activitypub/includes/class-webfinger.php | 143 +++- .../includes/collection/class-followers.php | 591 +++++++++++++++ .../includes/collection/class-users.php | 209 ++++++ .../plugins/activitypub/includes/compat.php | 37 + .../plugins/activitypub/includes/debug.php | 3 +- .../activitypub/includes/functions.php | 543 +++++++++----- .../plugins/activitypub/includes/help.php | 40 +- .../includes/model/class-activity.php | 126 ---- .../includes/model/class-application-user.php | 72 ++ .../includes/model/class-blog-user.php | 243 +++++++ .../includes/model/class-follower.php | 366 ++++++++++ .../activitypub/includes/model/class-post.php | 436 ++--------- .../activitypub/includes/model/class-user.php | 318 ++++++++ .../includes/peer/class-followers.php | 66 +- .../activitypub/includes/peer/class-users.php | 67 -- .../includes/rest/class-collection.php | 213 ++++++ .../includes/rest/class-followers.php | 100 ++- .../includes/rest/class-following.php | 73 +- .../activitypub/includes/rest/class-inbox.php | 223 ++---- .../includes/rest/class-nodeinfo.php | 83 +-- .../includes/rest/class-ostatus.php | 33 - .../includes/rest/class-outbox.php | 87 +-- .../includes/rest/class-server.php | 105 +++ .../activitypub/includes/rest/class-users.php | 155 ++++ .../includes/rest/class-webfinger.php | 113 ++- .../includes/table/class-followers.php | 148 ++++ .../includes/table/followers-list.php | 36 - .../includes/transformer/class-post.php | 512 +++++++++++++ .../integration/class-buddypress.php | 10 +- .../integration/class-nodeinfo.php | 49 ++ .../integration/class-webfinger.php | 58 ++ wp-content/plugins/activitypub/readme.txt | 147 +++- .../activitypub/templates/admin-header.php | 13 +- .../activitypub/templates/author-json.php | 92 +-- .../activitypub/templates/blog-json.php | 66 +- .../templates/blog-user-followers-list.php | 28 + .../activitypub/templates/followers-list.php | 16 - .../activitypub/templates/post-json.php | 4 +- .../activitypub/templates/settings.php | 403 ++++++----- .../templates/user-followers-list.php | 21 + .../activitypub/templates/user-settings.php | 32 + .../plugins/activitypub/templates/welcome.php | 152 ++-- 76 files changed, 7822 insertions(+), 2195 deletions(-) create mode 100644 wp-content/plugins/activitypub/assets/img/mp.jpg create mode 100644 wp-content/plugins/activitypub/assets/img/wp-logo.png create mode 100644 wp-content/plugins/activitypub/build/follow-me/block.json create mode 100644 wp-content/plugins/activitypub/build/follow-me/index.asset.php create mode 100644 wp-content/plugins/activitypub/build/follow-me/index.js create mode 100644 wp-content/plugins/activitypub/build/follow-me/style-index.css create mode 100644 wp-content/plugins/activitypub/build/follow-me/view.asset.php create mode 100644 wp-content/plugins/activitypub/build/follow-me/view.js create mode 100644 wp-content/plugins/activitypub/build/followers/block.json create mode 100644 wp-content/plugins/activitypub/build/followers/index.asset.php create mode 100644 wp-content/plugins/activitypub/build/followers/index.js create mode 100644 wp-content/plugins/activitypub/build/followers/style-view.css create mode 100644 wp-content/plugins/activitypub/build/followers/view.asset.php create mode 100644 wp-content/plugins/activitypub/build/followers/view.js create mode 100644 wp-content/plugins/activitypub/includes/activity/class-activity.php create mode 100644 wp-content/plugins/activitypub/includes/activity/class-actor.php create mode 100644 wp-content/plugins/activitypub/includes/activity/class-base-object.php create mode 100644 wp-content/plugins/activitypub/includes/class-blocks.php create mode 100644 wp-content/plugins/activitypub/includes/class-http.php create mode 100644 wp-content/plugins/activitypub/includes/class-migration.php create mode 100644 wp-content/plugins/activitypub/includes/class-scheduler.php create mode 100644 wp-content/plugins/activitypub/includes/collection/class-followers.php create mode 100644 wp-content/plugins/activitypub/includes/collection/class-users.php create mode 100644 wp-content/plugins/activitypub/includes/compat.php delete mode 100644 wp-content/plugins/activitypub/includes/model/class-activity.php create mode 100644 wp-content/plugins/activitypub/includes/model/class-application-user.php create mode 100644 wp-content/plugins/activitypub/includes/model/class-blog-user.php create mode 100644 wp-content/plugins/activitypub/includes/model/class-follower.php create mode 100644 wp-content/plugins/activitypub/includes/model/class-user.php delete mode 100644 wp-content/plugins/activitypub/includes/peer/class-users.php create mode 100644 wp-content/plugins/activitypub/includes/rest/class-collection.php delete mode 100644 wp-content/plugins/activitypub/includes/rest/class-ostatus.php create mode 100644 wp-content/plugins/activitypub/includes/rest/class-server.php create mode 100644 wp-content/plugins/activitypub/includes/rest/class-users.php create mode 100644 wp-content/plugins/activitypub/includes/table/class-followers.php delete mode 100644 wp-content/plugins/activitypub/includes/table/followers-list.php create mode 100644 wp-content/plugins/activitypub/includes/transformer/class-post.php create mode 100644 wp-content/plugins/activitypub/integration/class-nodeinfo.php create mode 100644 wp-content/plugins/activitypub/integration/class-webfinger.php create mode 100644 wp-content/plugins/activitypub/templates/blog-user-followers-list.php delete mode 100644 wp-content/plugins/activitypub/templates/followers-list.php create mode 100644 wp-content/plugins/activitypub/templates/user-followers-list.php create mode 100644 wp-content/plugins/activitypub/templates/user-settings.php diff --git a/wp-content/plugins/activitypub/.distignore b/wp-content/plugins/activitypub/.distignore index 782f2e88..871e8074 100644 --- a/wp-content/plugins/activitypub/.distignore +++ b/wp-content/plugins/activitypub/.distignore @@ -15,6 +15,8 @@ Makefile README.md readme.md CODE_OF_CONDUCT.md +FEDERATION.md +SECURITY.md LICENSE.md _site _config.yml @@ -36,3 +38,4 @@ phpunit.xml.dist tests node_modules vendor +src diff --git a/wp-content/plugins/activitypub/LICENSE b/wp-content/plugins/activitypub/LICENSE index e59f0cc6..644800f2 100644 --- a/wp-content/plugins/activitypub/LICENSE +++ b/wp-content/plugins/activitypub/LICENSE @@ -1,6 +1,7 @@ MIT License Copyright (c) 2019 Matthias Pfefferle +Copyright (c) 2023 Automattic Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/wp-content/plugins/activitypub/activitypub.php b/wp-content/plugins/activitypub/activitypub.php index 7320f0c6..521a3795 100644 --- a/wp-content/plugins/activitypub/activitypub.php +++ b/wp-content/plugins/activitypub/activitypub.php @@ -3,7 +3,7 @@ * Plugin Name: ActivityPub * Plugin URI: https://github.com/pfefferle/wordpress-activitypub/ * Description: The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format. - * Version: 0.17.0 + * Version: 1.0.7 * Author: Matthias Pfefferle & Automattic * Author URI: https://automattic.com/ * License: MIT @@ -15,85 +15,124 @@ namespace Activitypub; +use function Activitypub\is_blog_public; +use function Activitypub\site_supports_blocks; + +require_once __DIR__ . '/includes/compat.php'; +require_once __DIR__ . '/includes/functions.php'; + /** - * Initialize plugin + * Initialize the plugin constants. */ -function init() { - \defined( 'ACTIVITYPUB_EXCERPT_LENGTH' ) || \define( 'ACTIVITYPUB_EXCERPT_LENGTH', 400 ); - \defined( 'ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS' ) || \define( 'ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS', 3 ); - \defined( 'ACTIVITYPUB_HASHTAGS_REGEXP' ) || \define( 'ACTIVITYPUB_HASHTAGS_REGEXP', '(?:(?<=\s)|(?<=

)|(?<=
)|^)#([A-Za-z0-9_]+)(?:(?=\s|[[:punct:]]|$))' ); - \defined( 'ACTIVITYPUB_USERNAME_REGEXP' ) || \define( 'ACTIVITYPUB_USERNAME_REGEXP', '(?:([A-Za-z0-9_-]+)@((?:[A-Za-z0-9_-]+\.)+[A-Za-z]+))' ); - \defined( 'ACTIVITYPUB_ALLOWED_HTML' ) || \define( 'ACTIVITYPUB_ALLOWED_HTML', '