get_var("SELECT COUNT(*) FROM {$wpdb->prefix}igny8_tasks WHERE status IN ('pending', 'queued', 'new')"); $draft_tasks = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}igny8_tasks WHERE status IN ('draft', 'in_progress', 'review')"); $published_tasks = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}igny8_tasks WHERE status = 'completed'"); $total_tasks = $queued_tasks + $draft_tasks + $published_tasks; return [ 'view_tasks' => [ 'queued' => $queued_tasks, 'total' => $total_tasks, 'status' => $total_tasks > 0 ? 'completed' : 'pending' ], 'generate_drafts' => [ 'queued' => $queued_tasks, 'status' => $queued_tasks > 0 ? 'current' : ($draft_tasks > 0 ? 'completed' : 'pending') ], 'review_drafts' => [ 'drafts' => $draft_tasks, 'status' => $draft_tasks > 0 ? 'current' : ($published_tasks > 0 ? 'completed' : 'pending') ], 'publish' => [ 'published' => $published_tasks, 'drafts' => $draft_tasks, 'status' => $published_tasks > 0 ? 'completed' : ($draft_tasks > 0 ? 'current' : 'pending') ] ]; } // Handle URL parameters for subpages $subpage = $_GET['sm'] ?? 'home'; $GLOBALS['current_submodule'] = $subpage; $GLOBALS['current_module'] = 'writer'; // Start output buffering ob_start(); switch ($subpage) { case 'tasks': include plugin_dir_path(__FILE__) . 'tasks.php'; break; case 'drafts': include plugin_dir_path(__FILE__) . 'drafts.php'; break; case 'published': include plugin_dir_path(__FILE__) . 'published.php'; break; case 'home': default: // Home dashboard content // Load KPI data for dashboard calculations if (!defined('IGNY8_INCLUDE_CONFIG')) { define('IGNY8_INCLUDE_CONFIG', true); } $kpi_config = $GLOBALS['igny8_kpi_config'] ?? []; // Loaded globally in igny8.php $kpi_data = igny8_get_kpi_data_safe('writer_home', $kpi_config['writer_home'] ?? []); // Calculate dashboard metrics - Updated queries for correct status global $wpdb; // Queued tasks - tasks that are pending/not started $queued_tasks = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}igny8_tasks WHERE status IN ('pending', 'queued', 'new')"); // Draft tasks - content generated and saved as draft, awaiting review/publish $draft_tasks = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}igny8_tasks WHERE status IN ('draft', 'in_progress', 'review')"); // Published tasks - status is 'completed' in tasks table $published_tasks = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}igny8_tasks WHERE status = 'completed'"); $total_tasks = $queued_tasks + $draft_tasks + $published_tasks; // Calculate percentages for progress bars $queued_pct = $total_tasks > 0 ? round(($queued_tasks / $total_tasks) * 100) : 0; $draft_pct = $total_tasks > 0 ? round(($draft_tasks / $total_tasks) * 100) : 0; $published_pct = $total_tasks > 0 ? round(($published_tasks / $total_tasks) * 100) : 0; // Home page content ?>
Tasks Queued awaiting writing start
Drafts currently being written
Published live on your site

Writer Workflow Steps

Track your content creation progress

1
View Queued Tasks
0): ?> tasks queued No tasks available
2
Generate Drafts (AI)
0): ?> tasks ready for AI 0): ?> All tasks processed No tasks to process
3
Review Drafts
0): ?> drafts to review 0): ?> All drafts reviewed No drafts to review
4
Publish Content
0): ?> drafts ready to publish 0): ?> content published No content to publish

Workflow Status & AI Settings

Workflow Status & AI Settings

Manual AI Mode

Workflow Status & AI Settings

Workflow Status & AI Settings

Content Published by Type

Content distribution analysis

get_var("SELECT COUNT(*) FROM {$wpdb->prefix}igny8_tasks WHERE status = 'completed'"); echo '' . number_format($total_published) . ''; echo 'Total Published'; ?>
get_results(" SELECT content_type, COUNT(*) as count FROM {$wpdb->prefix}igny8_tasks WHERE status = 'completed' GROUP BY content_type ORDER BY count DESC "); if ($content_by_type): ?>
content_type)); $percentage = $total_published > 0 ? round(($type->count / $total_published) * 100) : 0; $color_class = $color_classes[$color_index % 4]; $color_index++; ?>
count); ?>
%

No published content found yet

View Tasks

Publishing Activity

Content publishing timeline

get_var("SELECT COUNT(*) FROM {$wpdb->prefix}igny8_tasks WHERE status = 'completed' AND updated_at >= DATE_SUB(NOW(), INTERVAL 7 DAY)"); echo '' . number_format($recent_7_days) . ''; echo 'This Week'; ?>
get_var("SELECT COUNT(*) FROM {$wpdb->prefix}igny8_tasks WHERE status = 'completed' AND DATE(updated_at) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)"); $last_7_days = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}igny8_tasks WHERE status = 'completed' AND updated_at >= DATE_SUB(NOW(), INTERVAL 7 DAY)"); $last_20_days = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}igny8_tasks WHERE status = 'completed' AND updated_at >= DATE_SUB(NOW(), INTERVAL 20 DAY)"); $all_time = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}igny8_tasks WHERE status = 'completed'"); ?>
Yesterday
0 ? round(($yesterday_count / $all_time) * 100) : 0; ?>%
Last 7 Days
0 ? round(($last_7_days / $all_time) * 100) : 0; ?>%
Last 20 Days
0 ? round(($last_20_days / $all_time) * 100) : 0; ?>%
All Time
100%

Content Workflow Summary

Content distribution analysis

Queued Tasks %
tasks waiting to start
Draft / Review %
drafts awaiting review and publish
Published %
tasks completed and published

Pending Actions

Action items requiring attention

0): ?>
tasks not yet started Start Writing
0): ?>
drafts awaiting review and publish Review Drafts
0): ?>
posts ready to publish View Published
All caught up! Consider adding new content ideas. Plan New Content
'writer', 'submodule' => 'home', 'ajaxUrl' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('igny8_writer_settings'), 'cronKey' => $cron_key ]); break; } // Capture page content $igny8_page_content = ob_get_clean(); // Include global layout include_once plugin_dir_path(__FILE__) . '../../core/global-layout.php';