Fix healthcheck when to supported event plugin is installed
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 53s
PHPUnit / PHPUnit – PHP 7.4 (pull_request) Failing after 1m5s
PHPUnit / PHPUnit – PHP 8.0 (pull_request) Failing after 1m1s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Failing after 1m1s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Failing after 59s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Failing after 59s
PHPUnit / PHPUnit – PHP 8.4 (pull_request) Failing after 1m1s

This commit is contained in:
André Menrath 2024-12-19 01:24:14 +01:00
parent 16b3c1402e
commit 569c326816
7 changed files with 21 additions and 16 deletions

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/), 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). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased ## [0.3.3] - 2024-12-19
### Added
* Add custom summary via shortcodes
## [0.3.2] - 2024-12-12
* Initial release on WordPress.org * Initial release on WordPress.org

View file

@ -3,7 +3,7 @@
**Tags:** events, fediverse, activitypub, calendar **Tags:** events, fediverse, activitypub, calendar
**Requires at least:** 6.5 **Requires at least:** 6.5
**Tested up to:** 6.7 **Tested up to:** 6.7
**Stable tag:** 0.3.2 **Stable tag:** 0.3.3
**Requires PHP:** 7.4 **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
@ -102,7 +102,7 @@ We're always interested in your feedback. Feel free to reach out to us via [E-Ma
## Changelog ## ## Changelog ##
### [0.3.2] 2024-12-12 ### ### [0.3.3] 2024-12-19 ###
* Initial release on https://wordpress.org/ * Initial release on https://wordpress.org/

View file

@ -3,7 +3,7 @@
* Plugin Name: Event Bridge for ActivityPub * Plugin Name: Event Bridge for ActivityPub
* Description: Integrating popular event plugins with the ActivityPub plugin. * Description: Integrating popular event plugins with the ActivityPub plugin.
* Plugin URI: https://event-federation.eu/ * Plugin URI: https://event-federation.eu/
* Version: 0.3.2 * Version: 0.3.3
* Author: André Menrath * Author: André Menrath
* Author URI: https://graz.social/@linos * Author URI: https://graz.social/@linos
* Text Domain: event-bridge-for-activitypub * 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 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. * Allowed HTML for admin notices.
@ -40,6 +40,7 @@ class General_Admin_Notices {
'a' => array( 'a' => array(
'href' => true, 'href' => true,
'title' => true, 'title' => true,
'target' => true,
), ),
'br', 'br',
'i', 'i',
@ -90,11 +91,11 @@ class General_Admin_Notices {
/* translators: 1: An URL to the list of supported event plugins. */ /* translators: 1: An URL to the list of supported event plugins. */
_x( _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. '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', 'admin notice',
'event-bridge-for-activitypub' '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 ) { if ( ! $event_post_type ) {
$active_event_plugins = Setup::get_instance()->get_active_event_plugins(); $active_event_plugins = Setup::get_instance()->get_active_event_plugins();
$active_event_plugin = reset( $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( $args = array(

View file

@ -3,7 +3,7 @@ Contributors: andremenrath
Tags: events, fediverse, activitypub, calendar Tags: events, fediverse, activitypub, calendar
Requires at least: 6.5 Requires at least: 6.5
Tested up to: 6.7 Tested up to: 6.7
Stable tag: 0.3.2 Stable tag: 0.3.3
Requires PHP: 7.4 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
@ -96,6 +96,6 @@ We're always interested in your feedback. Feel free to reach out to us via [E-Ma
== Changelog == == Changelog ==
= [0.3.2] 2024-12-12 = = [0.3.3] 2024-12-19 =
* Initial release on https://wordpress.org/ * Initial release on https://wordpress.org/

View file

@ -9,6 +9,7 @@
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
use Event_Bridge_For_ActivityPub\Setup; 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\Settings_Page;
use Event_Bridge_For_ActivityPub\Admin\Health_Check; use Event_Bridge_For_ActivityPub\Admin\Health_Check;
@ -41,6 +42,12 @@ WP_Filesystem();
<div class="box"> <div class="box">
<h2><?php \esc_html_e( 'Status', 'event-bridge-for-activitypub' ); ?></h2> <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> <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 ) { ?> <?php foreach ( $active_event_plugins as $active_event_plugin ) { ?>
<h3><?php echo esc_html( $active_event_plugin->get_plugin_name() ); ?>:</h3> <h3><?php echo esc_html( $active_event_plugin->get_plugin_name() ); ?>:</h3>
<ul class="event-bridge-for-activitypub-list"> <ul class="event-bridge-for-activitypub-list">