PluginProbe
Hostinger Tools / 2.0.6
Hostinger Tools v2.0.6
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 2.0.1 2.0.4 All 108 releases
hostinger / hostinger.php

hostinger.php in Hostinger Tools 2.0.6, at hostinger.php

82 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Hostinger
4 * Plugin URI: https://hostinger.com
5 * Description: Hostinger WordPress plugin.
6 * Version: 2.0.6
7 * Requires at least: 5.9
8 * Requires PHP: 7.4
9 * Author: Hostinger
10 * License: GPL v3
11 * License URI: https://www.gnu.org/licenses/gpl-3.0.html
12 * Author URI: https://www.hostinger.com
13 * Text Domain: hostinger
14 * Domain Path: /languages
15 *
16 * @package Hostinger
17 */
18
19 defined( 'ABSPATH' ) || exit;
20
21 if ( ! defined( 'HOSTINGER_VERSION' ) ) {
22 define( 'HOSTINGER_VERSION', '2.0.6' );
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 $hostinger_dir_parts = explode( '/', __DIR__ );
47 $hostinger_server_root_path = '/' . $hostinger_dir_parts[1] . '/' . $hostinger_dir_parts[2];
48 define( 'HOSTINGER_WP_TOKEN', $hostinger_server_root_path . '/.api_token' );
49 }
50
51 if ( ! defined( 'HOSTINGER_REST_URI' ) ) {
52 define( 'HOSTINGER_REST_URI', 'https://rest-hosting.hostinger.com' );
53 }
54
55 /**
56 * Plugin activation hook.
57 *
58 * @return void
59 */
60 function hostinger_activate(): void {
61 require_once HOSTINGER_ABSPATH . 'includes/class-hostinger-activator.php';
62 Hostinger_Activator::activate();
63 }
64
65 /**
66 * Plugin dectivation hook.
67 *
68 * @return void
69 */
70 function hostinger_deactivate(): void {
71 require_once HOSTINGER_ABSPATH . 'includes/class-hostinger-deactivator.php';
72 Hostinger_Deactivator::deactivate();
73 }
74
75 register_activation_hook( __FILE__, 'hostinger_activate' );
76 register_deactivation_hook( __FILE__, 'hostinger_deactivate' );
77
78 require_once HOSTINGER_ABSPATH . 'includes/class-hostinger.php';
79
80 $hostinger = new Hostinger();
81 $hostinger->run();
82