Commit graph

257 commits

Author SHA1 Message Date
Matthias Pfefferle
4fae81792b
Improve Auto-Post-Type-Detection (#917) 2024-10-11 07:54:52 +02:00
Matthias Pfefferle
37d34ab50e version bump 2024-10-09 12:57:00 +02:00
Konstantin Obenland
00a57c39a4
PHPCS: Enable Commenting sniff (#925)
* PHPCS: Enable Commenting sniff

* Apply suggestions from code review

Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>

* Fix param alignment.

---------

Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
2024-10-07 13:25:51 +02:00
Matt Wiebe
0625090989
Fix link regex (#922)
* Fix link regex

* add some tests

---------

Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
2024-10-07 13:25:32 +02:00
Matthias Pfefferle
ad1bcbd475 version bump 2024-10-02 11:35:08 +02:00
Konstantin Obenland
2b5f635ba3
Suggestion: Adopt WordPress PHP Coding Standards (#905)
* Update phpcs rules

* Automated style updates

* Silence all other Warnings and Errors

We'll fix them in follow ups.
2024-09-28 12:53:21 -05:00
Matthias Pfefferle
532062c5d8 version bump 2024-09-26 08:56:02 +02:00
Matthias Pfefferle
cc7a6cccc0 version bump 2024-09-25 15:40:56 +02:00
André Menrath
7370e97b5a
Add replies collection (#876)
* typo in phpdoc

* add first draft for adding replies collections to posts and comments

* refactoring

* Fix php CodeSniffer violations

* fix typo in php comment

* add draft for testing replies

* replies: test with own comment

* fix basic test for replies collection

* Restrict 'type' parameter for replies to 'post' or 'comment' in REST API

* some cleanups

* prefer ID over URL

* rename to `reply_id` to make clear that it is not the WordPress comment_id

* modularize retrieving of comment link via comment meta

* fix phpcs

* I think we should be more precise with this

and maybe there are other fallbacks coming

---------

Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
2024-09-25 13:24:35 +02:00
Matthias Pfefferle
63fc9ebef6 version bump 2024-09-17 14:45:35 +02:00
Matthias Pfefferle
c8c4963466 version bump 2024-09-16 20:14:26 +02:00
Matthias Pfefferle
8bff92d260
initial (#867) 2024-09-13 18:21:11 +02:00
Matthias Pfefferle
c180644ccc
Fix Extra-Fields handling (#886) 2024-09-09 12:54:57 +02:00
Matthias Pfefferle
15cff15bc1
Fixed: Content handling for Podcasts (#883) 2024-09-09 10:05:18 +02:00
Matthias Pfefferle
e6c8689b86 version bump 2024-09-09 09:44:35 +02:00
Matthias Pfefferle
88675ea6c6
Simple Remote-Reply endpoint. (#866)
* Simple Remote-Comment endpoint.

implements #864

* move sanitize to args

* fix PHPDoc

* change from actions to filters

thanks @akirk for your feedback!

* add generic Interaction hook
2024-09-04 13:37:38 +02:00
Jan Boddez
dabff80cc2
Add like handler (#804)
* Update class-comment.php

* Initial attempt

* Register like handler

* Add support for undoing likes

* add support for announce

and copied basic comment_type support handling from the Webmention plugin

* fix merge issues

* remove C&P issues

* add missing phpdoc

* Disable Announces and Likes by default.

* set ACTIVITYPUB_DISABLE_REACTIONS to false

* refactorings

* fix escaping

* add default object type

* deduplicate code

---------

Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
2024-08-16 12:55:16 +02:00
Daniel Hüsken
2ac7676359
Replace hashtags, urls and mentions in summary with links (#849)
* replace hashtags, mentions and ulrs in summary

* move faq stuff and auto generate markdown version with grunt

* I would rename it the class to `Link` because it's about linking not about URLs

* fix auto generated readme

* let use not converted links in extra fields our link generation

* consistency

* find new function name, because it is not purely about links

* make `rel` directly filterable to be more flexible in the future

* remove some whitespaces

* it is not needed to check for a link inside a link

* not convert extra field links with additional text

* not convert extra field links with additional text

* simplified code

---------

Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
2024-08-14 15:41:42 +02:00
Matt Wiebe
f068396e05
Autoloader: log failure in addition to wp_die() (#853) 2024-08-12 21:29:57 -05:00
Matthias Pfefferle
0bbd715d05
Refactor Media Handling a bit and add support for Seriously Simple Podcasting (#839)
* add some filters

* re-order functions for a better readability

* first draft to support Seriously Simple Podcasting

* use icon instead of thumbnail

* fix array_filter

* use transformer instead

* fix phpcs issues

* add some PHPDoc

* some more docs
2024-08-08 15:19:55 +02:00
Matthias Pfefferle
f95d0e44b7 prepare version 3.1.0 2024-08-07 17:37:01 +02:00
Matthias Pfefferle
a7f04db147 use 3.0.0
because we include some breaking changes
2024-07-26 13:51:03 +02:00
Matthias Pfefferle
c6062d88da prepare version 2.7.0 2024-07-25 11:00:24 +02:00
Matthias Pfefferle
6cc071d270 add migration for 2.7.0 2024-07-22 11:16:38 +02:00
Matthias Pfefferle
dc864c6443
Add setting to enable/disable the fediverse:creator OGP tag (#815) 2024-07-18 17:14:21 +02:00
Matthias Pfefferle
e490a0138d version bump 2024-07-18 08:23:50 +02:00
Matthias Pfefferle
dee41c3e43 version bump 2024-07-17 16:29:28 +02:00
Matthias Pfefferle
708efb1704
Update dependencies (#797)
* drop php 5.6 support

* update markdown
2024-07-08 20:03:07 +02:00
Matthias Pfefferle
3726dedfdc version bump 2024-07-01 12:47:10 +02:00
Matthias Pfefferle
8983629995
Add the Fediverse creator of a post to opengraph (#786)
* add the fediverse creator of a post to opengraph

see:

* https://wordpress.org/plugins/opengraph/
* https://codeberg.org/fediverse/fep/src/branch/main/fep/XXXX/fep-XXXX.md
* https://github.com/mastodon/mastodon/pull/30398

* remove prefix until it is clearified

* Do not add the metadata if it already exists
2024-07-01 12:32:55 +02:00
Matthias Pfefferle
d5132d311b version bump 2024-06-05 15:19:21 +02:00
Matt Wiebe
89a57302c6
Notifications: introduce general class and use it for new follows (#761)
* Notifications: introduce general class and use it for new follows

Also send stuff via Jetpack

---------

Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
2024-05-16 16:03:03 -05:00
Matthias Pfefferle
f0c52580ff
Improve AUTHORIZED_FETCH (#728)
* simplify code

* show limited profile informations

* exclude application user

* use actor instead of user

* change JS

* use Application instead of Application_User

* re-add use

* add summary

* Improves comment intent

* remove limited actor json in favour of the application user

---------

Co-authored-by: Django Doucet <mediaformat.ux@gmail.com>
2024-05-03 08:54:06 +02:00
Matthias Pfefferle
c9e980a6b8 version bump 2024-04-29 10:00:25 +02:00
Matthias Pfefferle
4cd98b2b76
Change/docs (#708)
* start CHANGELOG.md

fix #439 and #702

* use valid URL

* updated

* updates

* updates

* update readme.md

* add latest version

* highlight code

* fix excerpt length

* update readme

* added missing shared Dialog abstraction
2024-04-11 09:59:10 +02:00
Matthias Pfefferle
79f400d88a
Improve User management (#703)
* Use an ActivityPub capability to better enable/disable ActivityPub support

* split PRs

* remove test hook

* do not run migrations for new installs

* fix unit tests

* fix unit tests

* remove abandoned schedule!

* fix migration class

* fix order

* restructuring

* remove follower migration

* do not yet remove legacy followers

* remove blog-user changes

* use a const for the version number

* add user tests and fix old ones

* use a more generic async migrator

* optimized test
2024-03-11 15:19:07 +01:00
Matthias Pfefferle
cbbbd70890
A better default content handling based on the Object Type (#661)
* nicer default handling!

* use attachment based on the object type

* fix typo

* C&P issue

* update settings

* add default post format

* mixed up `post_format` with `object_type`

* use h2 instead of strong

* add theme support for `post-formats`

if using that feature for ActivityPub

* use Note instead of `image`, `video` and `gallery`

* add `alt` support for images

fix #94

* set type to `Note` if post-type has no title support

* better check

* hide "Post content" when WordPress-Post-Format is selected

* add ACTIVITYPUB_DEFAULT_OBJECT_TYPE const

* move some code

* use note as default
2024-02-29 14:47:10 +01:00
Matthias Pfefferle
149a31965f version bump 2024-02-27 10:13:32 +01:00
Matthias Pfefferle
5988736b14
Add/remote reply (#689) 2024-02-22 16:32:16 +01:00
Matthias Pfefferle
fadd1986ae version bump 2024-02-13 18:30:56 +01:00
Matthias Pfefferle
3b21061c49
re-add vary header (#683)
* re-add vary header

fixes #580

* add Const to enable/disable `Vary` header

* lets start with default "off"
2024-02-12 11:09:16 +01:00
Matthias Pfefferle
4a77436427 version bump 2024-02-01 11:20:15 +01:00
Matthias Pfefferle
1fc6869576
improve federated comments (#645)
* fix some times broken reply context

* revert changes

* add a filter to finally verify if an activity should be send or not

* better local comment handling

do not federate local only comments (fix #652) and hide "reply" link for federated comments

* show JSON only for comments that should be federated!

* fix parent_comment handling

* show external id if exists

* disable "edit comments" for federated comments

* some more doc

* added tests

* fix #658

* allow custom reply link!

* some restructurings

* this will be only a minor release

* version bump

* mark WordPress object as federated

* fix content filter issue!

fixes https://wordpress.org/support/topic/yasr-ratings-appear-on-comments-on-mastodon/

* add custom filter

thanks @janboddez for the idea https://github.com/Automattic/wordpress-activitypub/pull/645#issuecomment-1898820529

* optimize code a bit

* consts to enable/disable incoming/outgoing interactions

see https://wordpress.org/support/topic/how-to-suppress-user-comments-from-feed/

* rename state

* cleanup federation check

* fix markdown

* better handling of Create/Update/Delete

* update check
2024-02-01 11:17:03 +01:00
André Menrath
174262d22c
Add/event objects (#629)
* remove redundant property definitions

* Add redused context for actors.

* Add classes to construct Moblizon compatible events

* Bind the context to the activitypub object
- change the propertyname  which stores the json-ld context from context to _context, because context is already reserved in the ActivityStreams vocabulary.
- cleanup currently unused code

* fix phpcs

* Remove PostalAddress object: it's enough (at least atm) to directly write the array in transformers.

* Remove _context property from ActivityPub objects in favour of getter function get_json_ld_context()

* fix unit tests: ActivityPub Activity objects have a custom getter for the JsonLD context

* fix phpcs

* fix unit-tests to also support php5.6

* fix phpcs

* add param include_json_ld_context to to_array function
This allows to not set the @context in the resulting array.

* propagate the param include_json_ld_context to nested calls of to_array.

* fix phpcs

* Nested AcitivityPub objects: never build context in inner items in to_array function

* fix: param of set_address may also be an array

* fix typo in comment

* always prefix json-ld context with json-ld and move event class to sub-namespace

* fix usage of reserved object keyword
seems it should not be used as a namespace either

* Merge commit 'b2271cda6b857f879e0abd4f3c6683642d725267' into add/event-objects

* Fix calling non-static function as static

Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>

* Partly fix Json-LD contexts in collections

* Update includes/activity/class-base-object.php

* this is implicit

We already set the correct user with `$transformer->change_wp_user_id( $user_id );` so the Actor will be generated properly. We can change the behaviour, but we should not use both.

* this change prevents the Activity to re-use Object vars

this should stay as is, because it pre-fills the Activity with data (for example cc and to) and it will no longer be done with your change.

It is on purpose that it first sets the object and then replaces it with the URI.

See: https://github.com/Automattic/wordpress-activitypub/blob/master/includes/activity/class-activity.php#L195

* add `$include_json_ld_context` support to `to_json`

* disable some more contexts

* remove whitespace

* Add php-comment for 7ed17c042a

* Fix JSON-LD context for ActivityPub objects: child classes may override it.

* coding standards

* call folder/namespace `Extended_Object`

 to be consistent with folder names in singular

* fix: unnessesary nesting of extended-objects

* remove license

I hope this is fine, to have the complete plugin under the MIT @Menrath ?!?

---------

Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
2024-01-18 16:35:52 +01:00
Matthias Pfefferle
4fafea35e7
implements a basic followers endpoint for the mastodon api (#666)
* implements a basic followers endpoint for the mastodon api

see https://github.com/akirk/enable-mastodon-apps/pull/67

/cc @akirk

* fix php 5.6 issue
2024-01-18 13:38:02 +01:00
Matthias Pfefferle
7e35c1e8b9 version bump 2024-01-12 16:07:56 +01:00
Matthias Pfefferle
bdd8ab804f fix mentions and finally add dot support 2024-01-10 20:57:40 +01:00
Matthias Pfefferle
1fe2ff7ca5 remove dot 2024-01-10 20:49:38 +01:00
Matthias Pfefferle
f3753f2150 re-order positions 2024-01-10 20:42:02 +01:00
Matthias Pfefferle
907ae508b1 escape dot 2024-01-10 20:38:39 +01:00