{__('A physical', 'ai-rank-suite')} robots.txt {__('file exists on your server and overrides everything here. Delete it so WordPress can serve robots.txt dynamically.', 'ai-rank-suite')}
)}
);
}
function Breadcrumbs() {
const { data, update, save, busy, saved, error } = useSettings('/settings/breadcrumbs');
if (!data) return ;
const s = data.settings;
return (
update({ show_current: v })}
label={__('Show the current page as the last crumb', 'ai-rank-suite')}
/>
{__('Shortcode:', 'ai-rank-suite')}[airanksuite_breadcrumbs]
{__('In a theme template:', 'ai-rank-suite')}{' '}
{''}
);
}
/**
* The media library, counted, and the one job that fixes most of it.
*
* The settings below decide what a *new* image gets. This is about the
* images already there: how many say nothing, how many are the size of a
* poster, and a button that writes the missing alt texts from the template
* in one run, fifty at a time, with the bar moving.
*/
function MediaAudit() {
const [audit, setAudit] = useState(null);
const [error, setError] = useState(null);
const [job, setJob] = useState(null);
const load = (fresh = false) => api.get(`/image-seo/audit${fresh ? '?fresh=1' : ''}`).then(setAudit).catch((e) => setError(e.message));
useEffect(() => {
load();
}, []);
const fill = async () => {
setError(null);
const total = audit?.no_alt || 0;
let offset = 0;
let filled = 0;
let skipped = 0;
setJob({ filled, skipped, total, done: false });
try {
for (;;) {
const r = await api.post('/image-seo/fill', { offset });
filled += r.filled;
skipped += r.skipped;
offset = r.offset;
setJob({ filled, skipped, total, done: r.done });
if (r.done) break;
}
await load(true);
} catch (e) {
setError(e.message);
setJob(null);
}
};
if (error) return {error};
if (!audit) return {__('Counting the media library…', 'ai-rank-suite')};
const kb = (b) => (b >= 1024 * 1024 ? `${(b / 1024 / 1024).toFixed(1)} MB` : `${Math.round(b / 1024)} KB`);
return (
load(true)}>{__('Recount', 'ai-rank-suite')}}
>
{job ? (
) : (
{sprintf(__('Template: %s. Existing alt texts are never touched.', 'ai-rank-suite'), audit.template || '%filename%')}
update({ auto_alt: v })} label={__('Add alt text when an image has none', 'ai-rank-suite')} />
update({ auto_title: v })} label={__('Add title attribute when missing', 'ai-rank-suite')} />
{__('Existing alt texts are never overwritten — this only fills gaps.', 'ai-rank-suite')}
update({ link_nofollow: v })}
label={__('Add rel="nofollow" to external links', 'ai-rank-suite')}
/>
update({ link_new_tab: v })}
label={__('Open external links in a new tab', 'ai-rank-suite')}
/>
);
}
function GhostMode() {
const { data, update, save, busy, saved, error } = useSettings('/settings/hardening');
if (!data) return ;
const s = data.settings;
const TOGGLES = [
{ key: 'hide_generator', label: __('Hide the WordPress version', 'ai-rank-suite'), hint: __('Removes the generator meta tag — attackers match versions to known exploits', 'ai-rank-suite') },
{ key: 'strip_ver', label: __('Strip ?ver= from assets', 'ai-rank-suite'), hint: __('Plugin and theme versions leak through asset URLs', 'ai-rank-suite') },
{ key: 'remove_headers', label: __('Remove RSD, wlwmanifest & shortlink tags', 'ai-rank-suite'), hint: __('Legacy discovery endpoints nothing modern needs', 'ai-rank-suite') },
{ key: 'disable_xmlrpc', label: __('Disable XML-RPC', 'ai-rank-suite'), hint: __('A common brute-force and pingback-DDoS door. Jetpack and the mobile app need it — leave off in that case', 'ai-rank-suite') },
{ key: 'hide_login_error', label: __('Generic login errors', 'ai-rank-suite'), hint: __('“Wrong password” confirms a username exists — replace with a neutral message', 'ai-rank-suite') },
{ key: 'block_enum', label: __('Block user enumeration', 'ai-rank-suite'), hint: __('?author=1 redirects and the public REST users list reveal usernames for brute-forcing', 'ai-rank-suite') },
{ key: 'security_headers', label: __('Send security headers', 'ai-rank-suite'), hint: __('X-Content-Type-Options, X-Frame-Options, Referrer-Policy, Permissions-Policy', 'ai-rank-suite') },
{ key: 'hide_admin_bar', label: __('Hide the AI Rank Suite admin-bar menu', 'ai-rank-suite'), hint: __('Removes this plugin’s own entry from the WordPress toolbar. Everything stays reachable from the plugin screens', 'ai-rank-suite') },
];
return (