Fix healthcheck when to supported event plugin is installed #88

Open
linos wants to merge 3 commits from fix_healthcheck into main
7 changed files with 21 additions and 16 deletions
Showing only changes of commit 569c326816 - Show all commits

View file

@ -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

View file

@ -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/

View file

@ -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

View file

@ -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 <i>Event Bridge for ActivityPub</i> is of no use, because you do not have installed and activated a supported Event Plugin.
<br> For a list of supported Event Plugins see <a href="%1$s">here</a>.',
<br> For a list of supported Event Plugins see <a href="%1$s" target="_blank">here</a>.',
'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 )
);
}

View file

@ -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(

View file

@ -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/

View file

@ -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();
<div class="box">
<h2><?php \esc_html_e( 'Status', 'event-bridge-for-activitypub' ); ?></h2>
<p><?php \esc_html_e( 'The Event Bridge for ActivityPub detected the following (activated) event plugins:', 'event-bridge-for-activitypub' ); ?></p>
<?php
if ( empty( $active_event_plugins ) ) {
$notice = General_Admin_Notices::get_admin_notice_no_supported_event_plugin_active();
}
echo '<p>⚠' . \wp_kses( $notice, General_Admin_Notices::ALLOWED_HTML ) . '</p>';
?>
<?php foreach ( $active_event_plugins as $active_event_plugin ) { ?>
<h3><?php echo esc_html( $active_event_plugin->get_plugin_name() ); ?>:</h3>
<ul class="event-bridge-for-activitypub-list">