PluginProbe
Hostinger Tools / 3.0.79
Hostinger Tools v3.0.79
3.0.79 3.0.78 3.0.77 3.0.76 3.0.75 3.0.74 3.0.73 3.0.72 3.0.71 3.0.70 3.0.69 3.0.68 3.0.67 3.0.66 1.8.1 1.8.2 1.8.3 1.9.1 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 All 110 releases
← All changes | includes/Bootstrap.php +26 -4 3.0.78 → 3.0.79 View file →
@@ -5,11 +5,17 @@
5 5
6 6 use Hostinger\Admin\PluginSettings;
7 7 use Hostinger\Admin\Jobs\JobInitializer;
8 8 use Hostinger\Admin\Proxy;
9 +use Hostinger\Cdn\CacheClient;
10 +use Hostinger\Cdn\CachePurger;
11 +use Hostinger\Cdn\LiteSpeedHooks;
12 +use Hostinger\Cdn\SoftwareIdResolver;
9 13 use Hostinger\LlmsTxtGenerator\LlmsTxtFileHelper;
10 14 use Hostinger\LlmsTxtGenerator\LlmsTxtHeadLink;
11 15 use Hostinger\LlmsTxtGenerator\LlmsTxtParser;
16 +use Hostinger\LlmsTxtGenerator\LlmsTxtSummaryProvider;
17 +use Hostinger\Rest\CacheRoutes;
12 18 use Hostinger\Rest\Routes;
13 19 use Hostinger\Rest\SettingsRoutes;
14 20 use Hostinger\Admin\Assets as AdminAssets;
15 21 use Hostinger\Admin\Hooks as AdminHooks;
@@ -74,9 +80,9 @@
74 80
75 81 private function load_public_dependencies(): void {
76 82
77 83 $client = new Client(
78 - 'https://wh-wordpress-proxy-api.hostinger.io',
84 + 'https://' . HOSTINGER_PROXY_API_HOST,
79 85 array(
80 86 Config::TOKEN_HEADER => $this->utils->getApiToken(),
81 87 Config::DOMAIN_HEADER => $this->utils->getHostInfo(),
82 88 )
@@ -81,20 +87,36 @@
81 87 Config::DOMAIN_HEADER => $this->utils->getHostInfo(),
82 88 )
83 89 );
84 90
85 - new JobInitializer( new Proxy( $client, $this->utils ) );
91 + $llms_txt_parser = new LlmsTxtParser( new LlmsTxtSummaryProvider() );
92 +
93 + new JobInitializer( new Proxy( $client, $this->utils ), $llms_txt_parser );
86 94 new Hooks();
87 95
88 96 $plugin_settings = new PluginSettings();
89 97 $llms_txt_file_helper = new LlmsTxtFileHelper();
90 98
91 - new LlmsTxtGenerator( $plugin_settings, $llms_txt_file_helper, new LlmsTxtParser() );
99 + $llms_txt_generator = new LlmsTxtGenerator( $plugin_settings, $llms_txt_file_helper, $llms_txt_parser );
100 + $this->loader->add_action( 'wp_loaded', $llms_txt_generator, 'maybe_regenerate_after_update' );
92 101
93 102 $llms_txt_head_link = new LlmsTxtHeadLink( $plugin_settings, $llms_txt_file_helper );
94 103 $this->loader->add_action( 'wp_head', $llms_txt_head_link, 'render' );
95 104
105 + $cache_purger = $this->build_cache_purger( $client );
106 +
107 + new LiteSpeedHooks( $cache_purger, $this->utils );
108 +
96 109 $settings_routes = new SettingsRoutes( $plugin_settings );
97 - $routes = new Routes( $settings_routes );
110 + $cache_routes = new CacheRoutes( $cache_purger );
111 + $routes = new Routes( $settings_routes, $cache_routes );
98 112 $routes->init();
113 + }
114 +
115 + private function build_cache_purger( Client $client ): CachePurger {
116 + return new CachePurger(
117 + new CacheClient( $client ),
118 + new SoftwareIdResolver( $client ),
119 + $this->utils
120 + );
99 121 }
100 122 }