diff --git a/includes/admin/class-health-check.php b/includes/admin/class-health-check.php index fec797c..00044ec 100644 --- a/includes/admin/class-health-check.php +++ b/includes/admin/class-health-check.php @@ -86,6 +86,10 @@ class Health_Check { * @return bool True if the check passed. */ public static function test_if_event_transformer_is_used( $event_plugin ) { + if ( ! Setup::get_instance()->is_activitypub_plugin_active() ) { + return false; + } + // Get a (random) event post. $event_posts = self::get_most_recent_event_posts( $event_plugin->get_post_type(), 1 ); @@ -113,6 +117,10 @@ class Health_Check { * @return WP_Post[]|false Array of event posts, or false if none are found. */ public static function get_most_recent_event_posts( $event_post_type = null, $number_of_posts = 5 ) { + if ( ! Setup::get_instance()->is_activitypub_plugin_active() ) { + return false; + } + if ( ! $event_post_type ) { $active_event_plugins = Setup::get_instance()->get_active_event_plugins(); $active_event_plugin = reset( $active_event_plugins );