admin = $admin;
}
/**
* @param Metasync_Admin $admin
* @return self
*/
public static function get_instance(Metasync_Admin $admin): self
{
if (null === self::$instance || self::$instance->admin !== $admin) {
self::$instance = new self($admin);
}
return self::$instance;
}
// ------------------------------------------------------------------
// Dashboard iframe (~200 lines)
// ------------------------------------------------------------------
public function create_admin_dashboard_iframe()
{
$general_options = Metasync::get_option('general');
$otto_pixel_uuid = isset($general_options['otto_pixel_uuid']) ? $general_options['otto_pixel_uuid'] : '';
$api_key = isset($general_options['searchatlas_api_key']) ? $general_options['searchatlas_api_key'] : '';
$hide_dashboard = $general_options['hide_dashboard_framework'] ?? false;
if ($hide_dashboard) {
$this->admin->render_layout_open('Dashboard', 'dashboard', 'Overview of your SEO performance and plugin status.');
?>
Dashboard Disabled
The dashboard is currently disabled.
admin->render_layout_close(false);
return;
}
if (!$this->admin->is_heartbeat_connected()) {
$this->admin->render_layout_open('Dashboard', 'dashboard', 'Overview of your SEO performance and plugin status.');
?>
Setup Wizard
Run the setup wizard to configure your plugin, import from other SEO plugins, and optimize your settings in just a few minutes.
Access your dashboard to view analytics, manage SEO settings, and monitor your site performance.
Authentication required: Please authenticate with your ' . esc_html(Metasync::get_effective_plugin_name()) . ' account and save your auth token in general settings.';
echo 'Go to Settings';
} else {
echo 'Open Dashboard';
}
?>
admin->render_layout_close(); ?>
admin->render_layout_open('Robots.txt', 'robots_txt', 'Control which pages search engines can crawl.'); ?>
validate_content($content);
if ($validation['valid']) {
$result = $robots_txt->write_robots_file($content);
if (is_wp_error($result)) {
echo '
admin->render_layout_close(); ?>
admin->render_layout_open('404 Monitor', 'monitor_404', 'Track and manage 404 errors detected on your site.');
$ErrorMonitor->create_admin_plugin_interface();
$this->admin->render_layout_close();
}
public function create_admin_search_engine_verification_page()
{
$page_slug = Metasync_Admin::$page_slug . '_searchengines-verification';
?>
admin->render_layout_open('Site Verification', 'site_verification', 'Verify your site ownership with search engines and other platforms.'); ?>
admin->render_layout_close(); ?>
admin->render_layout_open('Breadcrumbs', 'breadcrumbs', 'Configure breadcrumb trail settings and placement.'); ?>
📖 How to Display Breadcrumbs
Breadcrumbs are not inserted automatically. Use one of the methods below to place them on your site.
Option 1 — Shortcode
Paste the shortcode inside any page, post, or widget:
[metasync_breadcrumb]
Option 2 — PHP Template Function
Call the helper function directly inside your theme template files (e.g. single.php, page.php, header.php):
<?php metasync_breadcrumb(); ?>
Option 3 — PHP Return Value
Get the breadcrumb HTML as a string to manipulate before output:
$breadcrumbs = new Metasync_Breadcrumbs();
echo $breadcrumbs->render_breadcrumb_html();
Tip: You can also pass a post_id argument to generate breadcrumbs for a specific post outside of a template context: echo $breadcrumbs->render_breadcrumb_html(['post_id' => 123]);
admin->render_layout_close(); ?>
admin->render_layout_open('Schema Markup', 'schema_markup', 'Configure global schema markup settings for your site. Organization and WebSite schemas are injected site-wide.');
?>
admin->render_layout_close();
}
public function create_admin_local_business_page()
{
$page_slug = Metasync_Admin::$page_slug . '_local-seo';
?>
admin->render_layout_open('Local Business', 'local_business', 'Configure local business information for better local SEO.'); ?>
admin->render_layout_close(); ?>
admin->render_layout_open('Code Snippets', 'code_snippets', 'Add custom code to your site header and footer.'); ?>
admin->render_layout_close(); ?>
admin->create_admin_google_instant_index_page();
}
public function create_admin_google_console_page()
{
?>
admin->render_layout_open('Google Console', 'google_console', ''); ?>
show_google_instant_indexing_console();
?>
admin->render_layout_close(); ?>
admin->render_layout_open('Bing Console', 'bing_console', ''); ?>
show_bing_instant_indexing_console();
?>
admin->render_layout_close(); ?>
admin->render_layout_open('Optimal Settings', 'optimal_settings', 'Apply recommended SEO settings automatically.'); ?>
Site Compatibility Status
Check your site's compatibility with optimal settings.
site_compatible_status_view();
?>
Optimization Settings
Configure optimization settings for best performance.
optimization_settings_options();
?>
admin->render_layout_close(); ?>
admin->render_layout_open('Global Settings', 'general', ''); ?>
admin->render_layout_close(); ?>
admin->render_layout_open('Common Meta Settings', 'general', ''); ?>
admin->render_layout_close(); ?>
admin->render_layout_open('Social Meta', 'general', ''); ?>
admin->render_layout_close(); ?>
admin->render_layout_open('Indexation Control', 'seo_controls', 'Control how search engines index your content.'); ?>
admin->render_layout_close(); ?>
');
settings_fields(Metasync_Admin::option_group);
do_settings_sections($page_slug);
do_settings_sections($site_info_slug);
submit_button();
printf('');
}
public function create_admin_error_logs_page()
{
?>
admin->render_layout_open('Error Logs', 'general', ''); ?>
Error Logs Management
View and manage system error logs to troubleshoot issues and monitor plugin performance.