diff --git a/.forgejo/workflows/phpunit.yml b/.forgejo/workflows/phpunit.yml index a576ee2..5bdae8d 100644 --- a/.forgejo/workflows/phpunit.yml +++ b/.forgejo/workflows/phpunit.yml @@ -75,21 +75,21 @@ jobs: run: bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1 6.6 false true true true - name: Run Integration tests for The Events Calendar - run: cd /workspace/Event-Federation/wordpress-activitypub-event-extensions/ && ./vendor/bin/phpunit --filter=the_events_calendar + run: cd /workspace/Event-Federation/wordpress-activitypub-event-bridge/ && ./vendor/bin/phpunit --filter=the_events_calendar env: PHP_VERSION: ${{ matrix.php-version }} - name: Run Integration tests for VS Event List - run: cd /workspace/Event-Federation/wordpress-activitypub-event-extensions/ && ./vendor/bin/phpunit --filter=vs_event_list + run: cd /workspace/Event-Federation/wordpress-activitypub-event-bridge/ && ./vendor/bin/phpunit --filter=vs_event_list env: PHP_VERSION: ${{ matrix.php-version }} - name: Run Integration tests for GatherPress - run: cd /workspace/Event-Federation/wordpress-activitypub-event-extensions/ && ./vendor/bin/phpunit --filter=gatherpress + run: cd /workspace/Event-Federation/wordpress-activitypub-event-bridge/ && ./vendor/bin/phpunit --filter=gatherpress env: PHP_VERSION: ${{ matrix.php-version }} - name: Run Integration tests for Events Manager - run: cd /workspace/Event-Federation/wordpress-activitypub-event-extensions/ && ./vendor/bin/phpunit --filter=events_manager + run: cd /workspace/Event-Federation/wordpress-activitypub-event-bridge/ && ./vendor/bin/phpunit --filter=events_manager env: PHP_VERSION: ${{ matrix.php-version }} \ No newline at end of file diff --git a/README.md b/README.md index e265a64..e6223b7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ActivityPub Event Extensions +# ActivityPub Event Bridge Contributors: andremenrath Tags: events, fediverse, activitypub,, calendar @@ -15,17 +15,17 @@ Integrating popular event plugins with the ActivityPub plugin. ## 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 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. +Make your events more discoverable, expand your reach effortlessly while being independent of other (commercial) platforms, and be a part of the growing decentralized web (the Fediverse). +With the ActivityPub Event Bridge plugin for WordPress, your events can be automatically followed, 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. +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 web. ### How It Works -With the Event Federation Plugin for WordPress, sharing your events is effortless and automatic! +With the ActivityPub Event Bridge WordPress plugin, 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.

@@ -40,13 +40,13 @@ These platforms create public event calendars by pulling in events from various

