-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathhcaptcha.php
96 lines (80 loc) · 1.98 KB
/
hcaptcha.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
/**
* Plugin hCaptcha
*
* @package hcaptcha-wp
* @author hCaptcha
* @license GPL-2.0-or-later
* @wordpress-plugin
*
* Plugin Name: hCaptcha for WP
* Plugin URI: https://www.hcaptcha.com/
* Description: hCaptcha keeps out bots and spam while putting privacy first. It is a drop-in replacement for reCAPTCHA.
* Version: 4.9.0
* Requires at least: 5.3
* Requires PHP: 7.2
* Author: hCaptcha
* Author URI: https://www.hcaptcha.com/
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: hcaptcha-for-forms-and-more
* Domain Path: /languages/
*
* WC requires at least: 3.0
* WC tested up to: 9.3
*/
// phpcs:ignore Generic.Commenting.DocComment.MissingShort
/** @noinspection PhpParamsInspection */
use HCaptcha\Main;
// If this file is called directly, abort.
if ( ! defined( 'ABSPATH' ) ) {
// @codeCoverageIgnoreStart
exit;
// @codeCoverageIgnoreEnd
}
/**
* Plugin version.
*/
const HCAPTCHA_VERSION = '4.9.0';
/**
* Path to the plugin dir.
*/
const HCAPTCHA_PATH = __DIR__;
/**
* Path to the plugin dir.
*/
const HCAPTCHA_INC = HCAPTCHA_PATH . '/src/php/includes';
/**
* Plugin dir url.
*/
define( 'HCAPTCHA_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
/**
* Main plugin file.
*/
const HCAPTCHA_FILE = __FILE__;
/**
* Default nonce action.
*/
const HCAPTCHA_ACTION = 'hcaptcha_action';
/**
* Default nonce name.
*/
const HCAPTCHA_NONCE = 'hcaptcha_nonce';
require_once HCAPTCHA_PATH . '/vendor/autoload.php';
require HCAPTCHA_INC . '/request.php';
require HCAPTCHA_INC . '/functions.php';
/**
* Get hCaptcha Main class instance.
*
* @return Main
*/
function hcaptcha(): Main {
static $hcaptcha;
if ( ! $hcaptcha ) {
// @codeCoverageIgnoreStart
$hcaptcha = new Main();
// @codeCoverageIgnoreEnd
}
return $hcaptcha;
}
hcaptcha()->init();