| @@ -2,8 +2,9 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace Hostinger\Admin; |
| 4 | 4 | |
| 5 | 5 | use Hostinger\Admin\Menu; |
| 6 | +use Hostinger\LlmsTxtGenerator\LlmsTxtFileHelper; | |
| 6 | 7 | use Hostinger\WpMenuManager\Menus; |
| 7 | 8 | use Hostinger\Helper; |
| 8 | 9 | use Hostinger\WpHelper\Utils; |
| 9 | 10 | |
| @@ -20,13 +21,19 @@ | ||
| 20 | 21 | */ |
| 21 | 22 | private Helper $helper; |
| 22 | 23 | |
| 23 | 24 | /** |
| 25 | + * @var LlmsTxtFileHelper | |
| 26 | + */ | |
| 27 | + private LlmsTxtFileHelper $llms_txt_file_helper; | |
| 28 | + | |
| 29 | + /** | |
| 24 | 30 | * @var Utils |
| 25 | 31 | */ |
| 26 | 32 | private Utils $utils; |
| 27 | 33 | |
| 28 | 34 | public function __construct() { |
| 35 | + $this->llms_txt_file_helper = new LlmsTxtFileHelper(); | |
| 29 | 36 | $this->helper = new Helper(); |
| 30 | 37 | $this->utils = new Utils(); |
| 31 | 38 | $admin_path = parse_url(admin_url(), PHP_URL_PATH); |
| 32 | 39 | |
| @@ -108,8 +115,10 @@ | ||
| 108 | 115 | 'hplatform' => ! empty( $_SERVER['H_PLATFORM'] ) ? 1 : 0, |
| 109 | 116 | 'plugin_split_notice' => $this->helper->should_plugin_split_notice_shown() ? 1 : 0, |
| 110 | 117 | 'hts_close_plugin_split_nonce' => wp_create_nonce( 'hts_close_plugin_split' ), |
| 111 | 118 | 'edit_site_url' => $this->helper->get_edit_site_url(), |
| 119 | + 'llmstxt_file_url' => $this->llms_txt_file_helper->get_llmstxt_file_url(), | |
| 120 | + 'llmstxt_file_user_generated' => $this->llms_txt_file_helper->is_user_generated_file(), | |
| 112 | 121 | 'translations' => array( |
| 113 | 122 | 'routes_tools' => __( 'Tools', 'hostinger' ), |
| 114 | 123 | 'hostinger_tools_open_guide' => __( 'Open guide', 'hostinger' ), |
| 115 | 124 | 'hostinger_tools_preview_site' => __( 'Preview site', 'hostinger' ), |
| @@ -138,11 +147,19 @@ | ||
| 138 | 147 | 'hostinger_tools_maintenance' => __( 'Maintenance', 'hostinger' ), |
| 139 | 148 | 'hostinger_tools_preview_my_website' => __( 'Preview my website', 'hostinger' ), |
| 140 | 149 | 'hostinger_tools_security' => __( 'Security', 'hostinger' ), |
| 141 | 150 | 'hostinger_tools_redirects' => __( 'Redirects', 'hostinger' ), |
| 142 | - 'hostinger_tools_llms' => __( 'AI Preferences', 'hostinger' ), | |
| 143 | - 'hostinger_tools_enable_llms_txt' => __( 'Turn on LLMs.txt', 'hostinger' ), | |
| 144 | - 'hostinger_tools_llms_txt_description' => __( 'Let Large Language Models (LLMs) discover, interpret and interact with your WordPress site.', 'hostinger' ), | |
| 151 | + 'hostinger_tools_llms' => __( 'LLM Optimization', 'hostinger' ), | |
| 152 | + 'hostinger_tools_enable_llms_txt' => __( 'Create LLMs.txt file', 'hostinger' ), | |
| 153 | + 'hostinger_tools_llms_txt_description' => __( 'Let AI explore, understand, and interact with your WordPress site', 'hostinger' ), | |
| 154 | + 'hostinger_tools_llms_txt_learn_more' => __( 'Learn more', 'hostinger' ), | |
| 155 | + 'hostinger_tools_llms_txt_check_validity' => __( 'Check validity', 'hostinger' ), | |
| 156 | + 'hostinger_tools_llms_txt_llmstxt' => __( 'LLMS.txt', 'hostinger' ), | |
| 157 | + 'hostinger_tools_llms_txt_external_file_found' => __( 'An external LLMs.txt file was found. Switching on the toggle will replace it with a new one.', 'hostinger' ), | |
| 158 | + 'hostinger_tools_llms_txt_modal_title' => __( 'Create new LLMs.txt file?', 'hostinger' ), | |
| 159 | + 'hostinger_tools_llms_txt_modal_description' => __( 'This will replace the existing LLMs.txt file with a new one by Hostinger Tools. The original file can’t be restored.', 'hostinger' ), | |
| 160 | + 'hostinger_tools_llms_txt_modal_cancel' => __( 'Cancel', 'hostinger' ), | |
| 161 | + 'hostinger_tools_llms_txt_modal_create_file' => __( 'Create file', 'hostinger' ), | |
| 145 | 162 | 'hostinger_tools_maintenance_mode' => __( 'Maintenance mode', 'hostinger' ), |
| 146 | 163 | 'hostinger_tools_bypass_link' => __( 'Bypass link', 'hostinger' ), |
| 147 | 164 | 'hostinger_tools_split_title' => __( 'We’re splitting Hostinger plugin into two: Hostinger Tools and Hostinger Easy Onboarding', 'hostinger' ), |
| 148 | 165 | 'hostinger_tools_split_body' => __( 'Hostinger Tools will offer new tools to simplify your site management. And Hostinger Easy Onboarding will guide you through the steps of building a website.', 'hostinger' ), |