From dddfa70f1f530f737531517469b1df64ea2adfd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Menrath?= Date: Fri, 6 Dec 2024 16:27:29 +0100 Subject: [PATCH] change plugin slug --- .forgejo/workflows/phpunit.yml | 2 +- composer.json | 2 +- event-bridge-for-activitypub.php | 4 ++-- includes/activitypub/transformer/class-event.php | 8 ++++---- includes/class-settings.php | 4 ++-- templates/settings.php | 6 +++--- ...t-class-activitypub-event-bridge-shortcodes.php | 14 +++++++------- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.forgejo/workflows/phpunit.yml b/.forgejo/workflows/phpunit.yml index a5589f9..e3e0f9e 100644 --- a/.forgejo/workflows/phpunit.yml +++ b/.forgejo/workflows/phpunit.yml @@ -77,7 +77,7 @@ jobs: - name: Run General Tests - run: cd /workspace/Event-Federation/wordpress-activitypub-event-bridge/ && ./vendor/bin/phpunit --filter=activitypub_event_bridge + run: cd /workspace/Event-Federation/wordpress-activitypub-event-bridge/ && ./vendor/bin/phpunit --filter=event_bridge_for_activitypub env: PHP_VERSION: ${{ matrix.php-version }} diff --git a/composer.json b/composer.json index 12a8b71..3ea82bb 100644 --- a/composer.json +++ b/composer.json @@ -69,7 +69,7 @@ "test-wp-event-manager": "phpunit --filter=wp_event_manager", "test-eventin": "phpunit --filter=eventin", "test-modern-events-calendar-lite": "phpunit --filter=modern_events_calendar_lite", - "test-activitypub-event-bridge-shortcodes": "phpunit --filter=activitypub_event_bridge_shortcodes", + "test-activitypub-event-bridge-shortcodes": "phpunit --filter=event_bridge_for_activitypub_shortcodes", "test-eventprime": "phpunit --filter=eventprime", "test-event-organiser": "phpunit --filter=event_organiser", "test-all": "phpunit" diff --git a/event-bridge-for-activitypub.php b/event-bridge-for-activitypub.php index 09bbbf1..8bb7ed3 100644 --- a/event-bridge-for-activitypub.php +++ b/event-bridge-for-activitypub.php @@ -27,8 +27,8 @@ define( 'EVENT_BRIDGE_FOR_ACTIVITYPUB_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); define( 'EVENT_BRIDGE_FOR_ACTIVITYPUB_PLUGIN_VERSION', current( get_file_data( __FILE__, array( 'Version' ), 'plugin' ) ) ); define( 'EVENT_BRIDGE_FOR_ACTIVITYPUB_DOMAIN', 'event-bridge-for-activitypub' ); define( 'EVENT_BRIDGE_FOR_ACTIVITYPUB_ACTIVITYPUB_PLUGIN_MIN_VERSION', '3.2.2' ); -define( 'ACTIVITYPUB_EVENT_BRIDGE_CUSTOM_SUMMARY', "\n[ap_hashcats][ap_hashtags]" ); -define( 'ACTIVITYPUB_EVENT_BRIDGE_DEFAULT_SUMMARY_TYPE', 'preset' ); +define( 'EVENT_BRIDGE_FOR_ACTIVITYPUB_CUSTOM_SUMMARY', "\n[ap_hashcats][ap_hashtags]" ); +define( 'EVENT_BRIDGE_FOR_ACTIVITYPUB_DEFAULT_SUMMARY_TYPE', 'preset' ); // Include and register the autoloader class for automatic loading of plugin classes. require_once EVENT_BRIDGE_FOR_ACTIVITYPUB_PLUGIN_DIR . '/includes/class-autoloader.php'; diff --git a/includes/activitypub/transformer/class-event.php b/includes/activitypub/transformer/class-event.php index b08fd61..c87f5f6 100644 --- a/includes/activitypub/transformer/class-event.php +++ b/includes/activitypub/transformer/class-event.php @@ -446,7 +446,7 @@ abstract class Event extends Post { $summary = \preg_replace( '/[\n\r\t]/', '', $summary ); $summary = \trim( $summary ); - $summary = \apply_filters( 'activitypub_event_bridge_the_summary', $summary, $post ); + $summary = \apply_filters( 'event_bridge_for_activitypub_the_summary', $summary, $post ); // Unregister the shortcodes. Shortcodes::unregister(); @@ -518,10 +518,10 @@ abstract class Event extends Post { * @return string The Template. */ protected function get_event_summary_template() { - $summary = \get_option( 'activitypub_event_bridge_custom_summary', ACTIVITYPUB_EVENT_BRIDGE_CUSTOM_SUMMARY ); - $template = $summary ?? ACTIVITYPUB_EVENT_BRIDGE_CUSTOM_SUMMARY; + $summary = \get_option( 'event_bridge_for_activitypub_custom_summary', EVENT_BRIDGE_FOR_ACTIVITYPUB_CUSTOM_SUMMARY ); + $template = $summary ?? EVENT_BRIDGE_FOR_ACTIVITYPUB_CUSTOM_SUMMARY; - return apply_filters( 'activitypub_event_bridge_summary_template', $template, $this->wp_object ); + return apply_filters( 'event_bridge_for_activitypub_summary_template', $template, $this->wp_object ); } /** diff --git a/includes/class-settings.php b/includes/class-settings.php index 8a6b322..6e00df1 100644 --- a/includes/class-settings.php +++ b/includes/class-settings.php @@ -85,12 +85,12 @@ class Settings { \register_setting( 'activitypub-event-bridge', - 'activitypub_event_bridge_custom_summary', + 'event_bridge_for_activitypub_custom_summary', array( 'type' => 'string', 'description' => \__( 'Define your own custom summary template for events', 'activitypub-event-bridge' ), 'show_in_rest' => true, - 'default' => ACTIVITYPUB_EVENT_BRIDGE_CUSTOM_SUMMARY, + 'default' => EVENT_BRIDGE_FOR_ACTIVITYPUB_CUSTOM_SUMMARY, ) ); } diff --git a/templates/settings.php b/templates/settings.php index f3b7641..6309ef0 100644 --- a/templates/settings.php +++ b/templates/settings.php @@ -47,7 +47,7 @@ $current_category_mapping = \get_option( 'event_bridge_for_activitypub_ev

- +
diff --git a/tests/test-class-activitypub-event-bridge-shortcodes.php b/tests/test-class-activitypub-event-bridge-shortcodes.php index 0b7e1ba..1256665 100644 --- a/tests/test-class-activitypub-event-bridge-shortcodes.php +++ b/tests/test-class-activitypub-event-bridge-shortcodes.php @@ -2,7 +2,7 @@ /** * Test file for Activitypub Shortcodes. * - * @package ActivityPub_Event_Bridge + * @package Event_Bridge_For_ActivityPub * @license AGPL-3.0-or-later */ @@ -25,7 +25,7 @@ class Test_Activitypub_Event_Bridge_Shortcodes extends WP_UnitTestCase { } // Make sure that ActivityPub support is enabled for The Events Calendar. - $aec = \ActivityPub_Event_Bridge\Setup::get_instance(); + $aec = \Event_Bridge_For_ActivityPub\Setup::get_instance(); $aec->activate_activitypub_support_for_active_event_plugins(); // Delete all posts afterwards. @@ -44,7 +44,7 @@ class Test_Activitypub_Event_Bridge_Shortcodes extends WP_UnitTestCase { // Call the transformer Factory. $transformer = \Activitypub\Transformer\Factory::get_transformer( $wp_object ); - if ( ! $transformer instanceof \ActivityPub_Event_Bridge\Activitypub\Transformer\Event ) { + if ( ! $transformer instanceof \Event_Bridge_For_ActivityPub\Activitypub\Transformer\Event ) { return; } @@ -77,7 +77,7 @@ class Test_Activitypub_Event_Bridge_Shortcodes extends WP_UnitTestCase { // Call the transformer Factory. $transformer = \Activitypub\Transformer\Factory::get_transformer( $wp_object ); - if ( ! $transformer instanceof \ActivityPub_Event_Bridge\Activitypub\Transformer\Event ) { + if ( ! $transformer instanceof \Event_Bridge_For_ActivityPub\Activitypub\Transformer\Event ) { return; } @@ -110,7 +110,7 @@ class Test_Activitypub_Event_Bridge_Shortcodes extends WP_UnitTestCase { // Call the transformer Factory. $transformer = \Activitypub\Transformer\Factory::get_transformer( $wp_object ); - if ( ! $transformer instanceof \ActivityPub_Event_Bridge\Activitypub\Transformer\Event ) { + if ( ! $transformer instanceof \Event_Bridge_For_ActivityPub\Activitypub\Transformer\Event ) { return; } @@ -138,7 +138,7 @@ class Test_Activitypub_Event_Bridge_Shortcodes extends WP_UnitTestCase { // Call the transformer Factory. $transformer = \Activitypub\Transformer\Factory::get_transformer( $wp_object ); - if ( ! $transformer instanceof \ActivityPub_Event_Bridge\Activitypub\Transformer\Event ) { + if ( ! $transformer instanceof \Event_Bridge_For_ActivityPub\Activitypub\Transformer\Event ) { return; } @@ -174,7 +174,7 @@ class Test_Activitypub_Event_Bridge_Shortcodes extends WP_UnitTestCase { // Call the transformer Factory. $transformer = \Activitypub\Transformer\Factory::get_transformer( $wp_object ); - if ( ! $transformer instanceof \ActivityPub_Event_Bridge\Activitypub\Transformer\Event ) { + if ( ! $transformer instanceof \Event_Bridge_For_ActivityPub\Activitypub\Transformer\Event ) { return; }