PluginProbe
BeyondWords – AI audio for publishers / 4.7.0
BeyondWords – AI audio for publishers v4.7.0
7.1.0 trunk 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.1.0 4.1.1 4.1.2 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.3.0 4.4.0 4.5.0 4.5.1 4.6.0 4.6.1 4.6.2 4.7.0 All 43 releases
speechkit / src / Core / Environment.php

Environment.php in BeyondWords – AI audio for publishers 4.7.0, at src/Core/Environment.php

183 lines 4.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 /**
6 * BeyondWords Environment.
7 *
8 * @package Beyondwords\Wordpress
9 * @author Stuart McAlpine <stu@beyondwords.io>
10 * @since 3.0.0
11 */
12
13 namespace Beyondwords\Wordpress\Core;
14
15 /**
16 * Environment setup
17 *
18 * @since 3.0.0
19 */
20 class Environment
21 {
22 /**
23 * The BeyondWords API URL.
24 *
25 * Override with BEYONDWORDS_API_URL in wp-config.php.
26 *
27 * @since 3.0.0
28 * @access private
29 * @var string
30 */
31 public const BEYONDWORDS_API_URL = 'https://api.beyondwords.io/v1';
32
33 /**
34 * The BeyondWords Backend URL.
35 *
36 * Override with BEYONDWORDS_BACKEND_URL in wp-config.php.
37 *
38 * @since 3.0.0
39 * @access private
40 * @var string
41 */
42 public const BEYONDWORDS_BACKEND_URL = '';
43
44 /**
45 * The BeyondWords JS SDK URL.
46 *
47 * Override with BEYONDWORDS_JS_SDK_URL in wp-config.php.
48 *
49 * @since 3.0.0
50 * @access private
51 * @var string
52 */
53 public const BEYONDWORDS_JS_SDK_URL = 'https://proxy.beyondwords.io/npm/@beyondwords/player@latest/dist/umd.js'; // phpcs:ignore Generic.Files.LineLength.TooLong
54
55 /**
56 * The BeyondWords JS SDK URL (Legacy).
57 *
58 * Override with BEYONDWORDS_JS_SDK_URL_LEGACY in wp-config.php.
59 *
60 * @since 4.0.0
61 * @access private
62 * @var string
63 */
64 public const BEYONDWORDS_JS_SDK_URL_LEGACY = 'https://proxy.beyondwords.io/npm/@beyondwords/audio-player@latest/dist/module/index.js'; // phpcs:ignore Generic.Files.LineLength.TooLong
65
66 /**
67 * The BeyondWords AMP Player URL.
68 *
69 * Override with BEYONDWORDS_AMP_PLAYER_URL in wp-config.php.
70 *
71 * @since 3.0.0
72 * @access private
73 * @var string
74 */
75 public const BEYONDWORDS_AMP_PLAYER_URL = 'https://audio.beyondwords.io/amp/%d?podcast_id=%s';
76
77 /**
78 * The BeyondWords AMP image URL.
79 *
80 * Override with BEYONDWORDS_AMP_IMG_URL in wp-config.php.
81 *
82 * @since 3.0.0
83 * @access private
84 * @var string
85 */
86 public const BEYONDWORDS_AMP_IMG_URL = 'https://s3-eu-west-1.amazonaws.com/beyondwords-assets/logo.svg';
87
88 /**
89 * The BeyondWords dashboard URL.
90 *
91 * Override with BEYONDWORDS_DASHBOARD_URL in wp-config.php.
92 *
93 * @since 3.0.0
94 * @access private
95 * @var string
96 */
97 public const BEYONDWORDS_DASHBOARD_URL = 'https://dash.beyondwords.io';
98
99 /**
100 * @return string
101 */
102 public static function getApiUrl()
103 {
104 if (defined('BEYONDWORDS_API_URL') && strlen(BEYONDWORDS_API_URL)) {
105 return BEYONDWORDS_API_URL;
106 }
107
108 return static::BEYONDWORDS_API_URL;
109 }
110
111 /**
112 * @return string
113 */
114 public static function getBackendUrl()
115 {
116 if (defined('BEYONDWORDS_BACKEND_URL') && strlen(BEYONDWORDS_BACKEND_URL)) {
117 return BEYONDWORDS_BACKEND_URL;
118 }
119
120 return static::BEYONDWORDS_BACKEND_URL;
121 }
122
123 /**
124 * @return string
125 */
126 public static function getJsSdkUrl()
127 {
128 if (defined('BEYONDWORDS_JS_SDK_URL') && strlen(BEYONDWORDS_JS_SDK_URL)) {
129 return BEYONDWORDS_JS_SDK_URL;
130 }
131
132 return static::BEYONDWORDS_JS_SDK_URL;
133 }
134
135 /**
136 * @return string
137 */
138 public static function getJsSdkUrlLegacy()
139 {
140 if (defined('BEYONDWORDS_JS_SDK_URL_LEGACY') && strlen(BEYONDWORDS_JS_SDK_URL_LEGACY)) {
141 return BEYONDWORDS_JS_SDK_URL_LEGACY;
142 }
143
144 return static::BEYONDWORDS_JS_SDK_URL_LEGACY;
145 }
146
147 /**
148 * @return string
149 */
150 public static function getAmpPlayerUrl()
151 {
152 if (defined('BEYONDWORDS_AMP_PLAYER_URL') && strlen(BEYONDWORDS_AMP_PLAYER_URL)) {
153 return BEYONDWORDS_AMP_PLAYER_URL;
154 }
155
156 return static::BEYONDWORDS_AMP_PLAYER_URL;
157 }
158
159 /**
160 * @return string
161 */
162 public static function getAmpImgUrl()
163 {
164 if (defined('BEYONDWORDS_AMP_IMG_URL') && strlen(BEYONDWORDS_AMP_IMG_URL)) {
165 return BEYONDWORDS_AMP_IMG_URL;
166 }
167
168 return static::BEYONDWORDS_AMP_IMG_URL;
169 }
170
171 /**
172 * @return string
173 */
174 public static function getDashboardUrl()
175 {
176 if (defined('BEYONDWORDS_DASHBOARD_URL') && strlen(BEYONDWORDS_DASHBOARD_URL)) {
177 return BEYONDWORDS_DASHBOARD_URL;
178 }
179
180 return static::BEYONDWORDS_DASHBOARD_URL;
181 }
182 }
183