'integrate_valuespace', 'label' => __('Connect to ValueSpace', 'valuespace'), 'loading_label' => __('Connecting...', 'valuespace'), 'disabled' => false, 'data_action' => 'integrate_valuespace' ]; } // Quick check: ValueSpace connected (just check for tokens, don't test connection) $vasp_connected = vasp_valuespace_is_connected(); if (!$vasp_connected) { return [ 'action' => 'integrate_valuespace', 'label' => __('Connect to ValueSpace', 'valuespace'), 'loading_label' => __('Connecting...', 'valuespace'), 'disabled' => false, 'data_action' => 'integrate_valuespace' ]; } // ValueSpace has tokens - quick check WordPress connection $wp_connected = vasp_wordpress_is_connected(); if (!$wp_connected) { return [ 'action' => 'integrate_wordpress', 'label' => __('Integrate WordPress', 'valuespace'), 'loading_label' => __('Integrating...', 'valuespace'), 'disabled' => false, 'data_action' => 'integrate_wordpress' ]; } // WordPress has tokens - check WooCommerce (only if WooCommerce is installed) $wc_installed = class_exists('WooCommerce'); $wc_connected = vasp_woocommerce_is_connected(); if ($wc_installed && !$wc_connected) { return [ 'action' => 'integrate_woocommerce', 'label' => __('Integrate WooCommerce', 'valuespace'), 'loading_label' => __('Integrating...', 'valuespace'), 'disabled' => false, 'data_action' => 'integrate_woocommerce' ]; } // All integrations have tokens - show "Open Dashboard" $config = vasp_get_config(); $dashboard_url = $config['dashboard_domain'] ?? ''; return [ 'action' => 'open_dashboard', 'label' => __('Open Dashboard', 'valuespace'), 'disabled' => false, 'data_action' => 'open_dashboard', 'dashboard_url' => $dashboard_url ]; }