Commit graph

165 commits

Author SHA1 Message Date
Matthias Pfefferle
1b85b77347
Hide Bookmarklet if site does not support Blocks (#851) 2024-08-13 00:34:56 +02:00
Matt Wiebe
08106890a3
Add Blog extra fields (#838)
Imitate User Extra Fields, and consolidate into an `ExtraFields` class

---------

Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
2024-08-09 09:40:35 -05:00
Matthias Pfefferle
1025ceed8c fix typo! 2024-07-29 15:58:34 +02:00
Matthias Pfefferle
5d780a9d35 change cursors 2024-07-26 13:27:36 +02:00
Matthias Pfefferle
1355c0b950 add link to tools page 2024-07-25 16:27:34 +02:00
Matthias Pfefferle
ea6c250556 rename template to be consistent 2024-07-25 14:58:36 +02:00
Matthias Pfefferle
b240589e78
Add "reply context" support (#819)
* add basic reply context support

* UX improvements

* remove unused style file

* built

* Add bookmarklet!

* add build

* small UX tweaks

* add toolbox box

* improved text

* optimized block filter

* add in-reply-to to activity

* refactor to add inboxes using filters

and retrieve/add inboxes of `in-reply-to` links

* renamings

* plugins do not like slashed IDs

* rename to match new get param

---------

Co-authored-by: Matt Wiebe <wiebe@automattic.com>
2024-07-24 23:44:01 +02:00
Matthias Pfefferle
6cc071d270 add migration for 2.7.0 2024-07-22 11:16:38 +02:00
Matthias Pfefferle
289684d15f
Add "Header Image" support (#816)
* Add "Header Image" support based on WordPress Site-Icon JS

* split settings pages

* Add support to change blog description

* use alternate settings for output

* add header image support for authors
2024-07-19 21:52:19 +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
d2260639b3
Add extra fields (#762)
* add extra fields settings

* add settings

* add settings link

* allow users to only edit their extra fields

* use nopaging instead of posts_per_page

thanks @mattwiebe

* load filters only on admin page and remove the view actions

* author should not be editable

* some improvements and extra informations

* description

* use nopaging instead

* add blog url

* formatting

* formatting

* some cosmetics

* return attachments

* formatting

* formatting

* add default extra fields

* remove unused migration

* better defaults handling

* use a filter to be able to unhook/replace default extra fields

* should fix #810

---------

Co-authored-by: Matt Wiebe <wiebe@automattic.com>
2024-07-15 18:03:40 +02:00
Matthias Pfefferle
3fde5bbe96
Improve lemmy compatibility (#752)
* improve lemmy compatibility

* simplify code

* fix tests

* use string instead of array

* use `actors` instead of `users`

* optimize ID generation

* update ID

* the #threadiverse needs Announces for everything! :)

* change to full Announce Object

* fix indents
2024-05-16 17:30:08 +02:00
Jan Boddez
2b96c6efd2
Improve transformer (#731)
* Factory::get_transformer() may return a WP_Error instance

* Fix templates

* PHPDoc

* "Fix" conneg (for posts, at least)

* (Hopefully) fix conneg for comments, too

* Ugly, but works?

* Fix outboxes, collections

* Clean up a bit

* Use Factory

* Remove outdated `use`

* Use Transformer\Factory instead of Transformer\Post

* "Fix" _deprecated_function() call

* Remove superfluous transformer check

* Remove transformer check

* Call Transformer::get_transformer() only once per request

* PHPDoc

* this should be fine

a failing transformer is very unlikely because there are a lot of checks before `is_singular` or `is_comment` is valid.

* no longer used

---------

Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
2024-05-16 15:14:31 +02:00
Matthias Pfefferle
1096944764 Remove beta label from the #Hashtag settings 2024-04-24 12:38:43 +02:00
Matthias Pfefferle
8405cb4baf add some help texts 2024-04-18 15:28:11 +02: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
c3c987a765
improve the settings screen (#681) 2024-01-30 21:29:09 +01:00
Matthias Pfefferle
48feabe39e
Improve post-type support (#675)
* Improve post-type support

* Remove `page` from default types (fix #665)
* Add description to settings (fix #673)

* fix tests
2024-01-25 15:51:21 +01:00
Matthias Pfefferle
3d1fab501d use esc_textarea 2024-01-22 11:50:32 +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
2c107eec62
Use FEP-2c59 for WebFinger reference (#636) 2024-01-08 20:01:16 +01:00
Matthias Pfefferle
b744dc551d
Comment Federation (#550)
* Comments 1

* Delete FUNDING.yml

* Add basic BuddyPress support

fix #122

thanks and props @skysarwer

* change URL to `bp_core_get_user_domain`

* fix "Follow" issue

fix #133

* fix #135

* version bump

* Create phpunit.yml

* Update composer.json

* Update composer.json

* Update phpunit.yml

* Update composer.json

* Create phpcs.yml

* Update phpcs.xml

* Update composer.json

* phpcs fixes

* fix typo

* Comments update

* webfinger_extract remove extra param

* coding standards

* Replies Collection, settings, other fixes

* Create stale.yml

* move stale file

* code standards cleanup

* Migrate / Update script

* bugfix

* add settings link to plugin page

* fix code standards

* fix cs

* fix PHPCS

* PHPCS fixes

* change background image for wp.org

* fix docker

* fix webfinger for email identifiers

fix #152

* version bump

* update composer file to fix unit testing

* allow plugins

* fix dependencies

* Migrate tools

* code cleanup

* regression fix

* Fix announce, clarified language

* update included filename

* code cleanup

* Improve migration UX

* Add comments view, warnings to migrate page

* style fix

* more style fixes

* Fix send_delete_activity

* replace ap_comment_id to reuse  replytocom var

* Comments class missing attributes

* Post class fix attributes

* move js file to assets/js

* Separate file for Comment processing hooks

* fix file path

* associate comments to back compat post

* Fix js assets enqueue

* change regex matching potential hashtags

Matches any string starting with '#' and consisting of any number and combination of [A-Za-z0-9_] that is directly followed by whitespace or punctuation. Groups everything after '#' for access in functions using this regex.

This fixes #183 (incomplete links on hashtags containing special characters) by not matching these at all.

* also detect hashtags at the start of a paragraph

* restrict html tags after which to detect a hashtag

Hashtags should not be detected after just any html tag - for example not after an opening a or div. To still allow detection at the start of a line, allow specifically p and br to directly precede a hashtag.

* fix pagination

* Add Custom Post Type support to outbox API

* remove comment_type

* fix comparison

* remove trailing spaces

* fix phpcs issues

* fix phpcs issues

* run phpcs also on pull_requests

* fix phpcs issues

* support threaded comments from ActivityPub

* refactor support for threaded comments from ActivityPub

* remove debugging log line

* add first unit tests for class inbox

* fix code smells

* make filter function static

* attempt to resolve backwards compatibility issues

* update js to new file

* delete old js

* Remove migrate code

* update post meta canonical

* remove type and mention meta from comment filters

* extract mentions from comment_content

* phpcbf

* remove extra curly bracket

* Remove migrate code

* remove version_check()

* Update enqueue scripts

* Remove remote comments from preprocessing

* Reply to comments from Dashboard

* rename function, inserts users into reply text

* Update dispatch comments

* update comment model

* fix comment model replies property

* fix preprocess_comment cap check

* Add webfinger filter to comments

* Add comment edit datetime

* cleanup

* fix var name

* cleanup

* phpcbf

* better actual translation support

* Separate comment reply script

* migrate dispatch, migrate comment model to transform

* ignore WP_Comment type for now

* Adds new helpers for resolving inReplyTo url

* Update activitypub_send_comment_activity to include type

* remove redundant id check

* reinclude user_id in saved ap_object meta

* update post field meta

* Fix comment updated datetime

* front-end reply inserts @mentions

* enqueue reply script on front end

* use const instead of dirname

* some simplifications

* move some functions

* fixes

* some more fixes

* fix namespace

* fix unittests

* fix testcase

* fixed typo

* fix tests

* fix tests

* fix PHPCS

* move functions to transformer class

* fix warnings

* Link remote comments on frontend

* Link to comment source as row action

* Init Comments class

* remove dead dispatch action

* re-add extract mentions filter

* Restore and tweak Comment transform

* Schedule comments activities for non-admin users

* lint

* remove context property

* rename get_id method to generate_id

* fix locale

* move functions

* PHPDoc

* this is never used

* remove some edit methods

* remove replies for now

* remove JS calls

* remove reply_recipients

* never used

* remove other query-vars

* otherwise to_json would not work properly

* small changes

* use `c` for comment IDs

* remove comments.php for now

maybe re-add it later

* wp_insert_post is an action

* also parse comment_text

* remove duplicate functions

* add Base transformer

* remove invalid test

* update to new query var

* update dispatcher to support comments and posts

* fix transition

* remove unused functions for now

* schedule_comment_activity seems to ignore create and update

* fix wrong use of functions!

* not every platforms sends an URL

* check source-id first

* remove hashtags for now

* fallback to ID

* fix typo

* move to_activity to Base class

* remove unused function

* add support for announce and like

* also ping inboxes of other commenters in the thread

* restructure WebFinger class

* some small improvements

* simplified to_object class

props @Menrath for the feedback and the idea!

* fix unit tests

* make transformer filterable

/cc @Menrath

* use transformer factory, so that transformer can be overwritten

* phpcs fixes

* fix attachments

* fix comment transformer

* remove comments for now

* update readme/changelog

* simplify and unify json_encodes

---------

Co-authored-by: Django Doucet <mediaformat.ux@gmail.com>
Co-authored-by: Andreas <andreas@bocops.de>
Co-authored-by: Eana Hufwe <eana@1a23.com>
Co-authored-by: Matthew Exon <git.mexon@spamgourmet.com>
Co-authored-by: Django Doucet <django.doucet@webdevstudios.com>
2023-12-22 10:12:26 +01:00
mdingemanse
e529b19b8b
Clarifying what [ap_excerpt] does (#578)
* clarifying excerpt

* Update help.php to clarify what [ap_excerpt] does
2023-11-26 21:18:03 +01:00
Matthias Pfefferle
21206ecda0
search for followers and order the output list (#502)
* search for followers and order the output list

* re-use existing nonce!

* verify nonce for search!

---------

Co-authored-by: Matt Wiebe <wiebe@automattic.com>
2023-11-17 18:44:13 +01:00
Matt Wiebe
9ff4d1251a
Attachments: add support for audio 🔈 and video 📼 (#536)
* only in the block editor
* update settings page copy: media, not just images

---------

Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
2023-10-27 15:55:44 -05:00
Matthias Pfefferle
444c4b2837
Fixes PHP warnings and remote delete (#468)
* fix #463

* fix delete

/cc #465 @janboddez

* add disclaimer to not use the same name as an author login

see #470

* check if url is cached before trashing it
2023-09-27 11:05:11 +02:00
Matt Wiebe
c748d12d89
fix lint issues (#406) 2023-08-30 14:23:20 -05:00
Matt Wiebe
dd693c7e67
Words: copy and language consistency/improvements everywhere (#404)
* copy and language improvements everywhere

* remove "try"

thanks @cavalierlife

---------

Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
2023-08-28 14:12:10 +02:00
Matthias Pfefferle
a9648798a8 input fields should be readonly 2023-08-11 12:20:56 +02:00
Matthias Pfefferle
f0c0c1bd21 Add disclaimer that content might look different 2023-08-09 11:17:33 +02:00
Matt Wiebe
5b9dadd6fd
Followers Block (#344)
Introduces a new Followers block. Proudly display your Fediverse followers to the world!

---------

Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
2023-07-26 15:05:41 -05:00
Matthias Pfefferle
8c650c3356 some more admin improvements 2023-07-24 14:13:26 +02:00
Matthias Pfefferle
fe90360bf0 fix copy and paste issue 2023-07-21 14:58:49 +02:00
Matthias Pfefferle
426ddffba0 First step of the settings redesign
thanks @nuriapenya for your help and the nice Screens!
2023-07-21 14:52:18 +02:00
Matthias Pfefferle
a5bc7628cf do not hide settings for now 2023-07-20 15:53:06 +02:00
Matthias Pfefferle
3b88d5e36c update checks 2023-07-20 15:19:19 +02:00
Matthias Pfefferle
44a81742aa Add settings to en/disable user types (for .org users) 2023-07-20 14:21:32 +02:00
Matt Wiebe
2596713213 Lint: now clean 2023-07-18 15:02:27 -05:00
Matthias Pfefferle
befd0d4f1e do not persist data in a getter! 2023-07-11 09:21:16 +02:00
Matthias Pfefferle
465a912a70 fix user settings 2023-07-10 14:08:51 +02:00
Matthias Pfefferle
5b712fb7cd fix some last "follower" issues 2023-07-07 13:43:12 +02:00
Matthias Pfefferle
96c1e92151 optimize and simplify followers 2023-07-06 14:42:18 +02:00
Matthias Pfefferle
493b8ffad5 use transformer instead of post-model 2023-07-03 17:59:42 +02:00
Matthias Pfefferle
359eabf671 use collection instead of factory 2023-07-03 11:20:44 +02:00
Matthias Pfefferle
43db2f2707 set context for output 2023-06-28 16:43:05 +02:00
Matthias Pfefferle
c266c927da transform users to actors 2023-06-28 14:22:27 +02:00
Matthias Pfefferle
e924019a73 added translators hint 2023-06-27 14:29:18 +02:00
Matthias Pfefferle
73c767df39 fix admin-header issue 2023-06-27 14:28:52 +02:00
Matthias Pfefferle
4f2a162f6c Fix follower-list actions 2023-06-27 14:28:52 +02:00
Matthias Pfefferle
0f72f94406 small updates 2023-06-27 14:26:37 +02:00