| @@ -1,14 +1,11 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace Hostinger; |
| 4 | 4 | |
| 5 | - | |
| 5 | +use Hostinger\Admin\Ajax as AdminAjax; | |
| 6 | 6 | use Hostinger\Admin\PluginSettings; |
| 7 | -use Hostinger\Admin\Jobs\JobInitializer; | |
| 8 | -use Hostinger\Admin\Proxy; | |
| 9 | 7 | use Hostinger\LlmsTxtGenerator\LlmsTxtFileHelper; |
| 10 | -use Hostinger\LlmsTxtGenerator\LlmsTxtParser; | |
| 11 | 8 | use Hostinger\Rest\Routes; |
| 12 | 9 | use Hostinger\Rest\SettingsRoutes; |
| 13 | 10 | use Hostinger\Admin\Assets as AdminAssets; |
| 14 | 11 | use Hostinger\Admin\Hooks as AdminHooks; |
| @@ -13,10 +10,8 @@ | ||
| 13 | 10 | use Hostinger\Admin\Assets as AdminAssets; |
| 14 | 11 | use Hostinger\Admin\Hooks as AdminHooks; |
| 15 | 12 | use Hostinger\Admin\Menu as AdminMenu; |
| 16 | 13 | use Hostinger\Admin\Redirects as AdminRedirects; |
| 17 | -use Hostinger\WpHelper\Config; | |
| 18 | -use Hostinger\WpHelper\Requests\Client; | |
| 19 | 14 | use Hostinger\WpHelper\Utils; |
| 20 | 15 | use Hostinger\LlmsTxtGenerator\LlmsTxtGenerator; |
| 21 | 16 | |
| 22 | 17 | defined( 'ABSPATH' ) || exit; |
| @@ -23,15 +18,11 @@ | ||
| 23 | 18 | |
| 24 | 19 | class Bootstrap { |
| 25 | 20 | |
| 26 | 21 | protected Loader $loader; |
| 27 | - protected Utils $utils; | |
| 28 | - protected Config $config; | |
| 29 | 22 | |
| 30 | 23 | public function __construct() { |
| 31 | 24 | $this->loader = new Loader(); |
| 32 | - $this->utils = new Utils(); | |
| 33 | - $this->config = new Config(); | |
| 34 | 25 | } |
| 35 | 26 | |
| 36 | 27 | public function run(): void { |
| 37 | 28 | $this->load_dependencies(); |
| @@ -63,31 +54,23 @@ | ||
| 63 | 54 | $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
| 64 | 55 | } |
| 65 | 56 | |
| 66 | 57 | private function load_admin_dependencies(): void { |
| 58 | + $utils = new Utils(); | |
| 67 | 59 | new AdminAssets(); |
| 68 | - new AdminHooks( $this->utils ); | |
| 60 | + new AdminHooks( $utils ); | |
| 69 | 61 | new AdminMenu(); |
| 70 | 62 | new AdminRedirects(); |
| 71 | 63 | new AdminRedirects(); |
| 64 | + new AdminAjax(); | |
| 72 | 65 | } |
| 73 | 66 | |
| 74 | 67 | private function load_public_dependencies(): void { |
| 75 | - | |
| 76 | - $client = new Client( | |
| 77 | - 'https://wh-wordpress-proxy-api.hostinger.io', | |
| 78 | - array( | |
| 79 | - Config::TOKEN_HEADER => $this->utils->getApiToken(), | |
| 80 | - Config::DOMAIN_HEADER => $this->utils->getHostInfo(), | |
| 81 | - ) | |
| 82 | - ); | |
| 83 | - | |
| 84 | - new JobInitializer( new Proxy( $client, $this->utils ) ); | |
| 85 | 68 | new Hooks(); |
| 86 | 69 | |
| 87 | 70 | $plugin_settings = new PluginSettings(); |
| 88 | 71 | |
| 89 | - new LlmsTxtGenerator( $plugin_settings, new LlmsTxtFileHelper(), new LlmsTxtParser() ); | |
| 72 | + new LlmsTxtGenerator( $plugin_settings, new LlmsTxtFileHelper() ); | |
| 90 | 73 | |
| 91 | 74 | $settings_routes = new SettingsRoutes( $plugin_settings ); |
| 92 | 75 | $routes = new Routes( $settings_routes ); |
| 93 | 76 | $routes->init(); |