',
''
);
} elseif ( ! Module_Registry::is_pro_active() ) {
return sprintf(
/* translators: 1: Opening strong tag, 2: Closing strong tag. */
__(
'%1$sTake your SEO further.%2$s Unlock AI metadata generation, internal link suggestions, automation, and other advanced SEO tools with Admin Optimizer Pro.',
'admin-optimizer'
),
'',
''
);
} else {
return $message;
}
},
10,
2
);
}
/**
* Disable Frontend archive pages
*
* @return void
*/
public function disable_frontend_pages() {
if ( ! is_admin() ) {
global $wp_query;
$set_404 = false;
if ( Module_Registry::is_enabled( 'disable_category_archive' ) && is_category() ) {
$set_404 = true;
} elseif ( Module_Registry::is_enabled( 'disable_tag_archive' ) && is_tag() ) {
$set_404 = true;
} elseif ( Module_Registry::is_enabled( 'disable_author_archive' ) && is_author() ) {
$set_404 = true;
} elseif ( Module_Registry::is_enabled( 'disable_date_archive' ) && is_date() ) {
$set_404 = true;
}
if ( $set_404 ) {
$wp_query->set_404();
}
}
}
/**
* Ordinary module IDs this Section owns, mapped to their navigation labels.
*
* @return array
*/
protected function section_nav_modules(): array {
return [
'seo_manager' => 'SEO Manager',
'xml_sitemap' => 'XML Sitemap & Google News Sitemap',
'redirect_manager' => 'Redirect Manager',
'ads_robots_txt' => 'Robots.txt & Ads.txt',
];
}
/**
* Section-owned "SEO Controls" presentation group of lightweight
* SECTION_FEATURE capabilities.
*
* @return array{label:string,description:string,members:array}
*/
protected function section_feature_group(): ?array {
return [
'label' => __( 'SEO Controls', 'admin-optimizer' ),
'description' => __( 'Control how WordPress content, archives, and URLs are exposed to search engines and visitors.', 'admin-optimizer' ),
'members' => [
'disable_category_archive',
'disable_tag_archive',
'disable_author_archive',
'disable_date_archive',
],
];
}
}