PluginProbe ʕ •ᴥ•ʔ
WPForms – Easy Form Builder for WordPress – Contact Forms, Payment Forms, Surveys, & More / 1.6.2.3
WPForms – Easy Form Builder for WordPress – Contact Forms, Payment Forms, Surveys, & More v1.6.2.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 / wpforms.php
wpforms-lite Last commit date
assets 5 years ago includes 5 years ago libs 5 years ago lite 5 years ago src 5 years ago templates 5 years ago vendor 5 years ago changelog.txt 5 years ago readme.txt 5 years ago uninstall.php 5 years ago wpforms.php 5 years ago
wpforms.php
228 lines
1 <?php
2 /**
3 * Plugin Name: WPForms Lite
4 * Plugin URI: https://wpforms.com
5 * Description: Beginner friendly WordPress contact form plugin. Use our Drag & Drop form builder to create your WordPress forms.
6 * Requires at least: 4.9
7 * Requires PHP: 5.5
8 * Author: WPForms
9 * Author URI: https://wpforms.com
10 * Version: 1.6.2.3
11 * Text Domain: wpforms-lite
12 * Domain Path: assets/languages
13 *
14 * WPForms is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation, either version 2 of the License, or
17 * any later version.
18 *
19 * WPForms is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with WPForms. If not, see <http://www.gnu.org/licenses/>.
26 */
27
28 // Exit if accessed directly.
29 if ( ! defined( 'ABSPATH' ) ) {
30 exit;
31 }
32
33 // Plugin version.
34 if ( ! defined( 'WPFORMS_VERSION' ) ) {
35 define( 'WPFORMS_VERSION', '1.6.2.3' );
36 }
37
38 // Plugin Folder Path.
39 if ( ! defined( 'WPFORMS_PLUGIN_DIR' ) ) {
40 define( 'WPFORMS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
41 }
42
43 // Plugin Folder URL.
44 if ( ! defined( 'WPFORMS_PLUGIN_URL' ) ) {
45 define( 'WPFORMS_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
46 }
47
48 // Plugin Root File.
49 if ( ! defined( 'WPFORMS_PLUGIN_FILE' ) ) {
50 define( 'WPFORMS_PLUGIN_FILE', __FILE__ );
51 }
52
53 // Don't allow multiple versions to be active.
54 if ( function_exists( 'wpforms' ) ) {
55
56 if ( ! function_exists( 'wpforms_pro_just_activated' ) ) {
57 /**
58 * When we are activate a Pro version, we need to do additional operations:
59 * 1) deactivate a Lite version
60 * 2) register option which help to run all activation process for Pro version (custom tables creation, etc.)
61 *
62 * @since 1.6.2
63 */
64 function wpforms_pro_just_activated() {
65
66 wpforms_deactivate();
67 add_option( 'wpforms_install', 1 );
68 }
69 }
70 add_action( 'activate_wpforms/wpforms.php', 'wpforms_pro_just_activated' );
71
72 if ( ! function_exists( 'wpforms_lite_just_activated' ) ) {
73 /**
74 * Store temporarily that the Lite version of the plugin was activated.
75 * This is needed because WP does a redirect after activation and
76 * we need to preserve this state to know whether user activated Lite or not.
77 *
78 * @since 1.5.8
79 */
80 function wpforms_lite_just_activated() {
81
82 set_transient( 'wpforms_lite_just_activated', true );
83 }
84 }
85 add_action( 'activate_wpforms-lite/wpforms.php', 'wpforms_lite_just_activated' );
86
87 if ( ! function_exists( 'wpforms_lite_just_deactivated' ) ) {
88 /**
89 * Store temporarily that Lite plugin was deactivated.
90 * Convert temporary "activated" value to a global variable,
91 * so it is available through the request. Remove from the storage.
92 *
93 * @since 1.5.8
94 */
95 function wpforms_lite_just_deactivated() {
96
97 global $wpforms_lite_just_activated, $wpforms_lite_just_deactivated;
98
99 $wpforms_lite_just_activated = (bool) get_transient( 'wpforms_lite_just_activated' );
100 $wpforms_lite_just_deactivated = true;
101
102 delete_transient( 'wpforms_lite_just_activated' );
103 }
104 }
105 add_action( 'deactivate_wpforms-lite/wpforms.php', 'wpforms_lite_just_deactivated' );
106
107 if ( ! function_exists( 'wpforms_deactivate' ) ) {
108 /**
109 * Deactivate Lite if WPForms already activated.
110 *
111 * @since 1.0.0
112 */
113 function wpforms_deactivate() {
114 deactivate_plugins( 'wpforms-lite/wpforms.php' );
115 }
116 }
117 add_action( 'admin_init', 'wpforms_deactivate' );
118
119 if ( ! function_exists( 'wpforms_lite_notice' ) ) {
120 /**
121 * Display the notice after deactivation when Pro is still active
122 * and user wanted to activate the Lite version of the plugin.
123 *
124 * @since 1.0.0
125 */
126 function wpforms_lite_notice() {
127
128 global $wpforms_lite_just_activated, $wpforms_lite_just_deactivated;
129
130 if (
131 empty( $wpforms_lite_just_activated ) ||
132 empty( $wpforms_lite_just_deactivated )
133 ) {
134 return;
135 }
136
137 // Currently tried to activate Lite with Pro still active, so display the message.
138 printf(
139 '<div class="notice notice-warning">
140 <p>%1$s</p>
141 <p>%2$s</p>
142 </div>',
143 esc_html__( 'Heads up!', 'wpforms-lite' ),
144 esc_html__( 'Your site already has WPForms Pro activated. If you want to switch to WPForms Lite, please first go to Plugins → Installed Plugins and deactivate WPForms. Then, you can activate WPForms Lite.', 'wpforms-lite' )
145 );
146
147 if ( isset( $_GET['activate'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
148 unset( $_GET['activate'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
149 }
150
151 unset( $wpforms_lite_just_activated, $wpforms_lite_just_deactivated );
152 }
153 }
154 add_action( 'admin_notices', 'wpforms_lite_notice' );
155
156 // Do not process the plugin code further.
157 return;
158 }
159
160 // We require PHP 5.5+ for the whole plugin to work.
161 if ( version_compare( phpversion(), '5.5', '<' ) ) {
162
163 if ( ! function_exists( 'wpforms_php52_notice' ) ) {
164 /**
165 * Display the notice after deactivation.
166 *
167 * @since 1.5.0
168 */
169 function wpforms_php52_notice() {
170 ?>
171 <div class="notice notice-error">
172 <p>
173 <?php
174 printf(
175 wp_kses(
176 /* translators: %s - WPBeginner URL for recommended WordPress hosting. */
177 __( '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' ),
178 array(
179 'a' => array(
180 'href' => array(),
181 'target' => array(),
182 'rel' => array(),
183 ),
184 'strong' => array(),
185 )
186 ),
187 'https://www.wpbeginner.com/wordpress-hosting/'
188 );
189 ?>
190 <br><br>
191 <?php
192 printf(
193 wp_kses(
194 /* translators: %s - WPForms.com URL for documentation with more details. */
195 __( '<strong>Note:</strong> 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' ),
196 array(
197 'a' => array(
198 'href' => array(),
199 'target' => array(),
200 'rel' => array(),
201 ),
202 'strong' => array(),
203 )
204 ),
205 'https://wpforms.com/docs/supported-php-version/'
206 );
207 ?>
208 </p>
209 </div>
210
211 <?php
212 // In case this is on plugin activation.
213 if ( isset( $_GET['activate'] ) ) { //phpcs:ignore
214 unset( $_GET['activate'] );
215 }
216 }
217 }
218 add_action( 'admin_notices', 'wpforms_php52_notice' );
219
220 // Do not process the plugin code further.
221 return;
222 }
223
224 // Define the class and the function.
225 require_once dirname( __FILE__ ) . '/src/WPForms.php';
226
227 wpforms();
228