| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * @package Freemius |
| 4 | 4 | * @copyright Copyright (c) 2015, Freemius, Inc. |
| @@ -145,9 +145,9 @@ | ||
| 145 | 145 | #region HTTP |
| 146 | 146 | #-------------------------------------------------------------------------------- |
| 147 | 147 | |
| 148 | 148 | if ( ! defined( 'WP_FS__IS_HTTP_REQUEST' ) ) { |
| 149 | - define( 'WP_FS__IS_HTTP_REQUEST', isset( $_SERVER['HTTP_HOST'] ) ); | |
| 149 | + define( 'WP_FS__IS_HTTP_REQUEST', isset( $_SERVER['HTTP_HOST'] ) && isset( $_SERVER['REQUEST_METHOD'] ) ); | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | if ( ! defined( 'WP_FS__IS_HTTPS' ) ) { |
| 153 | 153 | define( 'WP_FS__IS_HTTPS', ( WP_FS__IS_HTTP_REQUEST && |
| @@ -209,8 +209,12 @@ | ||
| 209 | 209 | if ( ! defined( 'WP_FS__API_SANDBOX_ADDRESS_LOCALHOST' ) ) { |
| 210 | 210 | define( 'WP_FS__API_SANDBOX_ADDRESS_LOCALHOST', 'http://sandbox-api.freemius:8080' ); |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | + if ( ! defined( 'WP_FS__API_TIMEOUT' ) ) { | |
| 214 | + define( 'WP_FS__API_TIMEOUT', 30 ); | |
| 215 | + } | |
| 216 | + | |
| 213 | 217 | // Set API address for local testing. |
| 214 | 218 | if ( ! WP_FS__IS_PRODUCTION_MODE ) { |
| 215 | 219 | if ( ! defined( 'FS_API__ADDRESS' ) ) { |
| 216 | 220 | define( 'FS_API__ADDRESS', WP_FS__API_ADDRESS_LOCALHOST ); |
| @@ -353,9 +357,9 @@ | ||
| 353 | 357 | define( 'WP_FS__IS_NETWORK_ADMIN', |
| 354 | 358 | is_multisite() && |
| 355 | 359 | ( is_network_admin() || |
| 356 | 360 | ( ( defined( 'DOING_AJAX' ) && DOING_AJAX && |
| 357 | - ( isset( $_REQUEST['_fs_network_admin'] ) /*|| | |
| 361 | + ( isset( $_REQUEST['_fs_network_admin'] ) && 'true' === $_REQUEST['_fs_network_admin'] /*|| | |
| 358 | 362 | ( ! empty( $_REQUEST['action'] ) && 'delete-plugin' === $_REQUEST['action'] )*/ ) |
| 359 | 363 | ) || |
| 360 | 364 | // Plugin uninstall. |
| 361 | 365 | defined( 'WP_UNINSTALL_PLUGIN' ) ) |
| @@ -384,8 +388,8 @@ | ||
| 384 | 388 | #endregion |
| 385 | 389 | |
| 386 | 390 | if ( ! defined( 'WP_FS__DEMO_MODE' ) ) { |
| 387 | 391 | define( 'WP_FS__DEMO_MODE', false ); |
| 388 | - } | |
| 389 | - if ( ! defined( 'FS_SDK__SSLVERIFY' ) ) { | |
| 390 | - define( 'FS_SDK__SSLVERIFY', false ); | |
| 391 | - } | |
| 392 | + } | |
| 393 | + if ( ! defined( 'FS_SDK__SSLVERIFY' ) ) { | |
| 394 | + define( 'FS_SDK__SSLVERIFY', false ); | |
| 395 | + } | |