| 1 |
<?php declare(strict_types=1); |
| 2 |
|
| 3 |
/** |
| 4 |
* Plugin Name: MultiSafepay |
| 5 |
* Plugin URI: https://docs.multisafepay.com/docs/woocommerce |
| 6 |
* Description: MultiSafepay Payment Plugin |
| 7 |
* Version: 6.13.0 |
| 8 |
* Author: MultiSafepay |
| 9 |
* Author URI: https://www.multisafepay.com |
| 10 |
* Copyright: Copyright (c) MultiSafepay, Inc. (https://www.multisafepay.com) |
| 11 |
* License: GNU General Public License v3.0 |
| 12 |
* License URI: http://www.gnu.org/licenses/gpl-3.0.html |
| 13 |
* Requires at least: 6.0 |
| 14 |
* Tested up to: 7.0.0 |
| 15 |
* WC requires at least: 6.0.0 |
| 16 |
* WC tested up to: 10.7.0 |
| 17 |
* Requires PHP: 7.3 |
| 18 |
* Text Domain: multisafepay |
| 19 |
* Domain Path: /languages |
| 20 |
*/ |
| 21 |
|
| 22 |
if ( ! defined( 'ABSPATH' ) ) { |
| 23 |
die(); |
| 24 |
} |
| 25 |
|
| 26 |
/** |
| 27 |
* Plugin version |
| 28 |
*/ |
| 29 |
define( 'MULTISAFEPAY_PLUGIN_VERSION', '6.13.0' ); |
| 30 |
|
| 31 |
/** |
| 32 |
* Plugin URL |
| 33 |
* Do not include a trailing slash. Should be included it in the string with which is concatenated |
| 34 |
*/ |
| 35 |
define( 'MULTISAFEPAY_PLUGIN_URL', plugins_url( '', __FILE__ ) ); |
| 36 |
|
| 37 |
/** |
| 38 |
* Plugin dir path |
| 39 |
* Include a trailing slash. Should not be included it in the string with which is concatenated |
| 40 |
*/ |
| 41 |
define( 'MULTISAFEPAY_PLUGIN_DIR_PATH', plugin_dir_path( __FILE__ ) ); |
| 42 |
|
| 43 |
/** |
| 44 |
* Composer's autoload file. |
| 45 |
*/ |
| 46 |
require_once MULTISAFEPAY_PLUGIN_DIR_PATH . 'vendor/autoload.php'; |
| 47 |
|
| 48 |
use MultiSafepay\WooCommerce\Utils\Activator; |
| 49 |
use MultiSafepay\WooCommerce\Main; |
| 50 |
|
| 51 |
/** |
| 52 |
* The code that runs during plugin activation. |
| 53 |
* The class is documented in src/utils/Activator.php |
| 54 |
* |
| 55 |
* @see https://developer.wordpress.org/reference/functions/register_activation_hook/ |
| 56 |
* |
| 57 |
* @param null|bool $network_wide |
| 58 |
* @return void |
| 59 |
*/ |
| 60 |
function activate_multisafepay( ?bool $network_wide ): void { |
| 61 |
$activator = new Activator(); |
| 62 |
$activator->activate( $network_wide ); |
| 63 |
} |
| 64 |
register_activation_hook( __FILE__, 'activate_multisafepay' ); |
| 65 |
|
| 66 |
/** |
| 67 |
* Init plugin |
| 68 |
* |
| 69 |
* @see https://developer.wordpress.org/plugins/hooks/ |
| 70 |
* @return void |
| 71 |
*/ |
| 72 |
function init_multisafepay() { |
| 73 |
if ( ! function_exists( 'is_plugin_active' ) ) { |
| 74 |
require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 75 |
} |
| 76 |
if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) { |
| 77 |
$plugin = new Main(); |
| 78 |
$plugin->init(); |
| 79 |
} |
| 80 |
} |
| 81 |
|
| 82 |
/** |
| 83 |
* Wait for WooCommerce to load |
| 84 |
* |
| 85 |
* @return void |
| 86 |
*/ |
| 87 |
function action_woocommerce_loaded() { |
| 88 |
init_multisafepay(); |
| 89 |
} |
| 90 |
add_action( 'woocommerce_loaded', 'action_woocommerce_loaded', 10, 1 ); |
| 91 |
|