diff --git a/activitypub-event-extensions.php b/activitypub-event-extensions.php
index 42f8b48..392601a 100644
--- a/activitypub-event-extensions.php
+++ b/activitypub-event-extensions.php
@@ -11,7 +11,7 @@
* License URI: https://www.gnu.org/licenses/agpl-3.0.de.html
* Requires PHP: 8.1
*
- * ActivityPub plugin tested up to: 3.2.2
+ * Requires at least ActivityPub plugin with version >= 3.2.2. ActivityPub plugin tested up to: 3.2.2.
*
* @package activitypub-event-extensions
* @license AGPL-3.0-or-later
@@ -26,6 +26,7 @@ define( 'ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_FILE', plugin_dir_path( __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';
diff --git a/includes/admin/class-general-admin-notices.php b/includes/admin/class-general-admin-notices.php
index a4de156..2751287 100644
--- a/includes/admin/class-general-admin-notices.php
+++ b/includes/admin/class-general-admin-notices.php
@@ -49,14 +49,31 @@ class General_Admin_Notices {
*/
public static function get_admin_notice_activitypub_plugin_not_enabled(): string {
return sprintf(
- /* translators: 1: the name of the event plugin a admin notice is shown. 2: The name of the ActivityPub plugin. */
+ /* 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.',
'admin notice',
'activitypub-event-extensions'
),
+ esc_html( self::ACTIVITYPUB_PLUGIN_URL )
+ );
+ }
+
+ /**
+ * Admin notice when the ActivityPub plugin version is too old.
+ *
+ * @return string
+ */
+ public static function get_admin_notice_activitypub_plugin_version_too_old(): string {
+ 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.',
+ 'admin notice',
+ 'activitypub-event-extensions'
+ ),
esc_html( self::ACTIVITYPUB_PLUGIN_URL ),
- admin_url( 'options-general.php?page=activitypub&tab=settings' )
+ esc_html( ACTIVITYPUB_EVENT_EXTENSIONS_ACTIVITYPUB_PLUGIN_MIN_VERSION )
);
}
@@ -67,15 +84,14 @@ class General_Admin_Notices {
*/
public static function get_admin_notice_no_supported_event_plugin_active(): string {
return sprintf(
- /* translators: 1: the name of the event plugin a admin notice is shown. 2: The name of the ActivityPub plugin. */
+ /* 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.
For a list of supported Event Plugins see here.',
'admin notice',
'activitypub-event-extensions'
),
- esc_html( self::ACTIVITYPUB_EVENT_EXTENSIONS_SUPPORTED_EVENT_PLUGINS_URL ),
- admin_url( 'options-general.php?page=activitypub&tab=settings' )
+ esc_html( self::ACTIVITYPUB_EVENT_EXTENSIONS_SUPPORTED_EVENT_PLUGINS_URL )
);
}
@@ -89,6 +105,16 @@ class General_Admin_Notices {
echo '
' . \wp_kses( $notice, self::ALLOWED_HTML ) . '
' . \wp_kses( $notice, self::ALLOWED_HTML ) . '