wpml_version() && $this->gateway->is_setup_complete(); } /** * {@inheritDoc} * * WCML defines its version constant unconditionally, but only creates the global * `$woocommerce_wpml` when its own WPML version check passes. Verified against WCML 5.6.3. */ public function wcml_version(): ?string { if ( ! isset( $GLOBALS['woocommerce_wpml'] ) ) { return null; } return self::string_constant( 'WCML_VERSION' ); } /** * Returns a constant's value when it is defined as a non-empty string. * * @param string $name Constant name. */ private static function string_constant( string $name ): ?string { if ( ! defined( $name ) ) { return null; } $value = constant( $name ); return is_string( $value ) && '' !== $value ? $value : null; } }