-
Notifications
You must be signed in to change notification settings - Fork 18
/
user-access-manager.php
76 lines (67 loc) · 2.13 KB
/
user-access-manager.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
<?php
/**
* Plugin Name: User Access Manager
* Plugin URI: https://wordpress.org/plugins/user-access-manager/
* Author URI: https://twitter.com/GM_Alex
* Version: 2.2.23
* Requires PHP: 7.2
* Author: Alexander Schneider
* Description: Manage the access to your posts, pages, categories and files.
* Text Domain: user-access-manager
*
* user-access-manager.php
*
* The the user access manager main file.
*
* PHP versions 5
*
* @author Alexander Schneider <[email protected]>
* @copyright 2008-2017 Alexander Schneider
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
* @version SVN: $id$
* @link http://wordpress.org/extend/plugins/user-access-manager/
*/
$basePath = __DIR__.DIRECTORY_SEPARATOR;
//Load language
require_once $basePath.'includes'.DIRECTORY_SEPARATOR.'language.php';
$locale = apply_filters('plugin_locale', get_locale(), 'user-access-manager');
load_textdomain(
'user-access-manager',
WP_LANG_DIR.DIRECTORY_SEPARATOR.'user-access-manager'.DIRECTORY_SEPARATOR.'user-access-manager-'.$locale.'.mo'
);
load_plugin_textdomain(
'user-access-manager',
false,
plugin_basename(dirname(__FILE__)).DIRECTORY_SEPARATOR.'languages'
);
//--- Check requirements ---
//Check php version
if (version_compare((string) phpversion(), '7.2') === -1) {
add_action(
'admin_notices',
function () {
echo '<div id="message" class="error"><p><strong>'
.sprintf(TXT_UAM_PHP_VERSION_TO_LOW, phpversion())
.'</strong></p></div>';
}
);
return;
}
//Check wordpress version
global $wp_version;
if (version_compare((string) $wp_version, '4.6') === -1) {
add_action(
'admin_notices',
function () use ($wp_version) {
echo '<div id="message" class="error"><p><strong>'
.sprintf(TXT_UAM_WORDPRESS_VERSION_TO_LOW, $wp_version)
.'</strong></p></div>';
}
);
return;
}
//Defines
require_once $basePath.'vendor/autoload.php';
require_once $basePath.'init.php';
global $userAccessManager;
$userAccessManager = initUserAccessManger();