| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
|
| 6 |
function botwriter_addnew_page_handler(){ |
| 7 |
// Verify permissions |
| 8 |
if (!current_user_can('manage_options')) { |
| 9 |
return; |
| 10 |
} |
| 11 |
|
| 12 |
$dir_images = plugin_dir_url(dirname(__FILE__)) . '/assets/images/'; |
| 13 |
|
| 14 |
$add_new_url_automatic_post_new = esc_url(get_admin_url(get_current_blog_id(), 'admin.php?page=botwriter_automatic_post_new')); |
| 15 |
|
| 16 |
$add_new_url_super_page = esc_url(get_admin_url(get_current_blog_id(), 'admin.php?page=botwriter_super_page')); |
| 17 |
$add_new_url_super_manual = esc_url(get_admin_url(get_current_blog_id(), 'admin.php?page=botwriter_super_page&mode=manual')); |
| 18 |
$add_new_url_rewriter = esc_url(get_admin_url(get_current_blog_id(), 'admin.php?page=botwriter_rewriter_page')); |
| 19 |
$add_new_url_siterewriter = esc_url(get_admin_url(get_current_blog_id(), 'admin.php?page=botwriter_siterewriter_page')); |
| 20 |
|
| 21 |
|
| 22 |
?> |
| 23 |
<div class="wrap"> |
| 24 |
<h1><?php esc_html_e('Create New Task', 'botwriter'); ?></h1> |
| 25 |
<p class="bw-addnew-subtitle"><?php esc_html_e('Choose how you want to generate content with AI.', 'botwriter'); ?></p> |
| 26 |
|
| 27 |
<div class="bw-addnew-grid"> |
| 28 |
|
| 29 |
<!-- Option 1: Standard Task --> |
| 30 |
<div class="bw-addnew-card bw-addnew-card--blue"> |
| 31 |
<div class="bw-addnew-card-header"> |
| 32 |
<div class="bw-addnew-card-titles"> |
| 33 |
<span class="bw-addnew-badge bw-addnew-badge--blue"><?php esc_html_e('Scheduled', 'botwriter'); ?></span> |
| 34 |
<h2 class="bw-addnew-card-title"><?php esc_html_e('Standard Task', 'botwriter'); ?></h2> |
| 35 |
</div> |
| 36 |
<div class="bw-addnew-card-icon"> |
| 37 |
<img src="<?php echo esc_url($dir_images . 'robot_icon2.png'); ?>" alt="<?php echo esc_attr__('AI BOT', 'botwriter'); ?>"> |
| 38 |
</div> |
| 39 |
</div> |
| 40 |
<div class="bw-addnew-card-body"> |
| 41 |
<p class="bw-addnew-card-desc"><?php esc_html_e('Create scheduled tasks to generate articles from prompts, keywords, RSS feeds, or external WordPress sites.', 'botwriter'); ?></p> |
| 42 |
<ul class="bw-addnew-card-features"> |
| 43 |
<li><?php esc_html_e('Articles from Prompt (Scheduled)', 'botwriter'); ?></li> |
| 44 |
<li><?php esc_html_e('Articles from Keywords', 'botwriter'); ?></li> |
| 45 |
<li><?php esc_html_e('Articles from RSS Feed', 'botwriter'); ?></li> |
| 46 |
<li><?php esc_html_e('Articles from External WordPress', 'botwriter'); ?></li> |
| 47 |
</ul> |
| 48 |
</div> |
| 49 |
<div class="bw-addnew-card-footer"> |
| 50 |
<a class="button button-primary bw-addnew-btn" href="<?php echo esc_url($add_new_url_automatic_post_new); ?>"><?php esc_html_e('Create Standard Task', 'botwriter'); ?> →</a> |
| 51 |
</div> |
| 52 |
</div> |
| 53 |
|
| 54 |
<!-- Option 2: Auto-pilot Super Task --> |
| 55 |
<div class="bw-addnew-card bw-addnew-card--purple"> |
| 56 |
<div class="bw-addnew-card-header"> |
| 57 |
<div class="bw-addnew-card-titles"> |
| 58 |
<span class="bw-addnew-badge bw-addnew-badge--purple"><?php esc_html_e('Auto-Pilot', 'botwriter'); ?></span> |
| 59 |
<h2 class="bw-addnew-card-title"><?php esc_html_e('Super Task AI', 'botwriter'); ?></h2> |
| 60 |
</div> |
| 61 |
<div class="bw-addnew-card-icon"> |
| 62 |
<img src="<?php echo esc_url($dir_images . 'ai_cerebro.png'); ?>" alt="<?php echo esc_attr__('AI BRAIN', 'botwriter'); ?>"> |
| 63 |
</div> |
| 64 |
</div> |
| 65 |
<div class="bw-addnew-card-body"> |
| 66 |
<p class="bw-addnew-card-desc"><?php esc_html_e('Generate a complete series of articles automatically. The AI creates titles, summaries, and content for you.', 'botwriter'); ?></p> |
| 67 |
<ul class="bw-addnew-card-features"> |
| 68 |
<li><?php esc_html_e('Blog Improvement Articles', 'botwriter'); ?></li> |
| 69 |
<li><?php esc_html_e('Tutorial & Step-by-Step Packs', 'botwriter'); ?></li> |
| 70 |
<li><?php esc_html_e('Tips, Tricks & Recommendations', 'botwriter'); ?></li> |
| 71 |
<li><?php esc_html_e('Reviews & Buying Guides', 'botwriter'); ?></li> |
| 72 |
</ul> |
| 73 |
</div> |
| 74 |
<div class="bw-addnew-card-footer"> |
| 75 |
<a class="button button-primary bw-addnew-btn" href="<?php echo esc_url($add_new_url_super_page); ?>"><?php esc_html_e('Create Super Task', 'botwriter'); ?> →</a> |
| 76 |
</div> |
| 77 |
</div> |
| 78 |
|
| 79 |
<!-- Option 3: Manual Super Task --> |
| 80 |
<div class="bw-addnew-card bw-addnew-card--green"> |
| 81 |
<div class="bw-addnew-card-header"> |
| 82 |
<div class="bw-addnew-card-titles"> |
| 83 |
<span class="bw-addnew-badge bw-addnew-badge--green"><?php esc_html_e('BYO Titles', 'botwriter'); ?></span> |
| 84 |
<h2 class="bw-addnew-card-title"><?php esc_html_e('Manual Super Task', 'botwriter'); ?></h2> |
| 85 |
</div> |
| 86 |
<div class="bw-addnew-card-icon"> |
| 87 |
<img src="<?php echo esc_url($dir_images . 'ai_cerebro.png'); ?>" alt="<?php echo esc_attr__('AI BRAIN MANUAL', 'botwriter'); ?>" class="bw-hue-rotate-90"> |
| 88 |
</div> |
| 89 |
</div> |
| 90 |
<div class="bw-addnew-card-body"> |
| 91 |
<p class="bw-addnew-card-desc"><?php esc_html_e('Have a list of titles? Paste them and let the AI write the articles for you one by one.', 'botwriter'); ?></p> |
| 92 |
<ul class="bw-addnew-card-features"> |
| 93 |
<li><?php esc_html_e('Paste your own list of titles', 'botwriter'); ?></li> |
| 94 |
<li><?php esc_html_e('Global prompt for all articles', 'botwriter'); ?></li> |
| 95 |
<li><?php esc_html_e('AI generates content & images', 'botwriter'); ?></li> |
| 96 |
<li><?php esc_html_e('Review and edit before publishing', 'botwriter'); ?></li> |
| 97 |
</ul> |
| 98 |
</div> |
| 99 |
<div class="bw-addnew-card-footer"> |
| 100 |
<a class="button button-primary bw-addnew-btn" href="<?php echo esc_url($add_new_url_super_manual); ?>"><?php esc_html_e('Create Manual Task', 'botwriter'); ?> →</a> |
| 101 |
</div> |
| 102 |
</div> |
| 103 |
|
| 104 |
<!-- Option 4: Content Rewriter --> |
| 105 |
<div class="bw-addnew-card bw-addnew-card--orange"> |
| 106 |
<div class="bw-addnew-card-header"> |
| 107 |
<div class="bw-addnew-card-titles"> |
| 108 |
<span class="bw-addnew-badge bw-addnew-badge--orange"><?php esc_html_e('Rewrite', 'botwriter'); ?></span> |
| 109 |
<h2 class="bw-addnew-card-title"><?php esc_html_e('Content Rewriter', 'botwriter'); ?></h2> |
| 110 |
</div> |
| 111 |
<div class="bw-addnew-card-icon"> |
| 112 |
<img src="<?php echo esc_url($dir_images . 'rewriter.png'); ?>" alt="<?php echo esc_attr__('AI REWRITER', 'botwriter'); ?>"> |
| 113 |
</div> |
| 114 |
</div> |
| 115 |
<div class="bw-addnew-card-body"> |
| 116 |
<p class="bw-addnew-card-desc"><?php esc_html_e('Fetch articles from any URL, extract the content, and let the AI rewrite them in your own voice.', 'botwriter'); ?></p> |
| 117 |
<ul class="bw-addnew-card-features"> |
| 118 |
<li><?php esc_html_e('Paste URLs of articles to rewrite', 'botwriter'); ?></li> |
| 119 |
<li><?php esc_html_e('Auto-extracts title and content', 'botwriter'); ?></li> |
| 120 |
<li><?php esc_html_e('Manual paste fallback', 'botwriter'); ?></li> |
| 121 |
<li><?php esc_html_e('Custom rewrite instructions', 'botwriter'); ?></li> |
| 122 |
</ul> |
| 123 |
</div> |
| 124 |
<div class="bw-addnew-card-footer"> |
| 125 |
<a class="button button-primary bw-addnew-btn" href="<?php echo esc_url($add_new_url_rewriter); ?>"><?php esc_html_e('Open Rewriter', 'botwriter'); ?> →</a> |
| 126 |
</div> |
| 127 |
</div> |
| 128 |
|
| 129 |
<!-- Option 5: Site Rewriter --> |
| 130 |
<div class="bw-addnew-card bw-addnew-card--teal"> |
| 131 |
<div class="bw-addnew-card-header"> |
| 132 |
<div class="bw-addnew-card-titles"> |
| 133 |
<span class="bw-addnew-badge bw-addnew-badge--teal"><?php esc_html_e('Crawl & Rewrite', 'botwriter'); ?></span> |
| 134 |
<h2 class="bw-addnew-card-title"><?php esc_html_e('Site Rewriter', 'botwriter'); ?></h2> |
| 135 |
</div> |
| 136 |
<div class="bw-addnew-card-icon"> |
| 137 |
<img src="<?php echo esc_url($dir_images . 'ai_cerebro.png'); ?>" alt="<?php echo esc_attr__('SITE REWRITER', 'botwriter'); ?>" class="bw-hue-rotate-200"> |
| 138 |
</div> |
| 139 |
</div> |
| 140 |
<div class="bw-addnew-card-body"> |
| 141 |
<p class="bw-addnew-card-desc"><?php esc_html_e('Crawl an entire website, pick the pages you want, and rewrite them all with AI. Full site migration in minutes.', 'botwriter'); ?></p> |
| 142 |
<ul class="bw-addnew-card-features"> |
| 143 |
<li><?php esc_html_e('Automatic page discovery from root URL', 'botwriter'); ?></li> |
| 144 |
<li><?php esc_html_e('Configurable crawl depth (1–3 levels)', 'botwriter'); ?></li> |
| 145 |
<li><?php esc_html_e('Select which pages to rewrite', 'botwriter'); ?></li> |
| 146 |
<li><?php esc_html_e('Up to 200 pages per crawl', 'botwriter'); ?></li> |
| 147 |
</ul> |
| 148 |
</div> |
| 149 |
<div class="bw-addnew-card-footer"> |
| 150 |
<a class="button button-primary bw-addnew-btn" href="<?php echo esc_url($add_new_url_siterewriter); ?>"><?php esc_html_e('Open Site Rewriter', 'botwriter'); ?> →</a> |
| 151 |
</div> |
| 152 |
</div> |
| 153 |
|
| 154 |
</div><!-- .bw-addnew-grid --> |
| 155 |
</div> |
| 156 |
|
| 157 |
<?php |
| 158 |
} |
| 159 |
|