PluginProbe
WS Form LITE – Drag & Drop Contact Form Builder / 1.11.4
WS Form LITE – Drag & Drop Contact Form Builder v1.11.4
1.12.10 1.12.8 1.12.6 1.12.5 1.12.3 1.12.0 1.11.19 1.11.17 1.11.16 1.11.15 1.11.14 1.11.11 1.11.8 1.11.5 1.11.4 1.9.248 1.9.249 1.9.26 1.9.43 1.9.46 1.9.47 1.9.5 1.9.6 1.9.64 1.9.7 All 363 releases
ws-form / ws-form.php

ws-form.php in WS Form LITE – Drag & Drop Contact Form Builder 1.11.4, at ws-form.php

215 lines 7.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * WS Form LITE - Drag & Drop Contact Form Builder
5 *
6 * @link https://wsform.com/
7 * @since 1.0.0
8 * @package WS_Form
9 *
10 * @wordpress-plugin
11 * Plugin Name: WS Form LITE - Drag & Drop Contact Form Builder
12 * Plugin URI: https://wsform.com/
13 * Description: Smart. Fast. Forms.
14 * Version: 1.11.4
15 * Requires at least: 5.4
16 * Requires PHP: 7.2
17 * Author: WS Form
18 * Author URI: https://wsform.com/
19 * License: GPL-3.0+
20 * License URI: http://www.gnu.org/licenses/gpl-3.0.txt
21 * Text Domain: ws-form
22 * Domain Path: /languages
23 */
24
25 // If this file is called directly, abort.
26 if(!defined('WPINC')) {
27
28 die;
29 }
30
31 // Load plugin.php
32 if(!function_exists('is_plugin_active')) {
33
34 include_once(ABSPATH . 'wp-admin/includes/plugin.php');
35 }
36
37 if(!is_plugin_active('ws-form-pro/ws-form.php')) {
38 // Constants
39 define('WS_FORM_NAME', 'ws-form');
40 define('WS_FORM_VERSION', '1.11.4');
41 define('WS_FORM_NAME_GENERIC', 'WS Form');
42 define('WS_FORM_NAME_PRESENTABLE', 'WS Form LITE');
43 define('WS_FORM_EDITION', 'basic');
44 define('WS_FORM_PLUGIN_FOLDER', 'ws-form');
45 define('WS_FORM_URL_HOME', 'https://wordpress.org/plugins/ws-form/');
46 define('WS_FORM_URL_DOWNLOAD', 'https://downloads.wordpress.org/plugin/ws-form.zip');
47 define('WS_FORM_UPLOAD_DIR', 'ws-form');
48 define('WS_FORM_IDENTIFIER', 'ws_form');
49 define('WS_FORM_DB_TABLE_PREFIX', 'wsf_');
50 define('WS_FORM_OPTION_NAME', 'ws_form');
51 define('WS_FORM_OPTION_SEPARATE_ACTION', false);
52 define('WS_FORM_OPTION_SEPARATE_CSS', true);
53 define('WS_FORM_OPTION_SEPARATE_TRANSLATE', true);
54 define('WS_FORM_SHORTCODE', 'ws_form');
55 define('WS_FORM_WIDGET', 'ws_form_widget');
56 define('WS_FORM_CAPABILITY_PREFIX', 'wsf_');
57 define('WS_FORM_USER_REQUEST_IDENTIFIER', 'ws-form');
58 define('WS_FORM_AUTHOR', 'Westguard Solutions');
59
60 // Paths
61 define('WS_FORM_PLUGIN_ROOT_FILE', __FILE__);
62 define('WS_FORM_PLUGIN_DIR_PATH', plugin_dir_path(__FILE__));
63 define('WS_FORM_PLUGIN_DIR_URL', plugin_dir_url(__FILE__));
64 define('WS_FORM_PLUGIN_BASENAME', plugin_basename(__FILE__));
65
66 // NONCE
67 define('WS_FORM_POST_NONCE_FIELD_NAME', 'wsf_nonce');
68 define('WS_FORM_POST_NONCE_ACTION_NAME', 'wsf_post');
69
70 // REST API
71 define('WS_FORM_RESTFUL_NAMESPACE', 'ws-form/v1');
72
73 // Framework
74 define('WS_FORM_DEFAULT_FRAMEWORK', 'ws-form');
75
76 // caniuse.com
77 define('WS_FORM_COMPATIBILITY_NAME', 'caniuse.com');
78 define('WS_FORM_COMPATIBILITY_URL', 'https://caniuse.com');
79 define('WS_FORM_COMPATIBILITY_MASK', 'https://caniuse.com/#feat=#compatibility_id');
80
81 // Modes
82 define('WS_FORM_MODES', 'basic,advanced');
83 define('WS_FORM_DEFAULT_MODE', 'basic');
84
85 // Captchas / Spam
86 define('WS_FORM_RECAPTCHA_ENDPOINT', 'https://www.google.com/recaptcha/api/siteverify');
87 define('WS_FORM_RECAPTCHA_QUERY_VAR', 'g-recaptcha-response');
88 define('WS_FORM_HCAPTCHA_ENDPOINT', 'https://hcaptcha.com/siteverify');
89 define('WS_FORM_HCAPTCHA_QUERY_VAR', 'h-captcha-response');
90 define('WS_FORM_TURNSTILE_ENDPOINT', 'https://challenges.cloudflare.com/turnstile/v0/siteverify');
91 define('WS_FORM_TURNSTILE_QUERY_VAR', 'cf-turnstile-response');
92 define('WS_FORM_CAPTCHAFOX_ENDPOINT', 'https://api.captchafox.com/siteverify');
93 define('WS_FORM_CAPTCHAFOX_QUERY_VAR', 'cf-captcha-response');
94 define('WS_FORM_SPAM_LEVEL_MAX', 100); // 0 = Not spam, 100 = Spam
95
96 // Labels
97 define('WS_FORM_LABEL_MAX_LENGTH', 1024);
98
99 // Sections
100 define('WS_FORM_SECTION_REPEATABLE_DELIMITER_SECTION', ',');
101 define('WS_FORM_SECTION_REPEATABLE_DELIMITER_ROW', ';');
102 define('WS_FORM_SECTION_REPEATABLE_DELIMITER_SUBMIT', '<br />');
103
104 // Fields
105 define('WS_FORM_FIELD_PREFIX', 'field_');
106 define('WS_FORM_FIELD_PREFIX_PUBLIC_', 'wsf_field_');
107
108 // Settings - Email
109 define('WS_FORM_SETTINGS_IMAGE_PREVIEW_SIZE', 'full');
110
111 // Settings - System
112 define('WS_FORM_MIN_VERSION_WORDPRESS', '5.4');
113 define('WS_FORM_MIN_VERSION_PHP', '7.2');
114 define('WS_FORM_MIN_VERSION_MYSQL', '5.6');
115 define('WS_FORM_MIN_INPUT_VARS', 100);
116 define('WS_FORM_MAX_MYSQL_ALLOWED_PACKET', 4194304);
117
118 // wp_remote_* settings
119 define('WS_FORM_API_CALL_TIMEOUT', 15);
120 define('WS_FORM_API_CALL_SSL_VERIFY', true);
121
122 // Review nag
123 define('WS_FORM_REVIEW_NAG_DURATION', 14);
124
125 // Data sources
126 define('WS_FORM_DATA_SOURCE_SCHEDULE_ID_PREFIX', 'wsf_');
127 define('WS_FORM_DATA_SOURCE_SCHEDULE_HOOK', 'ws_form_wp_cron_data_source');
128
129 // Reports
130 define('WS_FORM_REPORT_SCHEDULE_HOOK', 'ws_form_wp_cron_report');
131 define('WS_FORM_REPORT_ID_FORM_STATISTICS', 'ws_form_form_statistics');
132
133 // CSV imports for data grids
134 define('WS_FORM_UTF32_BIG_ENDIAN_BOM' , chr(0x00) . chr(0x00) . chr(0xFE) . chr(0xFF));
135 define('WS_FORM_UTF32_LITTLE_ENDIAN_BOM', chr(0xFF) . chr(0xFE) . chr(0x00) . chr(0x00));
136 define('WS_FORM_UTF16_BIG_ENDIAN_BOM' , chr(0xFE) . chr(0xFF));
137 define('WS_FORM_UTF16_LITTLE_ENDIAN_BOM', chr(0xFF) . chr(0xFE));
138 define('WS_FORM_UTF8_BOM' , chr(0xEF) . chr(0xBB) . chr(0xBF));
139
140 // Templates
141 define('WS_FORM_TEMPLATE_SVG_WIDTH_FORM', 140);
142 define('WS_FORM_TEMPLATE_SVG_HEIGHT_FORM', 180);
143 define('WS_FORM_TEMPLATE_SVG_WIDTH_SECTION', 140);
144 define('WS_FORM_TEMPLATE_SVG_HEIGHT_SECTION', 85);
145 define('WS_FORM_TEMPLATE_CHECKSUM_REPAIR', false);
146
147 // Submission exports
148 define('WS_FORM_SUBMIT_EXPORT_PAGE_SIZE', 200);
149 define('WS_FORM_SUBMIT_EXPORT_FILE_SIZE_ZIP', 524288);
150 define('WS_FORM_SUBMIT_EXPORT_TMP_DIR', 'submit/export/tmp');
151
152 // File uploads
153 define('WS_FORM_DROPZONEJS_IMAGE_SIZE', 'thumbnail');
154
155 // Styler / CSS
156 define('WS_FORM_STYLER', true);
157 define('WS_FORM_CSS_CACHE_DURATION_DEFAULT', 31536000);
158 define('WS_FORM_CSS_FILE_PATH', 'css/public');
159 define('WS_FORM_CSS_SKIN_DEFAULT', 'ws_form');
160
161 // AI
162 define('WS_FORM_ABILITY_API', true);
163 define('WS_FORM_ABILITY_API_NAMESPACE', 'ws-form/');
164 define('WS_FORM_MCP_ADAPTER', true);
165 define('WS_FORM_ANGIE', true);
166 define('WS_FORM_WP_AI_CLIENT', true);
167
168 // Resizable sidebar
169 define('WS_FORM_SIDEBAR_WIDTH_MIN', 340);
170 define('WS_FORM_SIDEBAR_WIDTH_MAX', 1000);
171 define('WS_FORM_SIDEBAR_WIDTH_DEFAULT', WS_FORM_SIDEBAR_WIDTH_MIN);
172 }
173
174 function ws_form_activate() {
175
176 if(is_plugin_active('ws-form-pro/ws-form.php')) {
177
178 deactivate_plugins('ws-form-pro/ws-form.php');
179 }
180
181 require_once WS_FORM_PLUGIN_DIR_PATH . 'includes/class-ws-form-activator.php';
182 WS_Form_Activator::activate();
183 }
184
185 // Deactivate
186 function ws_form_deactivate() {
187
188 require_once WS_FORM_PLUGIN_DIR_PATH . 'includes/class-ws-form-deactivator.php';
189 WS_Form_Deactivator::deactivate();
190 }
191
192 // Uninstall
193 function ws_form_uninstall() {
194
195 require_once WS_FORM_PLUGIN_DIR_PATH . 'includes/class-ws-form-uninstaller.php';
196 WS_Form_Uninstaller::uninstall();
197 }
198
199 // Register hooks for plugin activation, deactivation and uninstall
200 register_activation_hook(__FILE__, 'ws_form_activate');
201 register_deactivation_hook(__FILE__, 'ws_form_deactivate');
202 register_uninstall_hook(__FILE__, 'ws_form_uninstall');
203
204 if(!is_plugin_active('ws-form-pro/ws-form.php')) {
205
206 require WS_FORM_PLUGIN_DIR_PATH . 'includes/class-ws-form.php';
207
208 function ws_form_run() {
209
210 $plugin = new WS_Form();
211 $plugin->run();
212 }
213 ws_form_run();
214 }
215