| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* ====================================================================== |
| 5 |
* LICENSE: This file is subject to the terms and conditions defined in * |
| 6 |
* file 'license.txt', which is part of this source code package. * |
| 7 |
* ====================================================================== |
| 8 |
*/ |
| 9 |
|
| 10 |
/** |
| 11 |
* Legacy class |
| 12 |
* |
| 13 |
* This class exists only to cover the fatal error during plugin update from 5.11 to |
| 14 |
* 6.x.x. The problem is with the way AAM registers hooks to WP core `http_response` |
| 15 |
* hook |
| 16 |
* |
| 17 |
* @package AAM |
| 18 |
* @since 6.0.3 |
| 19 |
* @todo Remove in July 2021 |
| 20 |
*/ |
| 21 |
final class AAM_Core_Server |
| 22 |
{ |
| 23 |
|
| 24 |
/** |
| 25 |
* Server endpoint |
| 26 |
* |
| 27 |
* @version 6.0.3 |
| 28 |
*/ |
| 29 |
const SERVER_V2_URL = 'https://api.aamplugin.com/v2'; |
| 30 |
|
| 31 |
/** |
| 32 |
* Get AAM server endpoint |
| 33 |
* |
| 34 |
* @param string $v |
| 35 |
* |
| 36 |
* @return string |
| 37 |
* |
| 38 |
* @access public |
| 39 |
* @version 6.0.3 |
| 40 |
*/ |
| 41 |
public static function getEndpoint($v = 'V1') |
| 42 |
{ |
| 43 |
$endpoint = getenv("AAM_API_{$v}_ENDPOINT"); |
| 44 |
|
| 45 |
if (empty($endpoint)) { |
| 46 |
$endpoint = self::SERVER_V2_URL; |
| 47 |
} |
| 48 |
|
| 49 |
return $endpoint; |
| 50 |
} |
| 51 |
|
| 52 |
} |