-
Notifications
You must be signed in to change notification settings - Fork 2
/
cryptopay-wc-lite.php
73 lines (63 loc) · 1.85 KB
/
cryptopay-wc-lite.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
<?php
declare(strict_types=1);
defined('ABSPATH') || exit;
// @phpcs:disable PSR1.Files.SideEffects
// @phpcs:disable PSR12.Files.FileHeader
// @phpcs:disable Generic.Files.LineLength
// @phpcs:disable Generic.Files.InlineHTML
/**
* Plugin Name: CryptoPay Lite
* Version: 2.3.7
* Plugin URI: https://beycanpress.com/cryptopay/
* Description: All In One Cryptocurrency Payments for WordPress
* Author: BeycanPress LLC
* Author URI: https://beycanpress.com
* License: GPLv3
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
* Text Domain: cryptopay
* Domain Path: /languages
* Tags: Crypto, Cryptocurrency Payment, Gateway, WooCommerce
* Requires at least: 5.0
* Tested up to: 6.7.1
* Requires PHP: 8.1
*/
/**
* Define constants
*/
define('CPL_NL', "\n");
define('CPL_BR', '<br>');
define('CPL_BR2', '<br><br>');
/**
* @return void
*/
add_action('before_woocommerce_init', function (): void {
if (class_exists(Automattic\WooCommerce\Utilities\FeaturesUtil::class)) {
Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__, true);
Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('cart_checkout_blocks', __FILE__, true);
}
});
if (!function_exists('json_validate')) {
/**
* @param string $string
* @return bool
*/
function json_validate(string $string): bool
{
json_decode($string);
return JSON_ERROR_NONE === json_last_error();
}
}
require __DIR__ . '/vendor/autoload.php';
use BeycanPress\CryptoPayLite\PluginHero\Helpers;
$args = [
'phpVersions' => 8.1,
'extensions' => [
'bcmath',
'curl',
'file_get_contents',
]
];
if (Helpers::createRequirementRules($args, __FILE__)) {
define('CRYPTOPAY_LITE_LOADED', true);
new BeycanPress\CryptoPayLite\Loader(__FILE__);
}