Even platforms that don’t 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. +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. +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 +### Supported Event plugins * [The Events Calendar](https://de.wordpress.org/plugins/the-events-calendar/) * [VS Event List](https://de.wordpress.org/plugins/very-simple-event-list/) @@ -58,12 +58,12 @@ If you’re new to the [ActivityPub plugin](https://wordpress.org/plugins/activi ## Frequently Asked Questions -### Do I need to install another event plugin to use the Event Federation Plugin? +### 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 don’t fully support events yet, will display a all important information about the 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 don’t fully support events yet, will display all important information about the events. ### How much extra work is required to maintain my events across the decentralized Web? @@ -75,15 +75,15 @@ Yes, you can still use traditional social media if you wish. However, this plugi ### 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. +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. +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-bridge/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). +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-bridge/issues). ## Changelog diff --git a/activitypub-event-bridge.php b/activitypub-event-bridge.php new file mode 100644 index 0000000..db072a2 --- /dev/null +++ b/activitypub-event-bridge.php @@ -0,0 +1,72 @@ += 3.2.2. ActivityPub plugin tested up to: 3.2.2. + * + * @package ActivityPub_Event_Bridge + * @license AGPL-3.0-or-later + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore + +define( 'ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); +define( 'ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); +define( 'ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_FILE', plugin_dir_path( __FILE__ ) . '/' . basename( __FILE__ ) ); +define( 'ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); +define( 'ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_VERSION', current( get_file_data( __FILE__, array( 'Version' ), 'plugin' ) ) ); +define( 'ACTIVITYPUB_EVENT_BRIDGE_DOMAIN', 'activitypub-event-bridge' ); +define( 'ACTIVITYPUB_EVENT_BRIDGE_ACTIVITYPUB_PLUGIN_MIN_VERSION', '3.2.2' ); + +// Include and register the autoloader class for automatic loading of plugin classes. +require_once ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_DIR . '/includes/class-autoloader.php'; +ActivityPub_Event_Bridge\Autoloader::register(); + +// Initialize the plugin. +ActivityPub_Event_Bridge\Setup::get_instance(); + +// BeforeFirstRelease: Remove everything after this after here. + +/** + * Add a filter for http_request_host_is_external + * + * BeforeFirstRelease: Remove this for release. + */ +add_filter( 'http_request_host_is_external', 'activitypub_event_bridge_custom_http_request_host_is_external', 10, 3 ); + +/** + * Add a filter for http_request_host_is_external + * + * BeforeFirstRelease: Remove this for release. + * + * @param bool $is_external Whether the request is external. + */ +function activitypub_event_bridge_custom_http_request_host_is_external( $is_external ) { + $is_external = true; + + return $is_external; +} + +/** + * Don't verify ssl certs for testing. + * + * BeforeFirstRelease: Remove this for release. + */ +add_filter( 'https_ssl_verify', 'activitypub_event_bridge_dont_verify_local_dev_https', 10, 3 ); + +/** + * BeforeFirstRelease: remove it. + */ +function activitypub_event_bridge_dont_verify_local_dev_https() { + return false; +} diff --git a/activitypub-event-extensions.php b/activitypub-event-extensions.php deleted file mode 100644 index da80a3b..0000000 --- a/activitypub-event-extensions.php +++ /dev/null @@ -1,72 +0,0 @@ -= 3.2.2. ActivityPub plugin tested up to: 3.2.2. - * - * @package Activitypub_Event_Extensions - * @license AGPL-3.0-or-later - */ - -// Exit if accessed directly. -defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore - -define( 'ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); -define( 'ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); -define( 'ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_FILE', plugin_dir_path( __FILE__ ) . '/' . basename( __FILE__ ) ); -define( 'ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); -define( 'ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_VERSION', current( get_file_data( __FILE__, array( 'Version' ), 'plugin' ) ) ); -define( 'ACTIVITYPUB_EVENT_EXTENSIONS_DOMAIN', 'activitypub-event-extensions' ); -define( 'ACTIVITYPUB_EVENT_EXTENSIONS_ACTIVITYPUB_PLUGIN_MIN_VERSION', '3.2.2' ); - -// Include and register the autoloader class for automatic loading of plugin classes. -require_once ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_DIR . '/includes/class-autoloader.php'; -Activitypub_Event_Extensions\Autoloader::register(); - -// Initialize the plugin. -Activitypub_Event_Extensions\Setup::get_instance(); - -// BeforeFirstRelease: Remove everything after this after here. - -/** - * Add a filter for http_request_host_is_external - * - * BeforeFirstRelease: Remove this for release. - */ -add_filter( 'http_request_host_is_external', 'activitypub_event_extensions_custom_http_request_host_is_external', 10, 3 ); - -/** - * Add a filter for http_request_host_is_external - * - * BeforeFirstRelease: Remove this for release. - * - * @param bool $is_external Whether the request is external. - */ -function activitypub_event_extensions_custom_http_request_host_is_external( $is_external ) { - $is_external = true; - - return $is_external; -} - -/** - * Don't verify ssl certs for testing. - * - * BeforeFirstRelease: Remove this for release. - */ -add_filter( 'https_ssl_verify', 'activitypub_event_extensions_dont_verify_local_dev_https', 10, 3 ); - -/** - * BeforeFirstRelease: remove it. - */ -function activitypub_event_extensions_dont_verify_local_dev_https() { - return false; -} diff --git a/assets/css/activitypub-event-extensions-admin.css b/assets/css/activitypub-event-extensions-admin.css index c43ea1d..c59d1a1 100644 --- a/assets/css/activitypub-event-extensions-admin.css +++ b/assets/css/activitypub-event-extensions-admin.css @@ -1,4 +1,4 @@ -.activitypub-event-extensions-settings-page .box { +.activitypub-event-bridge-settings-page .box { border: 1px solid #c3c4c7; background-color: #fff; padding: 1em 1.5em; diff --git a/composer.json b/composer.json index 28fb046..44b5406 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { - "name": "menrath/wordpress-activitypub-event-extensions", - "description": "The ActivityPub Event Extensions help for event custom post types to federate properly.", + "name": "menrath/wordpress-activitypub-event-bridge", + "description": "The ActivityPub Event Bridge help for event custom post types to federate properly.", "type": "wordpress-plugin", "require": { "php": ">=8.1.0", @@ -32,7 +32,7 @@ } ], "extra": { - "installer-name": "activitypub-event-extensions" + "installer-name": "activitypub-event-bridge" }, "scripts": { "lint": [ diff --git a/docker-compose.yml b/docker-compose.yml index 78aacdd..dc71501 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,7 +13,7 @@ version: '3' # "request": "launch", # "port": 9003, # "pathMappings": { -# "/app/": "${workspaceRoot}/wp-content/plugins/activitypub-event-extensions/", +# "/app/": "${workspaceRoot}/wp-content/plugins/activitypub-event-bridge/", # "/tmp/wordpress/": "${workspaceRoot}/" # }, # }, diff --git a/docs/add_your_event_plugin.md b/docs/add_your_event_plugin.md index 1ec0b16..a7c8883 100644 --- a/docs/add_your_event_plugin.md +++ b/docs/add_your_event_plugin.md @@ -29,7 +29,7 @@ The Plugin takes care of applying the transformer, so you can jump right into im If you are writing a transformer for a custom post type it is recommended to start by extending the provided [event transformer](./includes/activitypub/transformer/class-event.php). It is an extension of the default generic post transformer and inherits useful default implementations for generating the [attachments](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-attachment), rendering a proper [content](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-content) in HTML from either blocks or the classic editor, extracting [tags](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-tag) and more. ```php -namespace Activitypub_Event_Extensions\Activitypub\Transformer; +namespace ActivityPub_Event_Bridge\Activitypub\Transformer; /** * ActivityPub Transformer for my_event_post_type. diff --git a/includes/activitypub/transformer/class-event.php b/includes/activitypub/transformer/class-event.php index a2e1056..1730950 100644 --- a/includes/activitypub/transformer/class-event.php +++ b/includes/activitypub/transformer/class-event.php @@ -2,11 +2,11 @@ /** * Replace the default ActivityPub Transformer * - * @package Activitypub_Event_Extensions + * @package ActivityPub_Event_Bridge * @license AGPL-3.0-or-later */ -namespace Activitypub_Event_Extensions\Activitypub\Transformer; +namespace ActivityPub_Event_Bridge\Activitypub\Transformer; // Exit if accessed directly. defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore @@ -118,7 +118,7 @@ abstract class Event extends Post { if ( is_null( $this->wp_taxonomy ) ) { return null; } - $current_category_mapping = \get_option( 'activitypub_event_extensions_event_category_mappings', array() ); + $current_category_mapping = \get_option( 'activitypub_event_bridge_event_category_mappings', array() ); $terms = \get_the_terms( $this->wp_object, $this->wp_taxonomy ); // Check if the event has a category set and if that category has a specific mapping return that one. @@ -126,7 +126,7 @@ abstract class Event extends Post { return sanitize_text_field( $current_category_mapping[ $terms[0]->slug ] ); } else { // Return the default event category. - return sanitize_text_field( \get_option( 'activitypub_event_extensions_default_event_category', 'MEETING' ) ); + return sanitize_text_field( \get_option( 'activitypub_event_bridge_default_event_category', 'MEETING' ) ); } } @@ -228,10 +228,10 @@ abstract class Event extends Post { $categories = array(); // Add the federated category string. - require_once ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_DIR . '/includes/event-categories.php'; + require_once ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_DIR . '/includes/event-categories.php'; $federated_category = $this->get_category(); - if ( array_key_exists( $federated_category, ACTIVITYPUB_EVENT_EXTENSIONS_EVENT_CATEGORIES ) ) { - $categories[] = ACTIVITYPUB_EVENT_EXTENSIONS_EVENT_CATEGORIES[ $federated_category ]; + if ( array_key_exists( $federated_category, ACTIVITYPUB_EVENT_BRIDGE_EVENT_CATEGORIES ) ) { + $categories[] = ACTIVITYPUB_EVENT_BRIDGE_EVENT_CATEGORIES[ $federated_category ]; } // Add all category terms. @@ -273,19 +273,19 @@ abstract class Event extends Post { $formatted_items = array(); if ( ! empty( $category ) ) { - $formatted_items[] = '🏷️ ' . __( 'Category', 'activitypub-event-extensions' ) . ': ' . $category; + $formatted_items[] = '🏷️ ' . __( 'Category', 'activitypub-event-bridge' ) . ': ' . $category; } if ( ! empty( $start_time ) ) { - $formatted_items[] = '🗓️ ' . __( 'Start', 'activitypub-event-extensions' ) . ': ' . $start_time; + $formatted_items[] = '🗓️ ' . __( 'Start', 'activitypub-event-bridge' ) . ': ' . $start_time; } if ( ! empty( $end_time ) ) { - $formatted_items[] = '⏳ ' . __( 'End', 'activitypub-event-extensions' ) . ': ' . $end_time; + $formatted_items[] = '⏳ ' . __( 'End', 'activitypub-event-bridge' ) . ': ' . $end_time; } if ( ! empty( $address ) ) { - $formatted_items[] = '📍 ' . __( 'Address', 'activitypub-event-extensions' ) . ': ' . $address; + $formatted_items[] = '📍 ' . __( 'Address', 'activitypub-event-bridge' ) . ': ' . $address; } // Compose the summary based on the number of meta items. diff --git a/includes/activitypub/transformer/class-events-manager.php b/includes/activitypub/transformer/class-events-manager.php index a760d2e..3acf6aa 100644 --- a/includes/activitypub/transformer/class-events-manager.php +++ b/includes/activitypub/transformer/class-events-manager.php @@ -2,18 +2,18 @@ /** * ActivityPub Transformer for the plugin Very Simple Event List. * - * @package Activitypub_Event_Extensions + * @package ActivityPub_Event_Bridge * @license AGPL-3.0-or-later */ -namespace Activitypub_Event_Extensions\Activitypub\Transformer; +namespace ActivityPub_Event_Bridge\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_Bridge\Activitypub\Transformer\Event as Event_Transformer; use DateTime; use DateTimeZone; use EM_Event; diff --git a/includes/activitypub/transformer/class-gatherpress.php b/includes/activitypub/transformer/class-gatherpress.php index bfe1e92..e3ec013 100644 --- a/includes/activitypub/transformer/class-gatherpress.php +++ b/includes/activitypub/transformer/class-gatherpress.php @@ -2,11 +2,11 @@ /** * ActivityPub Transformer for the plugin Very Simple Event List. * - * @package Activitypub_Event_Extensions + * @package ActivityPub_Event_Bridge * @license AGPL-3.0-or-later */ -namespace Activitypub_Event_Extensions\Activitypub\Transformer; +namespace ActivityPub_Event_Bridge\Activitypub\Transformer; // Exit if accessed directly. defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore @@ -14,7 +14,7 @@ defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore use Activitypub\Activity\Extended_Object\Event as Event_Object; use Activitypub\Activity\Extended_Object\Place; use Activitypub\Model\Blog; -use Activitypub_Event_Extensions\Activitypub\Transformer\Event; +use ActivityPub_Event_Bridge\Activitypub\Transformer\Event; use GatherPress\Core\Event as GatherPress_Event; /** diff --git a/includes/activitypub/transformer/class-the-events-calendar.php b/includes/activitypub/transformer/class-the-events-calendar.php index b83cd40..d6eb7fa 100644 --- a/includes/activitypub/transformer/class-the-events-calendar.php +++ b/includes/activitypub/transformer/class-the-events-calendar.php @@ -2,18 +2,18 @@ /** * ActivityPub Tribe Transformer * - * @package Activitypub_Event_Extensions + * @package ActivityPub_Event_Bridge * @license AGPL-3.0-or-later */ -namespace Activitypub_Event_Extensions\Activitypub\Transformer; +namespace ActivityPub_Event_Bridge\Activitypub\Transformer; // Exit if accessed directly. defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore 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_Bridge\Activitypub\Transformer\Event; use WP_Post; use function Activitypub\esc_hashtag; diff --git a/includes/activitypub/transformer/class-vs-event-list.php b/includes/activitypub/transformer/class-vs-event-list.php index dc0ae7b..35d33a2 100644 --- a/includes/activitypub/transformer/class-vs-event-list.php +++ b/includes/activitypub/transformer/class-vs-event-list.php @@ -2,18 +2,18 @@ /** * ActivityPub Transformer for the plugin Very Simple Event List. * - * @package Activitypub_Event_Extensions + * @package ActivityPub_Event_Bridge * @license AGPL-3.0-or-later */ -namespace Activitypub_Event_Extensions\Activitypub\Transformer; +namespace ActivityPub_Event_Bridge\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_Bridge\Activitypub\Transformer\Event as Event_Transformer; /** * ActivityPub Transformer for VS Event. diff --git a/includes/admin/class-event-plugin-admin-notices.php b/includes/admin/class-event-plugin-admin-notices.php index 2f9459c..73ed33c 100644 --- a/includes/admin/class-event-plugin-admin-notices.php +++ b/includes/admin/class-event-plugin-admin-notices.php @@ -4,17 +4,17 @@ * * Notices for guiding to proper configuration of ActivityPub with event plugins. * - * @package Activitypub_Event_Extensions + * @package ActivityPub_Event_Bridge * @since 1.0.0 * @license AGPL-3.0-or-later */ -namespace Activitypub_Event_Extensions\Admin; +namespace ActivityPub_Event_Bridge\Admin; // Exit if accessed directly. defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore -use Activitypub_Event_Extensions\Plugins\Event_Plugin; +use ActivityPub_Event_Bridge\Plugins\Event_Plugin; /** * Class responsible for Event Plugin related admin notices. @@ -76,7 +76,7 @@ class Event_Plugin_Admin_Notices { _x( 'You have installed the %1$s plugin, but the event post type of the plugin %2$s is not enabled in the %1$s settings.', 'admin notice', - 'activitypub-event-extensions' + 'activitypub-event-bridge' ), esc_html( $activitypub_plugin_data['Name'] ), esc_html( $event_plugin_data['Name'] ), diff --git a/includes/admin/class-general-admin-notices.php b/includes/admin/class-general-admin-notices.php index 5a26fb5..43cb4f3 100644 --- a/includes/admin/class-general-admin-notices.php +++ b/includes/admin/class-general-admin-notices.php @@ -4,12 +4,12 @@ * * Notices for guiding to proper configuration of this plugin. * - * @package Activitypub_Event_Extensions + * @package ActivityPub_Event_Bridge * @since 1.0.0 * @license AGPL-3.0-or-later */ -namespace Activitypub_Event_Extensions\Admin; +namespace ActivityPub_Event_Bridge\Admin; // Exit if accessed directly. defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore @@ -29,7 +29,7 @@ class General_Admin_Notices { */ const ACTIVITYPUB_PLUGIN_URL = 'https://wordpress.org/plugins/activitypub'; - const ACTIVITYPUB_EVENT_EXTENSIONS_SUPPORTED_EVENT_PLUGINS_URL = 'https://code.event-federation.eu/Event-Federation/wordpress-activitypub-event-extensions#events-plugin-that-will-be-supported-at-first'; + const ACTIVITYPUB_EVENT_BRIDGE_SUPPORTED_EVENT_PLUGINS_URL = 'https://code.event-federation.eu/Event-Federation/wordpress-activitypub-event-bridge#events-plugin-that-will-be-supported-at-first'; /** * Allowed HTML for admin notices. @@ -54,9 +54,9 @@ class General_Admin_Notices { return sprintf( /* translators: 1: An URL that points to the ActivityPub plugin. */ _x( - 'For the ActivityPub Event Extensions to work, you will need to install and activate the ActivityPub plugin.', + 'For the ActivityPub Event Bridge to work, you will need to install and activate the ActivityPub plugin.', 'admin notice', - 'activitypub-event-extensions' + 'activitypub-event-bridge' ), esc_html( self::ACTIVITYPUB_PLUGIN_URL ) ); @@ -71,12 +71,12 @@ class General_Admin_Notices { return sprintf( /* translators: 1: The name of the ActivityPub plugin. 2: The minimum required version number of the ActivityPub plugin. */ _x( - 'Please upgrade your ActivityPub plugin. At least version %2$s is required for the ActivityPub event extensions to work.', + 'Please upgrade your ActivityPub plugin. At least version %2$s is required for the ActivityPub Event Bridge to work.', 'admin notice', - 'activitypub-event-extensions' + 'activitypub-event-bridge' ), esc_html( self::ACTIVITYPUB_PLUGIN_URL ), - esc_html( ACTIVITYPUB_EVENT_EXTENSIONS_ACTIVITYPUB_PLUGIN_MIN_VERSION ) + esc_html( ACTIVITYPUB_EVENT_BRIDGE_ACTIVITYPUB_PLUGIN_MIN_VERSION ) ); } @@ -89,12 +89,12 @@ class General_Admin_Notices { return sprintf( /* translators: 1: An URL to the list of supported event plugins. */ _x( - 'The Plugin ActivityPub Event Extensions is of no use, because you do not have installed and activated a supported Event Plugin. + 'The Plugin ActivityPub Event Bridge is of no use, because you do not have installed and activated a supported Event Plugin.
For a list of supported Event Plugins see here.', 'admin notice', - 'activitypub-event-extensions' + 'activitypub-event-bridge' ), - esc_html( self::ACTIVITYPUB_EVENT_EXTENSIONS_SUPPORTED_EVENT_PLUGINS_URL ) + esc_html( self::ACTIVITYPUB_EVENT_BRIDGE_SUPPORTED_EVENT_PLUGINS_URL ) ); } diff --git a/includes/admin/class-settings-page.php b/includes/admin/class-settings-page.php index 27735b1..08a36d6 100644 --- a/includes/admin/class-settings-page.php +++ b/includes/admin/class-settings-page.php @@ -5,17 +5,17 @@ * This file contains the General class definition, which handles the "General" settings * page for the ActivityPub Event Extension Plugin, providing options for configuring various general settings. * - * @package Activitypub_Event_Extensions + * @package ActivityPub_Event_Bridge * @since 1.0.0 */ -namespace Activitypub_Event_Extensions\Admin; +namespace ActivityPub_Event_Bridge\Admin; // Exit if accessed directly. defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore -use Activitypub_Event_Extensions\Plugins\Event_Plugin; -use Activitypub_Event_Extensions\Setup; +use ActivityPub_Event_Bridge\Plugins\Event_Plugin; +use ActivityPub_Event_Bridge\Setup; /** * Class responsible for the ActivityPub Event Extension related Settings. @@ -26,9 +26,9 @@ use Activitypub_Event_Extensions\Setup; * @since 1.0.0 */ class Settings_Page { - const STATIC = 'Activitypub_Event_Extensions\Admin\Settings_Page'; + const STATIC = 'ActivityPub_Event_Bridge\Admin\Settings_Page'; - const SETTINGS_SLUG = 'activitypub-event-extensions'; + const SETTINGS_SLUG = 'activitypub-event-bridge'; /** * Warning if the plugin is Active and the ActivityPub plugin is not. * @@ -37,7 +37,7 @@ class Settings_Page { public static function admin_menu(): void { \add_options_page( 'Activitypub Event Extension', - __( 'ActivityPub Events', 'activitypub-event-extensions' ), + __( 'ActivityPub Events', 'activitypub-event-bridge' ), 'manage_options', self::SETTINGS_SLUG, array( self::STATIC, 'settings_page' ) @@ -104,6 +104,6 @@ class Settings_Page { 'event_terms' => $event_terms, ); - \load_template( ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_DIR . 'templates/settings.php', true, $args ); + \load_template( ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_DIR . 'templates/settings.php', true, $args ); } } diff --git a/includes/class-autoloader.php b/includes/class-autoloader.php index d23adf2..e0315d8 100644 --- a/includes/class-autoloader.php +++ b/includes/class-autoloader.php @@ -1,17 +1,17 @@ 'string', 'description' => \__( 'Define your own custom post template', 'activitypub' ), @@ -52,8 +52,8 @@ class Settings { ); \register_setting( - 'activitypub-event-extensions', - 'activitypub_event_extensions_event_category_mappings', + 'activitypub-event-bridge', + 'activitypub_event_bridge_event_category_mappings', array( 'type' => 'array', 'description' => \__( 'Define your own custom post template', 'activitypub' ), diff --git a/includes/class-setup.php b/includes/class-setup.php index a02076c..39a4766 100644 --- a/includes/class-setup.php +++ b/includes/class-setup.php @@ -1,31 +1,31 @@ activitypub_plugin_is_active ) { - // deactivate_plugins( ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_FILE ); + // deactivate_plugins( ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_FILE ); // return; // }. $this->active_event_plugins = self::detect_active_event_plugins(); @@ -124,10 +124,10 @@ class Setup { * @var array */ private const EVENT_PLUGIN_CLASSES = array( - '\Activitypub_Event_Extensions\Plugins\Events_Manager', - '\Activitypub_Event_Extensions\Plugins\GatherPress', - '\Activitypub_Event_Extensions\Plugins\The_Events_Calendar', - '\Activitypub_Event_Extensions\Plugins\VS_Event_List', + '\ActivityPub_Event_Bridge\Plugins\Events_Manager', + '\ActivityPub_Event_Bridge\Plugins\GatherPress', + '\ActivityPub_Event_Bridge\Plugins\The_Events_Calendar', + '\ActivityPub_Event_Bridge\Plugins\VS_Event_List', ); /** @@ -160,7 +160,7 @@ class Setup { * @return void */ protected function setup_hooks(): void { - register_activation_hook( ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_FILE, array( $this, 'activate' ) ); + register_activation_hook( ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_FILE, array( $this, 'activate' ) ); add_action( 'admin_init', array( $this, 'do_admin_notices' ) ); add_action( 'admin_init', array( Settings::class, 'register_settings' ) ); @@ -175,12 +175,12 @@ class Setup { add_action( 'admin_menu', array( Settings_Page::class, 'admin_menu' ) ); add_filter( - 'plugin_action_links_' . ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_BASENAME, + 'plugin_action_links_' . ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_BASENAME, array( Settings_Page::class, 'settings_link' ) ); // Check if the minimum required version of the ActivityPub plugin is installed. - if ( ! version_compare( $this->activitypub_plugin_version, ACTIVITYPUB_EVENT_EXTENSIONS_ACTIVITYPUB_PLUGIN_MIN_VERSION ) ) { + if ( ! version_compare( $this->activitypub_plugin_version, ACTIVITYPUB_EVENT_BRIDGE_ACTIVITYPUB_PLUGIN_MIN_VERSION ) ) { return; } @@ -195,15 +195,15 @@ class Setup { * @return void */ public static function enqueue_styles( $hook_suffix ): void { - if ( false !== strpos( $hook_suffix, 'activitypub-event-extensions' ) ) { + if ( false !== strpos( $hook_suffix, 'activitypub-event-bridge' ) ) { wp_enqueue_style( - 'activitypub-event-extensions-admin-styles', + 'activitypub-event-bridge-admin-styles', plugins_url( - 'assets/css/activitypub-event-extensions-admin.css', - ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_FILE + 'assets/css/activitypub-event-bridge-admin.css', + ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_FILE ), array(), - ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_VERSION + ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_VERSION ); } } @@ -218,15 +218,15 @@ class Setup { // Check if any general admin notices are needed and add actions to insert the needed admin notices. if ( ! $this->activitypub_plugin_is_active ) { // The ActivityPub plugin is not active. - add_action( 'admin_notices', array( 'Activitypub_Event_Extensions\Admin\General_Admin_Notices', 'activitypub_plugin_not_enabled' ), 10, 1 ); + add_action( 'admin_notices', array( 'ActivityPub_Event_Bridge\Admin\General_Admin_Notices', 'activitypub_plugin_not_enabled' ), 10, 1 ); } - if ( ! version_compare( $this->activitypub_plugin_version, ACTIVITYPUB_EVENT_EXTENSIONS_ACTIVITYPUB_PLUGIN_MIN_VERSION ) ) { + if ( ! version_compare( $this->activitypub_plugin_version, ACTIVITYPUB_EVENT_BRIDGE_ACTIVITYPUB_PLUGIN_MIN_VERSION ) ) { // The ActivityPub plugin is too old. - add_action( 'admin_notices', array( 'Activitypub_Event_Extensions\Admin\General_Admin_Notices', 'activitypub_plugin_version_too_old' ), 10, 1 ); + add_action( 'admin_notices', array( 'ActivityPub_Event_Bridge\Admin\General_Admin_Notices', 'activitypub_plugin_version_too_old' ), 10, 1 ); } if ( empty( $this->active_event_plugins ) ) { // No supported Event Plugin is active. - add_action( 'admin_notices', array( 'Activitypub_Event_Extensions\Admin\General_Admin_Notices', 'no_supported_event_plugin_active' ), 10, 1 ); + add_action( 'admin_notices', array( 'ActivityPub_Event_Bridge\Admin\General_Admin_Notices', 'no_supported_event_plugin_active' ), 10, 1 ); } } @@ -279,9 +279,9 @@ class Setup { } /** - * Activates the ActivityPub Event Extensions plugin. + * Activates the ActivityPub Event Bridge plugin. * - * This method handles the activation of the ActivityPub Event Extensions plugin. + * This method handles the activation of the ActivityPub Event Bridge plugin. * * @since 1.0.0 * @@ -290,7 +290,7 @@ class Setup { public function activate(): void { // Don't allow plugin activation, when the ActivityPub plugin is not activated yet. if ( ! $this->activitypub_plugin_is_active ) { - deactivate_plugins( plugin_basename( ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_FILE ) ); + deactivate_plugins( plugin_basename( ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_FILE ) ); $notice = General_Admin_Notices::get_admin_notice_activitypub_plugin_not_enabled(); wp_die( wp_kses( $notice, General_Admin_Notices::ALLOWED_HTML ), @@ -300,7 +300,7 @@ class Setup { } if ( empty( $this->active_event_plugins ) ) { - deactivate_plugins( plugin_basename( ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_FILE ) ); + deactivate_plugins( plugin_basename( ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_FILE ) ); $notice = General_Admin_Notices::get_admin_notice_no_supported_event_plugin_active(); wp_die( wp_kses( $notice, General_Admin_Notices::ALLOWED_HTML ), diff --git a/includes/event-categories.php b/includes/event-categories.php index a867167..6350a52 100644 --- a/includes/event-categories.php +++ b/includes/event-categories.php @@ -2,46 +2,46 @@ /** * File responsible for defining the event category strings. * - * @package Activitypub_Event_Extensions + * @package ActivityPub_Event_Bridge * @since 1.0.0 * @license AGPL-3.0-or-later */ -namespace Activitypub_Event_Extensions; +namespace ActivityPub_Event_Bridge; define( - 'ACTIVITYPUB_EVENT_EXTENSIONS_EVENT_CATEGORIES', + 'ACTIVITYPUB_EVENT_BRIDGE_EVENT_CATEGORIES', array( - 'ARTS' => __( 'Arts', 'activitypub-event-extensions' ), - 'BOOK_CLUBS' => __( 'Book clubs', 'activitypub-event-extensions' ), - 'BUSINESS' => __( 'Business', 'activitypub-event-extensions' ), - 'CAUSES' => __( 'Causes', 'activitypub-event-extensions' ), - 'COMEDY' => __( 'Comedy', 'activitypub-event-extensions' ), - 'CRAFTS' => __( 'Crafts', 'activitypub-event-extensions' ), - 'FOOD_DRINK' => __( 'Food & Drink', 'activitypub-event-extensions' ), - 'HEALTH' => __( 'Health', 'activitypub-event-extensions' ), - 'MUSIC' => __( 'Music', 'activitypub-event-extensions' ), - 'AUTO_BOAT_AIR' => __( 'Auto, boat and air', 'activitypub-event-extensions' ), - 'COMMUNITY' => __( 'Community', 'activitypub-event-extensions' ), - 'FAMILY_EDUCATION' => __( 'Family & Education', 'activitypub-event-extensions' ), - 'FASHION_BEAUTY' => __( 'Fashion & Beauty', 'activitypub-event-extensions' ), - 'FILM_MEDIA' => __( 'Film & Media', 'activitypub-event-extensions' ), - 'GAMES' => __( 'Games', 'activitypub-event-extensions' ), - 'LANGUAGE_CULTURE' => __( 'Language & Culture', 'activitypub-event-extensions' ), - 'LEARNING' => __( 'Learning', 'activitypub-event-extensions' ), - 'LGBTQ' => __( 'LGBTQ', 'activitypub-event-extensions' ), - 'MOVEMENTS_POLITICS' => __( 'Movements and politics', 'activitypub-event-extensions' ), - 'NETWORKING' => __( 'Networking', 'activitypub-event-extensions' ), - 'PARTY' => __( 'Party', 'activitypub-event-extensions' ), - 'PERFORMING_VISUAL_ARTS' => __( 'Performing & Visual Arts', 'activitypub-event-extensions' ), - 'PETS' => __( 'Pets', 'activitypub-event-extensions' ), - 'PHOTOGRAPHY' => __( 'Photography', 'activitypub-event-extensions' ), - 'OUTDOORS_ADVENTURE' => __( 'Outdoors & Adventure', 'activitypub-event-extensions' ), - 'SPIRITUALITY_RELIGION_BELIEFS' => __( 'Spirituality, Religion & Beliefs', 'activitypub-event-extensions' ), - 'SCIENCE_TECH' => __( 'Science & Tech', 'activitypub-event-extensions' ), - 'SPORTS' => __( 'Sports', 'activitypub-event-extensions' ), - 'THEATRE' => __( 'Theatre', 'activitypub-event-extensions' ), - 'MEETING' => __( 'Meeting', 'activitypub-event-extensions' ), // Default value in federation. - 'DEFAULT' => __( 'Default', 'activitypub-event-extensions' ), // Internal default for overrides. + 'ARTS' => __( 'Arts', 'activitypub-event-bridge' ), + 'BOOK_CLUBS' => __( 'Book clubs', 'activitypub-event-bridge' ), + 'BUSINESS' => __( 'Business', 'activitypub-event-bridge' ), + 'CAUSES' => __( 'Causes', 'activitypub-event-bridge' ), + 'COMEDY' => __( 'Comedy', 'activitypub-event-bridge' ), + 'CRAFTS' => __( 'Crafts', 'activitypub-event-bridge' ), + 'FOOD_DRINK' => __( 'Food & Drink', 'activitypub-event-bridge' ), + 'HEALTH' => __( 'Health', 'activitypub-event-bridge' ), + 'MUSIC' => __( 'Music', 'activitypub-event-bridge' ), + 'AUTO_BOAT_AIR' => __( 'Auto, boat and air', 'activitypub-event-bridge' ), + 'COMMUNITY' => __( 'Community', 'activitypub-event-bridge' ), + 'FAMILY_EDUCATION' => __( 'Family & Education', 'activitypub-event-bridge' ), + 'FASHION_BEAUTY' => __( 'Fashion & Beauty', 'activitypub-event-bridge' ), + 'FILM_MEDIA' => __( 'Film & Media', 'activitypub-event-bridge' ), + 'GAMES' => __( 'Games', 'activitypub-event-bridge' ), + 'LANGUAGE_CULTURE' => __( 'Language & Culture', 'activitypub-event-bridge' ), + 'LEARNING' => __( 'Learning', 'activitypub-event-bridge' ), + 'LGBTQ' => __( 'LGBTQ', 'activitypub-event-bridge' ), + 'MOVEMENTS_POLITICS' => __( 'Movements and politics', 'activitypub-event-bridge' ), + 'NETWORKING' => __( 'Networking', 'activitypub-event-bridge' ), + 'PARTY' => __( 'Party', 'activitypub-event-bridge' ), + 'PERFORMING_VISUAL_ARTS' => __( 'Performing & Visual Arts', 'activitypub-event-bridge' ), + 'PETS' => __( 'Pets', 'activitypub-event-bridge' ), + 'PHOTOGRAPHY' => __( 'Photography', 'activitypub-event-bridge' ), + 'OUTDOORS_ADVENTURE' => __( 'Outdoors & Adventure', 'activitypub-event-bridge' ), + 'SPIRITUALITY_RELIGION_BELIEFS' => __( 'Spirituality, Religion & Beliefs', 'activitypub-event-bridge' ), + 'SCIENCE_TECH' => __( 'Science & Tech', 'activitypub-event-bridge' ), + 'SPORTS' => __( 'Sports', 'activitypub-event-bridge' ), + 'THEATRE' => __( 'Theatre', 'activitypub-event-bridge' ), + 'MEETING' => __( 'Meeting', 'activitypub-event-bridge' ), // Default value in federation. + 'DEFAULT' => __( 'Default', 'activitypub-event-bridge' ), // Internal default for overrides. ), ); diff --git a/includes/plugins/class-event-plugin.php b/includes/plugins/class-event-plugin.php index 47a66bf..f70cfa0 100644 --- a/includes/plugins/class-event-plugin.php +++ b/includes/plugins/class-event-plugin.php @@ -4,13 +4,13 @@ * * Basic information that each supported event needs for this plugin to work. * - * @package Activitypub_Event_Extensions + * @package ActivityPub_Event_Bridge * @since 1.0.0 */ -namespace Activitypub_Event_Extensions\Plugins; +namespace ActivityPub_Event_Bridge\Plugins; -use Activitypub_Event_Extensions\Activitypub\Transformer\Event as Event_Transformer; +use ActivityPub_Event_Bridge\Activitypub\Transformer\Event as Event_Transformer; // Exit if accessed directly. defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore diff --git a/includes/plugins/class-events-manager.php b/includes/plugins/class-events-manager.php index 319b2e8..feffcc5 100644 --- a/includes/plugins/class-events-manager.php +++ b/includes/plugins/class-events-manager.php @@ -5,11 +5,11 @@ * Defines all the necessary meta information for the Events Manager WordPress Plugin. * * @link https://wordpress.org/plugins/events-manager/ - * @package Activitypub_Event_Extensions + * @package ActivityPub_Event_Bridge * @since 1.0.0 */ -namespace Activitypub_Event_Extensions\Plugins; +namespace ActivityPub_Event_Bridge\Plugins; // Exit if accessed directly. defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore diff --git a/includes/plugins/class-gatherpress.php b/includes/plugins/class-gatherpress.php index 3575bbb..dead962 100644 --- a/includes/plugins/class-gatherpress.php +++ b/includes/plugins/class-gatherpress.php @@ -5,11 +5,11 @@ * Defines all the necessary meta information for the GatherPress plugin. * * @link https://wordpress.org/plugins/gatherpress/ - * @package Activitypub_Event_Extensions + * @package ActivityPub_Event_Bridge * @since 1.0.0 */ -namespace Activitypub_Event_Extensions\Plugins; +namespace ActivityPub_Event_Bridge\Plugins; // Exit if accessed directly. defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore diff --git a/includes/plugins/class-the-events-calendar.php b/includes/plugins/class-the-events-calendar.php index 6f18a5a..ef07590 100644 --- a/includes/plugins/class-the-events-calendar.php +++ b/includes/plugins/class-the-events-calendar.php @@ -5,11 +5,11 @@ * Defines all the necessary meta information for the events calendar. * * @link https://wordpress.org/plugins/the-events-calendar/ - * @package Activitypub_Event_Extensions + * @package ActivityPub_Event_Bridge * @since 1.0.0 */ -namespace Activitypub_Event_Extensions\Plugins; +namespace ActivityPub_Event_Bridge\Plugins; // Exit if accessed directly. defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore diff --git a/includes/plugins/class-vs-event-list.php b/includes/plugins/class-vs-event-list.php index cdcafab..0e1b0dc 100644 --- a/includes/plugins/class-vs-event-list.php +++ b/includes/plugins/class-vs-event-list.php @@ -6,13 +6,13 @@ * "Very Simple Events List". * * @link https://de.wordpress.org/plugins/very-simple-event-list/ - * @package Activitypub_Event_Extensions + * @package ActivityPub_Event_Bridge * @since 1.0.0 */ -namespace Activitypub_Event_Extensions\Plugins; +namespace ActivityPub_Event_Bridge\Plugins; -use Activitypub_Event_Extensions\Event_Plugins; +use ActivityPub_Event_Bridge\Event_Plugins; // Exit if accessed directly. defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore diff --git a/phpcs.xml b/phpcs.xml index d7cc4f5..cf1bc1b 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -105,7 +105,7 @@ - + @@ -114,7 +114,7 @@ - + diff --git a/readme.txt b/readme.txt index 4a8efef..f1c8203 100644 --- a/readme.txt +++ b/readme.txt @@ -1,4 +1,4 @@ -=== ActivityPub Event Extensions === +=== ActivityPub Event Bridge === Contributors: andremenrath Tags: events, fediverse, activitypub, activitystreams, calendar Requires at least: 6.5 @@ -11,17 +11,17 @@ Integrating popular event plugins with the ActivityPub plugin. == 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 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. +Make your events more discoverable, expand your reach effortlessly while being independent of other (commercial) platforms, and be a part of the growing decentralized web (the Fediverse). +With the ActivityPub Event Bridge Plugin for WordPress, your events can be automatically followed, 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. +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 web. = How It Works = -With the Event Federation Plugin for WordPress, sharing your events is effortless and automatic! +With the ActivityPub Event Bridge WordPress plugin, 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) @@ -34,7 +34,7 @@ These platforms create public event calendars by pulling in events from various == 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](https://wordpress.org/plugins/activitypub/). Additionally, you need to use one of the supported event Plugins. = Supported Event Plugins = @@ -53,7 +53,7 @@ If you’re new to the [ActivityPub plugin](https://wordpress.org/plugins/activi 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 don’t fully support events yet, will display a all important information about the 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 don’t fully support events yet, will display all important information about the events. = How much extra work is required to maintain my events across the decentralized Web? = @@ -69,11 +69,11 @@ No, the Event Federation Plugin depends on the [ActivityPub plugin](https://word = 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-bridge/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). +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-bridge/issues). == Changelog == diff --git a/templates/settings.php b/templates/settings.php index df52492..0652cbd 100644 --- a/templates/settings.php +++ b/templates/settings.php @@ -1,10 +1,10 @@ __( 'Arts', 'activitypub-event-extensions' ), - 'BOOK_CLUBS' => __( 'Book clubs', 'activitypub-event-extensions' ), - 'BUSINESS' => __( 'Business', 'activitypub-event-extensions' ), - 'CAUSES' => __( 'Causes', 'activitypub-event-extensions' ), - 'COMEDY' => __( 'Comedy', 'activitypub-event-extensions' ), - 'CRAFTS' => __( 'Crafts', 'activitypub-event-extensions' ), - 'FOOD_DRINK' => __( 'Food & Drink', 'activitypub-event-extensions' ), - 'HEALTH' => __( 'Health', 'activitypub-event-extensions' ), - 'MUSIC' => __( 'Music', 'activitypub-event-extensions' ), - 'AUTO_BOAT_AIR' => __( 'Auto, boat and air', 'activitypub-event-extensions' ), - 'COMMUNITY' => __( 'Community', 'activitypub-event-extensions' ), - 'FAMILY_EDUCATION' => __( 'Family & Education', 'activitypub-event-extensions' ), - 'FASHION_BEAUTY' => __( 'Fashion & Beauty', 'activitypub-event-extensions' ), - 'FILM_MEDIA' => __( 'Film & Media', 'activitypub-event-extensions' ), - 'GAMES' => __( 'Games', 'activitypub-event-extensions' ), - 'LANGUAGE_CULTURE' => __( 'Language & Culture', 'activitypub-event-extensions' ), - 'LEARNING' => __( 'Learning', 'activitypub-event-extensions' ), - 'LGBTQ' => __( 'LGBTQ', 'activitypub-event-extensions' ), - 'MOVEMENTS_POLITICS' => __( 'Movements and politics', 'activitypub-event-extensions' ), - 'NETWORKING' => __( 'Networking', 'activitypub-event-extensions' ), - 'PARTY' => __( 'Party', 'activitypub-event-extensions' ), - 'PERFORMING_VISUAL_ARTS' => __( 'Performing & Visual Arts', 'activitypub-event-extensions' ), - 'PETS' => __( 'Pets', 'activitypub-event-extensions' ), - 'PHOTOGRAPHY' => __( 'Photography', 'activitypub-event-extensions' ), - 'OUTDOORS_ADVENTURE' => __( 'Outdoors & Adventure', 'activitypub-event-extensions' ), - 'SPIRITUALITY_RELIGION_BELIEFS' => __( 'Spirituality, Religion & Beliefs', 'activitypub-event-extensions' ), - 'SCIENCE_TECH' => __( 'Science & Tech', 'activitypub-event-extensions' ), - 'SPORTS' => __( 'Sports', 'activitypub-event-extensions' ), - 'THEATRE' => __( 'Theatre', 'activitypub-event-extensions' ), - 'MEETING' => __( 'Meeting', 'activitypub-event-extensions' ), // Default value in federation. - 'DEFAULT' => __( 'Default', 'activitypub-event-extensions' ), // Internal default for overrides. + 'ARTS' => __( 'Arts', 'activitypub-event-bridge' ), + 'BOOK_CLUBS' => __( 'Book clubs', 'activitypub-event-bridge' ), + 'BUSINESS' => __( 'Business', 'activitypub-event-bridge' ), + 'CAUSES' => __( 'Causes', 'activitypub-event-bridge' ), + 'COMEDY' => __( 'Comedy', 'activitypub-event-bridge' ), + 'CRAFTS' => __( 'Crafts', 'activitypub-event-bridge' ), + 'FOOD_DRINK' => __( 'Food & Drink', 'activitypub-event-bridge' ), + 'HEALTH' => __( 'Health', 'activitypub-event-bridge' ), + 'MUSIC' => __( 'Music', 'activitypub-event-bridge' ), + 'AUTO_BOAT_AIR' => __( 'Auto, boat and air', 'activitypub-event-bridge' ), + 'COMMUNITY' => __( 'Community', 'activitypub-event-bridge' ), + 'FAMILY_EDUCATION' => __( 'Family & Education', 'activitypub-event-bridge' ), + 'FASHION_BEAUTY' => __( 'Fashion & Beauty', 'activitypub-event-bridge' ), + 'FILM_MEDIA' => __( 'Film & Media', 'activitypub-event-bridge' ), + 'GAMES' => __( 'Games', 'activitypub-event-bridge' ), + 'LANGUAGE_CULTURE' => __( 'Language & Culture', 'activitypub-event-bridge' ), + 'LEARNING' => __( 'Learning', 'activitypub-event-bridge' ), + 'LGBTQ' => __( 'LGBTQ', 'activitypub-event-bridge' ), + 'MOVEMENTS_POLITICS' => __( 'Movements and politics', 'activitypub-event-bridge' ), + 'NETWORKING' => __( 'Networking', 'activitypub-event-bridge' ), + 'PARTY' => __( 'Party', 'activitypub-event-bridge' ), + 'PERFORMING_VISUAL_ARTS' => __( 'Performing & Visual Arts', 'activitypub-event-bridge' ), + 'PETS' => __( 'Pets', 'activitypub-event-bridge' ), + 'PHOTOGRAPHY' => __( 'Photography', 'activitypub-event-bridge' ), + 'OUTDOORS_ADVENTURE' => __( 'Outdoors & Adventure', 'activitypub-event-bridge' ), + 'SPIRITUALITY_RELIGION_BELIEFS' => __( 'Spirituality, Religion & Beliefs', 'activitypub-event-bridge' ), + 'SCIENCE_TECH' => __( 'Science & Tech', 'activitypub-event-bridge' ), + 'SPORTS' => __( 'Sports', 'activitypub-event-bridge' ), + 'THEATRE' => __( 'Theatre', 'activitypub-event-bridge' ), + 'MEETING' => __( 'Meeting', 'activitypub-event-bridge' ), // Default value in federation. + 'DEFAULT' => __( 'Default', 'activitypub-event-bridge' ), // Internal default for overrides. ); -$selected_default_event_category = \get_option( 'activitypub_event_extensions_default_event_category', 'MEETING' ); -$current_category_mapping = \get_option( 'activitypub_event_extensions_event_category_mappings', array() ); +$selected_default_event_category = \get_option( 'activitypub_event_bridge_default_event_category', 'MEETING' ); +$current_category_mapping = \get_option( 'activitypub_event_bridge_event_category_mappings', array() ); ?>
-

+


-
+
- +
-

-

+

+

- +
- '; $label ) { echo ''; @@ -95,14 +95,14 @@ $current_category_mapping = \get_option( 'activitypub_event_extensions_ev
-

-

+

+

name ); ?> - ' . esc_html( $default_event_category_strings[ $mapping ] ) . ''; } - echo ''; + echo ''; foreach ( Event::DEFAULT_EVENT_CATEGORIES as $event_category ) { echo ''; } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index de49112..f17b5f9 100755 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -2,7 +2,7 @@ /** * PHPUnit bootstrap file. * - * @package Activitypub_Event_Extensions + * @package ActivityPub_Event_Bridge */ $_tests_dir = getenv( 'WP_TESTS_DIR' ); @@ -78,7 +78,7 @@ function _manually_load_plugin() { } // At last manually load our WordPress plugin. - require dirname( __DIR__ ) . '/activitypub-event-extensions.php'; + require dirname( __DIR__ ) . '/activitypub-event-bridge.php'; } tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' ); diff --git a/tests/test-class-plugin-events-manger.php b/tests/test-class-plugin-events-manger.php index 3d3c7d2..665b3c8 100644 --- a/tests/test-class-plugin-events-manger.php +++ b/tests/test-class-plugin-events-manger.php @@ -2,7 +2,7 @@ /** * Class SampleTest * - * @package Activitypub_Event_Extensions + * @package ActivityPub_Event_Bridge */ /** @@ -23,7 +23,7 @@ class Test_Events_Manager extends WP_UnitTestCase { update_option( 'dbem_events_anonymous_submissions', true ); // Make sure that ActivityPub support is enabled for Events Manager. - $aec = \Activitypub_Event_Extensions\Setup::get_instance(); + $aec = \ActivityPub_Event_Bridge\Setup::get_instance(); $aec->activate_activitypub_support_for_active_event_plugins(); // Delete all posts afterwards. @@ -37,7 +37,7 @@ class Test_Events_Manager extends WP_UnitTestCase { // We only test for one event plugin being active at the same time, // even though we support multiple onces in theory. // But testing all combinations is beyond scope. - $active_event_plugins = \Activitypub_Event_Extensions\Setup::get_instance()->get_active_event_plugins(); + $active_event_plugins = \ActivityPub_Event_Bridge\Setup::get_instance()->get_active_event_plugins(); $this->assertEquals( 1, count( $active_event_plugins ) ); // Enable ActivityPub support for the event plugin. @@ -61,7 +61,7 @@ class Test_Events_Manager extends WP_UnitTestCase { $transformer = \Activitypub\Transformer\Factory::get_transformer( $wp_object ); // Check that we got the right transformer. - $this->assertInstanceOf( \Activitypub_Event_Extensions\Activitypub\Transformer\Events_Manager::class, $transformer ); + $this->assertInstanceOf( \ActivityPub_Event_Bridge\Activitypub\Transformer\Events_Manager::class, $transformer ); } /** diff --git a/tests/test-class-plugin-gatherpress.php b/tests/test-class-plugin-gatherpress.php index b2ac3eb..1fffa4b 100644 --- a/tests/test-class-plugin-gatherpress.php +++ b/tests/test-class-plugin-gatherpress.php @@ -2,7 +2,7 @@ /** * Class SampleTest * - * @package Activitypub_Event_Extensions + * @package ActivityPub_Event_Bridge */ /** @@ -23,7 +23,7 @@ class Test_GatherPress extends WP_UnitTestCase { GatherPress\Core\Setup::get_instance()->activate_gatherpress_plugin( false ); // Make sure that ActivityPub support is enabled for The Events Calendar. - $aec = \Activitypub_Event_Extensions\Setup::get_instance(); + $aec = \ActivityPub_Event_Bridge\Setup::get_instance(); $aec->activate_activitypub_support_for_active_event_plugins(); // Delete all posts afterwards. @@ -37,7 +37,7 @@ class Test_GatherPress extends WP_UnitTestCase { // We only test for one event plugin being active at the same time, // even though we support multiple onces in theory. // But testing all combinations is beyond scope. - $active_event_plugins = \Activitypub_Event_Extensions\Setup::get_instance()->get_active_event_plugins(); + $active_event_plugins = \ActivityPub_Event_Bridge\Setup::get_instance()->get_active_event_plugins(); $this->assertEquals( 1, count( $active_event_plugins ) ); // Enable ActivityPub support for the event plugin. @@ -65,7 +65,7 @@ class Test_GatherPress extends WP_UnitTestCase { $transformer = \Activitypub\Transformer\Factory::get_transformer( $event->event ); // Check that we got the right transformer. - $this->assertInstanceOf( \Activitypub_Event_Extensions\Activitypub\Transformer\GatherPress::class, $transformer ); + $this->assertInstanceOf( \ActivityPub_Event_Bridge\Activitypub\Transformer\GatherPress::class, $transformer ); } /** diff --git a/tests/test-class-plugin-the-events-calendar.php b/tests/test-class-plugin-the-events-calendar.php index fd589f7..8edad47 100644 --- a/tests/test-class-plugin-the-events-calendar.php +++ b/tests/test-class-plugin-the-events-calendar.php @@ -2,7 +2,7 @@ /** * Class SampleTest * - * @package Activitypub_Event_Extensions + * @package ActivityPub_Event_Bridge */ /** @@ -62,7 +62,7 @@ class Test_The_Events_Calendar extends WP_UnitTestCase { } // Make sure that ActivityPub support is enabled for The Events Calendar. - $aec = \Activitypub_Event_Extensions\Setup::get_instance(); + $aec = \ActivityPub_Event_Bridge\Setup::get_instance(); $aec->activate_activitypub_support_for_active_event_plugins(); // Delete all posts afterwards. @@ -76,7 +76,7 @@ class Test_The_Events_Calendar extends WP_UnitTestCase { // We only test for one event plugin being active at the same time, // even though we support multiple onces in theory. // But testing all combinations is beyond scope. - $active_event_plugins = \Activitypub_Event_Extensions\Setup::get_instance()->get_active_event_plugins(); + $active_event_plugins = \ActivityPub_Event_Bridge\Setup::get_instance()->get_active_event_plugins(); $this->assertEquals( 1, count( $active_event_plugins ) ); // Enable ActivityPub support for the event plugin. @@ -91,7 +91,7 @@ class Test_The_Events_Calendar extends WP_UnitTestCase { $transformer = \Activitypub\Transformer\Factory::get_transformer( $wp_object ); // Check that we got the right transformer. - $this->assertInstanceOf( \Activitypub_Event_Extensions\Activitypub\Transformer\The_Events_Calendar::class, $transformer ); + $this->assertInstanceOf( \ActivityPub_Event_Bridge\Activitypub\Transformer\The_Events_Calendar::class, $transformer ); } /** @@ -128,10 +128,10 @@ class Test_The_Events_Calendar extends WP_UnitTestCase { $category_id_theatre = wp_insert_term( 'Theatre', Tribe__Events__Main::TAXONOMY, array( 'slug' => 'theatre' ) ); // Set default mapping for event categories. - update_option( 'activitypub_event_extensions_default_event_category', 'MUSIC' ); + update_option( 'activitypub_event_bridge_default_event_category', 'MUSIC' ); // Set an override for the category with the slug theatre. - update_option( 'activitypub_event_extensions_event_category_mappings', array( 'theatre' => 'THEATRE' ) ); + update_option( 'activitypub_event_bridge_event_category_mappings', array( 'theatre' => 'THEATRE' ) ); // Create a The Events Calendar event with the music category. $wp_object = tribe_events() diff --git a/tests/test-class-plugin-vs-event-list.php b/tests/test-class-plugin-vs-event-list.php index 98d5830..48e513d 100644 --- a/tests/test-class-plugin-vs-event-list.php +++ b/tests/test-class-plugin-vs-event-list.php @@ -2,7 +2,7 @@ /** * Class SampleTest * - * @package Activitypub_Event_Extensions + * @package ActivityPub_Event_Bridge */ /** @@ -20,7 +20,7 @@ class Test_VS_Event_List extends WP_UnitTestCase { } // Make sure that ActivityPub support is enabled for The Events Calendar. - $aec = \Activitypub_Event_Extensions\Setup::get_instance(); + $aec = \ActivityPub_Event_Bridge\Setup::get_instance(); $aec->activate_activitypub_support_for_active_event_plugins(); // Delete all posts afterwards. @@ -34,7 +34,7 @@ class Test_VS_Event_List extends WP_UnitTestCase { // We only test for one event plugin being active at the same time, // even though we support multiple onces in theory. // But testing all combinations is beyond scope. - $active_event_plugins = \Activitypub_Event_Extensions\Setup::get_instance()->get_active_event_plugins(); + $active_event_plugins = \ActivityPub_Event_Bridge\Setup::get_instance()->get_active_event_plugins(); $this->assertEquals( 1, count( $active_event_plugins ) ); // Enable ActivityPub support for the event plugin. @@ -58,7 +58,7 @@ class Test_VS_Event_List extends WP_UnitTestCase { $transformer = \Activitypub\Transformer\Factory::get_transformer( $wp_object ); // Check that we got the right transformer. - $this->assertInstanceOf( \Activitypub_Event_Extensions\Activitypub\Transformer\VS_Event_List::class, $transformer ); + $this->assertInstanceOf( \ActivityPub_Event_Bridge\Activitypub\Transformer\VS_Event_List::class, $transformer ); } /** @@ -173,10 +173,10 @@ class Test_VS_Event_List extends WP_UnitTestCase { $category_id_theatre = wp_insert_term( 'Theatre', 'event_cat', array( 'slug' => 'theatre' ) ); // Set default mapping for event categories. - update_option( 'activitypub_event_extensions_default_event_category', 'MUSIC' ); + update_option( 'activitypub_event_bridge_default_event_category', 'MUSIC' ); // Set an override for the category with the slug theatre. - update_option( 'activitypub_event_extensions_event_category_mappings', array( 'theatre' => 'THEATRE' ) ); + update_option( 'activitypub_event_bridge_event_category_mappings', array( 'theatre' => 'THEATRE' ) ); // Create a VS Event List event with the music category. $wp_post_id = wp_insert_post(