From 569c3268168f1ffa87ddd7b268f8c050f7311297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Menrath?= Date: Thu, 19 Dec 2024 01:24:14 +0100 Subject: [PATCH] Fix healthcheck when to supported event plugin is installed --- CHANGELOG.md | 8 +------- README.md | 4 ++-- event-bridge-for-activitypub.php | 2 +- includes/admin/class-general-admin-notices.php | 7 ++++--- includes/admin/class-health-check.php | 5 ++++- readme.txt | 4 ++-- templates/welcome.php | 7 +++++++ 7 files changed, 21 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7e4577..f1b3e56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,13 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased - -### Added - -* Add custom summary via shortcodes - -## [0.3.2] - 2024-12-12 +## [0.3.3] - 2024-12-19 * Initial release on WordPress.org diff --git a/README.md b/README.md index 83c871f..9543da5 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ **Tags:** events, fediverse, activitypub, calendar **Requires at least:** 6.5 **Tested up to:** 6.7 -**Stable tag:** 0.3.2 +**Stable tag:** 0.3.3 **Requires PHP:** 7.4 **License:** AGPL-3.0-or-later **License URI:** https://www.gnu.org/licenses/agpl-3.0.html @@ -102,7 +102,7 @@ We're always interested in your feedback. Feel free to reach out to us via [E-Ma ## Changelog ## -### [0.3.2] 2024-12-12 ### +### [0.3.3] 2024-12-19 ### * Initial release on https://wordpress.org/ diff --git a/event-bridge-for-activitypub.php b/event-bridge-for-activitypub.php index ec9cfad..f1ce6b3 100644 --- a/event-bridge-for-activitypub.php +++ b/event-bridge-for-activitypub.php @@ -3,7 +3,7 @@ * Plugin Name: Event Bridge for ActivityPub * Description: Integrating popular event plugins with the ActivityPub plugin. * Plugin URI: https://event-federation.eu/ - * Version: 0.3.2 + * Version: 0.3.3 * Author: André Menrath * Author URI: https://graz.social/@linos * Text Domain: event-bridge-for-activitypub diff --git a/includes/admin/class-general-admin-notices.php b/includes/admin/class-general-admin-notices.php index a58c2c4..5571291 100644 --- a/includes/admin/class-general-admin-notices.php +++ b/includes/admin/class-general-admin-notices.php @@ -29,7 +29,7 @@ class General_Admin_Notices { */ const ACTIVITYPUB_PLUGIN_URL = 'https://wordpress.org/plugins/activitypub'; - const EVENT_BRIDGE_FOR_ACTIVITYPUB_SUPPORTED_EVENT_PLUGINS_URL = 'https://code.event-federation.eu/Event-Federation/wordpress-event-bridge-for-activitypub#events-plugin-that-will-be-supported-at-first'; + const EVENT_BRIDGE_FOR_ACTIVITYPUB_SUPPORTED_EVENT_PLUGINS_URL = 'https://code.event-federation.eu/Event-Federation/wordpress-event-bridge-for-activitypub#supported-event-plugins'; /** * Allowed HTML for admin notices. @@ -40,6 +40,7 @@ class General_Admin_Notices { 'a' => array( 'href' => true, 'title' => true, + 'target' => true, ), 'br', 'i', @@ -90,11 +91,11 @@ class General_Admin_Notices { /* translators: 1: An URL to the list of supported event plugins. */ _x( 'The Plugin Event Bridge for ActivityPub 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.', +
For a list of supported Event Plugins see here.', 'admin notice', 'event-bridge-for-activitypub' ), - esc_html( self::EVENT_BRIDGE_FOR_ACTIVITYPUB_SUPPORTED_EVENT_PLUGINS_URL ) + esc_url( self::EVENT_BRIDGE_FOR_ACTIVITYPUB_SUPPORTED_EVENT_PLUGINS_URL ) ); } diff --git a/includes/admin/class-health-check.php b/includes/admin/class-health-check.php index 45d4ea0..07c0a95 100644 --- a/includes/admin/class-health-check.php +++ b/includes/admin/class-health-check.php @@ -116,7 +116,10 @@ class Health_Check { if ( ! $event_post_type ) { $active_event_plugins = Setup::get_instance()->get_active_event_plugins(); $active_event_plugin = reset( $active_event_plugins ); - $event_post_type = $active_event_plugin->get_post_type(); + if ( ! $active_event_plugin ) { + return false; + } + $event_post_type = $active_event_plugin->get_post_type(); } $args = array( diff --git a/readme.txt b/readme.txt index 35b33d0..fb93cf9 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: andremenrath Tags: events, fediverse, activitypub, calendar Requires at least: 6.5 Tested up to: 6.7 -Stable tag: 0.3.2 +Stable tag: 0.3.3 Requires PHP: 7.4 License: AGPL-3.0-or-later License URI: https://www.gnu.org/licenses/agpl-3.0.html @@ -96,6 +96,6 @@ We're always interested in your feedback. Feel free to reach out to us via [E-Ma == Changelog == -= [0.3.2] 2024-12-12 = += [0.3.3] 2024-12-19 = * Initial release on https://wordpress.org/ diff --git a/templates/welcome.php b/templates/welcome.php index 503df4f..c6c3567 100644 --- a/templates/welcome.php +++ b/templates/welcome.php @@ -9,6 +9,7 @@ defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore use Event_Bridge_For_ActivityPub\Setup; +use Event_Bridge_For_ActivityPub\Admin\General_Admin_Notices; use Event_Bridge_For_ActivityPub\Admin\Settings_Page; use Event_Bridge_For_ActivityPub\Admin\Health_Check; @@ -41,6 +42,12 @@ WP_Filesystem();

+ ⚠' . \wp_kses( $notice, General_Admin_Notices::ALLOWED_HTML ) . '

'; + ?>

get_plugin_name() ); ?>: