PluginProbe ʕ •ᴥ•ʔ
WPForms – Easy Form Builder for WordPress – Contact Forms, Payment Forms, Surveys, & More / 1.9.0.3
WPForms – Easy Form Builder for WordPress – Contact Forms, Payment Forms, Surveys, & More v1.9.0.3
1.10.1.1 1.10.1 1.10.0.5 trunk 1.1.4 1.1.4.2 1.1.5 1.1.5.1 1.1.6 1.1.6.1 1.1.7 1.1.7.1 1.1.7.2 1.1.8 1.1.8.1 1.1.8.2 1.1.8.3 1.1.8.4 1.10.0.1 1.10.0.2 1.10.0.3 1.10.0.4 1.2.0 1.2.0.1 1.2.1 1.2.2 1.2.2.1 1.2.2.2 1.2.3 1.2.3.1 1.2.3.2 1.2.4 1.2.4.1 1.2.5 1.2.5.1 1.2.6 1.2.7 1.2.8 1.2.8.1 1.2.9 1.3.0 1.3.1 1.3.1.1 1.3.1.2 1.3.2 1.3.3 1.3.5 1.3.6 1.3.6.1 1.3.6.2 1.3.7.2 1.3.7.3 1.3.7.4 1.3.8 1.3.9.1 1.4.0.1 1.4.1.1 1.4.2 1.4.2.1 1.4.2.2 1.4.3 1.4.4 1.4.4.1 1.4.5 1.4.5.1 1.4.5.2 1.4.5.3 1.4.6 1.4.7.1 1.4.7.2 1.4.8.1 1.4.9 1.5.0.1 1.5.0.3 1.5.0.4 1.5.1 1.5.1.1 1.5.1.3 1.5.2.1 1.5.2.2 1.5.2.3 1.5.3 1.5.3.1 1.5.4.1 1.5.4.2 1.5.5 1.5.5.1 1.5.6 1.5.6.2 1.5.7 1.5.8.2 1.5.9.1 1.5.9.4 1.5.9.5 1.6.0.1 1.6.0.2 1.6.1 1.6.2.2 1.6.2.3 1.6.3.1 1.6.4 1.6.4.1 1.6.5 1.6.6 1.6.7 1.6.7.1 1.6.7.2 1.6.7.3 1.6.8 1.6.8.1 1.6.9 1.7.0 1.7.1.1 1.7.1.2 1.7.2 1.7.2.1 1.7.3 1.7.4 1.7.4.1 1.7.4.2 1.7.5.1 1.7.5.2 1.7.5.3 1.7.5.5 1.7.6 1.7.7 1.7.7.1 1.7.7.2 1.7.8 1.7.9 1.7.9.1 1.8.0.1 1.8.0.2 1.8.1.1 1.8.1.2 1.8.1.3 1.8.2.1 1.8.2.2 1.8.2.3 1.8.3 1.8.3.1 1.8.4 1.8.4.1 1.8.5.2 1.8.5.3 1.8.5.4 1.8.6.2 1.8.6.3 1.8.6.4 1.8.7.2 1.8.8.2 1.8.8.3 1.8.9.1 1.8.9.2 1.8.9.4 1.8.9.5 1.8.9.6 1.9.0.1 1.9.0.2 1.9.0.3 1.9.0.4 1.9.1.1 1.9.1.2 1.9.1.3 1.9.1.4 1.9.1.5 1.9.1.6 1.9.2.1 1.9.2.2 1.9.2.3 1.9.3.1 1.9.3.2 1.9.4.1 1.9.4.2 1.9.5 1.9.5.1 1.9.5.2 1.9.6 1.9.6.1 1.9.6.2 1.9.7.1 1.9.7.2 1.9.7.3 1.9.8.1 1.9.8.2 1.9.8.4 1.9.8.7 1.9.9.2 1.9.9.3 1.9.9.4
wpforms-lite / includes / compat.php
wpforms-lite / includes Last commit date
admin 1 year ago emails 1 year ago fields 1 year ago functions 1 year ago providers 1 year ago templates 1 year ago class-db.php 1 year ago class-fields.php 1 year ago class-form.php 1 year ago class-install.php 1 year ago class-process.php 1 year ago class-providers.php 1 year ago class-templates.php 1 year ago class-widget.php 1 year ago compat.php 1 year ago deprecated.php 1 year ago functions-list.php 1 year ago functions.php 1 year ago integrations.php 1 year ago
compat.php
75 lines
1 <?php
2 /**
3 * WordPress core function polyfill for WordPress 5.2 - 5.4.
4 *
5 * @since 1.7.6
6 */
7 if ( ! function_exists( 'wp_get_environment_type' ) ) {
8 /**
9 * Retrieves the current environment type.
10 *
11 * The type can be set via the `WP_ENVIRONMENT_TYPE` global system variable,
12 * or a constant of the same name.
13 *
14 * Possible values are 'local', 'development', 'staging', and 'production'.
15 * If not set, the type defaults to 'production'.
16 *
17 * @return string The current environment type.
18 */
19 function wp_get_environment_type() { // phpcs:ignore Generic.Metrics.CyclomaticComplexity.TooHigh, WPForms.Comments.SinceTag.MissingSince
20
21 static $current_env = '';
22
23 if ( ! defined( 'WP_RUN_CORE_TESTS' ) && $current_env ) {
24 return $current_env;
25 }
26
27 $wp_environments = [
28 'local',
29 'development',
30 'staging',
31 'production',
32 ];
33
34 // Add a note about the deprecated WP_ENVIRONMENT_TYPES constant.
35 if ( defined( 'WP_ENVIRONMENT_TYPES' ) && function_exists( '_deprecated_argument' ) ) {
36 // phpcs:disable WPForms.PHP.ValidateDomain.InvalidDomain
37 if ( function_exists( '__' ) ) {
38 /* translators: %s - WP_ENVIRONMENT_TYPES. */
39 $message = sprintf( __( 'The %s constant is no longer supported.' ), 'WP_ENVIRONMENT_TYPES' );
40 } else {
41 $message = sprintf( 'The %s constant is no longer supported.', 'WP_ENVIRONMENT_TYPES' );
42 }
43 // phpcs:enable WPForms.PHP.ValidateDomain.InvalidDomain
44
45 _deprecated_argument(
46 'define()',
47 '5.5.1',
48 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
49 $message
50 );
51 }
52
53 // Check if the environment variable has been set, if `getenv` is available on the system.
54 if ( function_exists( 'getenv' ) ) {
55 $has_env = getenv( 'WP_ENVIRONMENT_TYPE' );
56
57 if ( $has_env !== false ) {
58 $current_env = $has_env;
59 }
60 }
61
62 // Fetch the environment from a constant, this overrides the global system variable.
63 if ( defined( 'WP_ENVIRONMENT_TYPE' ) ) {
64 $current_env = WP_ENVIRONMENT_TYPE;
65 }
66
67 // Make sure the environment is an allowed one, and not accidentally set to an invalid value.
68 if ( ! in_array( $current_env, $wp_environments, true ) ) {
69 $current_env = 'production';
70 }
71
72 return $current_env;
73 }
74 }
75