PluginProbe ʕ •ᴥ•ʔ
WPForms – Easy Form Builder for WordPress – Contact Forms, Payment Forms, Surveys, & More / 1.7.4.1
WPForms – Easy Form Builder for WordPress – Contact Forms, Payment Forms, Surveys, & More v1.7.4.1
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 4 years ago includes 4 years ago libs 4 years ago lite 4 years ago src 4 years ago templates 4 years ago vendor 4 years ago changelog.txt 4 years ago readme.txt 4 years ago uninstall.php 4 years ago wpforms.php 4 years ago
wpforms.php
283 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: 5.2
7 * Requires PHP: 5.6
8 * Author: WPForms
9 * Author URI: https://wpforms.com
10 * Version: 1.7.4.1
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 <https://www.gnu.org/licenses/>.
26 */
27
28 // Exit if accessed directly.
29 if ( ! defined( 'ABSPATH' ) ) {
30 exit;
31 }
32
33 if ( ! defined( 'WPFORMS_VERSION' ) ) {
34 /**
35 * Plugin version.
36 *
37 * @since 1.0.0
38 */
39 define( 'WPFORMS_VERSION', '1.7.4.1' );
40 }
41
42 // Plugin Folder Path.
43 if ( ! defined( 'WPFORMS_PLUGIN_DIR' ) ) {
44 define( 'WPFORMS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
45 }
46
47 // Plugin Folder URL.
48 if ( ! defined( 'WPFORMS_PLUGIN_URL' ) ) {
49 define( 'WPFORMS_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
50 }
51
52 // Plugin Root File.
53 if ( ! defined( 'WPFORMS_PLUGIN_FILE' ) ) {
54 define( 'WPFORMS_PLUGIN_FILE', __FILE__ );
55 }
56
57 // Don't allow multiple versions to be active.
58 if ( function_exists( 'wpforms' ) ) {
59
60 if ( ! function_exists( 'wpforms_pro_just_activated' ) ) {
61 /**
62 * When we activate a Pro version, we need to do additional operations:
63 * 1) deactivate a Lite version;
64 * 2) register option which help to run all activation process for Pro version (custom tables creation, etc.).
65 *
66 * @since 1.6.2
67 */
68 function wpforms_pro_just_activated() {
69
70 wpforms_deactivate();
71 add_option( 'wpforms_install', 1 );
72 }
73 }
74 add_action( 'activate_wpforms/wpforms.php', 'wpforms_pro_just_activated' );
75
76 if ( ! function_exists( 'wpforms_lite_just_activated' ) ) {
77 /**
78 * Store temporarily that the Lite version of the plugin was activated.
79 * This is needed because WP does a redirect after activation and
80 * we need to preserve this state to know whether user activated Lite or not.
81 *
82 * @since 1.5.8
83 */
84 function wpforms_lite_just_activated() {
85
86 set_transient( 'wpforms_lite_just_activated', true );
87 }
88 }
89 add_action( 'activate_wpforms-lite/wpforms.php', 'wpforms_lite_just_activated' );
90
91 if ( ! function_exists( 'wpforms_lite_just_deactivated' ) ) {
92 /**
93 * Store temporarily that Lite plugin was deactivated.
94 * Convert temporary "activated" value to a global variable,
95 * so it is available through the request. Remove from the storage.
96 *
97 * @since 1.5.8
98 */
99 function wpforms_lite_just_deactivated() {
100
101 global $wpforms_lite_just_activated, $wpforms_lite_just_deactivated;
102
103 $wpforms_lite_just_activated = (bool) get_transient( 'wpforms_lite_just_activated' );
104 $wpforms_lite_just_deactivated = true;
105
106 delete_transient( 'wpforms_lite_just_activated' );
107 }
108 }
109 add_action( 'deactivate_wpforms-lite/wpforms.php', 'wpforms_lite_just_deactivated' );
110
111 if ( ! function_exists( 'wpforms_deactivate' ) ) {
112 /**
113 * Deactivate Lite if WPForms already activated.
114 *
115 * @since 1.0.0
116 */
117 function wpforms_deactivate() {
118
119 $plugin = 'wpforms-lite/wpforms.php';
120
121 deactivate_plugins( $plugin );
122
123 do_action( 'wpforms_plugin_deactivated', $plugin );
124 }
125 }
126 add_action( 'admin_init', 'wpforms_deactivate' );
127
128 if ( ! function_exists( 'wpforms_lite_notice' ) ) {
129 /**
130 * Display the notice after deactivation when Pro is still active
131 * and user wanted to activate the Lite version of the plugin.
132 *
133 * @since 1.0.0
134 */
135 function wpforms_lite_notice() {
136
137 global $wpforms_lite_just_activated, $wpforms_lite_just_deactivated;
138
139 if (
140 empty( $wpforms_lite_just_activated ) ||
141 empty( $wpforms_lite_just_deactivated )
142 ) {
143 return;
144 }
145
146 // Currently tried to activate Lite with Pro still active, so display the message.
147 printf(
148 '<div class="notice notice-warning">
149 <p>%1$s</p>
150 <p>%2$s</p>
151 </div>',
152 esc_html__( 'Heads up!', 'wpforms-lite' ),
153 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' )
154 );
155
156 if ( isset( $_GET['activate'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
157 unset( $_GET['activate'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
158 }
159
160 unset( $wpforms_lite_just_activated, $wpforms_lite_just_deactivated );
161 }
162 }
163 add_action( 'admin_notices', 'wpforms_lite_notice' );
164
165 // Do not process the plugin code further.
166 return;
167 }
168
169 // We require PHP version 5.6+ for the whole plugin to work.
170 if ( version_compare( phpversion(), '5.6', '<' ) ) {
171
172 if ( ! function_exists( 'wpforms_php52_notice' ) ) {
173
174 /**
175 * Display the notice about incompatible PHP version after deactivation.
176 *
177 * @since 1.5.0
178 */
179 function wpforms_php52_notice() {
180
181 ?>
182 <div class="notice notice-error">
183 <p>
184 <?php
185 printf(
186 wp_kses(
187 /* translators: %s - WPBeginner URL for recommended WordPress hosting. */
188 __( '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' ),
189 [
190 'a' => [
191 'href' => [],
192 'target' => [],
193 'rel' => [],
194 ],
195 'strong' => [],
196 ]
197 ),
198 'https://www.wpbeginner.com/wordpress-hosting/'
199 );
200 ?>
201 <br><br>
202 <?php
203 printf(
204 wp_kses(
205 /* translators: %s - WPForms.com URL for documentation with more details. */
206 __( '<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' ),
207 [
208 'a' => [
209 'href' => [],
210 'target' => [],
211 'rel' => [],
212 ],
213 'strong' => [],
214 ]
215 ),
216 'https://wpforms.com/docs/supported-php-version/'
217 );
218 ?>
219 </p>
220 </div>
221
222 <?php
223 // In case this is on plugin activation.
224 // phpcs:disable WordPress.Security.NonceVerification.Recommended
225 if ( isset( $_GET['activate'] ) ) {
226 unset( $_GET['activate'] );
227 }
228 // phpcs:enable WordPress.Security.NonceVerification.Recommended
229 }
230 }
231
232 add_action( 'admin_notices', 'wpforms_php52_notice' );
233
234 // Do not process the plugin code further.
235 return;
236 }
237
238 // We require WP version 5.2+ for the whole plugin to work.
239 if ( version_compare( $GLOBALS['wp_version'], '5.2', '<' ) ) {
240
241 if ( ! function_exists( 'wpforms_wp_notice' ) ) {
242
243 /**
244 * Display the notice about incompatible WP version after deactivation.
245 *
246 * @since 1.7.3
247 */
248 function wpforms_wp_notice() {
249
250 ?>
251 <div class="notice notice-error">
252 <p>
253 <?php
254 printf(
255 /* translators: %s - WordPress version. */
256 esc_html__( 'The WPForms plugin is disabled because it requires WordPress %s or greater.', 'wpforms-lite' ),
257 '5.2'
258 );
259 ?>
260 </p>
261 </div>
262
263 <?php
264 // In case this is on plugin activation.
265 // phpcs:disable WordPress.Security.NonceVerification.Recommended
266 if ( isset( $_GET['activate'] ) ) {
267 unset( $_GET['activate'] );
268 }
269 // phpcs:enable WordPress.Security.NonceVerification.Recommended
270 }
271 }
272
273 add_action( 'admin_notices', 'wpforms_wp_notice' );
274
275 // Do not process the plugin code further.
276 return;
277 }
278
279 // Define the class and the function.
280 require_once dirname( __FILE__ ) . '/src/WPForms.php';
281
282 wpforms();
283