namespace, '/system', array( array( 'methods' => 'GET', 'callback' => array( $this, 'get_system' ), 'permission_callback' => array( $this, 'check_permission' ), ), ) ); } /** * Return plugin + environment info. */ public function get_system(): WP_REST_Response { return new WP_REST_Response( array( 'plugin' => array( 'version' => PROFIT_ENGINE_VERSION, 'db_version' => (int) get_option( 'profit_engine_db_version', 0 ), 'installed' => get_option( 'profit_engine_installed_at', null ), ), 'env' => array( 'php' => PHP_VERSION, 'wp' => get_bloginfo( 'version' ), 'wc' => defined( 'WC_VERSION' ) ? WC_VERSION : null, 'hpos' => $this->hpos_enabled(), ), 'ready' => true, ), 200 ); } /** * Whether HPOS (custom order tables) is the active order store. */ private function hpos_enabled(): bool { if ( ! class_exists( \Automattic\WooCommerce\Utilities\OrderUtil::class ) ) { return false; } return \Automattic\WooCommerce\Utilities\OrderUtil::custom_orders_table_usage_is_enabled(); } }