PluginProbe ʕ •ᴥ•ʔ
Code Manager / 1.0.48
Code Manager v1.0.48
1.0.48 1.0.47 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.24 1.0.25 1.0.26 1.0.27 1.0.28 1.0.3 1.0.30 1.0.31 1.0.32 1.0.33 1.0.34 1.0.35 1.0.36 1.0.37 1.0.38 1.0.39 1.0.4 1.0.40 1.0.41 1.0.42 1.0.43 1.0.44 1.0.45 1.0.46 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9
code-manager / vendor / freemius / config.php
code-manager / vendor / freemius Last commit date
assets 2 days ago includes 2 days ago languages 2 days ago templates 2 days ago LICENSE.txt 2 days ago config.php 2 days ago index.php 2 days ago require.php 2 days ago start.php 2 days ago
config.php
396 lines
1 <?php
2 /**
3 * @package Freemius
4 * @copyright Copyright (c) 2015, Freemius, Inc.
5 * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6 * @since 1.0.4
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 if ( ! defined( 'WP_FS__SLUG' ) ) {
14 define( 'WP_FS__SLUG', 'freemius' );
15 }
16 if ( ! defined( 'WP_FS__DEV_MODE' ) ) {
17 define( 'WP_FS__DEV_MODE', false );
18 }
19
20 #--------------------------------------------------------------------------------
21 #region API Connectivity Issues Simulation
22 #--------------------------------------------------------------------------------
23
24 if ( ! defined( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY' ) ) {
25 define( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY', false );
26 }
27 if ( ! defined( 'WP_FS__SIMULATE_NO_CURL' ) ) {
28 define( 'WP_FS__SIMULATE_NO_CURL', false );
29 }
30 if ( ! defined( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE' ) ) {
31 define( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE', false );
32 }
33 if ( ! defined( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL' ) ) {
34 define( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL', false );
35 }
36 if ( WP_FS__SIMULATE_NO_CURL ) {
37 define( 'FS_SDK__SIMULATE_NO_CURL', true );
38 }
39 if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE ) {
40 define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE', true );
41 }
42 if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL ) {
43 define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL', true );
44 }
45
46 #endregion
47
48 if ( ! defined( 'WP_FS__SIMULATE_FREEMIUS_OFF' ) ) {
49 define( 'WP_FS__SIMULATE_FREEMIUS_OFF', false );
50 }
51
52 if ( ! defined( 'WP_FS__PING_API_ON_IP_OR_HOST_CHANGES' ) ) {
53 /**
54 * @since 1.1.7.3
55 * @author Vova Feldman (@svovaf)
56 *
57 * I'm not sure if shared servers periodically change IP, or the subdomain of the
58 * admin dashboard. Also, I've seen sites that have strange loop of switching
59 * between domains on a daily basis. Therefore, to eliminate the risk of
60 * multiple unwanted connectivity test pings, temporary ignore domain or
61 * server IP changes.
62 */
63 define( 'WP_FS__PING_API_ON_IP_OR_HOST_CHANGES', false );
64 }
65
66 /**
67 * If your dev environment supports custom public network IP setup
68 * like VVV, please update WP_FS__LOCALHOST_IP with your public IP
69 * and uncomment it during dev.
70 */
71 if ( ! defined( 'WP_FS__LOCALHOST_IP' ) ) {
72 // VVV default public network IP.
73 define( 'WP_FS__VVV_DEFAULT_PUBLIC_IP', '192.168.50.4' );
74
75 // define( 'WP_FS__LOCALHOST_IP', WP_FS__VVV_DEFAULT_PUBLIC_IP );
76 }
77
78 /**
79 * If true and running with secret key, the opt-in process
80 * will skip the email activation process which is invoked
81 * when the email of the context user already exist in Freemius
82 * database (as a security precaution, to prevent sharing user
83 * secret with unauthorized entity).
84 *
85 * IMPORTANT:
86 * AS A SECURITY PRECAUTION, WE VALIDATE THE TIMESTAMP OF THE OPT-IN REQUEST.
87 * THEREFORE, MAKE SURE THAT WHEN USING THIS PARAMETER,YOUR TESTING ENVIRONMENT'S
88 * CLOCK IS SYNCED.
89 */
90 if ( ! defined( 'WP_FS__SKIP_EMAIL_ACTIVATION' ) ) {
91 define( 'WP_FS__SKIP_EMAIL_ACTIVATION', false );
92 }
93
94
95 #--------------------------------------------------------------------------------
96 #region Directories
97 #--------------------------------------------------------------------------------
98
99 if ( ! defined( 'WP_FS__DIR' ) ) {
100 define( 'WP_FS__DIR', dirname( __FILE__ ) );
101 }
102 if ( ! defined( 'WP_FS__DIR_INCLUDES' ) ) {
103 define( 'WP_FS__DIR_INCLUDES', WP_FS__DIR . '/includes' );
104 }
105 if ( ! defined( 'WP_FS__DIR_TEMPLATES' ) ) {
106 define( 'WP_FS__DIR_TEMPLATES', WP_FS__DIR . '/templates' );
107 }
108 if ( ! defined( 'WP_FS__DIR_ASSETS' ) ) {
109 define( 'WP_FS__DIR_ASSETS', WP_FS__DIR . '/assets' );
110 }
111 if ( ! defined( 'WP_FS__DIR_CSS' ) ) {
112 define( 'WP_FS__DIR_CSS', WP_FS__DIR_ASSETS . '/css' );
113 }
114 if ( ! defined( 'WP_FS__DIR_JS' ) ) {
115 define( 'WP_FS__DIR_JS', WP_FS__DIR_ASSETS . '/js' );
116 }
117 if ( ! defined( 'WP_FS__DIR_IMG' ) ) {
118 define( 'WP_FS__DIR_IMG', WP_FS__DIR_ASSETS . '/img' );
119 }
120 if ( ! defined( 'WP_FS__DIR_SDK' ) ) {
121 define( 'WP_FS__DIR_SDK', WP_FS__DIR_INCLUDES . '/sdk' );
122 }
123
124 #endregion
125
126 /**
127 * Domain / URL / Address
128 */
129 define( 'WP_FS__ROOT_DOMAIN_PRODUCTION', 'freemius.com' );
130 define( 'WP_FS__DOMAIN_PRODUCTION', 'wp.freemius.com' );
131 define( 'WP_FS__ADDRESS_PRODUCTION', 'https://' . WP_FS__DOMAIN_PRODUCTION );
132
133 if ( ! defined( 'WP_FS__DOMAIN_LOCALHOST' ) ) {
134 define( 'WP_FS__DOMAIN_LOCALHOST', 'wp.freemius' );
135 }
136 if ( ! defined( 'WP_FS__ADDRESS_LOCALHOST' ) ) {
137 define( 'WP_FS__ADDRESS_LOCALHOST', 'http://' . WP_FS__DOMAIN_LOCALHOST . ':8080' );
138 }
139
140 if ( ! defined( 'WP_FS__TESTING_DOMAIN' ) ) {
141 define( 'WP_FS__TESTING_DOMAIN', 'fswp' );
142 }
143
144 #--------------------------------------------------------------------------------
145 #region HTTP
146 #--------------------------------------------------------------------------------
147
148 if ( ! defined( 'WP_FS__IS_HTTP_REQUEST' ) ) {
149 define( 'WP_FS__IS_HTTP_REQUEST', isset( $_SERVER['HTTP_HOST'] ) && isset( $_SERVER['REQUEST_METHOD'] ) );
150 }
151
152 if ( ! defined( 'WP_FS__IS_HTTPS' ) ) {
153 define( 'WP_FS__IS_HTTPS', ( WP_FS__IS_HTTP_REQUEST &&
154 // Checks if CloudFlare's HTTPS (Flexible SSL support).
155 isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) &&
156 'https' === strtolower( $_SERVER['HTTP_X_FORWARDED_PROTO'] )
157 ) ||
158 // Check if HTTPS request.
159 ( isset( $_SERVER['HTTPS'] ) && 'on' == $_SERVER['HTTPS'] ) ||
160 ( isset( $_SERVER['SERVER_PORT'] ) && 443 == $_SERVER['SERVER_PORT'] )
161 );
162 }
163
164 if ( ! defined( 'WP_FS__IS_POST_REQUEST' ) ) {
165 define( 'WP_FS__IS_POST_REQUEST', ( WP_FS__IS_HTTP_REQUEST &&
166 strtoupper( $_SERVER['REQUEST_METHOD'] ) == 'POST' ) );
167 }
168
169 if ( ! defined( 'WP_FS__REMOTE_ADDR' ) ) {
170 define( 'WP_FS__REMOTE_ADDR', fs_get_ip() );
171 }
172
173 if ( ! defined( 'WP_FS__IS_LOCALHOST' ) ) {
174 if ( defined( 'WP_FS__LOCALHOST_IP' ) ) {
175 define( 'WP_FS__IS_LOCALHOST', ( WP_FS__LOCALHOST_IP === WP_FS__REMOTE_ADDR ) );
176 } else {
177 define( 'WP_FS__IS_LOCALHOST', WP_FS__IS_HTTP_REQUEST &&
178 is_string( WP_FS__REMOTE_ADDR ) &&
179 ( substr( WP_FS__REMOTE_ADDR, 0, 4 ) === '127.' ||
180 WP_FS__REMOTE_ADDR === '::1' )
181 );
182 }
183 }
184
185 if ( ! defined( 'WP_FS__IS_LOCALHOST_FOR_SERVER' ) ) {
186 define( 'WP_FS__IS_LOCALHOST_FOR_SERVER', ( ! WP_FS__IS_HTTP_REQUEST ||
187 false !== strpos( $_SERVER['HTTP_HOST'], 'localhost' ) ) );
188 }
189
190 #endregion
191
192 if ( ! defined( 'WP_FS__IS_PRODUCTION_MODE' ) ) {
193 // By default, run with Freemius production servers.
194 define( 'WP_FS__IS_PRODUCTION_MODE', true );
195 }
196
197 if ( ! defined( 'WP_FS__ADDRESS' ) ) {
198 define( 'WP_FS__ADDRESS', ( WP_FS__IS_PRODUCTION_MODE ? WP_FS__ADDRESS_PRODUCTION : WP_FS__ADDRESS_LOCALHOST ) );
199 }
200
201
202 #--------------------------------------------------------------------------------
203 #region API
204 #--------------------------------------------------------------------------------
205
206 if ( ! defined( 'WP_FS__API_ADDRESS_LOCALHOST' ) ) {
207 define( 'WP_FS__API_ADDRESS_LOCALHOST', 'http://api.freemius-local.com:8080' );
208 }
209 if ( ! defined( 'WP_FS__API_SANDBOX_ADDRESS_LOCALHOST' ) ) {
210 define( 'WP_FS__API_SANDBOX_ADDRESS_LOCALHOST', 'http://sandbox-api.freemius:8080' );
211 }
212
213 if ( ! defined( 'WP_FS__API_TIMEOUT' ) ) {
214 define( 'WP_FS__API_TIMEOUT', 30 );
215 }
216
217 // Set API address for local testing.
218 if ( ! WP_FS__IS_PRODUCTION_MODE ) {
219 if ( ! defined( 'FS_API__ADDRESS' ) ) {
220 define( 'FS_API__ADDRESS', WP_FS__API_ADDRESS_LOCALHOST );
221 }
222 if ( ! defined( 'FS_API__SANDBOX_ADDRESS' ) ) {
223 define( 'FS_API__SANDBOX_ADDRESS', WP_FS__API_SANDBOX_ADDRESS_LOCALHOST );
224 }
225 }
226
227 #endregion
228
229 #--------------------------------------------------------------------------------
230 #region Checkout
231 #--------------------------------------------------------------------------------
232
233 if ( ! defined( 'FS_CHECKOUT__ADDRESS_PRODUCTION' ) ) {
234 define( 'FS_CHECKOUT__ADDRESS_PRODUCTION', 'https://checkout.freemius.com' );
235 }
236
237 if ( ! defined( 'FS_CHECKOUT__ADDRESS_LOCALHOST' ) ) {
238 define( 'FS_CHECKOUT__ADDRESS_LOCALHOST', 'http://checkout.freemius-local.com:8080' );
239 }
240
241 if ( ! defined( 'FS_CHECKOUT__ADDRESS' ) ) {
242 define( 'FS_CHECKOUT__ADDRESS', ( WP_FS__IS_PRODUCTION_MODE ? FS_CHECKOUT__ADDRESS_PRODUCTION : FS_CHECKOUT__ADDRESS_LOCALHOST ) );
243 }
244
245 #endregion
246
247 define( 'WP_FS___OPTION_PREFIX', 'fs' . ( WP_FS__IS_PRODUCTION_MODE ? '' : '_dbg' ) . '_' );
248
249 if ( ! defined( 'WP_FS__ACCOUNTS_OPTION_NAME' ) ) {
250 define( 'WP_FS__ACCOUNTS_OPTION_NAME', WP_FS___OPTION_PREFIX . 'accounts' );
251 }
252 if ( ! defined( 'WP_FS__API_CACHE_OPTION_NAME' ) ) {
253 define( 'WP_FS__API_CACHE_OPTION_NAME', WP_FS___OPTION_PREFIX . 'api_cache' );
254 }
255 if ( ! defined( 'WP_FS__GDPR_OPTION_NAME' ) ) {
256 define( 'WP_FS__GDPR_OPTION_NAME', WP_FS___OPTION_PREFIX . 'gdpr' );
257 }
258 define( 'WP_FS__OPTIONS_OPTION_NAME', WP_FS___OPTION_PREFIX . 'options' );
259
260 /**
261 * Module types
262 *
263 * @since 1.2.2
264 */
265 define( 'WP_FS__MODULE_TYPE_PLUGIN', 'plugin' );
266 define( 'WP_FS__MODULE_TYPE_THEME', 'theme' );
267
268 /**
269 * Billing Frequencies
270 */
271 define( 'WP_FS__PERIOD_ANNUALLY', 'annual' );
272 define( 'WP_FS__PERIOD_MONTHLY', 'monthly' );
273 define( 'WP_FS__PERIOD_LIFETIME', 'lifetime' );
274
275 /**
276 * Plans
277 */
278 define( 'WP_FS__PLAN_DEFAULT_PAID', false );
279 define( 'WP_FS__PLAN_FREE', 'free' );
280 define( 'WP_FS__PLAN_TRIAL', 'trial' );
281
282 /**
283 * Times in seconds
284 */
285 if ( ! defined( 'WP_FS__TIME_5_MIN_IN_SEC' ) ) {
286 define( 'WP_FS__TIME_5_MIN_IN_SEC', 300 );
287 }
288 if ( ! defined( 'WP_FS__TIME_10_MIN_IN_SEC' ) ) {
289 define( 'WP_FS__TIME_10_MIN_IN_SEC', 600 );
290 }
291 // define( 'WP_FS__TIME_15_MIN_IN_SEC', 900 );
292 if ( ! defined( 'WP_FS__TIME_12_HOURS_IN_SEC' ) ) {
293 define( 'WP_FS__TIME_12_HOURS_IN_SEC', 43200 );
294 }
295 if ( ! defined( 'WP_FS__TIME_24_HOURS_IN_SEC' ) ) {
296 define( 'WP_FS__TIME_24_HOURS_IN_SEC', WP_FS__TIME_12_HOURS_IN_SEC * 2 );
297 }
298 if ( ! defined( 'WP_FS__TIME_WEEK_IN_SEC' ) ) {
299 define( 'WP_FS__TIME_WEEK_IN_SEC', 7 * WP_FS__TIME_24_HOURS_IN_SEC );
300 }
301
302 #--------------------------------------------------------------------------------
303 #region Debugging
304 #--------------------------------------------------------------------------------
305
306 if ( ! defined( 'WP_FS__DEBUG_SDK' ) ) {
307 $debug_mode = get_option( 'fs_debug_mode', null );
308
309 if ( $debug_mode === null ) {
310 $debug_mode = false;
311 add_option( 'fs_debug_mode', $debug_mode );
312 }
313
314 define( 'WP_FS__DEBUG_SDK', is_numeric( $debug_mode ) ? ( 0 < $debug_mode ) : WP_FS__DEV_MODE );
315 }
316
317 if ( ! defined( 'WP_FS__ECHO_DEBUG_SDK' ) ) {
318 define( 'WP_FS__ECHO_DEBUG_SDK', WP_FS__DEV_MODE && ! empty( $_GET['fs_dbg_echo'] ) );
319 }
320 if ( ! defined( 'WP_FS__LOG_DATETIME_FORMAT' ) ) {
321 define( 'WP_FS__LOG_DATETIME_FORMAT', 'Y-m-d H:i:s' );
322 }
323 if ( ! defined( 'FS_API__LOGGER_ON' ) ) {
324 define( 'FS_API__LOGGER_ON', WP_FS__DEBUG_SDK );
325 }
326
327 if ( WP_FS__ECHO_DEBUG_SDK ) {
328 error_reporting( E_ALL );
329 }
330
331 #endregion
332
333 if ( ! defined( 'WP_FS__SCRIPT_START_TIME' ) ) {
334 define( 'WP_FS__SCRIPT_START_TIME', time() );
335 }
336 if ( ! defined( 'WP_FS__DEFAULT_PRIORITY' ) ) {
337 define( 'WP_FS__DEFAULT_PRIORITY', 10 );
338 }
339 if ( ! defined( 'WP_FS__LOWEST_PRIORITY' ) ) {
340 define( 'WP_FS__LOWEST_PRIORITY', 999999999 );
341 }
342
343 #--------------------------------------------------------------------------------
344 #region Multisite Network
345 #--------------------------------------------------------------------------------
346
347 /**
348 * Do not use this define directly, it will have the wrong value
349 * during plugin uninstall/deletion when the inclusion of the plugin
350 * is triggered due to registration with register_uninstall_hook().
351 *
352 * Instead, use fs_is_network_admin().
353 *
354 * @author Vova Feldman (@svovaf)
355 */
356 if ( ! defined( 'WP_FS__IS_NETWORK_ADMIN' ) ) {
357 define( 'WP_FS__IS_NETWORK_ADMIN',
358 is_multisite() &&
359 ( is_network_admin() ||
360 ( ( defined( 'DOING_AJAX' ) && DOING_AJAX &&
361 ( isset( $_REQUEST['_fs_network_admin'] ) && 'true' === $_REQUEST['_fs_network_admin'] /*||
362 ( ! empty( $_REQUEST['action'] ) && 'delete-plugin' === $_REQUEST['action'] )*/ )
363 ) ||
364 // Plugin uninstall.
365 defined( 'WP_UNINSTALL_PLUGIN' ) )
366 )
367 );
368 }
369
370 /**
371 * Do not use this define directly, it will have the wrong value
372 * during plugin uninstall/deletion when the inclusion of the plugin
373 * is triggered due to registration with register_uninstall_hook().
374 *
375 * Instead, use fs_is_blog_admin().
376 *
377 * @author Vova Feldman (@svovaf)
378 */
379 if ( ! defined( 'WP_FS__IS_BLOG_ADMIN' ) ) {
380 define( 'WP_FS__IS_BLOG_ADMIN', is_blog_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && isset( $_REQUEST['_fs_blog_admin'] ) ) );
381 }
382
383 if ( ! defined( 'WP_FS__SHOW_NETWORK_EVEN_WHEN_DELEGATED' ) ) {
384 // Set to true to show network level settings even if delegated to site admins.
385 define( 'WP_FS__SHOW_NETWORK_EVEN_WHEN_DELEGATED', false );
386 }
387
388 #endregion
389
390 if ( ! defined( 'WP_FS__DEMO_MODE' ) ) {
391 define( 'WP_FS__DEMO_MODE', false );
392 }
393 if ( ! defined( 'FS_SDK__SSLVERIFY' ) ) {
394 define( 'FS_SDK__SSLVERIFY', false );
395 }
396