| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: User Access Manager |
| 4 |
* Plugin URI: https://wordpress.org/plugins/user-access-manager/ |
| 5 |
* Author URI: https://twitter.com/GM_Alex |
| 6 |
* Version: 2.3.20 |
| 7 |
* Requires PHP: 8.0 |
| 8 |
* Author: Alexander Schneider |
| 9 |
* Description: Manage the access to your posts, pages, categories and files. |
| 10 |
* Text Domain: user-access-manager |
| 11 |
* |
| 12 |
* user-access-manager.php |
| 13 |
* |
| 14 |
* The user access manager main file. |
| 15 |
* |
| 16 |
* PHP versions 5 |
| 17 |
* |
| 18 |
* @author Alexander Schneider <alexanderschneider85@gmail.com> |
| 19 |
* @copyright 2008-2017 Alexander Schneider |
| 20 |
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 |
| 21 |
* @version SVN: $id$ |
| 22 |
* @link http://wordpress.org/extend/plugins/user-access-manager/ |
| 23 |
*/ |
| 24 |
|
| 25 |
function initUam() { |
| 26 |
$basePath = __DIR__ . DIRECTORY_SEPARATOR; |
| 27 |
|
| 28 |
//Load language |
| 29 |
require_once $basePath . 'includes' . DIRECTORY_SEPARATOR . 'language.php'; |
| 30 |
$locale = apply_filters('plugin_locale', get_locale(), 'user-access-manager'); |
| 31 |
load_textdomain( |
| 32 |
'user-access-manager', |
| 33 |
WP_LANG_DIR . DIRECTORY_SEPARATOR . 'user-access-manager' . DIRECTORY_SEPARATOR . 'user-access-manager-' . $locale . '.mo' |
| 34 |
); |
| 35 |
load_plugin_textdomain( |
| 36 |
'user-access-manager', |
| 37 |
false, |
| 38 |
plugin_basename(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'languages' |
| 39 |
); |
| 40 |
|
| 41 |
//--- Check requirements --- |
| 42 |
|
| 43 |
//Check php version |
| 44 |
if (version_compare((string)phpversion(), '7.2') === -1) { |
| 45 |
add_action( |
| 46 |
'admin_notices', |
| 47 |
function () { |
| 48 |
echo '<div id="message" class="error"><p><strong>' |
| 49 |
. sprintf(TXT_UAM_PHP_VERSION_TO_LOW, phpversion()) |
| 50 |
. '</strong></p></div>'; |
| 51 |
} |
| 52 |
); |
| 53 |
|
| 54 |
return; |
| 55 |
} |
| 56 |
|
| 57 |
//Check WordPress version |
| 58 |
global $wp_version; |
| 59 |
|
| 60 |
if (version_compare((string)$wp_version, '4.6') === -1) { |
| 61 |
add_action( |
| 62 |
'admin_notices', |
| 63 |
function () use ($wp_version) { |
| 64 |
echo '<div id="message" class="error"><p><strong>' |
| 65 |
. sprintf(TXT_UAM_WORDPRESS_VERSION_TO_LOW, $wp_version) |
| 66 |
. '</strong></p></div>'; |
| 67 |
} |
| 68 |
); |
| 69 |
|
| 70 |
return; |
| 71 |
} |
| 72 |
|
| 73 |
//Defines |
| 74 |
require_once $basePath . 'includes' . DIRECTORY_SEPARATOR . 'version.php'; |
| 75 |
require_once $basePath.'vendor/autoload.php'; |
| 76 |
require_once $basePath.'init.php'; |
| 77 |
global $userAccessManager; |
| 78 |
$userAccessManager = initUserAccessManger(); |
| 79 |
} |
| 80 |
|
| 81 |
add_action('init', 'initUam', 0); |
| 82 |
|