Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../public_h.../wp-conte.../plugins/wpforms-...
File: wpforms.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Plugin Name: WPForms Lite
[2] Fix | Delete
* Plugin URI: https://wpforms.com
[3] Fix | Delete
* Description: Beginner friendly WordPress contact form plugin. Use our Drag & Drop form builder to create your WordPress forms.
[4] Fix | Delete
* Requires at least: 5.5
[5] Fix | Delete
* Requires PHP: 7.0
[6] Fix | Delete
* Author: WPForms
[7] Fix | Delete
* Author URI: https://wpforms.com
[8] Fix | Delete
* Version: 1.8.9.6
[9] Fix | Delete
* Text Domain: wpforms-lite
[10] Fix | Delete
* Domain Path: assets/languages
[11] Fix | Delete
*
[12] Fix | Delete
* WPForms is free software: you can redistribute it and/or modify
[13] Fix | Delete
* it under the terms of the GNU General Public License as published by
[14] Fix | Delete
* the Free Software Foundation, either version 2 of the License, or
[15] Fix | Delete
* any later version.
[16] Fix | Delete
*
[17] Fix | Delete
* WPForms is distributed in the hope that it will be useful,
[18] Fix | Delete
* but WITHOUT ANY WARRANTY; without even the implied warranty of
[19] Fix | Delete
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
[20] Fix | Delete
* GNU General Public License for more details.
[21] Fix | Delete
*
[22] Fix | Delete
* You should have received a copy of the GNU General Public License
[23] Fix | Delete
* along with WPForms. If not, see <https://www.gnu.org/licenses/>.
[24] Fix | Delete
*/
[25] Fix | Delete
[26] Fix | Delete
// Exit if accessed directly.
[27] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[28] Fix | Delete
exit;
[29] Fix | Delete
}
[30] Fix | Delete
[31] Fix | Delete
if ( is_multisite() ) {
[32] Fix | Delete
$is_pro = file_exists( __DIR__ . '/pro/wpforms-pro.php' );
[33] Fix | Delete
[34] Fix | Delete
if ( ! $is_pro ) { // <- is lite.
[35] Fix | Delete
$lite_base = plugin_basename( __FILE__ );
[36] Fix | Delete
[37] Fix | Delete
$active_plugins = get_option( 'active_plugins', [] );
[38] Fix | Delete
$active_network_plugins = get_site_option( 'active_sitewide_plugins' );
[39] Fix | Delete
[40] Fix | Delete
if (
[41] Fix | Delete
isset( $active_network_plugins[ $lite_base ] )
[42] Fix | Delete
&& in_array( 'wpforms/wpforms.php', $active_plugins, true )
[43] Fix | Delete
) {
[44] Fix | Delete
// Keep plugin active but silent.
[45] Fix | Delete
return;
[46] Fix | Delete
}
[47] Fix | Delete
}
[48] Fix | Delete
}
[49] Fix | Delete
[50] Fix | Delete
if ( ! defined( 'WPFORMS_VERSION' ) ) {
[51] Fix | Delete
/**
[52] Fix | Delete
* Plugin version.
[53] Fix | Delete
*
[54] Fix | Delete
* @since 1.0.0
[55] Fix | Delete
*/
[56] Fix | Delete
define( 'WPFORMS_VERSION', '1.8.9.6' );
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
// Plugin Folder Path.
[60] Fix | Delete
if ( ! defined( 'WPFORMS_PLUGIN_DIR' ) ) {
[61] Fix | Delete
define( 'WPFORMS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
[62] Fix | Delete
}
[63] Fix | Delete
[64] Fix | Delete
// Plugin Folder URL.
[65] Fix | Delete
if ( ! defined( 'WPFORMS_PLUGIN_URL' ) ) {
[66] Fix | Delete
define( 'WPFORMS_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
[67] Fix | Delete
}
[68] Fix | Delete
[69] Fix | Delete
// Plugin Root File.
[70] Fix | Delete
if ( ! defined( 'WPFORMS_PLUGIN_FILE' ) ) {
[71] Fix | Delete
define( 'WPFORMS_PLUGIN_FILE', __FILE__ );
[72] Fix | Delete
}
[73] Fix | Delete
[74] Fix | Delete
// Don't allow multiple versions to be active.
[75] Fix | Delete
if ( function_exists( 'wpforms' ) ) {
[76] Fix | Delete
[77] Fix | Delete
if ( ! function_exists( 'wpforms_pro_just_activated' ) ) {
[78] Fix | Delete
/**
[79] Fix | Delete
* When we activate a Pro version, we need to do additional operations:
[80] Fix | Delete
* 1) deactivate a Lite version;
[81] Fix | Delete
* 2) register option which help to run all activation process for Pro version (custom tables creation, etc.).
[82] Fix | Delete
*
[83] Fix | Delete
* @since 1.6.2
[84] Fix | Delete
* @deprecated 1.8.7
[85] Fix | Delete
*/
[86] Fix | Delete
function wpforms_pro_just_activated() {
[87] Fix | Delete
[88] Fix | Delete
_deprecated_function( __METHOD__, '1.8.7 of the WPForms plugin' );
[89] Fix | Delete
[90] Fix | Delete
wpforms_deactivate();
[91] Fix | Delete
add_option( 'wpforms_install', 1 );
[92] Fix | Delete
}
[93] Fix | Delete
}
[94] Fix | Delete
[95] Fix | Delete
if ( ! function_exists( 'wpforms_lite_just_activated' ) ) {
[96] Fix | Delete
/**
[97] Fix | Delete
* Store temporarily that the Lite version of the plugin was activated.
[98] Fix | Delete
* This is needed because WP does a redirect after activation and
[99] Fix | Delete
* we need to preserve this state to know whether user activated Lite or not.
[100] Fix | Delete
*
[101] Fix | Delete
* @since 1.5.8
[102] Fix | Delete
*/
[103] Fix | Delete
function wpforms_lite_just_activated() {
[104] Fix | Delete
[105] Fix | Delete
set_transient( 'wpforms_lite_just_activated', true );
[106] Fix | Delete
}
[107] Fix | Delete
add_action( 'activate_wpforms-lite/wpforms.php', 'wpforms_lite_just_activated' );
[108] Fix | Delete
}
[109] Fix | Delete
[110] Fix | Delete
if ( ! function_exists( 'wpforms_lite_just_deactivated' ) ) {
[111] Fix | Delete
/**
[112] Fix | Delete
* Store temporarily that Lite plugin was deactivated.
[113] Fix | Delete
* Convert temporary "activated" value to a global variable,
[114] Fix | Delete
* so it is available through the request. Remove from the storage.
[115] Fix | Delete
*
[116] Fix | Delete
* @since 1.5.8
[117] Fix | Delete
* @deprecated 1.8.7
[118] Fix | Delete
*/
[119] Fix | Delete
function wpforms_lite_just_deactivated() {
[120] Fix | Delete
[121] Fix | Delete
_deprecated_function( __METHOD__, '1.8.7 of the WPForms plugin' );
[122] Fix | Delete
[123] Fix | Delete
global $wpforms_lite_just_activated, $wpforms_lite_just_deactivated;
[124] Fix | Delete
[125] Fix | Delete
$wpforms_lite_just_activated = (bool) get_transient( 'wpforms_lite_just_activated' );
[126] Fix | Delete
$wpforms_lite_just_deactivated = true;
[127] Fix | Delete
[128] Fix | Delete
delete_transient( 'wpforms_lite_just_activated' );
[129] Fix | Delete
}
[130] Fix | Delete
}
[131] Fix | Delete
[132] Fix | Delete
if ( ! function_exists( 'wpforms_deactivate' ) ) {
[133] Fix | Delete
/**
[134] Fix | Delete
* Deactivate Lite if WPForms already activated.
[135] Fix | Delete
*
[136] Fix | Delete
* @since 1.0.0
[137] Fix | Delete
*/
[138] Fix | Delete
function wpforms_deactivate() {
[139] Fix | Delete
[140] Fix | Delete
$pro_file = wpforms()->is_pro() ? WPFORMS_PLUGIN_FILE : __FILE__;
[141] Fix | Delete
$lite_file = wpforms()->is_pro() ? __FILE__ : WPFORMS_PLUGIN_FILE;
[142] Fix | Delete
[143] Fix | Delete
$lite_base = plugin_basename( $lite_file );
[144] Fix | Delete
$pro_base = plugin_basename( $pro_file );
[145] Fix | Delete
[146] Fix | Delete
if (
[147] Fix | Delete
! is_multisite()
[148] Fix | Delete
|| is_plugin_active_for_network( $pro_base )
[149] Fix | Delete
|| ( ! is_plugin_active_for_network( $pro_base ) && ! is_plugin_active_for_network( $lite_base ) )
[150] Fix | Delete
) {
[151] Fix | Delete
deactivate_plugins( $lite_base );
[152] Fix | Delete
[153] Fix | Delete
/**
[154] Fix | Delete
* Fires on plugin deactivation.
[155] Fix | Delete
*
[156] Fix | Delete
* @since 1.6.3.1
[157] Fix | Delete
*
[158] Fix | Delete
* @param string $plugin_basename The plugin basename.
[159] Fix | Delete
*/
[160] Fix | Delete
do_action( 'wpforms_plugin_deactivated', $lite_base );
[161] Fix | Delete
[162] Fix | Delete
// Run the installation on the next admin visit.
[163] Fix | Delete
add_option( 'wpforms_install', 1 );
[164] Fix | Delete
}
[165] Fix | Delete
}
[166] Fix | Delete
}
[167] Fix | Delete
add_action( 'admin_init', 'wpforms_deactivate' );
[168] Fix | Delete
[169] Fix | Delete
if ( ! function_exists( 'wpforms_lite_notice' ) ) {
[170] Fix | Delete
/**
[171] Fix | Delete
* Display the notice after deactivation when Pro is still active
[172] Fix | Delete
* and user wanted to activate the Lite version of the plugin.
[173] Fix | Delete
*
[174] Fix | Delete
* @since 1.0.0
[175] Fix | Delete
*/
[176] Fix | Delete
function wpforms_lite_notice() {
[177] Fix | Delete
[178] Fix | Delete
$pro_file = wpforms()->is_pro() ? WPFORMS_PLUGIN_FILE : __FILE__;
[179] Fix | Delete
$lite_file = wpforms()->is_pro() ? __FILE__ : WPFORMS_PLUGIN_FILE;
[180] Fix | Delete
[181] Fix | Delete
$lite_base = plugin_basename( $lite_file );
[182] Fix | Delete
$pro_base = plugin_basename( $pro_file );
[183] Fix | Delete
[184] Fix | Delete
// Do not show the notice if upgrade from Lite to Pro.
[185] Fix | Delete
if ( (bool) get_transient( 'wpforms_lite_just_activated' ) === false ) {
[186] Fix | Delete
return;
[187] Fix | Delete
}
[188] Fix | Delete
[189] Fix | Delete
if (
[190] Fix | Delete
! is_multisite()
[191] Fix | Delete
|| is_plugin_active_for_network( $pro_base )
[192] Fix | Delete
|| ( ! is_plugin_active_for_network( $pro_base ) && ! is_plugin_active_for_network( $lite_base ) )
[193] Fix | Delete
) {
[194] Fix | Delete
$message = sprintf(
[195] Fix | Delete
/* translators: %s - Path to installed plugins. */
[196] Fix | Delete
__( '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' ),
[197] Fix | Delete
is_multisite() ? __( 'Network Admin → Plugins → Installed Plugins', 'wpforms-lite' ) : __( 'Plugins → Installed Plugins', 'wpforms-lite' )
[198] Fix | Delete
);
[199] Fix | Delete
[200] Fix | Delete
// Currently tried to activate Lite with Pro still active, so display the message.
[201] Fix | Delete
printf(
[202] Fix | Delete
'<div class="notice wpforms-notice notice-warning wpforms-license-notice" id="wpforms-notice-pro-active">
[203] Fix | Delete
<h3 style="margin: .75em 0 0 0;">
[204] Fix | Delete
<img src="%1$s" style="vertical-align: text-top; width: 20px; margin-right: 7px;">%2$s
[205] Fix | Delete
</h3>
[206] Fix | Delete
<p>%3$s</p>
[207] Fix | Delete
</div>',
[208] Fix | Delete
esc_url( WPFORMS_PLUGIN_URL . 'assets/images/exclamation-triangle.svg' ),
[209] Fix | Delete
esc_html__( 'Heads up!', 'wpforms-lite' ),
[210] Fix | Delete
esc_html( $message )
[211] Fix | Delete
);
[212] Fix | Delete
[213] Fix | Delete
delete_transient( 'wpforms_lite_just_activated' );
[214] Fix | Delete
[215] Fix | Delete
if ( isset( $_GET['activate'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
[216] Fix | Delete
unset( $_GET['activate'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
[217] Fix | Delete
}
[218] Fix | Delete
}
[219] Fix | Delete
}
[220] Fix | Delete
}
[221] Fix | Delete
add_action( 'admin_notices', 'wpforms_lite_notice' );
[222] Fix | Delete
add_action( 'network_admin_notices', 'wpforms_lite_notice' );
[223] Fix | Delete
[224] Fix | Delete
// Do not process the plugin code further.
[225] Fix | Delete
return;
[226] Fix | Delete
}
[227] Fix | Delete
[228] Fix | Delete
// We require PHP version 7.0+ for the whole plugin to work.
[229] Fix | Delete
if ( version_compare( phpversion(), '7.0', '<' ) ) {
[230] Fix | Delete
[231] Fix | Delete
if ( ! function_exists( 'wpforms_php52_notice' ) ) {
[232] Fix | Delete
[233] Fix | Delete
/**
[234] Fix | Delete
* Display the notice about incompatible PHP version after deactivation.
[235] Fix | Delete
*
[236] Fix | Delete
* @since 1.5.0
[237] Fix | Delete
*/
[238] Fix | Delete
function wpforms_php52_notice() {
[239] Fix | Delete
[240] Fix | Delete
?>
[241] Fix | Delete
<div class="notice notice-error">
[242] Fix | Delete
<p>
[243] Fix | Delete
<?php
[244] Fix | Delete
printf(
[245] Fix | Delete
wp_kses(
[246] Fix | Delete
/* translators: %s - WPBeginner URL for recommended WordPress hosting. */
[247] Fix | Delete
__( 'Your site is running an <strong>insecure version</strong> of PHP that is no longer supported. Please contact your web hosting provider to update your PHP version or switch to a <a href="%s" target="_blank" rel="noopener noreferrer">recommended WordPress hosting company</a>.', 'wpforms-lite' ),
[248] Fix | Delete
[
[249] Fix | Delete
'a' => [
[250] Fix | Delete
'href' => [],
[251] Fix | Delete
'target' => [],
[252] Fix | Delete
'rel' => [],
[253] Fix | Delete
],
[254] Fix | Delete
'strong' => [],
[255] Fix | Delete
]
[256] Fix | Delete
),
[257] Fix | Delete
'https://www.wpbeginner.com/wordpress-hosting/'
[258] Fix | Delete
);
[259] Fix | Delete
?>
[260] Fix | Delete
<br><br>
[261] Fix | Delete
<?php
[262] Fix | Delete
printf(
[263] Fix | Delete
wp_kses(
[264] Fix | Delete
/* translators: %s - WPForms.com URL for documentation with more details. */
[265] Fix | Delete
__( '<strong>Note:</strong> The WPForms plugin is disabled on your site until you fix the issue. <a href="%s" target="_blank" rel="noopener noreferrer">Read more for additional information.</a>', 'wpforms-lite' ),
[266] Fix | Delete
[
[267] Fix | Delete
'a' => [
[268] Fix | Delete
'href' => [],
[269] Fix | Delete
'target' => [],
[270] Fix | Delete
'rel' => [],
[271] Fix | Delete
],
[272] Fix | Delete
'strong' => [],
[273] Fix | Delete
]
[274] Fix | Delete
),
[275] Fix | Delete
'https://wpforms.com/docs/supported-php-version/'
[276] Fix | Delete
);
[277] Fix | Delete
?>
[278] Fix | Delete
</p>
[279] Fix | Delete
</div>
[280] Fix | Delete
[281] Fix | Delete
<?php
[282] Fix | Delete
// In case this is on plugin activation.
[283] Fix | Delete
// phpcs:disable WordPress.Security.NonceVerification.Recommended
[284] Fix | Delete
if ( isset( $_GET['activate'] ) ) {
[285] Fix | Delete
unset( $_GET['activate'] );
[286] Fix | Delete
}
[287] Fix | Delete
// phpcs:enable WordPress.Security.NonceVerification.Recommended
[288] Fix | Delete
}
[289] Fix | Delete
}
[290] Fix | Delete
[291] Fix | Delete
add_action( 'admin_notices', 'wpforms_php52_notice' );
[292] Fix | Delete
[293] Fix | Delete
// Do not process the plugin code further.
[294] Fix | Delete
return;
[295] Fix | Delete
}
[296] Fix | Delete
[297] Fix | Delete
// We require WP version 5.5+ for the whole plugin to work.
[298] Fix | Delete
if ( version_compare( $GLOBALS['wp_version'], '5.5', '<' ) ) {
[299] Fix | Delete
[300] Fix | Delete
if ( ! function_exists( 'wpforms_wp_notice' ) ) {
[301] Fix | Delete
[302] Fix | Delete
/**
[303] Fix | Delete
* Display the notice about incompatible WP version after deactivation.
[304] Fix | Delete
*
[305] Fix | Delete
* @since 1.7.3
[306] Fix | Delete
*/
[307] Fix | Delete
function wpforms_wp_notice() {
[308] Fix | Delete
[309] Fix | Delete
?>
[310] Fix | Delete
<div class="notice notice-error">
[311] Fix | Delete
<p>
[312] Fix | Delete
<?php
[313] Fix | Delete
printf(
[314] Fix | Delete
/* translators: %s - WordPress version. */
[315] Fix | Delete
esc_html__( 'The WPForms plugin is disabled because it requires WordPress %s or later.', 'wpforms-lite' ),
[316] Fix | Delete
'5.5'
[317] Fix | Delete
);
[318] Fix | Delete
?>
[319] Fix | Delete
</p>
[320] Fix | Delete
</div>
[321] Fix | Delete
[322] Fix | Delete
<?php
[323] Fix | Delete
// In case this is on plugin activation.
[324] Fix | Delete
// phpcs:disable WordPress.Security.NonceVerification.Recommended
[325] Fix | Delete
if ( isset( $_GET['activate'] ) ) {
[326] Fix | Delete
unset( $_GET['activate'] );
[327] Fix | Delete
}
[328] Fix | Delete
// phpcs:enable WordPress.Security.NonceVerification.Recommended
[329] Fix | Delete
}
[330] Fix | Delete
}
[331] Fix | Delete
[332] Fix | Delete
add_action( 'admin_notices', 'wpforms_wp_notice' );
[333] Fix | Delete
[334] Fix | Delete
// Do not process the plugin code further.
[335] Fix | Delete
return;
[336] Fix | Delete
}
[337] Fix | Delete
[338] Fix | Delete
// Define the class and the function.
[339] Fix | Delete
require_once dirname( __FILE__ ) . '/src/WPForms.php';
[340] Fix | Delete
[341] Fix | Delete
wpforms();
[342] Fix | Delete
[343] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function