Compare commits

..

No commits in common. "main" and "format_summary" have entirely different histories.

16 changed files with 92 additions and 197 deletions

3
.gitignore vendored
View file

@ -1,4 +1,3 @@
vendor/ vendor
composer.lock composer.lock
.phpunit.result.cache .phpunit.result.cache
node_modules/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 389 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

View file

@ -1,92 +1,26 @@
# ActivityPub Event Extensions This is a WordPress plugin improves the Fediverse integration of Events via the [WordPress ActivityPub plugin](https://wordpress.org/plugins/activitypub/).
Contributors: andremenrath > **_NOTE:_** This is still pre-alpha. It is not more than a skeleton/playground. Things change rapidly. Please contact us, instead of trying it out yourself at this time.
Tags: events, fediverse, activitypub,, calendar
Requires at least: 6.5
Tested up to: 6.6
Stable tag: 0.1.0
Requires PHP: 8.1
License: AGPL-3.0-or-later
License URI: https://www.gnu.org/licenses/agpl-3.0.html
Integrating popular event plugins with the ActivityPub plugin. For more information checkout our website https://event-federation.eu/. You can follow updates via [RSS](https://event-federation.eu/feed/) or ActivityPub: [@blog@event-federation.eu](https://event-federation.eu/blog/).
![](.wordpress-org/banner-1544x500.jpg) ## Goals
* Proper ActivityPub (JSON-LD) representation of events within WordPress
* Improving the setup and configuration workflow of ActivityPub
* Researching/Implementing federated RSVP/attendee management
## Description ## Supported Event Plugins
Make your events more discoverable, expand your reach effortlessly while being independent of other (commercial) platforms, and part of the growing decentralized web. ### Events plugin that will be supported at first:
With the ActivityPub Event Extensions Plugin for WordPress, your events can be automatically aggregated and displayed across decentralized platforms like [Mastodon](https://joinmastodon.org) or [Gancio](https://gancio.org), without any extra work.
Forget the hassle of managing multiple social media accounts just to keep your audience informed.
This plugin is not an event managing plugin but an add-on to popular event plugins. It extends their functionality to fully support the [ActivityPub plugin](https://wordpress.org/plugins/activitypub/).
With the ActivityPub plugin people can follow your website directly and engage with your events just as they would on social media - liking, boosting and even commenting if you enable it.
You retain full ownership of your content. By integrating into your existing setup, it ensures no extra work is needed while enhancing your events' visibility across the Fediverse.
### How It Works
With the Event Federation Plugin for WordPress, sharing your events is effortless and automatic!
Once you create an event on your WordPress site, it is seamlessly shared across the decentralized web using the ActivityPub protocol.
<p align="center">
<img src="./.wordpress-org/event-activitypub-publishing.gif" alt="Logo" width="250" />
</p>
Your events can be automatically delivered to platforms that fully support events, such as [Mobilizon](https://joinmobilizon.org/), [Gancio](https://gancio.org), [Friendica](https://friendi.ca), [Hubzilla](https://hubzilla.org), and [Pleroma](https://pleroma.social/).
These platforms create public event calendars by pulling in events from various sources, including your website. Any updates you make to your events are synced across these platforms—so you only need to manage your events on your own site, with no extra work required.
<p align="center">
<img src="./.wordpress-org/decentralized-event-calenders.gif" alt="Logo" width="250" />
</p>
Even platforms that dont yet fully support events, like [Mastodon](https://joinmastodon.org), will still receive a detailed, well-composed summary of your event.
The Event Federation Plugin ensures that users from those platforms are provided with all important information about an event.
## Installation
This plugin depends on the [ActivityPub plugin](https://wordpress.org/plugins/activitypub/). Additionally, you need to use one of the supported Event Plugins. See below.
### Supported Event Plugins
* [The Events Calendar](https://de.wordpress.org/plugins/the-events-calendar/) * [The Events Calendar](https://de.wordpress.org/plugins/the-events-calendar/)
* [VS Event List](https://de.wordpress.org/plugins/very-simple-event-list/) * [VS Event List](https://de.wordpress.org/plugins/very-simple-event-list/)
* [Events Manager](https://de.wordpress.org/plugins/events-manager/) * [Events Manager](https://de.wordpress.org/plugins/events-manager/)
* [GatherPress](https://github.com/GatherPress/gatherpress)
## Configuration ### Later:
- [All in One Events Calendar](https://de.wordpress.org/plugins/all-in-one-event-calendar/)
- TBA
If youre new to the [ActivityPub plugin](https://wordpress.org/plugins/activitypub/), its recommended to spend a few minutes reading through its documentation to familiarize yourself with its setup and functionality. ### Your event plugin:
- [**Contact us**](https://event-federation.eu/contact/), if you want to see your event plugin on the list.
## Frequently Asked Questions
### Do I need to install another event plugin to use the Event Federation Plugin?
Yes, this plugin works needs a supported event plugin such as The Events Calendar, VS Event List, or Events Manager to manage your events. It just fills the missing gap between event plugins and the [ActivityPub plugin](https://wordpress.org/plugins/activitypub/).
### What platforms can follow my events?
Your events can be followed on platforms that support ActivityPub like [Mobilizon](https://joinmobilizon.org/), [Gancio](https://gancio.org), [Friendica](https://friendi.ca), [Hubzilla](https://hubzilla.org), and [Pleroma](https://pleroma.social/). Even other applications like [Mastodon](https://joinmastodon.org), which dont fully support events yet, will display a all important information about the events.
### How much extra work is required to maintain my events across the decentralized Web?
None! Once the plugin is set up, your events are automatically sent to all connected platforms or account that follow you (your Website). Any updates you make to your events are synced without additional effort.
### Can I still use social media to promote my events?
Yes, you can still use traditional social media if you wish. However, this plugin helps reduce reliance on commercial platforms by connecting your events to the decentralized Fediverse.
### Will this plugin work if I don't use the ActivityPub plugin?
No, the Event Federation Plugin depends on the ActivityPub plugin to deliver your events across decentralized platforms, so it's essential to have it installed and configured.
### My event plugin is not supported, what can I do?
If you know about coding have a look at the documentation of how to add your plugin or open an [issue](https://code.event-federation.eu/Event-Federation/wordpress-activitypub-event-extensions/issues), if we can spare some free hours we might add it.
### What if I experience problems?
We're always interested in your feedback. Feel free to reach out to us via [E-Mail](https://event-federation.eu/contact/) or create an [issue](https://code.event-federation.eu/Event-Federation/wordpress-activitypub-event-extensions/issues).
## Changelog
### [0.1.0] 2024-10-01
* Initial alpha release on WordPress.org

View file

@ -13,7 +13,7 @@
* *
* Requires at least ActivityPub plugin with version >= 3.2.2. ActivityPub plugin tested up to: 3.2.2. * Requires at least ActivityPub plugin with version >= 3.2.2. ActivityPub plugin tested up to: 3.2.2.
* *
* @package Activitypub_Event_Extensions * @package activitypub-event-extensions
* @license AGPL-3.0-or-later * @license AGPL-3.0-or-later
*/ */

View file

@ -8,13 +8,12 @@
namespace Activitypub_Event_Extensions\Activitypub\Transformer; namespace Activitypub_Event_Extensions\Activitypub\Transformer;
// Exit if accessed directly. use DateTime;
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
use Activitypub\Activity\Extended_Object\Event as Event_Object; use Activitypub\Activity\Extended_Object\Event as Event_Object;
use Activitypub\Activity\Extended_Object\Place; use Activitypub\Activity\Extended_Object\Place;
use Activitypub\Transformer\Post; use Activitypub\Transformer\Post;
use DateTime;
/** /**
* Base transformer for WordPress event post types to ActivityPub events. * Base transformer for WordPress event post types to ActivityPub events.

View file

@ -8,18 +8,18 @@
namespace Activitypub_Event_Extensions\Activitypub\Transformer; namespace Activitypub_Event_Extensions\Activitypub\Transformer;
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
use Activitypub\Activity\Extended_Object\Event;
use Activitypub\Activity\Extended_Object\Place;
use Activitypub_Event_Extensions\Activitypub\Transformer\Event as Event_Transformer; use Activitypub_Event_Extensions\Activitypub\Transformer\Event as Event_Transformer;
use DateTime; use DateTime;
use DateTimeZone; use DateTimeZone;
use EM_Event; use EM_Event;
use Activitypub\Activity\Extended_Object\Event;
use Activitypub\Activity\Extended_Object\Place;
use function Activitypub\esc_hashtag; use function Activitypub\esc_hashtag;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/** /**
* ActivityPub Transformer for events from the WordPress plugin 'Events Manager' * ActivityPub Transformer for events from the WordPress plugin 'Events Manager'
* *

View file

@ -8,15 +8,18 @@
namespace Activitypub_Event_Extensions\Activitypub\Transformer; namespace Activitypub_Event_Extensions\Activitypub\Transformer;
// Exit if accessed directly. use Activitypub_Event_Extensions\Activitypub\Transformer\Event;
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore use Activitypub\Model\Blog;
use Activitypub\Activity\Extended_Object\Event as Event_Object; use Activitypub\Activity\Extended_Object\Event as Event_Object;
use Activitypub\Activity\Extended_Object\Place; use Activitypub\Activity\Extended_Object\Place;
use Activitypub\Model\Blog;
use Activitypub_Event_Extensions\Activitypub\Transformer\Event;
use GatherPress\Core\Event as GatherPress_Event; use GatherPress\Core\Event as GatherPress_Event;
use function Activitypub\get_rest_url_by_path;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/** /**
* ActivityPub Transformer for VS Event * ActivityPub Transformer for VS Event
* *

View file

@ -8,16 +8,16 @@
namespace Activitypub_Event_Extensions\Activitypub\Transformer; namespace Activitypub_Event_Extensions\Activitypub\Transformer;
// Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) {
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore exit; // Exit if accessed directly.
}
use Activitypub\Activity\Extended_Object\Event as Event_Object;
use Activitypub\Activity\Extended_Object\Place;
use Activitypub_Event_Extensions\Activitypub\Transformer\Event; use Activitypub_Event_Extensions\Activitypub\Transformer\Event;
use Activitypub\Activity\Extended_Object\Place;
use Activitypub\Activity\Extended_Object\Event as Event_Object;
use WP_Error;
use WP_Post; use WP_Post;
use function Activitypub\esc_hashtag;
/** /**
* ActivityPub Tribe Transformer * ActivityPub Tribe Transformer
* *
@ -47,27 +47,18 @@ final class The_Events_Calendar extends Event {
} }
/** /**
* Get the tags, including also the set categories from The Events Calendar. * Get tribe category of wp_post
* *
* @return ?array The array if tags, * @return string|null tribe category if it exists
*/ */
public function get_tag(): ?array { public function get_tribe_category() {
$tags = array(); $categories = tribe_get_event_cat_slugs( $this->wp_object->ID );
$category_ids = tribe_get_event_cat_ids();
if ( $category_ids ) {
foreach ( $category_ids as $category_id ) {
$term = \get_term( $category_id );
$tag = array(
'type' => 'Hashtag',
'href' => \esc_url( \get_term_link( $term ) ),
'name' => esc_hashtag( $term->name ),
);
$tags[] = $tag;
}
}
$tags[] = parent::get_tag();
return $tags; if ( count( $categories ) === 0 ) {
return null;
}
return $categories[0];
} }
/** /**
@ -95,15 +86,19 @@ final class The_Events_Calendar extends Event {
* @return string status of the event * @return string status of the event
*/ */
public function get_tribe_status() { public function get_tribe_status() {
if ( 'canceled' === $this->tribe_event->event_status ) { if ( 'canceled' === $this->tribe_event->event_status ) {
return 'CANCELLED'; return 'CANCELLED';
} }
if ( 'postponed' === $this->tribe_event->event_status ) { if ( 'postponed' === $this->tribe_event->event_status ) {
return 'CANCELLED'; // This will be reflected in the cancelled reason. return 'CANCELLED'; // This will be reflected in the cancelled reason.
} }
if ( '' === $this->tribe_event->event_status ) {
return 'CONFIRMED'; return 'CONFIRMED';
} }
return new WP_Error( 'invalid event_status value', __( 'invalid event_status', 'activitypub' ), array( 'status' => 404 ) );
}
/** /**
* Check if the comments are enabled for the current event. * Check if the comments are enabled for the current event.
@ -127,6 +122,7 @@ final class The_Events_Calendar extends Event {
* @return string The content. * @return string The content.
*/ */
protected function get_content() { protected function get_content() {
$content = parent::get_content(); $content = parent::get_content();
// /BeforeFirstRelease: // /BeforeFirstRelease:
// * remove link at the end of the content. // * remove link at the end of the content.
@ -143,7 +139,7 @@ final class The_Events_Calendar extends Event {
*/ */
public function get_location(): Place|null { public function get_location(): Place|null {
// Get short handle for the venues. // Get short handle for the venues.
$venues = $this->tribe_event->venues; $venues = $this->wp_object->venues;
// Get first venue. We currently only support a single venue. // Get first venue. We currently only support a single venue.
if ( $venues instanceof \Tribe\Events\Collections\Lazy_Post_Collection ) { if ( $venues instanceof \Tribe\Events\Collections\Lazy_Post_Collection ) {
@ -188,8 +184,6 @@ final class The_Events_Calendar extends Event {
$location = new Place(); $location = new Place();
if ( count( $address ) > 1 ) { if ( count( $address ) > 1 ) {
$location->set_address( $address ); $location->set_address( $address );
} else {
$location->set_address( $venue->post_title );
} }
$location->set_id( $venue->permalink ); $location->set_id( $venue->permalink );
$location->set_name( $venue->post_title ); $location->set_name( $venue->post_title );

View file

@ -8,12 +8,13 @@
namespace Activitypub_Event_Extensions\Activitypub\Transformer; namespace Activitypub_Event_Extensions\Activitypub\Transformer;
// Exit if accessed directly. use Activitypub_Event_Extensions\Activitypub\Transformer\Event as Event_Transformer;
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
use Activitypub\Activity\Extended_Object\Event; use Activitypub\Activity\Extended_Object\Event;
use Activitypub\Activity\Extended_Object\Place; use Activitypub\Activity\Extended_Object\Place;
use Activitypub_Event_Extensions\Activitypub\Transformer\Event as Event_Transformer;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/** /**
* ActivityPub Transformer for VS Event. * ActivityPub Transformer for VS Event.

View file

@ -11,9 +11,6 @@
namespace Activitypub_Event_Extensions\Admin; namespace Activitypub_Event_Extensions\Admin;
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
use Activitypub_Event_Extensions\Plugins\Event_Plugin; use Activitypub_Event_Extensions\Plugins\Event_Plugin;
/** /**

View file

@ -11,9 +11,6 @@
namespace Activitypub_Event_Extensions\Admin; namespace Activitypub_Event_Extensions\Admin;
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
/** /**
* Class responsible for general admin notices. * Class responsible for general admin notices.
* *

View file

@ -11,12 +11,12 @@
namespace Activitypub_Event_Extensions\Admin; namespace Activitypub_Event_Extensions\Admin;
use Activitypub_Event_Extensions\Setup;
use Activitypub_Event_Extensions\Plugins\Event_Plugin;
// Exit if accessed directly. // Exit if accessed directly.
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
use Activitypub_Event_Extensions\Plugins\Event_Plugin;
use Activitypub_Event_Extensions\Setup;
/** /**
* Class responsible for the ActivityPub Event Extension related Settings. * Class responsible for the ActivityPub Event Extension related Settings.
* *

View file

@ -11,11 +11,11 @@
namespace Activitypub_Event_Extensions; namespace Activitypub_Event_Extensions;
use Activitypub\Activity\Extended_Object\Event;
// Exit if accessed directly. // Exit if accessed directly.
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
use Activitypub\Activity\Extended_Object\Event;
/** /**
* Class responsible for the ActivityPui Event Extension related Settings. * Class responsible for the ActivityPui Event Extension related Settings.
* *

View file

@ -12,14 +12,14 @@
namespace Activitypub_Event_Extensions; namespace Activitypub_Event_Extensions;
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
use Activitypub_Event_Extensions\Admin\Event_Plugin_Admin_Notices; use Activitypub_Event_Extensions\Admin\Event_Plugin_Admin_Notices;
use Activitypub_Event_Extensions\Admin\General_Admin_Notices; use Activitypub_Event_Extensions\Admin\General_Admin_Notices;
use Activitypub_Event_Extensions\Admin\Settings_Page; use Activitypub_Event_Extensions\Admin\Settings_Page;
use Activitypub_Event_Extensions\Plugins\Event_Plugin; use Activitypub_Event_Extensions\Plugins\Event_Plugin;
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
require_once ABSPATH . 'wp-admin/includes/plugin.php'; require_once ABSPATH . 'wp-admin/includes/plugin.php';
/** /**

View file

@ -1,82 +1,53 @@
=== ActivityPub Event Extensions === === ActivityPub Event Extensions ===
Contributors: andremenrath Contributors: menrath
Tags: events, fediverse, activitypub, activitystreams, calendar Tags: events, fediverse, activitypub, activitystreams
Requires at least: 6.5 Requires at least: 5.5
Tested up to: 6.6 Tested up to: 6.4
Stable tag: 0.1.0 Stable tag: 1.0.0
Requires PHP: 8.1 Requires PHP: 7.4
License: AGPL-3.0-or-later License: AGPL-3.0-or-later
License URI: https://www.gnu.org/licenses/agpl-3.0.html License URI: https://www.gnu.org/licenses/agpl-3.0.html
Integrating popular event plugins with the ActivityPub plugin.
The ActivityPub Event Extensions
== Description == == Description ==
Make your events more discoverable, expand your reach effortlessly while being independent of other (commercial) platforms, and part of the growing decentralized web. With this event others can automatically aggregate and display events published on your website!
With the ActivityPub Event Extensions Plugin for WordPress, your events can be automatically aggregated and displayed across decentralized platforms like [Mastodon](https://joinmastodon.org) or [Gancio](https://gancio.org), without any extra work. Additionally, people who do not want to miss on of your events will not have to follow a social-media account of yours that you maintain on the website of another party (and thereby you push the people to use these platforms), but could just follow your website directly.
Forget the hassle of managing multiple social media accounts just to keep your audience informed. Following like in social media, including all features you know like boosting, liking or commenting.
And the best: as you already publish events on your website, this means no extra work for you.
This plugin is not an event managing plugin but an add-on to popular event plugins. It extends their functionality to fully support the [ActivityPub plugin](https://wordpress.org/plugins/activitypub/). In the long term it actually might lead to less work and you help to provide a momentum to become independent of commercial platforms like Facebook and co.
With the ActivityPub plugin people can follow your website directly and engage with your events just as they would on social media - liking, boosting and even commenting if you enable it. For more details read our detailed project description.
You retain full ownership of your content. By integrating into your existing setup, it ensures no extra work is needed while enhancing your events' visibility across the Fediverse.
= How It Works =
With the Event Federation Plugin for WordPress, sharing your events is effortless and automatic!
Once you create an event on your WordPress site, it is seamlessly shared across the decentralized web using the ActivityPub protocol.
![](./.wordpress-org/event-activitypub-publishing.gif)
Your events can be automatically delivered to platforms that fully support events, such as [Mobilizon](https://joinmobilizon.org/), [Gancio](https://gancio.org), [Friendica](https://friendi.ca), [Hubzilla](https://hubzilla.org), and [Pleroma](https://pleroma.social/).
These platforms create public event calendars by pulling in events from various sources, including your website. Any updates you make to your events are synced across these platforms—so you only need to manage your events on your own site, with no extra work required.
![](./.wordpress-org/decentralized-event-calenders.gif)
== Installation == == Installation ==
This plugin depends on the [ActivityPub plugin](https://wordpress.org/plugins/activitypub/). Additionally, you need to use one of the supported Event Plugins. This plugin depends on the ActivityPub plugin. Furthermore you need to use one of the supported Event Plugins. See below.
= Supported Event Plugins = == Supported Event Plugins ==
* [The Events Calendar](https://de.wordpress.org/plugins/the-events-calendar/) * [The Events Calendar](https://de.wordpress.org/plugins/the-events-calendar/)
* [VS Event List](https://de.wordpress.org/plugins/very-simple-event-list/) * [VS Event List](https://de.wordpress.org/plugins/very-simple-event-list/)
* [Events Manager](https://de.wordpress.org/plugins/events-manager/) * [Events Manager](https://de.wordpress.org/plugins/events-manager/)
* [GatherPress](https://github.com/GatherPress/gatherpress)
== Configuration == == Configuration ==
If youre new to the [ActivityPub plugin](https://wordpress.org/plugins/activitypub/), its recommended to spend a few minutes reading through its documentation to familiarize yourself with its setup and functionality. At first be sure to spend some minutes reading the Documentation of the ActivityPub plugin](https://wordpress.org/plugins/activitypub/), in case you have not used it before.
TODO
== Frequently Asked Questions == == Frequently Asked Questions ==
= Do I need to install another event plugin to use the Event Federation Plugin? =
Yes, this plugin works as an add-on and requires both the ActivityPub plugin a supported event plugin such as The Events Calendar, VS Event List, or Events Manager to manage your events.
= What platforms can follow my events? =
Your events can be followed on platforms that support ActivityPub like [Mobilizon](https://joinmobilizon.org/), [Gancio](https://gancio.org), [Friendica](https://friendi.ca), [Hubzilla](https://hubzilla.org), and [Pleroma](https://pleroma.social/). Even other applications like [Mastodon](https://joinmastodon.org), which dont fully support events yet, will display a all important information about the events.
= How much extra work is required to maintain my events across the decentralized Web? =
None! Once the plugin is set up, your events are automatically sent to all connected platforms or account that follow you (your Website). Any updates you make to your events are synced without additional effort.
= Can I still use social media to promote my events? =
Yes, you can still use traditional social media if you wish. However, this plugin helps reduce reliance on commercial platforms by connecting your events to the decentralized Fediverse.
= Will this plugin work if I don't use the ActivityPub plugin? =
No, the Event Federation Plugin depends on the [ActivityPub plugin](https://wordpress.org/plugins/activitypub/) to deliver your events across decentralized platforms, so it's essential to have it installed and configured.
= My event plugin is not supported, what can I do? = = My event plugin is not supported, what can I do? =
If you know about coding have a look at the documentation of how to add your plugin or open an [issue](https://code.event-federation.eu/Event-Federation/wordpress-activitypub-event-extensions/issues), if we can spare some free hours we might add it. If you know about coding have a look at the documentation of how to add your plugin or open an [issue](https://code.event-federation.eu/Event-Federation/wordpress-activitypub-event-extensions/issues), if we can spare some free hours we might add it.
= What if I experience problems? = = What if I experience problems? =
We're always interested in your feedback. Feel free to reach out to us via [E-Mail](https://event-federation.eu/contact/) or create an [issue](https://code.event-federation.eu/Event-Federation/wordpress-activitypub-event-extensions/issues). We're always interested in your feedback. Feel free to reach out to us via E-Mail or create an [issue](https://code.event-federation.eu/Event-Federation/wordpress-activitypub-event-extensions/issues).
== Changelog == == Changelog ==
= [0.1.0] 2024-09-01 = = [1.0.0] 2024-09-01 =
* Initial alpha release on WordPress.org * Initial release