| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Plugin Name: Hostinger |
| 5 |
* Plugin URI: https://hostinger.com |
| 6 |
* Description: Hostinger WordPress plugin. |
| 7 |
* Version: 1.8.2 |
| 8 |
* Requires at least: 5.6 |
| 9 |
* Requires PHP: 7.4 |
| 10 |
* Author: Hostinger |
| 11 |
* License: GPL v3 |
| 12 |
* License URI: https://www.gnu.org/licenses/gpl-3.0.html |
| 13 |
* Author URI: https://www.hostinger.com |
| 14 |
* Text Domain: hostinger |
| 15 |
* Domain Path: /languages |
| 16 |
* |
| 17 |
*/ |
| 18 |
|
| 19 |
defined( 'ABSPATH' ) || exit; |
| 20 |
|
| 21 |
if ( ! defined( 'HOSTINGER_VERSION' ) ) { |
| 22 |
define( 'HOSTINGER_VERSION', '1.8.2' ); |
| 23 |
} |
| 24 |
|
| 25 |
if ( ! defined( 'HOSTINGER_ABSPATH' ) ) { |
| 26 |
define( 'HOSTINGER_ABSPATH', plugin_dir_path( __FILE__ ) ); |
| 27 |
} |
| 28 |
|
| 29 |
if ( ! defined( 'HOSTINGER_PLUGIN_FILE' ) ) { |
| 30 |
define( 'HOSTINGER_PLUGIN_FILE', __FILE__ ); |
| 31 |
} |
| 32 |
|
| 33 |
if ( ! defined( 'HOSTINGER_PLUGIN_URL' ) ) { |
| 34 |
define( 'HOSTINGER_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
| 35 |
} |
| 36 |
|
| 37 |
if ( ! defined( 'HOSTINGER_ASSETS_URL' ) ) { |
| 38 |
define( 'HOSTINGER_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' ); |
| 39 |
} |
| 40 |
|
| 41 |
if ( ! defined( 'HOSTINGER_WP_CONFIG_PATH' ) ) { |
| 42 |
define( 'HOSTINGER_WP_CONFIG_PATH', ABSPATH . '/.private/config.json' ); |
| 43 |
} |
| 44 |
|
| 45 |
if ( ! defined( 'HOSTINGER_WP_TOKEN' ) ) { |
| 46 |
$path = explode('/', __DIR__); |
| 47 |
$serverRootPath = '/' . $path[1] . '/' . $path[2]; |
| 48 |
define( 'HOSTINGER_WP_TOKEN', $serverRootPath . '/.api_token' ); |
| 49 |
} |
| 50 |
|
| 51 |
if ( ! defined( 'HOSTINGER_REST_URI' ) ) { |
| 52 |
define( 'HOSTINGER_REST_URI', 'https://rest-hosting.hostinger.com' ); |
| 53 |
} |
| 54 |
|
| 55 |
function hostinger_activate(): void { |
| 56 |
require_once HOSTINGER_ABSPATH . 'includes/class-hostinger-activator.php'; |
| 57 |
Hostinger_Activator::activate(); |
| 58 |
} |
| 59 |
|
| 60 |
function hostinger_deactivate(): void { |
| 61 |
require_once HOSTINGER_ABSPATH . 'includes/class-hostinger-deactivator.php'; |
| 62 |
Hostinger_Deactivator::deactivate(); |
| 63 |
} |
| 64 |
|
| 65 |
register_activation_hook( __FILE__, 'hostinger_activate' ); |
| 66 |
register_deactivation_hook( __FILE__, 'hostinger_deactivate' ); |
| 67 |
require_once HOSTINGER_ABSPATH . 'includes/class-hostinger.php'; |
| 68 |
|
| 69 |
$plugin = new Hostinger(); |
| 70 |
$plugin->run(); |
| 71 |
|