Admin
1 month ago
Cli
8 months ago
LlmsTxtGenerator
4 months ago
Mcp
10 months ago
Preview
1 year ago
Rest
9 months ago
Views
11 months ago
Activator.php
11 months ago
Bootstrap.php
8 months ago
Cli.php
8 months ago
ComingSoon.php
1 month ago
Deactivator.php
11 months ago
DefaultOptions.php
1 month ago
Errors.php
11 months ago
Helper.php
8 months ago
Hooks.php
1 month ago
Hostinger.php
1 month ago
I18n.php
11 months ago
LlmsTxtGenerator.php
11 months ago
Loader.php
11 months ago
Settings.php
11 months ago
Hostinger.php
52 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Hostinger; |
| 4 | |
| 5 | use Hostinger\Bootstrap; |
| 6 | |
| 7 | defined( 'ABSPATH' ) || exit; |
| 8 | |
| 9 | class Hostinger { |
| 10 | protected string $plugin_name = 'Hostinger'; |
| 11 | protected string $version; |
| 12 | |
| 13 | /** |
| 14 | * @return void |
| 15 | */ |
| 16 | public function bootstrap(): void { |
| 17 | $this->version = $this->get_plugin_version(); |
| 18 | $bootstrap = new Bootstrap(); |
| 19 | $bootstrap->run(); |
| 20 | } |
| 21 | |
| 22 | /** |
| 23 | * @return void |
| 24 | */ |
| 25 | public function run(): void { |
| 26 | $this->bootstrap(); |
| 27 | } |
| 28 | /** PHPCS:disable WordPress.NamingConventions.PrefixAllGlobals.VariableConstantNameFound */ |
| 29 | /** |
| 30 | * Define constant |
| 31 | * |
| 32 | * @param string $name Constant name. |
| 33 | * @param string|bool $value Constant value. |
| 34 | */ |
| 35 | private function define( string $name, $value ): void { |
| 36 | if ( ! defined( $name ) ) { |
| 37 | define( $name, $value ); |
| 38 | } |
| 39 | } |
| 40 | /** PHPCS:enable */ |
| 41 | /** |
| 42 | * @return string |
| 43 | */ |
| 44 | private function get_plugin_version(): string { |
| 45 | if ( defined( 'HOSTINGER_WORDPRESS_PLUGIN_VERSION' ) ) { |
| 46 | return HOSTINGER_WORDPRESS_PLUGIN_VERSION; |
| 47 | } |
| 48 | |
| 49 | return '1.0.0'; |
| 50 | } |
| 51 | } |
| 52 |