-
Notifications
You must be signed in to change notification settings - Fork 2
/
mosparo-integration.php
63 lines (54 loc) · 2.16 KB
/
mosparo-integration.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
/**
* mosparo Integration
*
* @package MosparoIntegration
* @author mosparo Core Developers and contributors
* @copyright 2021-2024 mosparo Core Developers and contributors
* @license MIT
*
* @wordpress-plugin
* Plugin Name: mosparo Integration
* Plugin URI: https://mosparo.io/integrations/wordpress/
* Description: Adds the ability to protect forms in WordPress with mosparo.
* Author: mosparo
* Author URI: https://mosparo.io/
* License: MIT
* Version: 1.12.0
* Text Domain: mosparo-integration
* Domain Path: /languages
*/
use MosparoIntegration\Helper\AdminHelper;
use MosparoIntegration\Helper\ConfigHelper;
use MosparoIntegration\Helper\FrontendHelper;
use MosparoIntegration\Helper\ModuleHelper;
require_once(__DIR__ . '/src/autoload.php');
require_once(__DIR__ . '/vendor-prefixed/autoload.php');
function mosparoIntegrationInitialize()
{
$configHelper = ConfigHelper::getInstance();
$moduleHelper = ModuleHelper::getInstance();
$moduleHelper->initializeActiveModules(plugin_dir_path(__FILE__), plugin_dir_url(__FILE__));
$frontendHelper = FrontendHelper::getInstance();
$frontendHelper->initializeScheduleEvents();
$adminHelper = AdminHelper::getInstance();
$adminHelper->initializeAdmin(__DIR__, plugin_dir_url(__FILE__), plugin_basename(__FILE__));
}
add_action('plugins_loaded', 'mosparoIntegrationInitialize', 1);
function mosparoIntegrationInitializeTextDomain()
{
load_plugin_textdomain('mosparo-integration', false, dirname(plugin_basename(__FILE__)) . '/languages');
}
add_action('init', 'mosparoIntegrationInitializeTextDomain');
function mosparoIntegrationActivatePlugin()
{
if (!wp_next_scheduled('mosparo_integration_refresh_css_url_cache')) {
wp_schedule_event(time(), 'daily', 'mosparo_integration_refresh_css_url_cache');
}
}
register_activation_hook(__FILE__, 'mosparoIntegrationActivatePlugin');
function mosparoIntegrationDeactivatePlugin()
{
wp_clear_scheduled_hook('mosparo_integration_refresh_css_url_cache');
}
register_deactivation_hook(__FILE__, 'mosparoIntegrationDeactivatePlugin');