_initApiUrl();
}
public function getCurrentGuideStep() {
$step = get_option(WAIC_CODE . '_guide_step');
return empty($step) ? 0 : (int) $step;
}
public function isEndGuide( $step = false ) {
if (false == $step) {
$step = $this->getCurrentGuideStep();
}
return $step == $this->_endGuideStep;
}
public function endGuide() {
update_option(WAIC_CODE . '_guide_step', $this->_endGuideStep);
}
public function getSkipStep( $step ) {
return ( $step + 1 ) * ( -1 );
}
public function skipGuide( $step = false ) {
if (false == $step) {
$step = $this->getCurrentGuideStep();
}
if (0 <= $step) {
update_option(WAIC_CODE . '_guide_step', $this->getSkipStep($step), 'no');
}
}
public function nextStep( $step ) {
if (0 <= $step) {
$step++;
$data = $this->getGuideSteps($step, true);
if (!$data || !is_array($data)) {
$step = $this->_endGuideStep;
}
update_option(WAIC_CODE . '_guide_step', $step, 'no');
$data['step'] = $step;
return $data;
}
return false;
}
public function backStep( $step ) {
if (0 < $step) {
$step--;
$data = $this->getGuideSteps($step, true);
if (!$data || !is_array($data)) {
$step = 0;
}
update_option(WAIC_CODE . '_guide_step', $step, 'no');
$data['step'] = $step;
return $data;
}
return false;
}
public function startGuide( $restart = false ) {
$step = $this->getCurrentGuideStep();
if ($this->_endGuideStep == $step && !$restart) {
return false;
}
if (0 > $step) {
$step = ( $this->_endGuideStep == $step ? 0 : ( $step * ( -1 ) - 1 ) );
$data = $this->getGuideSteps($step, true);
if (!$data || !is_array($data)) {
$step = 0;
}
update_option(WAIC_CODE . '_guide_step', $step, 'no');
$data['step'] = $step;
return $data;
}
}
public function getGuideSteps( $s = false, $url = false ) {
/* translators: %1$s: plugin link, %2$s - contacts link */
$contacts = sprintf(__('Each tool is designed to save you time and maximize efficiency. If you need guidance on using these features, check out our %1$s or %2$s for support.', 'ai-copilot-content-generator'), '' . esc_html__('Knowledge Base', 'ai-copilot-content-generator') . '', '' . esc_html__('Contact Us', 'ai-copilot-content-generator') . '');
$steps = array(
array(
'title' => __('Welcome to AIWU plugin', 'ai-copilot-content-generator'),
'body' => __('Thank you for installing AIWU! You’ve just unlocked the best AI-powered content automation for your website. AIWU helps you generate, optimize, and manage content effortlessly.', 'ai-copilot-content-generator') .
'
' .
__('This quick step-by-step tutorial will guide you through the key features in just 2 minutes. Let’s get started!', 'ai-copilot-content-generator'),
'next' => true,
'skip' => true,
),
array(
'title' => __('Connect your AI API key', 'ai-copilot-content-generator'),
'body' => __('To activate AI-powered content automation, you need to connect an AI provider. AIWU supports OpenAI, Gemini, and DeepSeek. We do not take any commission – you only pay for the tokens used by your selected provider.', 'ai-copilot-content-generator') .
'
' .
__('Now, let’s enter your API key. If you don’t have an account yet, check out our detailed guide on how to create one.', 'ai-copilot-content-generator'),
'next' => true,
'back' => true,
'tab' => 'settings',
),
array(
'title' => __('Explore your AI workspace', 'ai-copilot-content-generator'),
'body' => __('This is your AI Workspace, where all AI-powered automation happens:', 'ai-copilot-content-generator') .
'