-
Notifications
You must be signed in to change notification settings - Fork 0
/
sift-for-woocommerce.php
64 lines (59 loc) · 1.77 KB
/
sift-for-woocommerce.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
<?php
/**
* Sift for WooCommerce
*
* @since 1.0.0
* @version 1.0.0
* @author WooCommerce
* @license GPL-3.0-or-later
*
* @noinspection ALL
*
* @wordpress-plugin
* Plugin Name: Sift For WooCommerce
* Plugin URI: https://wpspecialprojects.wordpress.com
* Description: A plugin to integrate WooCommerce with Sift Science Fraud Detection
* Version: 1.0.0
* Requires at least: 6.2
* Tested up to: 6.2
* Requires PHP: 8.0
* Author: WooCommerce
* Author URI: https://github.com/woocommerce/sift-for-woocommerce
* License: GPL v3 or later
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
* Text Domain: sift-for-woocommerce
* Domain Path: /languages
**/
declare( strict_types=1 );
defined( 'ABSPATH' ) || exit;
// Load plugin translations so they are available even for the error admin notices.
add_action(
'init',
static function () {
load_plugin_textdomain(
'sift-for-woocommerce',
false,
__DIR__ . '/languages'
);
}
);
// Load the autoloader.
if ( ! is_file( __DIR__ . '/vendor/autoload.php' ) ) {
add_action(
'admin_notices',
static function () {
$message = __( 'It seems like <strong>Sift for WooCommerce</strong> is corrupted. Please reinstall!', 'sift-for-woocommerce' );
$html_message = wp_sprintf( '<div class="error notice wpcomsp-scaffold-error">%s</div>', wpautop( $message ) );
echo wp_kses_post( $html_message );
}
);
return;
}
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/src/sift-for-woocommerce.php';
add_action(
'plugins_loaded',
function () {
\Sift_For_WooCommerce\Sift_For_WooCommerce::get_instance();
}
);