-
Notifications
You must be signed in to change notification settings - Fork 0
/
sensei-compat-conflicts-checker.php
52 lines (47 loc) · 1.46 KB
/
sensei-compat-conflicts-checker.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
<?php
/**
* Conflicts checker.
*
* @package woothemes-sensei
*
* @since 1.2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
require_once __DIR__ . '/plugins/sensei-pro/modules/shared-module/includes/class-conflicts-checker.php';
// The namespace is replaced with `Woothemes_Sensei` in the `Conflicts_Checker` during the build.
use Woothemes_Sensei\Conflicts_Checker;
/**
* Tells if Sensei Pro (Paid Courses) has conflicts with other activated plugins.
*/
function woothemes_sensei_has_conflicts(): bool {
$checker = new Conflicts_Checker(
[
'plugin_slug' => 'woothemes-sensei',
'conflicts' => [
[
'plugin_slug' => 'sensei-pro',
'message' => __(
'<strong>Sensei Pro</strong> plugin already provides all the features that
<strong>Sensei Pro (WC Paid Courses)</strong> has. If you
still want to activate the <strong>Sensei Pro (WooCommerce Paid Courses)</strong>
then deactivate the <strong>Sensei Pro</strong> first.',
'woothemes-sensei'
),
],
[
'plugin_slug' => 'sensei-interactive-blocks',
'deactivate' => 'sensei-interactive-blocks',
'message_type' => 'notice',
'message' => __(
"<strong>Sensei Blocks</strong> plugin has been disabled. All the features in <strong>Sensei Blocks</strong>
are included in <strong>Sensei Pro (WC Paid Courses)</strong>. You don't need both plugins.",
'sensei-pro'
),
],
],
]
);
return $checker->has_conflicts();
}