| @@ -2,11 +2,11 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * Plugin Name: Hostinger |
| 4 | 4 | * Plugin URI: https://hostinger.com |
| 5 | 5 | * Description: Hostinger WordPress plugin. |
| 6 | - * Version: 2.0.0 | |
| 7 | - * Requires at least: 5.9 | |
| 8 | - * Requires PHP: 7.4 | |
| 6 | + * Version: 2.2.4 | |
| 7 | + * Requires at least: 5.5 | |
| 8 | + * Requires PHP: 8.0 | |
| 9 | 9 | * Author: Hostinger |
| 10 | 10 | * License: GPL v3 |
| 11 | 11 | * License URI: https://www.gnu.org/licenses/gpl-3.0.html |
| 12 | 12 | * Author URI: https://www.hostinger.com |
| @@ -15,12 +15,16 @@ | ||
| 15 | 15 | * |
| 16 | 16 | * @package Hostinger |
| 17 | 17 | */ |
| 18 | 18 | |
| 19 | +use Hostinger\Hostinger; | |
| 20 | +use Hostinger\Activator; | |
| 21 | +use Hostinger\Deactivator; | |
| 22 | + | |
| 19 | 23 | defined( 'ABSPATH' ) || exit; |
| 20 | 24 | |
| 21 | 25 | if ( ! defined( 'HOSTINGER_VERSION' ) ) { |
| 22 | - define( 'HOSTINGER_VERSION', '2.0.0' ); | |
| 26 | + define( 'HOSTINGER_VERSION', '2.2.4' ); | |
| 23 | 27 | } |
| 24 | 28 | |
| 25 | 29 | if ( ! defined( 'HOSTINGER_ABSPATH' ) ) { |
| 26 | 30 | define( 'HOSTINGER_ABSPATH', plugin_dir_path( __FILE__ ) ); |
| @@ -51,27 +55,30 @@ | ||
| 51 | 55 | if ( ! defined( 'HOSTINGER_REST_URI' ) ) { |
| 52 | 56 | define( 'HOSTINGER_REST_URI', 'https://rest-hosting.hostinger.com' ); |
| 53 | 57 | } |
| 54 | 58 | |
| 59 | +$vendor_file = __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'; | |
| 60 | + | |
| 61 | +if ( file_exists( $vendor_file ) ) { | |
| 62 | + require_once $vendor_file; | |
| 63 | +} | |
| 64 | + | |
| 55 | 65 | /** |
| 56 | - * @return void | |
| 66 | + * Plugin activation hook. | |
| 57 | 67 | */ |
| 58 | 68 | function hostinger_activate(): void { |
| 59 | - require_once HOSTINGER_ABSPATH . 'includes/class-hostinger-activator.php'; | |
| 60 | - Hostinger_Activator::activate(); | |
| 69 | + Activator::activate(); | |
| 61 | 70 | } |
| 62 | 71 | |
| 63 | 72 | /** |
| 64 | - * @return void | |
| 73 | + * Plugin deactivation hook. | |
| 65 | 74 | */ |
| 66 | 75 | function hostinger_deactivate(): void { |
| 67 | - require_once HOSTINGER_ABSPATH . 'includes/class-hostinger-deactivator.php'; | |
| 68 | - Hostinger_Deactivator::deactivate(); | |
| 76 | + Deactivator::deactivate(); | |
| 69 | 77 | } |
| 70 | 78 | |
| 71 | 79 | register_activation_hook( __FILE__, 'hostinger_activate' ); |
| 72 | 80 | register_deactivation_hook( __FILE__, 'hostinger_deactivate' ); |
| 73 | 81 | |
| 74 | -require_once HOSTINGER_ABSPATH . 'includes/class-hostinger.php'; | |
| 75 | 82 | |
| 76 | 83 | $hostinger = new Hostinger(); |
| 77 | 84 | $hostinger->run(); |