self::is_hpct_active(), 'hpct_imported' => self::is_hpct_imported(), 'hivepress' => self::is_hivepress_active(), 'woocommerce' => self::is_woocommerce_active(), ); return self::$detected; } /** * Can WPDO register its HPCT-inherited module interceptors? * * True when: * - hp-custom-tables is NOT active, OR * - hp-custom-tables IS active but already imported into WPDO. */ public static function can_register_hpct_hooks(): bool { $compat = self::check(); // HPCT not active → WPDO can freely register. if ( ! $compat['hpct_active'] ) { return true; } // HPCT is active but already imported → WPDO takes over. if ( $compat['hpct_imported'] ) { return true; } // HPCT is active and NOT imported → defer to HPCT. return false; } /** * Can WPDO register zone-specific interceptors (hot/warm/cold/archive)? * * Zone interceptors are always safe to register — they operate on * WPDO's own tables and do not conflict with HPCT. */ public static function can_register_zone_hooks(): bool { return true; } /** * Should WPDO show an admin notice about HPCT import? */ public static function should_show_hpct_notice(): bool { $compat = self::check(); return $compat['hpct_active'] && ! $compat['hpct_imported']; } /** * Is HivePress core active? */ public static function is_hivepress_active(): bool { return class_exists( 'HivePress\Core' ); } /** * Is WooCommerce active? */ public static function is_woocommerce_active(): bool { return class_exists( 'WooCommerce' ); } /** * Is LatePoint plugin active? (v2.5.0 M16 polish — for module detector.) * * LatePoint exposes the OsBookingHelper class and `latepoint_*` action * hooks. Detect via either the helper class or the version constant. */ public static function is_latepoint_active(): bool { return class_exists( 'OsBookingHelper' ) || defined( 'LATEPOINT_VERSION' ) || function_exists( 'latepoint_get_settings' ); } // ── Detection Methods ──────────────────────────────────────────────── /** * Is HP Custom Tables plugin active (loaded)? * * Checks for the HPCT_Loader class, which is always loaded * when hp-custom-tables is active. */ public static function is_hpct_active(): bool { return class_exists( 'HPCT_Loader' ) || defined( 'HPCT_VERSION' ); } /** * Has HPCT been imported into WPDO? */ private static function is_hpct_imported(): bool { return (bool) get_option( 'wpdo_hpct_imported', false ); } }