| 1 |
<?php |
| 2 |
// @codingStandardsIgnoreFile |
| 3 |
/** |
| 4 |
* s2Member's self re-activation routines. |
| 5 |
* |
| 6 |
* Copyright: © 2009-2011 |
| 7 |
* {@link http://websharks-inc.com/ WebSharks, Inc.} |
| 8 |
* (coded in the USA) |
| 9 |
* |
| 10 |
* Released under the terms of the GNU General Public License. |
| 11 |
* You should have received a copy of the GNU General Public License, |
| 12 |
* along with this software. In the main directory, see: /licensing/ |
| 13 |
* If not, see: {@link http://www.gnu.org/licenses/}. |
| 14 |
* |
| 15 |
* @package s2Member\Installation |
| 16 |
* @since 3.5 |
| 17 |
*/ |
| 18 |
if(!defined('WPINC')) // MUST have WordPress. |
| 19 |
exit ("Do not access this file directly."); |
| 20 |
|
| 21 |
if(!class_exists("c_ws_plugin__s2member_check_activation")) |
| 22 |
{ |
| 23 |
/** |
| 24 |
* s2Member's self re-activation routines. |
| 25 |
* |
| 26 |
* @package s2Member\Installation |
| 27 |
* @since 3.5 |
| 28 |
*/ |
| 29 |
class c_ws_plugin__s2member_check_activation |
| 30 |
{ |
| 31 |
/** |
| 32 |
* Checks for existing installs that are NOT yet re-activated. |
| 33 |
* |
| 34 |
* @package s2Member\Installation |
| 35 |
* @since 3.5 |
| 36 |
* |
| 37 |
* @attaches-to ``add_action("admin_init");`` |
| 38 |
*/ |
| 39 |
public static function check() |
| 40 |
{ |
| 41 |
if(!($v = get_option("ws_plugin__s2member_activated_version")) || !version_compare($v, WS_PLUGIN__S2MEMBER_VERSION, ">=")) |
| 42 |
c_ws_plugin__s2member_installation::activate("version"); |
| 43 |
|
| 44 |
else if(is_multisite() && is_main_site() && (!($mms_v = get_option("ws_plugin__s2member_activated_mms_version")) || !version_compare($mms_v, WS_PLUGIN__S2MEMBER_VERSION, ">="))) |
| 45 |
c_ws_plugin__s2member_installation::activate("mms_version"); |
| 46 |
|
| 47 |
else if(!($l = (int)get_option("ws_plugin__s2member_activated_levels")) || $l !== $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]) |
| 48 |
c_ws_plugin__s2member_installation::activate("levels"); |
| 49 |
} |
| 50 |
} |
| 51 |
} |
| 52 |
|