-
Notifications
You must be signed in to change notification settings - Fork 0
/
simpay-wordpress.php
49 lines (36 loc) · 1.33 KB
/
simpay-wordpress.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* Plugin Name: SimPay Wordpress
* Plugin URI: https://simpay.pl
* Description: Use SimPay SMS service to use during registration or access to the post.
* Version: 2.2.5
* Author: SimPay
* Author URI: https://simpay.pl
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: simpay-wordpress.
*/
use SimPay\SimPayWordpressPlugin\PluginManagement\PluginManagerFactory;
defined('ABSPATH') || exit;
define('SIMPAY_PLUGIN_FILE', __FILE__);
define('SIMPAY_ABSPATH', __DIR__.'/');
define('SIMPAY_CONFIG_PATH', __DIR__.'/config/simpay-wordpress.json');
require_once __DIR__.'/vendor/autoload.php';
function simpay_activateSimPayWordpressPlugin(): void
{
$pluginManager = PluginManagerFactory::create();
$pluginManager->activatePlugin();
}
function simpay_deactivateSimPayWordpressPlugin(): void
{
$pluginManager = PluginManagerFactory::create();
$pluginManager->deactivatePlugin();
}
register_activation_hook(__FILE__, 'simpay_activateSimPayWordpressPlugin');
register_deactivation_hook(__FILE__, 'simpay_deactivateSimPayWordpressPlugin');
function simpay_initSimPay(): void
{
$pluginManager = PluginManagerFactory::create();
$pluginManager->init();
}
add_action('plugins_loaded', 'simpay_initSimPay', 11);