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