-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
executable file
·36 lines (31 loc) · 1.17 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
36
<?php
/**
* Plugin Name: LNC nCaptcha Add-on for Gravity Forms
* Description: LNC nCaptcha Add-on for Gravity Forms provides nCaptcha for gravity form
* Version: 0.0.2
* Author: LNC
* Author URI: http://learnnear.club/
*/
use LNCNcaptchaGravityAddon\Model\Constructor\Constructor;
if (!defined('ABSPATH')) exit; // Exit if accessed directly
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-gravity-addon'));
}
if (!is_plugin_active('gravityforms/gravityforms.php')) {
throw new Exception(__('Gravity forms plugin must be enabled'));
}
Constructor::getInstance();
} catch (Exception $exception) {
deactivate_plugins('lnc-ncaptcha-gravity-addon/index.php');
add_action('admin_notices', function () use ($exception) {
echo '<div class="error"><p>' . esc_html($exception->getMessage()) . '</p></div>';
});
}
$constructor = Constructor::getInstance();