PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.18
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.18
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/models/FrmUsage.php +8 -42 6.276.18 View file →
@@ -44,11 +44,8 @@
44 44 }
45 45
46 46 /**
47 47 * @since 3.06.04
48 - *
49 - * @param bool $regenerate
50 - *
51 48 * @return string
52 49 */
53 50 public function uuid( $regenerate = false ) {
54 51 $uuid_key = 'frm-usage-uuid';
@@ -53,9 +50,9 @@
53 50 public function uuid( $regenerate = false ) {
54 51 $uuid_key = 'frm-usage-uuid';
55 52 $uuid = get_option( $uuid_key );
56 53
57 - if ( $regenerate || ! $uuid ) {
54 + if ( $regenerate || empty( $uuid ) ) {
58 55 // Definitely not cryptographically secure but
59 56 // close enough to provide an unique id
60 57 $uuid = md5( uniqid() . site_url() );
61 58 update_option( $uuid_key, $uuid, 'no' );
@@ -65,9 +62,8 @@
65 62 }
66 63
67 64 /**
68 65 * @since 3.06.04
69 - *
70 66 * @return array
71 67 */
72 68 public function snapshot() {
73 69 global $wpdb, $wp_version;
@@ -99,9 +95,8 @@
99 95 'fields' => $this->fields(),
100 96 'actions' => $this->actions(),
101 97
102 98 'onboarding-wizard' => $this->onboarding_wizard(),
103 - 'welcome-tour' => FrmWelcomeTourController::get_usage_data(),
104 99 'flows' => FrmUsageController::get_flows_data(),
105 100 'payments' => $this->payments(),
106 101 'subscriptions' => $this->payments( 'frm_subscriptions' ),
107 102 );
@@ -142,14 +137,12 @@
142 137 *
143 138 * @since 6.16.1
144 139 *
145 140 * @param string $table Database table name.
146 - *
147 141 * @return array
148 142 */
149 143 private function payments( $table = 'frm_payments' ) {
150 144 $allowed_tables = array( 'frm_payments', 'frm_subscriptions' );
151 -
152 145 if ( ! in_array( $table, $allowed_tables, true ) ) {
153 146 return array();
154 147 }
155 148
@@ -165,9 +158,8 @@
165 158 )
166 159 );
167 160
168 161 $payments = array();
169 -
170 162 foreach ( $rows as $row ) {
171 163 $payments[] = array(
172 164 'amount' => (float) $row->amount,
173 165 'status' => $row->status,
@@ -180,15 +172,14 @@
180 172 }
181 173
182 174 /**
183 175 * @since 3.06.04
184 - *
185 176 * @return array
186 177 */
187 178 private function plugins() {
188 179 $plugin_list = FrmAppHelper::get_plugins();
189 - $plugins = array();
190 180
181 + $plugins = array();
191 182 foreach ( $plugin_list as $slug => $info ) {
192 183 $plugins[] = array(
193 184 'name' => $info['Name'],
194 185 'slug' => $slug,
@@ -203,9 +194,8 @@
203 194 /**
204 195 * Add global settings to tracking data.
205 196 *
206 197 * @since 3.06.04
207 - *
208 198 * @return array
209 199 */
210 200 private function settings() {
211 201 $settings_list = FrmAppHelper::get_settings();
@@ -222,19 +212,13 @@
222 212 'menu',
223 213 'mu_menu',
224 214 'no_ips',
225 215 'custom_header_ip',
226 - 'enable_gdpr',
227 - 'no_gdpr_cookies',
228 216 'btsp_css',
229 217 'btsp_version',
230 218 'admin_bar',
231 219 'summary_emails',
232 220 'active_captcha',
233 - 'honeypot',
234 - 'wp_spam_check',
235 - 'denylist_check',
236 - 'email_style',
237 221 );
238 222
239 223 foreach ( $pass_settings as $setting ) {
240 224 if ( isset( $settings_list->$setting ) ) {
@@ -255,9 +239,8 @@
255 239 *
256 240 * @since 3.06.04
257 241 *
258 242 * @param FrmSettings $settings_list
259 - *
260 243 * @return array
261 244 */
262 245 private function messages( $settings_list ) {
263 246 $messages = array(
@@ -270,11 +253,11 @@
270 253 'login_msg',
271 254 'admin_permission',
272 255 );
273 256
274 - $default = $settings_list->default_options();
257 + $default = $settings_list->default_options();
258 +
275 259 $message_settings = array();
276 -
277 260 foreach ( $messages as $message ) {
278 261 $message_settings[ 'changed-' . $message ] = $settings_list->$message === $default[ $message ] ? 0 : 1;
279 262 }
280 263
@@ -286,9 +269,8 @@
286 269 *
287 270 * @since 3.06.04
288 271 *
289 272 * @param FrmSettings $settings_list
290 - *
291 273 * @return array
292 274 */
293 275 private function permissions( $settings_list ) {
294 276 $permissions = array();
@@ -304,9 +286,8 @@
304 286 }
305 287
306 288 /**
307 289 * @since 3.06.04
308 - *
309 290 * @return array
310 291 */
311 292 private function forms() {
312 293 $s_query = array(
@@ -321,10 +302,10 @@
321 302 $forms = array();
322 303 $settings = array(
323 304 'form_class',
324 305 'akismet',
306 + 'honeypot',
325 307 'antispam',
326 - 'stopforumspam',
327 308 'custom_style',
328 309 'success_action',
329 310 'show_form',
330 311 'no_save',
@@ -354,9 +335,8 @@
354 335 'submit_conditions',
355 336 );
356 337
357 338 $style = new FrmStyle();
358 -
359 339 foreach ( $saved_forms as $form ) {
360 340 $new_form = array(
361 341 'form_id' => $form->id,
362 342 'description' => $form->description,
@@ -397,11 +377,8 @@
397 377 }
398 378
399 379 /**
400 380 * @since 3.06.04
401 - *
402 - * @param int|string $form_id Form ID.
403 - *
404 381 * @return int
405 382 */
406 383 private function form_field_count( $form_id ) {
407 384 global $wpdb;
@@ -418,11 +395,8 @@
418 395 }
419 396
420 397 /**
421 398 * @since 3.06.04
422 - *
423 - * @param int|string $form_id Form ID.
424 - *
425 399 * @return int
426 400 */
427 401 private function form_action_count( $form_id ) {
428 402 $args = array(
@@ -438,9 +412,8 @@
438 412 /**
439 413 * Get the last 100 fields created.
440 414 *
441 415 * @since 3.06.04
442 - *
443 416 * @return array
444 417 */
445 418 private function fields() {
446 419 $args = array(
@@ -447,21 +420,18 @@
447 420 'limit' => 50,
448 421 'order_by' => 'id DESC',
449 422 );
450 423
451 - $fields = FrmDb::get_results( 'frm_fields', array(), 'id, form_id, name, type, field_options', $args );
452 -
424 + $fields = FrmDb::get_results( 'frm_fields', array(), 'form_id, name, type, field_options', $args );
453 425 foreach ( $fields as $k => $field ) {
454 426 FrmAppHelper::unserialize_or_decode( $field->field_options );
455 427 $fields[ $k ]->field_options = json_encode( $field->field_options );
456 428 }
457 -
458 429 return $fields;
459 430 }
460 431
461 432 /**
462 433 * @since 3.06.04
463 - *
464 434 * @return array
465 435 */
466 436 private function actions() {
467 437 $args = array(
@@ -468,11 +438,11 @@
468 438 'post_type' => FrmFormActionsController::$action_post_type,
469 439 'numberposts' => 100,
470 440 );
471 441
472 - $actions = array();
442 + $actions = array();
443 +
473 444 $saved_actions = FrmDb::check_cache( json_encode( $args ), 'frm_actions', $args, 'get_posts' );
474 -
475 445 foreach ( $saved_actions as $action ) {
476 446 $actions[] = array(
477 447 'form_id' => $action->menu_order,
478 448 'type' => $action->post_excerpt,
@@ -485,9 +455,8 @@
485 455 }
486 456
487 457 /**
488 458 * @since 3.06.04
489 - *
490 459 * @return bool
491 460 */
492 461 private function tracking_allowed() {
493 462 return FrmUsageController::tracking_allowed();
@@ -494,11 +463,8 @@
494 463 }
495 464
496 465 /**
497 466 * @since 3.06.04
498 - *
499 - * @param mixed $value Value.
500 - *
501 467 * @return string
502 468 */
503 469 private function maybe_json( $value ) {
504 470 return is_array( $value ) ? json_encode( $value ) : $value;