PluginProbe
WS Form LITE – Drag & Drop Contact Form Builder / 1.12.8
WS Form LITE – Drag & Drop Contact Form Builder v1.12.8
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 1.9.79 All 362 releases
ws-form / ws-form.php

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

220 lines 7.5 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.12.8
15 * Requires at least: 5.5
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.12.8');
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 // Captchas / Spam
82 define('WS_FORM_RECAPTCHA_ENDPOINT', 'https://www.google.com/recaptcha/api/siteverify');
83 define('WS_FORM_RECAPTCHA_QUERY_VAR', 'g-recaptcha-response');
84 define('WS_FORM_HCAPTCHA_ENDPOINT', 'https://hcaptcha.com/siteverify');
85 define('WS_FORM_HCAPTCHA_QUERY_VAR', 'h-captcha-response');
86 // phpcs:ignore PluginCheck.CodeAnalysis.Offloading.OffloadedContent -- Turnstile siteverify API
87 define('WS_FORM_TURNSTILE_ENDPOINT', 'https://challenges.cloudflare.com/turnstile/v0/siteverify');
88 define('WS_FORM_TURNSTILE_QUERY_VAR', 'cf-turnstile-response');
89 define('WS_FORM_CAPTCHAFOX_ENDPOINT', 'https://api.captchafox.com/siteverify');
90 define('WS_FORM_CAPTCHAFOX_QUERY_VAR', 'cf-captcha-response');
91 define('WS_FORM_SPAM_LEVEL_MAX', 100); // 0 = Not spam, 100 = Spam
92
93 // Labels
94 define('WS_FORM_LABEL_MAX_LENGTH', 1024);
95
96 // Sections
97 define('WS_FORM_SECTION_REPEATABLE_DELIMITER_SECTION', ',');
98 define('WS_FORM_SECTION_REPEATABLE_DELIMITER_ROW', ';');
99 define('WS_FORM_SECTION_REPEATABLE_DELIMITER_SUBMIT', '<br />');
100
101 // Fields
102 define('WS_FORM_FIELD_PREFIX', 'field_');
103 define('WS_FORM_FIELD_PREFIX_PUBLIC_', 'wsf_field_');
104
105 // Settings - Email
106 define('WS_FORM_SETTINGS_IMAGE_PREVIEW_SIZE', 'full');
107
108 // Settings - System
109 define('WS_FORM_MIN_VERSION_WORDPRESS', '5.5');
110 define('WS_FORM_MIN_VERSION_PHP', '7.2');
111 define('WS_FORM_MIN_VERSION_MYSQL', '5.6');
112 define('WS_FORM_MIN_INPUT_VARS', 100);
113 define('WS_FORM_MAX_MYSQL_ALLOWED_PACKET', 4194304);
114
115 // wp_remote_* settings
116 define('WS_FORM_API_CALL_TIMEOUT', 15);
117 define('WS_FORM_API_CALL_SSL_VERIFY', true);
118
119 // Review nag
120 define('WS_FORM_REVIEW_NAG_DURATION', 14);
121
122 // Data sources
123 define('WS_FORM_DATA_SOURCE_SCHEDULE_ID_PREFIX', 'wsf_');
124 define('WS_FORM_DATA_SOURCE_SCHEDULE_HOOK', 'ws_form_wp_cron_data_source');
125
126 // Reports
127 define('WS_FORM_REPORT_SCHEDULE_HOOK', 'ws_form_wp_cron_report');
128 define('WS_FORM_REPORT_ID_FORM_STATISTICS', 'ws_form_form_statistics');
129
130 // CSV imports for data grids
131 define('WS_FORM_UTF32_BIG_ENDIAN_BOM' , chr(0x00) . chr(0x00) . chr(0xFE) . chr(0xFF));
132 define('WS_FORM_UTF32_LITTLE_ENDIAN_BOM', chr(0xFF) . chr(0xFE) . chr(0x00) . chr(0x00));
133 define('WS_FORM_UTF16_BIG_ENDIAN_BOM' , chr(0xFE) . chr(0xFF));
134 define('WS_FORM_UTF16_LITTLE_ENDIAN_BOM', chr(0xFF) . chr(0xFE));
135 define('WS_FORM_UTF8_BOM' , chr(0xEF) . chr(0xBB) . chr(0xBF));
136
137 // Templates
138 define('WS_FORM_TEMPLATE_SVG_WIDTH_FORM', 140);
139 define('WS_FORM_TEMPLATE_SVG_HEIGHT_FORM', 180);
140 define('WS_FORM_TEMPLATE_SVG_WIDTH_SECTION', 140);
141 define('WS_FORM_TEMPLATE_SVG_HEIGHT_SECTION', 85);
142 define('WS_FORM_TEMPLATE_CHECKSUM_REPAIR', false);
143
144 // Collapse settings/template integrations under Integrations when count exceeds this
145 define('WS_FORM_INTEGRATIONS_COLLAPSE_THRESHOLD', 5);
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 (layout editor)
169 define('WS_FORM_SIDEBAR_WIDTH_MIN', 400);
170 define('WS_FORM_SIDEBAR_WIDTH_MAX', 1000);
171 define('WS_FORM_SIDEBAR_WIDTH_DEFAULT', 400);
172
173 // Resizable sidebar (submissions)
174 define('WS_FORM_SIDEBAR_WIDTH_MIN_SUBMIT', 350);
175 define('WS_FORM_SIDEBAR_WIDTH_MAX_SUBMIT', 1000);
176 define('WS_FORM_SIDEBAR_WIDTH_DEFAULT_SUBMIT', 350);
177 }
178
179 function ws_form_activate() {
180
181 if(is_plugin_active('ws-form-pro/ws-form.php')) {
182
183 deactivate_plugins('ws-form-pro/ws-form.php');
184 }
185
186 require_once WS_FORM_PLUGIN_DIR_PATH . 'includes/class-ws-form-activator.php';
187 WS_Form_Activator::activate();
188 }
189
190 // Deactivate
191 function ws_form_deactivate() {
192
193 require_once WS_FORM_PLUGIN_DIR_PATH . 'includes/class-ws-form-deactivator.php';
194 WS_Form_Deactivator::deactivate();
195 }
196
197 // Uninstall
198 function ws_form_uninstall() {
199
200 require_once WS_FORM_PLUGIN_DIR_PATH . 'includes/class-ws-form-uninstaller.php';
201 WS_Form_Uninstaller::uninstall();
202 }
203
204 // Register hooks for plugin activation, deactivation and uninstall
205 register_activation_hook(__FILE__, 'ws_form_activate');
206 register_deactivation_hook(__FILE__, 'ws_form_deactivate');
207 register_uninstall_hook(__FILE__, 'ws_form_uninstall');
208
209 if(!is_plugin_active('ws-form-pro/ws-form.php')) {
210
211 require WS_FORM_PLUGIN_DIR_PATH . 'includes/class-ws-form.php';
212
213 function ws_form_run() {
214
215 $plugin = new WS_Form();
216 $plugin->run();
217 }
218 ws_form_run();
219 }
220