or \n if (preg_match('/(
]*>|]*class=["\'][^"\']*main-page-wrapper[^"\']*["\'][^>]*>|]*>)/i', $html, $matches)) {\n $target = $matches[0];\n $html = str_replace($target, $target . "\n" . $h1_tag, $html);\n }\n }\n\n return $html;\n }\n\n private function get_page_h1() {\n if (is_front_page() || is_home()) {\n return "Zoha Tech BD – Smart Tech, Simply Delivered";\n } elseif (function_exists('is_shop') && is_shop()) {\n return "Shop Authentic Gadgets & Electronics";\n } elseif (function_exists('is_product_category') && is_product_category()) {\n $term = get_queried_object();\n return $term ? $term->name : "Products";\n } elseif (is_singular()) {\n return get_the_title();\n }\n return "Zoha Tech BD";\n }\n\n /**\n * 9. Robots.txt Filter\n */\n public function filter_robots_txt($output, $public) {\n if ('0' === $public) {\n return $output;\n }\n\n $sitemap_url = home_url('/wp-sitemap.xml');\n $custom_rules = "User-agent: *\n";\n $custom_rules .= "Disallow: /wp-admin/\n";\n $custom_rules .= "Allow: /wp-admin/admin-ajax.php\n";\n $custom_rules .= "Disallow: /wp-content/uploads/wc-logs/\n";\n $custom_rules .= "Disallow: /wp-content/uploads/woocommerce_transient_files/\n";\n $custom_rules .= "Disallow: /wp-content/uploads/woocommerce_uploads/\n";\n $custom_rules .= "Disallow: /*?add-to-cart=\n";\n $custom_rules .= "Disallow: /*?*add-to-cart=\n";\n $custom_rules .= "Disallow: /cart/\n";\n $custom_rules .= "Disallow: /checkout/\n";\n $custom_rules .= "Disallow: /my-account/\n\n";\n $custom_rules .= "Sitemap: " . esc_url($sitemap_url) . "\n";\n\n return $custom_rules;\n }\n}\n\n// Initialize on plugins_loaded\nadd_action('plugins_loaded', ['Zoha_Master_SEO', 'get_instance'], 5);\n