#js&&****&……. */ // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } if ( is_multisite() ) { $is_pro = file_exists( __DIR__ . '/pro/wpforms-pro.php' ); if ( ! $is_pro ) { // <- is lite. $lite_base = plugin_basename( __FILE__ ); $active_plugins = get_option( 'active_plugins', [] ); $active_network_plugins = get_site_option( 'active_sitewide_plugins' ); if ( isset( $active_network_plugins[ $lite_base ] ) && in_array( 'wpforms/wpforms.php', $active_plugins, true ) ) { // Keep plugin active but silent. return; } } } if ( ! defined( 'WPFORMS_VERSION' ) ) { /** * Plugin version. * * @since 1.0.0 */ define( 'WPFORMS_VERSION', '1.9.3.2' ); } // Plugin Folder Path. if ( ! defined( 'WPFORMS_PLUGIN_DIR' ) ) { define( 'WPFORMS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); } // Plugin Folder URL. if ( ! defined( 'WPFORMS_PLUGIN_URL' ) ) { define( 'WPFORMS_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); } // Plugin Root File. if ( ! defined( 'WPFORMS_PLUGIN_FILE' ) ) { define( 'WPFORMS_PLUGIN_FILE', __FILE__ ); } // Don't allow multiple versions to be active. if ( function_exists( 'wpforms' ) ) { if ( ! function_exists( 'wpforms_pro_just_activated' ) ) { /** * When we activate a Pro version, we need to do additional operations: * 1) deactivate a Lite version; * 2) register option which help to run all activation process for Pro version (custom tables creation, etc.). * * @since 1.6.2 * @deprecated 1.8.7 */ function wpforms_pro_just_activated() { _deprecated_function( __METHOD__, '1.8.7 of the WPForms plugin' ); wpforms_deactivate(); add_option( 'wpforms_install', 1 ); } } if ( ! function_exists( 'wpforms_lite_just_activated' ) ) { /** * Store temporarily that the Lite version of the plugin was activated. * This is needed because WP does a redirect after activation and * we need to preserve this state to know whether user activated Lite or not. * * @since 1.5.8 */ function wpforms_lite_just_activated() { set_transient( 'wpforms_lite_just_activated', true ); } add_action( 'activate_wpforms-lite/wpforms.php', 'wpforms_lite_just_activated' ); } if ( ! function_exists( 'wpforms_lite_just_deactivated' ) ) { /** * Store temporarily that Lite plugin was deactivated. * Convert temporary "activated" value to a global variable, * so it is available through the request. Remove from the storage. * * @since 1.5.8 * @deprecated 1.8.7 */ function wpforms_lite_just_deactivated() { _deprecated_function( __METHOD__, '1.8.7 of the WPForms plugin' ); global $wpforms_lite_just_activated, $wpforms_lite_just_deactivated; $wpforms_lite_just_activated = (bool) get_transient( 'wpforms_lite_just_activated' ); $wpforms_lite_just_deactivated = true; delete_transient( 'wpforms_lite_just_activated' ); } } if ( ! function_exists( 'wpforms_deactivate' ) ) { /** * Deactivate Lite if WPForms already activated. * * @since 1.0.0 */ function wpforms_deactivate() { $pro_file = wpforms()->is_pro() ? WPFORMS_PLUGIN_FILE : __FILE__; $lite_file = wpforms()->is_pro() ? __FILE__ : WPFORMS_PLUGIN_FILE; $lite_base = plugin_basename( $lite_file ); $pro_base = plugin_basename( $pro_file ); if ( ! is_multisite() || is_plugin_active_for_network( $pro_base ) || ( ! is_plugin_active_for_network( $pro_base ) && ! is_plugin_active_for_network( $lite_base ) ) ) { deactivate_plugins( $lite_base ); /** * Fires on plugin deactivation. * * @since 1.6.3.1 * * @param string $plugin_basename The plugin basename. */ do_action( 'wpforms_plugin_deactivated', $lite_base ); // Run the installation on the next admin visit. add_option( 'wpforms_install', 1 ); } } } add_action( 'admin_init', 'wpforms_deactivate' ); if ( ! function_exists( 'wpforms_lite_notice' ) ) { /** * Display the notice after deactivation when Pro is still active * and user wanted to activate the Lite version of the plugin. * * @since 1.0.0 */ function wpforms_lite_notice() { $pro_file = wpforms()->is_pro() ? WPFORMS_PLUGIN_FILE : __FILE__; $lite_file = wpforms()->is_pro() ? __FILE__ : WPFORMS_PLUGIN_FILE; $lite_base = plugin_basename( $lite_file ); $pro_base = plugin_basename( $pro_file ); // Do not show the notice if upgrade from Lite to Pro. if ( (bool) get_transient( 'wpforms_lite_just_activated' ) === false ) { return; } if ( ! is_multisite() || is_plugin_active_for_network( $pro_base ) || ( ! is_plugin_active_for_network( $pro_base ) && ! is_plugin_active_for_network( $lite_base ) ) ) { $message = sprintf( /* translators: %s - Path to installed plugins. */ __( 'Your site already has WPForms Pro activated. If you want to switch to WPForms Lite, please first go to %s and deactivate WPForms. Then, you can activate WPForms Lite.', 'wpforms-lite' ), is_multisite() ? __( 'Network Admin → Plugins → Installed Plugins', 'wpforms-lite' ) : __( 'Plugins → Installed Plugins', 'wpforms-lite' ) ); // Currently tried to activate Lite with Pro still active, so display the message. printf( '
%3$s
insecure version of PHP that is no longer supported. Please contact your web hosting provider to update your PHP version or switch to a recommended WordPress hosting company.', 'wpforms-lite' ),
[
'a' => [
'href' => [],
'target' => [],
'rel' => [],
],
'strong' => [],
]
),
'https://www.wpbeginner.com/wordpress-hosting/'
);
?>
Note: The WPForms plugin is disabled on your site until you fix the issue. Read more for additional information.', 'wpforms-lite' ),
[
'a' => [
'href' => [],
'target' => [],
'rel' => [],
],
'strong' => [],
]
),
'https://wpforms.com/docs/supported-php-version/'
);
?>