PluginProbe
Search Atlas SEO – OTTO AI SEO Automation for WordPress / 2.7.1
Search Atlas SEO – OTTO AI SEO Automation for WordPress v2.7.1
2.7.1 2.7.2 2.7.0 2.6.26 2.6.25 2.6.24 2.6.23 2.6.22 2.6.21 2.6.20 2.6.19 2.6.18 2.6.17 2.6.16 2.6.15 2.6.14 2.6.13 2.6.12 2.6.11 2.6.10 2.6.9 2.6.8 2.6.7 2.6.6 2.6.5 All 141 releases
metasync / robots-txt / views / admin-page.php

admin-page.php in Search Atlas SEO – OTTO AI SEO Automation for WordPress 2.7.1, at robots-txt/views/admin-page.php

191 lines 10.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Robots.txt Admin Page View
4 *
5 * @package Search Atlas SEO
6 * @copyright Copyright (C) 2021-2025, Search Atlas Group - [email protected]
7 * @since 2.5.6
8 */
9
10 // If this file is called directly, abort.
11 if (!defined('WPINC')) {
12 die;
13 }
14
15 $site_url = get_site_url();
16 $robots_url = trailingslashit($site_url) . 'robots.txt';
17 ?>
18 <div class="metasync-robots-txt-page">
19 <?php if (!$is_writable): ?>
20 <div class="notice notice-error">
21 <p>
22 <strong><?php esc_html_e('Warning:', 'metasync'); ?></strong>
23 <?php if ($file_exists): ?>
24 <?php esc_html_e('The robots.txt file is not writable. Please check file permissions.', 'metasync'); ?>
25 <?php else: ?>
26 <?php esc_html_e('Cannot create robots.txt file. Please check that your WordPress root directory is writable.', 'metasync'); ?>
27 <?php endif; ?>
28 </p>
29 </div>
30 <?php endif; ?>
31
32 <div class="metasync-robots-txt-container">
33 <div class="metasync-robots-txt-editor">
34 <div class="metasync-card">
35 <div class="metasync-card-header">
36 <h2><?php esc_html_e('Edit robots.txt', 'metasync'); ?><?php Metasync::render_tooltip_icon('robots_txt_editor', 'This file tells search engines which pages they may crawl. A wrong rule (e.g. Disallow: /) can remove your entire site from Google — change it only if you know the effect.'); ?></h2>
37 <div class="metasync-robots-info">
38 <span class="metasync-robots-status">
39 <?php
40 $robots_txt = Metasync_Robots_Txt::get_instance();
41 $is_virtual = $robots_txt->is_virtual_mode();
42 if ($file_exists): ?>
43 <span class="dashicons dashicons-yes-alt" style="color: #46b450;"></span>
44 <?php esc_html_e('Generated', 'metasync'); ?>
45 <?php if ($is_virtual): ?>
46 <span style="color: #2271b1; font-size: 12px; margin-left: 5px;">(Virtual)</span>
47 <?php endif; ?>
48 <?php else: ?>
49 <span class="dashicons dashicons-warning" style="color: #f0b849;"></span>
50 <?php esc_html_e('Not Generated', 'metasync'); ?>
51 <?php endif; ?>
52 </span>
53 <a href="<?php echo esc_url(admin_url('admin.php?page=' . Metasync_Admin::$page_slug . '-import-external&tab=robots')); ?>" class="button button-secondary" style="margin-right: 10px;">
54 <span class="dashicons dashicons-download" style="margin-top:3px;font-size:15px;width:15px;height:15px;"></span> <?php esc_html_e('Import from SEO Plugins', 'metasync'); ?>
55 </a>
56 <a href="<?php echo esc_url($robots_url); ?>" target="_blank" class="button button-secondary">
57 <?php esc_html_e('View robots.txt', 'metasync'); ?>
58 <span class="dashicons dashicons-external" style="margin-top: 4px;"></span>
59 </a>
60 </div>
61 </div>
62
63 <form method="post" action="" id="robots-txt-form">
64 <?php wp_nonce_field('metasync_save_robots_txt', 'metasync_robots_txt_nonce'); ?>
65
66 <div class="metasync-editor-container">
67 <textarea
68 id="robots-txt-editor"
69 name="robots_content"
70 rows="20"
71 class="large-text code"
72 <?php echo !$is_writable ? 'readonly' : ''; ?>
73 ><?php echo esc_textarea($current_content); ?></textarea>
74 </div>
75
76 <div class="metasync-editor-actions">
77 <?php if ($is_writable): ?>
78 <button type="submit" id="save-robots-btn" class="button button-primary button-large">
79 <span class="dashicons dashicons-saved" style="margin-top: 4px;"></span>
80 <?php esc_html_e('Save Changes', 'metasync'); ?>
81 </button>
82 <button type="button" id="reset-to-default" class="button button-secondary">
83 <span class="dashicons dashicons-image-rotate" style="margin-top: 4px;"></span>
84 <?php esc_html_e('Reset to Default', 'metasync'); ?>
85 </button>
86 <?php endif; ?>
87 <button type="button" id="validate-content" class="button button-secondary">
88 <span class="dashicons dashicons-yes-alt" style="margin-top: 4px;"></span>
89 <?php esc_html_e('Validate', 'metasync'); ?>
90 </button>
91 </div>
92
93 <div id="validation-results" class="metasync-validation-results" style="display: none;"></div>
94 </form>
95
96 <div class="metasync-robots-help">
97 <h3><?php esc_html_e('Quick Guide', 'metasync'); ?></h3>
98 <div class="metasync-help-grid">
99 <div class="metasync-help-item">
100 <strong>User-agent:</strong>
101 <p><?php esc_html_e('Specifies which crawler the rules apply to. Use * for all crawlers.', 'metasync'); ?></p>
102 <code>User-agent: *</code>
103 </div>
104 <div class="metasync-help-item">
105 <strong>Disallow:</strong>
106 <p><?php esc_html_e('Blocks access to specific paths or files.', 'metasync'); ?></p>
107 <code>Disallow: /wp-admin/</code>
108 </div>
109 <div class="metasync-help-item">
110 <strong>Allow:</strong>
111 <p><?php esc_html_e('Explicitly allows access to specific paths (overrides Disallow).', 'metasync'); ?></p>
112 <code>Allow: /wp-admin/admin-ajax.php</code>
113 </div>
114 <div class="metasync-help-item">
115 <strong>Sitemap:</strong>
116 <p><?php esc_html_e('Points crawlers to your XML sitemap.', 'metasync'); ?></p>
117 <code>Sitemap: <?php echo esc_html($site_url); ?>/sitemap.xml</code>
118 </div>
119 </div>
120 </div>
121 </div>
122 </div>
123
124 <div class="metasync-robots-txt-sidebar">
125 <div class="metasync-card">
126 <div class="metasync-card-header">
127 <h3><?php esc_html_e('Backup History', 'metasync'); ?></h3>
128 </div>
129
130 <?php
131 // Backup History is paginated so the list always reflects the
132 // full stored state (and its true total), rather than a fixed
133 // slice that makes deleted entries appear to "reappear".
134 $robots_txt = Metasync_Robots_Txt::get_instance();
135 $backup_per_page = Metasync_Robots_Txt_Database::BACKUPS_PER_PAGE;
136 $backup_total = $robots_txt->get_backup_count();
137 $backup_total_pages = max(1, (int) ceil($backup_total / $backup_per_page));
138 $backup_page = 1;
139 // $backups already holds the first page (from the controller).
140 require __DIR__ . '/backup-history.php';
141 ?>
142 </div>
143
144 <div class="metasync-card metasync-warnings-card">
145 <div class="metasync-card-header">
146 <h3><?php esc_html_e('Important Notes', 'metasync'); ?></h3>
147 </div>
148 <ul class="metasync-warnings-list">
149 <li>
150 <span class="dashicons dashicons-warning" style="color: #f0b849;"></span>
151 <?php esc_html_e('Never block your entire site (Disallow: /) as it will prevent all search engines from indexing your content.', 'metasync'); ?>
152 </li>
153 <li>
154 <span class="dashicons dashicons-info" style="color: #2271b1;"></span>
155 <?php esc_html_e('Changes to robots.txt take effect immediately but may take time for search engines to recognize.', 'metasync'); ?>
156 </li>
157 <li>
158 <span class="dashicons dashicons-admin-plugins" style="color: #2271b1;"></span>
159 <?php esc_html_e('Some hosting providers may override robots.txt files. Check with your host if changes don\'t work.', 'metasync'); ?>
160 </li>
161 </ul>
162 </div>
163 </div>
164 </div>
165 </div>
166
167 <!-- Validation Modal (Fixed Position Overlay) -->
168 <div id="robots-validation-modal" class="metasync-modal" style="display: none;">
169 <div class="metasync-modal-overlay"></div>
170 <div class="metasync-modal-content">
171 <div class="metasync-modal-header">
172 <h2 id="modal-title"></h2>
173 <button type="button" class="metasync-modal-close">&times;</button>
174 </div>
175 <div class="metasync-modal-body" id="modal-body"></div>
176 <div class="metasync-modal-footer" id="modal-footer">
177 <div class="metasync-modal-footer-left">
178 <button type="button" class="button button-primary metasync-modal-confirm" id="modal-confirm-btn"><?php esc_html_e('Save Anyway', 'metasync'); ?></button>
179 </div>
180 <div class="metasync-modal-footer-right">
181 <button type="button" class="button button-secondary metasync-modal-cancel"><?php esc_html_e('Cancel', 'metasync'); ?></button>
182 </div>
183 </div>
184 </div>
185 </div>
186
187 <?php
188 // Load separate CSS and JS files
189 require_once __DIR__ . '/styles.php';
190 require_once __DIR__ . '/scripts.php';
191