wordpress-activitypub
wordpress-activitypub copied to clipboard
[WIP] Federated Comments
Restarting a fresh PR from #95
This currently includes code for Comments & Posts
Posts:
- [x] Fixes Post Updates
- [x] Fixes Deletes
Comments: Adds the ability to reply to comments from the Moderation page
- [x] Comments support threading
- [x] Local / Remote comments can be deleted
- [x] Local / Remote comments can be updated
TODOs:
- [ ] Complete Replies Collection
- [x] Refactor AP object ID ( migrate from permalink to non-pretty permalinks
example.com/?p={post_ID}
) Discuss in #16 - [ ] Upgrade script
SonarCloud Quality Gate failed.
0 Bugs
0 Vulnerabilities
0 Security Hotspots
72 Code Smells
No Coverage information
3.1% Duplication
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
👀
@pfefferle just a note that SonarCloud code smell uses rules that conflict with phpcs
.
Yea, ignore sonar cube!
@mediaformat but there seems to be a conflict in activitypub.php
.
@mediaformat but there seems to be a conflict in
activitypub.php
.
@pfefferle I'm not seeing anything out of ordinary, any chance you could pinpoint the error? EDIT: Just saw the conflict and resolved it
Nice, thanks. Is it still [WIP]?
There is one last piece to this, a tools page for manually federating updates (deletes, or delete and announce with new ID).
Ready to go!
One more fix coming ;-)
SonarCloud Quality Gate failed.
1 Bug
0 Vulnerabilities
0 Security Hotspots
1856 Code Smells
No Coverage information
1.3% Duplication
Pagination of migrate-list.php
/ wp-admin/tools.php?page=activitypub_tools
is not working, will fix, but shouldn't block review.
SonarCloud Quality Gate failed.
0 Bugs
0 Vulnerabilities
0 Security Hotspots
1896 Code Smells
No Coverage information
1.3% Duplication
We should also add some tests.
@pfefferle I added a view Posts with (activitypub) Comments to the Migration page.
There is a column which displays number of (published) comments. However some posts in this view may display 0
comment count (this number is only for published comments). Do you find that confusing? or have any suggestion?
@mediaformat I will fokus on this PR during the holidays and had a look at the migration part... I am not sure if this is a good idea, because it could be very distructive! I think we should stick with backwards compatibility in the first place.
@mediaformat had a look at the migration part... I am not sure if this is a good idea, because it could be very distructive! I think we should stick with backwards compatibility in the first place.
Ok, I'll remove all that code. Backwards Compat then will only be checking first for permalink...
What do you think about this way (at least as quick fix) https://github.com/pfefferle/wordpress-activitypub/pull/231 ?
@pfefferle the \add_post_meta( $post_id, 'activitypub_canonical_url', \get_permalink( $post_id ), true );
looks good
Is there a public WP instance where this is available to read from? Curious in how the AP payloads look for comments and posts.
It is a pull request and not actually in stable afaik
On Mon, Feb 6, 2023, 9:26 AM John Spurlock @.***> wrote:
Is there a public WP instance where this is available to read from? Curious in how the AP payloads look for comments and posts.
— Reply to this email directly, view it on GitHub https://github.com/pfefferle/wordpress-activitypub/pull/142#issuecomment-1419456090, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANUKZUUHZLJ73KXRVDULHDWWEX57ANCNFSM5TPKQ6SA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
I know, I'm just wondering if there is a staging server or something
There isn't a staging server, I'm testing this locally with ngrok, and mastodon. The AP payloads are pretty typical/similar to other implementations
Congrats on the acquisition - can't wait to unlock ActivityPub comments/replies for WP posts - hopefully this is still a priority!
Ok, a few things broke and are left to fix
- processing remote comments (update, delete)
Also, I'll probably extract the post/comments replies collection into a separate PR, to reduce the scope of this one.
@mediaformat are you fine with me adding some changes directly to your PR?
@mediaformat I planned to also work a bit more on the topic but then came the https://github.com/Automattic/wordpress-activitypub/issues/523.
I would love to:
- [ ] simplify the code a bit (move global functions to transformer and similar stuff)
- [ ] Start with inbox-handlers to have the code a bit more structured. If we have a good idea how to do it, we can adapt it for
follow
andDelete
afterwards. Something like-
/handler/class-create.php
-
/handler/class-like.php
-
/handler/class-update.php
-
- [x] use the Mention class also for comments
What do you think?
I would love to: * simplify the code a bit (move global functions to transformer and similar stuff) * Start with inbox-handlers to have the code a bit more structured. What do you think?
I agree with the simplification, and inbox handlers and all.
I ended up re-added some of the code that was removed, because I wanted to fix some bugs from where I left off last time (federation wasn't working well for deletes, edits). But it took a while to figure out why things weren't working. 😅
Anyhow everything is working again: threads, mentions, replies, edits, deletes. 🎉
I would love to keep in in draft state for the next week, that it will not be merged by accident.
?replytocom=1
seems to redirect even with ActivityPub Accept header.