[
'section' => 'head', 'recommended' => true,
'label' => __( 'WordPress version', 'ago-cleanup' ),
'summary' => __( 'Hides your WordPress version from the page source.', 'ago-cleanup' ),
'what' => __( 'Removes the version number from HTML meta tag and RSS feeds.', 'ago-cleanup' ),
'why' => __( 'Attackers scan for outdated versions. Hiding it is a small but standard hardening step.', 'ago-cleanup' ),
'caveat' => '',
],
'wlw_manifest' => [
'section' => 'head', 'recommended' => true,
'label' => __( 'Windows Live Writer link', 'ago-cleanup' ),
'summary' => __( 'Removes a `` tag for a Microsoft tool retired in 2017.', 'ago-cleanup' ),
'what' => __( 'Removes the wlwmanifest.xml link from the HTML head.', 'ago-cleanup' ),
'why' => __( 'Nobody uses Windows Live Writer anymore. Dead bytes.', 'ago-cleanup' ),
'caveat' => '',
],
'rsd_link' => [
'section' => 'head', 'recommended' => true,
'label' => __( 'RSD link', 'ago-cleanup' ),
'summary' => __( 'Removes a `` tag used by ancient blog editors.', 'ago-cleanup' ),
'what' => __( 'Removes the Really Simple Discovery link from the HTML head.', 'ago-cleanup' ),
'why' => __( 'Modern publishing uses the REST API. RSD is dead weight.', 'ago-cleanup' ),
'caveat' => '',
],
'shortlinks' => [
'section' => 'head', 'recommended' => true,
'label' => __( 'Shortlinks', 'ago-cleanup' ),
'summary' => __( 'Removes the `?p=123` style shortlink.', 'ago-cleanup' ),
'what' => __( 'Removes shortlinks from the HTML head and HTTP headers.', 'ago-cleanup' ),
'why' => __( 'You already have pretty permalinks. The shortlink duplicates URLs and confuses analytics.', 'ago-cleanup' ),
'caveat' => '',
],
'rss_feeds' => [
'section' => 'head', 'recommended' => false,
'label' => __( 'RSS feed links in head', 'ago-cleanup' ),
'summary' => __( 'Hides RSS auto-discovery `` tags.', 'ago-cleanup' ),
'what' => __( 'Removes the `` tags from the HTML head.', 'ago-cleanup' ),
'why' => __( 'If your site is not a blog, nobody subscribes by RSS. Cleans up the head.', 'ago-cleanup' ),
'caveat' => __( 'Only enable if you do NOT publish a blog or podcast.', 'ago-cleanup' ),
],
'emojis' => [
'section' => 'assets', 'recommended' => true,
'label' => __( 'Emoji scripts and styles', 'ago-cleanup' ),
'summary' => __( 'Saves ~14 KB per page by removing emoji fallback for old browsers.', 'ago-cleanup' ),
'what' => __( 'Removes the JS+CSS WordPress loads to render emojis as images on old browsers.', 'ago-cleanup' ),
'why' => __( 'All modern browsers render emojis natively. The fallback is dead weight.', 'ago-cleanup' ),
'caveat' => '',
],
'embeds' => [
'section' => 'assets', 'recommended' => true,
'label' => __( 'oEmbed scripts', 'ago-cleanup' ),
'summary' => __( 'Saves ~6 KB. Most sites do not use WordPress-to-WordPress embeds.', 'ago-cleanup' ),
'what' => __( 'Removes the WordPress embed JS that previews your post URL in other WordPress sites.', 'ago-cleanup' ),
'why' => __( 'Saves a request and bytes.', 'ago-cleanup' ),
'caveat' => __( 'YouTube, Twitter and other oEmbeds still work, this only removes WP-to-WP embed.', 'ago-cleanup' ),
],
'jquery_migrate' => [
'section' => 'assets', 'recommended' => false,
'label' => __( 'jQuery Migrate', 'ago-cleanup' ),
'summary' => __( 'Removes compatibility shim for old jQuery 1.x syntax.', 'ago-cleanup' ),
'what' => __( 'Removes the jQuery Migrate compatibility layer on the frontend.', 'ago-cleanup' ),
'why' => __( 'If your theme and plugins are modern, you do not need this.', 'ago-cleanup' ),
'caveat' => __( 'Test the frontend after enabling. If sliders/modals break, turn it back off.', 'ago-cleanup' ),
],
'dashicons' => [
'section' => 'assets', 'recommended' => false,
'label' => __( 'Dashicons for guests', 'ago-cleanup' ),
'summary' => __( 'Saves ~45 KB for non-logged-in visitors.', 'ago-cleanup' ),
'what' => __( 'Removes the WordPress admin icon font for visitors that are NOT logged in.', 'ago-cleanup' ),
'why' => __( 'Dashicons belong to wp-admin. Public visitors do not need them.', 'ago-cleanup' ),
'caveat' => __( 'Some themes/plugins use Dashicons on the frontend. Test after enabling.', 'ago-cleanup' ),
],
'global_styles' => [
'section' => 'assets', 'recommended' => false,
'label' => __( 'Block editor global styles', 'ago-cleanup' ),
'summary' => __( 'Skip Gutenberg block styles on sites that do not use blocks.', 'ago-cleanup' ),
'what' => __( 'Removes the global-styles inline CSS and wp-block-library stylesheet on the frontend.', 'ago-cleanup' ),
'why' => __( 'If you use Elementor/Bricks/Divi/classic editor instead of Gutenberg, this CSS is unused.', 'ago-cleanup' ),
'caveat' => __( 'Disable ONLY if you do not render Gutenberg blocks on the frontend.', 'ago-cleanup' ),
],
'xmlrpc' => [
'section' => 'security', 'recommended' => true,
'label' => __( 'XML-RPC', 'ago-cleanup' ),
'summary' => __( 'Closes an endpoint often used for brute-force login attempts.', 'ago-cleanup' ),
'what' => __( 'Disables XML-RPC completely (xmlrpc.php returns nothing).', 'ago-cleanup' ),
'why' => __( 'XML-RPC is hammered by attackers trying password combos. Most sites do not need it.', 'ago-cleanup' ),
'caveat' => __( 'Disable ONLY if you do not use the WordPress mobile app, Jetpack remote publishing or trackbacks.', 'ago-cleanup' ),
],
'rest_api' => [
'section' => 'security', 'recommended' => false,
'label' => __( 'Block public REST API', 'ago-cleanup' ),
'summary' => __( 'Stops user enumeration via `/wp-json/wp/v2/users`.', 'ago-cleanup' ),
'what' => __( 'Restricts the REST API to authenticated users. Public scrapers cannot enumerate users or content.', 'ago-cleanup' ),
'why' => __( 'By default, the API lists every author. Restricting it blocks this enumeration.', 'ago-cleanup' ),
'caveat' => __( 'Disable only if your frontend code does not need public REST endpoints. Most forms and headless setups DO need it.', 'ago-cleanup' ),
],
'self_pingbacks' => [
'section' => 'other', 'recommended' => true,
'label' => __( 'Self-pingbacks', 'ago-cleanup' ),
'summary' => __( 'Stops auto-comments on your own post when you link to yourself.', 'ago-cleanup' ),
'what' => __( 'Stops WordPress from creating a pingback comment on your own post every time you link from one of your posts to another.', 'ago-cleanup' ),
'why' => __( 'Self-pingbacks clutter the comments section and serve no purpose.', 'ago-cleanup' ),
'caveat' => '',
],
];
}
/** Escapes a text and shows the parts written between backticks as code. */
private static function with_code( string $text ): string {
return (string) preg_replace( '/`([^`]+)`/', '$1', esc_html( $text ) );
}
public static function render(): void {
$toggles = self::toggles();
$section_meta = [
'head' => [ __( 'HTML head cleanup', 'ago-cleanup' ), __( 'Remove legacy `` and `` tags that bloat every page.', 'ago-cleanup' ) ],
'assets' => [ __( 'Scripts & styles', 'ago-cleanup' ), __( 'Stop loading JS and CSS your visitors don\'t need.', 'ago-cleanup' ) ],
'security' => [ __( 'Security hardening', 'ago-cleanup' ), __( 'Close common attack surfaces.', 'ago-cleanup' ) ],
'other' => [ __( 'Other', 'ago-cleanup' ), '' ],
];
?>
v
[] ] ); ?>
$t ) : if ( $t['section'] !== $section ) continue; ?>[] ] ); ?>
[] ] ); ?>
[] ] ); ?>