-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
executable file
·35 lines (31 loc) · 1.14 KB
/
index.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
<?php
/**
* Plugin Name: nCaptcha Contact Form 7 addon
* Description: nCaptcha provider for Contact Form 7
* Version: 0.0.2
* Author: LNC
* Author URI: http://learnnear.club/
*/
use LNCNcaptchaContact7Addon\Controllers\NCaptchaController;
use LNCNcaptchaContact7Addon\Model\Constructor\Constructor;
if (!function_exists('is_plugin_active')) {
include_once(ABSPATH . 'wp-admin/includes/plugin.php');
}
try {
$composerLoader = __DIR__ . '/vendor/autoload.php';
if (file_exists($composerLoader)) {
require_once $composerLoader;
} else {
throw new Exception(__('Install the composer for current work', 'lnc-ncaptcha-contact7-addon'));
}
if (!is_plugin_active('contact-form-7/wp-contact-form-7.php')) {
throw new Exception(__('Contact form 7 plugin must be enabled'));
}
Constructor::getInstance();
} catch (Exception $exception) {
deactivate_plugins('lnc-ncaptcha-contact7-addon/index.php');
add_action('admin_notices', function () use ($exception) {
echo '<div class="error"><p>' . esc_html($exception->getMessage()) . '</p></div>';
});
}
$constructor = Constructor::getInstance();