| @@ -1,51 +1,70 @@ | ||
| 1 | 1 | <?php |
| 2 | +// @codingStandardsIgnoreFile | |
| 2 | 3 | /** |
| 3 | -* WordPress® with s2Member only. | |
| 4 | -* | |
| 5 | -* Copyright: © 2009-2011 | |
| 6 | -* {@link http://www.websharks-inc.com/ WebSharks, Inc.} | |
| 7 | -* ( coded in the USA ) | |
| 8 | -* | |
| 9 | -* Released under the terms of the GNU General Public License. | |
| 10 | -* You should have received a copy of the GNU General Public License, | |
| 11 | -* along with this software. In the main directory, see: /licensing/ | |
| 12 | -* If not, see: {@link http://www.gnu.org/licenses/}. | |
| 13 | -* | |
| 14 | -* @package s2Member | |
| 15 | -* @since 110912 | |
| 16 | -*/ | |
| 17 | -include_once dirname (__FILE__) . "/includes/classes/utils-s2o.inc.php"; | |
| 18 | -/**/ | |
| 19 | -if (($ws_plugin__s2member_o_temp_a["wp_dir"] = c_ws_plugin__s2member_utils_s2o::wp_dir (dirname (__FILE__), dirname ($_SERVER["SCRIPT_FILENAME"])))) | |
| 4 | + * WordPress with s2Member only. | |
| 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 | |
| 16 | + * @since 110912 | |
| 17 | + */ | |
| 18 | +//260904.2255 A public health request proves that this exact PHP file is reachable, then exits before loading any s2Member or WordPress code. | |
| 19 | +if(isset($_GET['s2member_health_check'])) | |
| 20 | +{ | |
| 21 | + $ws_plugin__s2member_health_token = (isset($_GET['s2member_health_token'])) ? preg_replace('/[^a-zA-Z0-9_-]/', '', substr((string)$_GET['s2member_health_token'], 0, 80)) : ''; | |
| 22 | + $ws_plugin__s2member_health_time = sprintf('%.6F', microtime(TRUE)); | |
| 23 | + header('Content-Type: text/plain; charset=UTF-8'); | |
| 24 | + header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0'); | |
| 25 | + header('Pragma: no-cache'); | |
| 26 | + header('X-s2Member-Loader: s2member-o'); //260910.0709 Keep the diagnostic identity aligned with the long-established s2member-o.php endpoint; the persisted loader option remains `s2o`. | |
| 27 | + header('X-s2Member-Health-Token: '.$ws_plugin__s2member_health_token); | |
| 28 | + header('X-s2Member-Health-Time: '.$ws_plugin__s2member_health_time); | |
| 29 | + echo 's2member-o-health:'.$ws_plugin__s2member_health_token.':'.$ws_plugin__s2member_health_time; | |
| 30 | + exit; | |
| 31 | +} | |
| 32 | + | |
| 33 | +define ('_WS_PLUGIN__S2MEMBER_ONLY', TRUE); | |
| 34 | + | |
| 35 | +include_once dirname(__FILE__).'/src/includes/classes/utils-s2o.inc.php'; | |
| 36 | + | |
| 37 | +if(($ws_plugin__s2member_o['wp_dir'] = c_ws_plugin__s2member_utils_s2o::wp_dir(dirname(__FILE__), dirname($_SERVER['SCRIPT_FILENAME'])))) | |
| 38 | +{ | |
| 39 | + if(($ws_plugin__s2member_o['wp_settings_as'] = c_ws_plugin__s2member_utils_s2o::wp_settings_as($ws_plugin__s2member_o['wp_dir'], __FILE__))) | |
| 20 | 40 | { |
| 21 | - if (($ws_plugin__s2member_o_temp_a["wp_settings_as"] = c_ws_plugin__s2member_utils_s2o::wp_settings_as ($ws_plugin__s2member_o_temp_a["wp_dir"], __FILE__))) | |
| 22 | - { | |
| 23 | - /** | |
| 24 | - * Short initialization mode for WordPress®. | |
| 25 | - * | |
| 26 | - * @package s2Member | |
| 27 | - * @since 110912 | |
| 28 | - * | |
| 29 | - * @var bool | |
| 30 | - */ | |
| 31 | - define ("SHORTINIT", true); | |
| 32 | - /** | |
| 33 | - * Flag indicating only s2Member is being loaded. | |
| 34 | - * | |
| 35 | - * @package s2Member | |
| 36 | - * @since 110912 | |
| 37 | - * | |
| 38 | - * @var bool | |
| 39 | - */ | |
| 40 | - define ("WS_PLUGIN__S2MEMBER_ONLY", true); | |
| 41 | - /* | |
| 42 | - Load WordPress®. | |
| 43 | - */ | |
| 44 | - require($ws_plugin__s2member_o_temp_a["wp_dir"] . "/wp-load.php"); | |
| 45 | - eval ("?>" . /* Settings after ``SHORTINIT``. */ $ws_plugin__s2member_o_temp_a["wp_settings_as"]); | |
| 46 | - } | |
| 47 | - else /* Else fallback on full WordPress®. */ | |
| 48 | - require($ws_plugin__s2member_o_temp_a["wp_dir"] . "/wp-load.php"); | |
| 41 | + /** | |
| 42 | + * Short initialization mode for WordPress. | |
| 43 | + * | |
| 44 | + * @package s2Member | |
| 45 | + * @since 110912 | |
| 46 | + * | |
| 47 | + * @var bool | |
| 48 | + */ | |
| 49 | + define ('SHORTINIT', TRUE); | |
| 50 | + | |
| 51 | + /** | |
| 52 | + * Flag indicating only s2Member is being loaded. | |
| 53 | + * | |
| 54 | + * @package s2Member | |
| 55 | + * @since 110912 | |
| 56 | + * | |
| 57 | + * @var bool | |
| 58 | + */ | |
| 59 | + define ('WS_PLUGIN__S2MEMBER_ONLY', TRUE); | |
| 60 | + | |
| 61 | + /* | |
| 62 | + Load WordPress. | |
| 63 | + */ | |
| 64 | + require($ws_plugin__s2member_o['wp_dir'].'/wp-load.php'); | |
| 65 | + eval ('?>'.$ws_plugin__s2member_o['wp_settings_as']); | |
| 49 | 66 | } |
| 50 | -unset ($ws_plugin__s2member_o_temp_a); | |
| 51 | -?> | |
| 67 | + else // Else fallback on full WordPress. | |
| 68 | + require($ws_plugin__s2member_o['wp_dir'].'/wp-load.php'); | |
| 69 | +} | |
| 70 | +unset($ws_plugin__s2member_o); | |