PluginProbe ʕ •ᴥ•ʔ
EmbedPress – PDF Embedder, Embed PDF viewer, YouTube Videos, 3D FlipBook, Social feeds & more / 2.0.1
EmbedPress – PDF Embedder, Embed PDF viewer, YouTube Videos, 3D FlipBook, Social feeds & more v2.0.1
4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 2.0.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.2.0 2.2.1 2.2.2 2.3.0 2.3.1 2.3.2 2.3.3 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.1.3 3.2.0 3.2.1 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.4.0 3.4.1 3.4.2 3.4.3 3.5.0 3.5.1 3.5.2 3.5.3 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.7.0 3.7.1 3.7.2 3.7.3 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.9.0 3.9.1 3.9.10 3.9.11 3.9.12 3.9.13 3.9.14 3.9.15 3.9.16 3.9.17 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9 4.0.0 4.0.1 4.0.10 4.0.11 4.0.12 4.0.13 4.0.14 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.0.9 4.1.0 4.1.1 4.1.10 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 4.3.1 4.4.0 4.4.1 4.4.10 4.4.11 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9 4.5.0 4.5.1
embedpress / freemius / config.php
embedpress / freemius Last commit date
assets 9 years ago includes 9 years ago languages 9 years ago templates 9 years ago LICENSE.txt 9 years ago config.php 9 years ago index.php 9 years ago require.php 9 years ago start.php 9 years ago
config.php
328 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 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__DOMAIN_PRODUCTION', 'wp.freemius.com' );
130 define( 'WP_FS__ADDRESS_PRODUCTION', 'https://' . WP_FS__DOMAIN_PRODUCTION );
131
132 if ( ! defined( 'WP_FS__DOMAIN_LOCALHOST' ) ) {
133 define( 'WP_FS__DOMAIN_LOCALHOST', 'wp.freemius' );
134 }
135 if ( ! defined( 'WP_FS__ADDRESS_LOCALHOST' ) ) {
136 define( 'WP_FS__ADDRESS_LOCALHOST', 'http://' . WP_FS__DOMAIN_LOCALHOST . ':8080' );
137 }
138
139 if ( ! defined( 'WP_FS__TESTING_DOMAIN' ) ) {
140 define( 'WP_FS__TESTING_DOMAIN', 'fswp' );
141 }
142
143 #--------------------------------------------------------------------------------
144 #region HTTP
145 #--------------------------------------------------------------------------------
146
147 if ( ! defined( 'WP_FS__IS_HTTP_REQUEST' ) ) {
148 define( 'WP_FS__IS_HTTP_REQUEST', isset( $_SERVER['HTTP_HOST'] ) );
149 }
150
151 if ( ! defined( 'WP_FS__IS_HTTPS' ) ) {
152 define( 'WP_FS__IS_HTTPS', ( WP_FS__IS_HTTP_REQUEST &&
153 // Checks if CloudFlare's HTTPS (Flexible SSL support).
154 isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) &&
155 'https' === strtolower( $_SERVER['HTTP_X_FORWARDED_PROTO'] )
156 ) ||
157 // Check if HTTPS request.
158 ( isset( $_SERVER['HTTPS'] ) && 'on' == $_SERVER['HTTPS'] ) ||
159 ( isset( $_SERVER['SERVER_PORT'] ) && 443 == $_SERVER['SERVER_PORT'] )
160 );
161 }
162
163 if ( ! defined( 'WP_FS__IS_POST_REQUEST' ) ) {
164 define( 'WP_FS__IS_POST_REQUEST', ( WP_FS__IS_HTTP_REQUEST &&
165 strtoupper( $_SERVER['REQUEST_METHOD'] ) == 'POST' ) );
166 }
167
168 if ( ! defined( 'WP_FS__REMOTE_ADDR' ) ) {
169 define( 'WP_FS__REMOTE_ADDR', fs_get_ip() );
170 }
171
172 if ( ! defined( 'WP_FS__IS_LOCALHOST' ) ) {
173 if ( defined( 'WP_FS__LOCALHOST_IP' ) ) {
174 define( 'WP_FS__IS_LOCALHOST', ( WP_FS__LOCALHOST_IP === WP_FS__REMOTE_ADDR ) );
175 } else {
176 define( 'WP_FS__IS_LOCALHOST', WP_FS__IS_HTTP_REQUEST &&
177 is_string( WP_FS__REMOTE_ADDR ) &&
178 ( substr( WP_FS__REMOTE_ADDR, 0, 4 ) === '127.' ||
179 WP_FS__REMOTE_ADDR === '::1' )
180 );
181 }
182 }
183
184 if ( ! defined( 'WP_FS__IS_LOCALHOST_FOR_SERVER' ) ) {
185 define( 'WP_FS__IS_LOCALHOST_FOR_SERVER', ( ! WP_FS__IS_HTTP_REQUEST ||
186 false !== strpos( $_SERVER['HTTP_HOST'], 'localhost' ) ) );
187 }
188
189 #endregion
190
191 if ( ! defined( 'WP_FS__IS_PRODUCTION_MODE' ) ) {
192 // By default, run with Freemius production servers.
193 define( 'WP_FS__IS_PRODUCTION_MODE', true );
194 }
195
196 if ( ! defined( 'WP_FS__ADDRESS' ) ) {
197 define( 'WP_FS__ADDRESS', ( WP_FS__IS_PRODUCTION_MODE ? WP_FS__ADDRESS_PRODUCTION : WP_FS__ADDRESS_LOCALHOST ) );
198 }
199
200
201 #--------------------------------------------------------------------------------
202 #region API
203 #--------------------------------------------------------------------------------
204
205 if ( ! defined( 'WP_FS__API_ADDRESS_LOCALHOST' ) ) {
206 define( 'WP_FS__API_ADDRESS_LOCALHOST', 'http://api.freemius:8080' );
207 }
208 if ( ! defined( 'WP_FS__API_SANDBOX_ADDRESS_LOCALHOST' ) ) {
209 define( 'WP_FS__API_SANDBOX_ADDRESS_LOCALHOST', 'http://sandbox-api.freemius:8080' );
210 }
211
212 // Set API address for local testing.
213 if ( ! WP_FS__IS_PRODUCTION_MODE ) {
214 if ( ! defined( 'FS_API__ADDRESS' ) ) {
215 define( 'FS_API__ADDRESS', WP_FS__API_ADDRESS_LOCALHOST );
216 }
217 if ( ! defined( 'FS_API__SANDBOX_ADDRESS' ) ) {
218 define( 'FS_API__SANDBOX_ADDRESS', WP_FS__API_SANDBOX_ADDRESS_LOCALHOST );
219 }
220 }
221
222 #endregion
223
224 #--------------------------------------------------------------------------------
225 #region Checkout
226 #--------------------------------------------------------------------------------
227
228 if ( ! defined( 'FS_CHECKOUT__ADDRESS_PRODUCTION' ) ) {
229 define( 'FS_CHECKOUT__ADDRESS_PRODUCTION', 'https://checkout.freemius.com' );
230 }
231
232 if ( ! defined( 'FS_CHECKOUT__ADDRESS_LOCALHOST' ) ) {
233 define( 'FS_CHECKOUT__ADDRESS_LOCALHOST', 'http://checkout.freemius:8080' );
234 }
235
236 if ( ! defined( 'FS_CHECKOUT__ADDRESS' ) ) {
237 define( 'FS_CHECKOUT__ADDRESS', ( WP_FS__IS_PRODUCTION_MODE ? FS_CHECKOUT__ADDRESS_PRODUCTION : FS_CHECKOUT__ADDRESS_LOCALHOST ) );
238 }
239
240 #endregion
241
242 define( 'WP_FS___OPTION_PREFIX', 'fs' . ( WP_FS__IS_PRODUCTION_MODE ? '' : '_dbg' ) . '_' );
243
244 if ( ! defined( 'WP_FS__ACCOUNTS_OPTION_NAME' ) ) {
245 define( 'WP_FS__ACCOUNTS_OPTION_NAME', WP_FS___OPTION_PREFIX . 'accounts' );
246 }
247 if ( ! defined( 'WP_FS__API_CACHE_OPTION_NAME' ) ) {
248 define( 'WP_FS__API_CACHE_OPTION_NAME', WP_FS___OPTION_PREFIX . 'api_cache' );
249 }
250 define( 'WP_FS__OPTIONS_OPTION_NAME', WP_FS___OPTION_PREFIX . 'options' );
251
252 /**
253 * Module types
254 *
255 * @since 1.2.2
256 */
257 define( 'WP_FS__MODULE_TYPE_PLUGIN', 'plugin' );
258 define( 'WP_FS__MODULE_TYPE_THEME', 'theme' );
259
260 /**
261 * Billing Frequencies
262 */
263 define( 'WP_FS__PERIOD_ANNUALLY', 'annual' );
264 define( 'WP_FS__PERIOD_MONTHLY', 'monthly' );
265 define( 'WP_FS__PERIOD_LIFETIME', 'lifetime' );
266
267 /**
268 * Plans
269 */
270 define( 'WP_FS__PLAN_DEFAULT_PAID', false );
271 define( 'WP_FS__PLAN_FREE', 'free' );
272 define( 'WP_FS__PLAN_TRIAL', 'trial' );
273
274 /**
275 * Times in seconds
276 */
277 if ( ! defined( 'WP_FS__TIME_5_MIN_IN_SEC' ) ) {
278 define( 'WP_FS__TIME_5_MIN_IN_SEC', 300 );
279 }
280 if ( ! defined( 'WP_FS__TIME_10_MIN_IN_SEC' ) ) {
281 define( 'WP_FS__TIME_10_MIN_IN_SEC', 600 );
282 }
283 // define( 'WP_FS__TIME_15_MIN_IN_SEC', 900 );
284 if ( ! defined( 'WP_FS__TIME_24_HOURS_IN_SEC' ) ) {
285 define( 'WP_FS__TIME_24_HOURS_IN_SEC', 86400 );
286 }
287
288 #--------------------------------------------------------------------------------
289 #region Debugging
290 #--------------------------------------------------------------------------------
291
292 if ( ! defined( 'WP_FS__DEBUG_SDK' ) ) {
293 $debug_mode = get_option( 'fs_debug_mode', null );
294
295 if ( $debug_mode === null ) {
296 $debug_mode = false;
297 add_option( 'fs_debug_mode', $debug_mode );
298 }
299
300 define( 'WP_FS__DEBUG_SDK', is_numeric( $debug_mode ) ? ( 0 < $debug_mode ) : WP_FS__DEV_MODE );
301 }
302
303 if ( ! defined( 'WP_FS__ECHO_DEBUG_SDK' ) ) {
304 define( 'WP_FS__ECHO_DEBUG_SDK', WP_FS__DEV_MODE && ! empty( $_GET['fs_dbg_echo'] ) );
305 }
306 if ( ! defined( 'WP_FS__LOG_DATETIME_FORMAT' ) ) {
307 define( 'WP_FS__LOG_DATETIME_FORMAT', 'Y-m-d H:i:s' );
308 }
309 if ( ! defined( 'FS_API__LOGGER_ON' ) ) {
310 define( 'FS_API__LOGGER_ON', WP_FS__DEBUG_SDK );
311 }
312
313 if ( WP_FS__ECHO_DEBUG_SDK ) {
314 error_reporting( E_ALL );
315 }
316
317 #endregion
318
319 if ( ! defined( 'WP_FS__SCRIPT_START_TIME' ) ) {
320 define( 'WP_FS__SCRIPT_START_TIME', time() );
321 }
322 if ( ! defined( 'WP_FS__DEFAULT_PRIORITY' ) ) {
323 define( 'WP_FS__DEFAULT_PRIORITY', 10 );
324 }
325 if ( ! defined( 'WP_FS__LOWEST_PRIORITY' ) ) {
326 define( 'WP_FS__LOWEST_PRIORITY', 999999999 );
327 }
328