',
''
);
} elseif ( ! Module_Registry::is_pro_active() ) {
return sprintf(
/* translators: 1: Opening strong tag, 2: Closing strong tag. */
__(
'%1$sStrengthen your security toolkit.%2$s Unlock additional login protection, authentication, and advanced security features with Admin Optimizer Pro.',
'admin-optimizer'
),
'',
''
);
} else {
return $message;
}
},
10,
2
);
}
/**
* Remove entries from the HTTP header
*
* @return void
*/
public function configure_http_header() {
if ( headers_sent() ) {
return;
}
if ( Module_Registry::is_enabled( 'remove_pingback_header' ) ) {
header_remove( 'X-Pingback' );
}
if ( Module_Registry::is_enabled( 'remove_powered_by_header' ) ) {
header_remove( 'X-Powered-By' );
}
}
/**
* Ordinary module IDs this Section owns, mapped to their navigation labels.
*
* @return array
*/
protected function section_nav_modules(): array {
return [
'block_login' => 'Block Failed Login',
'two_factor_authentication' => 'Two-factor Authentication',
'custom_login_url' => 'Custom Login URL',
];
}
/**
* Section-owned "Hardening" presentation group of lightweight
* SECTION_FEATURE capabilities.
*
* @return array{label:string,description:string,members:array}
*/
protected function section_feature_group(): ?array {
return [
'label' => __( 'Hardening', 'admin-optimizer' ),
'description' => __( 'Strengthen WordPress security by reducing unnecessary exposure and disabling commonly abused features.', 'admin-optimizer' ),
'members' => [
'disable_xmlrpc',
'hide_wp_version',
'remove_pingback_header',
'remove_powered_by_header',
'remove_rest_api_link',
'remove_rsd',
'remove_shortlink',
],
];
}
}