feat(2meet-data-optimizer): warn when HivePress / WooCommerce run without their AddOn
- TMDO_Compatibility::missing_integration_addons() reports active HivePress / WooCommerce whose AddOn bootstrap class is absent - Surface it as Site Health test wpdo_missing_integration_addons (also on the admin Doctor tab) and an administrator notice (TMDO_Missing_Addons_Notice) - Verify: MissingIntegrationAddonsTest (5, class stand-ins in separate processes); core unit 651 / integration 449, HP 148, WC 10 OK; read-only check: dev20/21 HivePress+WooCommerce, dev22 HivePress, others clean - PR: PR-035
This commit is contained in:
@@ -68,6 +68,26 @@ class TMDO_Compatibility {
|
||||
return class_exists( 'WooCommerce' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Integrations that are active while their AddOn is not.
|
||||
*
|
||||
* Core does not know these plugins; their fields are only optimised by the
|
||||
* matching AddOn. The AddOn is detected by its bootstrap class, which its
|
||||
* main file declares as soon as the plugin loads.
|
||||
*
|
||||
* @return array<string, string> Plugin name → AddOn plugin slug.
|
||||
*/
|
||||
public static function missing_integration_addons(): array {
|
||||
$missing = array();
|
||||
if ( self::is_hivepress_active() && ! class_exists( 'TMDO_HP_Bootstrap' ) ) {
|
||||
$missing['HivePress'] = '2meet-data-optimizer-hivepress-addon';
|
||||
}
|
||||
if ( self::is_woocommerce_active() && ! class_exists( 'TMDO_Woocommerce_Bootstrap' ) ) {
|
||||
$missing['WooCommerce'] = '2meet-data-optimizer-woocommerce-addon';
|
||||
}
|
||||
return $missing;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is LatePoint plugin active? (v2.5.0 M16 polish — for module detector.)
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user