assets
10 years ago
includes
10 years ago
templates
10 years ago
LICENSE.txt
10 years ago
config.php
10 years ago
start.php
10 years ago
config.php
161 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @package Freemius |
| 4 | * @copyright Copyright (c) 2015, Freemius, Inc. |
| 5 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 6 | * @since 1.0.4 |
| 7 | */ |
| 8 | |
| 9 | if ( ! defined( 'ABSPATH' ) ) { |
| 10 | exit; |
| 11 | } |
| 12 | |
| 13 | define( 'WP_FS__SLUG', 'freemius' ); |
| 14 | if ( ! defined( 'WP_FS__DEV_MODE' ) ) { |
| 15 | define( 'WP_FS__DEV_MODE', false ); |
| 16 | } |
| 17 | |
| 18 | /** |
| 19 | * API Connectivity Simulation |
| 20 | */ |
| 21 | define( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY', false && WP_FS__DEV_MODE ); |
| 22 | define( 'WP_FS__SIMULATE_NO_CURL', false && WP_FS__DEV_MODE ); |
| 23 | define( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE', false && WP_FS__DEV_MODE ); |
| 24 | define( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL', false && WP_FS__DEV_MODE ); |
| 25 | if ( WP_FS__SIMULATE_NO_CURL ) { |
| 26 | define( 'FS_SDK__SIMULATE_NO_CURL', true ); |
| 27 | } |
| 28 | if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE ) { |
| 29 | define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE', true ); |
| 30 | } |
| 31 | if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL ) { |
| 32 | define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL', true ); |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * If your dev environment supports custom public network IP setup |
| 37 | * like VVV, please update WP_FS__LOCALHOST_IP with your public IP |
| 38 | * and uncomment it during dev. |
| 39 | */ |
| 40 | if ( ! defined( 'WP_FS__LOCALHOST_IP' ) ) { |
| 41 | // VVV default public network IP. |
| 42 | define( 'WP_FS__VVV_DEFAULT_PUBLIC_IP', '192.168.50.4' ); |
| 43 | |
| 44 | // define( 'WP_FS__LOCALHOST_IP', WP_FS__VVV_DEFAULT_PUBLIC_IP ); |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * If true and running with secret key, the opt-in process |
| 49 | * will skip the email activation process which is invoked |
| 50 | * when the email of the context user already exist in Freemius |
| 51 | * database (as a security precaution, to prevent sharing user |
| 52 | * secret with unauthorized entity). |
| 53 | * |
| 54 | * IMPORTANT: |
| 55 | * AS A SECURITY PRECAUTION, WE VALIDATE THE TIMESTAMP OF THE OPT-IN REQUEST. |
| 56 | * THEREFORE, MAKE SURE THAT WHEN USING THIS PARAMETER,YOUR TESTING ENVIRONMENT'S |
| 57 | * CLOCK IS SYNCED. |
| 58 | */ |
| 59 | define( 'WP_FS__SKIP_EMAIL_ACTIVATION', false ); |
| 60 | |
| 61 | |
| 62 | /** |
| 63 | * Directories |
| 64 | */ |
| 65 | define( 'WP_FS__DIR', dirname( __FILE__ ) ); |
| 66 | define( 'WP_FS__DIR_INCLUDES', WP_FS__DIR . '/includes' ); |
| 67 | define( 'WP_FS__DIR_TEMPLATES', WP_FS__DIR . '/templates' ); |
| 68 | define( 'WP_FS__DIR_ASSETS', WP_FS__DIR . '/assets' ); |
| 69 | define( 'WP_FS__DIR_CSS', WP_FS__DIR_ASSETS . '/css' ); |
| 70 | define( 'WP_FS__DIR_JS', WP_FS__DIR_ASSETS . '/js' ); |
| 71 | define( 'WP_FS__DIR_IMG', WP_FS__DIR_ASSETS . '/img' ); |
| 72 | define( 'WP_FS__DIR_SDK', WP_FS__DIR_INCLUDES . '/sdk' ); |
| 73 | |
| 74 | |
| 75 | /** |
| 76 | * Domain / URL / Address |
| 77 | */ |
| 78 | define( 'WP_FS__TESTING_DOMAIN', 'fswp:8080' ); |
| 79 | define( 'WP_FS__DOMAIN_PRODUCTION', 'wp.freemius.com' ); |
| 80 | define( 'WP_FS__DOMAIN_LOCALHOST', 'wp.freemius' ); |
| 81 | define( 'WP_FS__ADDRESS_LOCALHOST', 'http://' . WP_FS__DOMAIN_LOCALHOST . ':8080' ); |
| 82 | define( 'WP_FS__ADDRESS_PRODUCTION', 'https://' . WP_FS__DOMAIN_PRODUCTION ); |
| 83 | |
| 84 | define( 'WP_FS__IS_PRODUCTION_MODE', ! defined( 'WP_FS__DEV_MODE' ) || ! WP_FS__DEV_MODE || ( WP_FS__TESTING_DOMAIN !== $_SERVER['HTTP_HOST'] ) ); |
| 85 | |
| 86 | define( 'WP_FS__ADDRESS', ( WP_FS__IS_PRODUCTION_MODE ? WP_FS__ADDRESS_PRODUCTION : WP_FS__ADDRESS_LOCALHOST ) ); |
| 87 | |
| 88 | if ( defined( 'WP_FS__LOCALHOST_IP' ) ) { |
| 89 | define( 'WP_FS__IS_LOCALHOST', ( WP_FS__LOCALHOST_IP == $_SERVER['REMOTE_ADDR'] ) ); |
| 90 | } else { |
| 91 | define( 'WP_FS__IS_LOCALHOST', ( substr( $_SERVER['REMOTE_ADDR'], 0, 4 ) == '127.' || $_SERVER['REMOTE_ADDR'] == '::1' ) ); |
| 92 | } |
| 93 | |
| 94 | define( 'WP_FS__IS_LOCALHOST_FOR_SERVER', ( false !== strpos( $_SERVER['HTTP_HOST'], 'localhost' ) ) ); |
| 95 | |
| 96 | // Set API address for local testing. |
| 97 | if ( ! WP_FS__IS_PRODUCTION_MODE ) { |
| 98 | define( 'FS_API__ADDRESS', 'http://api.freemius:8080' ); |
| 99 | define( 'FS_API__SANDBOX_ADDRESS', 'http://sandbox-api.freemius:8080' ); |
| 100 | } |
| 101 | |
| 102 | define( 'WP_FS___OPTION_PREFIX', 'fs' . ( WP_FS__IS_PRODUCTION_MODE ? '' : '_dbg' ) . '_' ); |
| 103 | |
| 104 | if ( ! defined( 'WP_FS__ACCOUNTS_OPTION_NAME' ) ) { |
| 105 | define( 'WP_FS__ACCOUNTS_OPTION_NAME', WP_FS___OPTION_PREFIX . 'accounts' ); |
| 106 | } |
| 107 | if ( ! defined( 'WP_FS__API_CACHE_OPTION_NAME' ) ) { |
| 108 | define( 'WP_FS__API_CACHE_OPTION_NAME', WP_FS___OPTION_PREFIX . 'api_cache' ); |
| 109 | } |
| 110 | define( 'WP_FS__OPTIONS_OPTION_NAME', WP_FS___OPTION_PREFIX . 'options' ); |
| 111 | |
| 112 | define( 'WP_FS__IS_HTTPS', ( |
| 113 | // Checks if CloudFlare's HTTPS (Flexible SSL support) |
| 114 | isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && 'https' === strtolower( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) ) || |
| 115 | // Check if HTTPS request. |
| 116 | ( isset( $_SERVER['HTTPS'] ) && 'on' == $_SERVER['HTTPS'] ) || |
| 117 | ( isset( $_SERVER['SERVER_PORT'] ) && 443 == $_SERVER['SERVER_PORT'] ) |
| 118 | ); |
| 119 | |
| 120 | define( 'WP_FS__IS_POST_REQUEST', ( strtoupper( $_SERVER['REQUEST_METHOD'] ) == 'POST' ) ); |
| 121 | |
| 122 | /** |
| 123 | * Billing Frequencies |
| 124 | */ |
| 125 | define( 'WP_FS__PERIOD_ANNUALLY', 'annual' ); |
| 126 | define( 'WP_FS__PERIOD_MONTHLY', 'monthly' ); |
| 127 | define( 'WP_FS__PERIOD_LIFETIME', 'lifetime' ); |
| 128 | |
| 129 | /** |
| 130 | * Plans |
| 131 | */ |
| 132 | define( 'WP_FS__PLAN_DEFAULT_PAID', false ); |
| 133 | define( 'WP_FS__PLAN_FREE', 'free' ); |
| 134 | define( 'WP_FS__PLAN_TRIAL', 'trial' ); |
| 135 | |
| 136 | /** |
| 137 | * Times in seconds |
| 138 | */ |
| 139 | // define( 'WP_FS__TIME_5_MIN_IN_SEC', 300 ); |
| 140 | define( 'WP_FS__TIME_10_MIN_IN_SEC', 600 ); |
| 141 | // define( 'WP_FS__TIME_15_MIN_IN_SEC', 900 ); |
| 142 | define( 'WP_FS__TIME_24_HOURS_IN_SEC', 86400 ); |
| 143 | |
| 144 | /** |
| 145 | * Debugging |
| 146 | */ |
| 147 | define( 'WP_FS__DEBUG_SDK', ! empty( $_GET['fs_dbg'] ) ); |
| 148 | define( 'WP_FS__ECHO_DEBUG_SDK', ! empty( $_GET['fs_dbg_echo'] ) ); |
| 149 | define( 'WP_FS__LOG_DATETIME_FORMAT', 'Y-n-d H:i:s' ); |
| 150 | |
| 151 | if ( WP_FS__ECHO_DEBUG_SDK ) { |
| 152 | error_reporting( E_ALL ); |
| 153 | ini_set( 'error_reporting', E_ALL ); |
| 154 | ini_set( 'display_errors', true ); |
| 155 | ini_set( 'html_errors', true ); |
| 156 | } |
| 157 | |
| 158 | |
| 159 | define( 'WP_FS__SCRIPT_START_TIME', time() ); |
| 160 | define( 'WP_FS__LOWEST_PRIORITY', 999999999 ); |
| 161 |