PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.20
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.20
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 +7 -39 6.276.20 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();
@@ -229,12 +219,8 @@
229 219 'btsp_version',
230 220 'admin_bar',
231 221 'summary_emails',
232 222 'active_captcha',
233 - 'honeypot',
234 - 'wp_spam_check',
235 - 'denylist_check',
236 - 'email_style',
237 223 );
238 224
239 225 foreach ( $pass_settings as $setting ) {
240 226 if ( isset( $settings_list->$setting ) ) {
@@ -255,9 +241,8 @@
255 241 *
256 242 * @since 3.06.04
257 243 *
258 244 * @param FrmSettings $settings_list
259 - *
260 245 * @return array
261 246 */
262 247 private function messages( $settings_list ) {
263 248 $messages = array(
@@ -270,11 +255,11 @@
270 255 'login_msg',
271 256 'admin_permission',
272 257 );
273 258
274 - $default = $settings_list->default_options();
259 + $default = $settings_list->default_options();
260 +
275 261 $message_settings = array();
276 -
277 262 foreach ( $messages as $message ) {
278 263 $message_settings[ 'changed-' . $message ] = $settings_list->$message === $default[ $message ] ? 0 : 1;
279 264 }
280 265
@@ -286,9 +271,8 @@
286 271 *
287 272 * @since 3.06.04
288 273 *
289 274 * @param FrmSettings $settings_list
290 - *
291 275 * @return array
292 276 */
293 277 private function permissions( $settings_list ) {
294 278 $permissions = array();
@@ -304,9 +288,8 @@
304 288 }
305 289
306 290 /**
307 291 * @since 3.06.04
308 - *
309 292 * @return array
310 293 */
311 294 private function forms() {
312 295 $s_query = array(
@@ -321,10 +304,10 @@
321 304 $forms = array();
322 305 $settings = array(
323 306 'form_class',
324 307 'akismet',
308 + 'honeypot',
325 309 'antispam',
326 - 'stopforumspam',
327 310 'custom_style',
328 311 'success_action',
329 312 'show_form',
330 313 'no_save',
@@ -354,9 +337,8 @@
354 337 'submit_conditions',
355 338 );
356 339
357 340 $style = new FrmStyle();
358 -
359 341 foreach ( $saved_forms as $form ) {
360 342 $new_form = array(
361 343 'form_id' => $form->id,
362 344 'description' => $form->description,
@@ -397,11 +379,8 @@
397 379 }
398 380
399 381 /**
400 382 * @since 3.06.04
401 - *
402 - * @param int|string $form_id Form ID.
403 - *
404 383 * @return int
405 384 */
406 385 private function form_field_count( $form_id ) {
407 386 global $wpdb;
@@ -418,11 +397,8 @@
418 397 }
419 398
420 399 /**
421 400 * @since 3.06.04
422 - *
423 - * @param int|string $form_id Form ID.
424 - *
425 401 * @return int
426 402 */
427 403 private function form_action_count( $form_id ) {
428 404 $args = array(
@@ -438,9 +414,8 @@
438 414 /**
439 415 * Get the last 100 fields created.
440 416 *
441 417 * @since 3.06.04
442 - *
443 418 * @return array
444 419 */
445 420 private function fields() {
446 421 $args = array(
@@ -448,20 +423,17 @@
448 423 'order_by' => 'id DESC',
449 424 );
450 425
451 426 $fields = FrmDb::get_results( 'frm_fields', array(), 'id, form_id, name, type, field_options', $args );
452 -
453 427 foreach ( $fields as $k => $field ) {
454 428 FrmAppHelper::unserialize_or_decode( $field->field_options );
455 429 $fields[ $k ]->field_options = json_encode( $field->field_options );
456 430 }
457 -
458 431 return $fields;
459 432 }
460 433
461 434 /**
462 435 * @since 3.06.04
463 - *
464 436 * @return array
465 437 */
466 438 private function actions() {
467 439 $args = array(
@@ -468,11 +440,11 @@
468 440 'post_type' => FrmFormActionsController::$action_post_type,
469 441 'numberposts' => 100,
470 442 );
471 443
472 - $actions = array();
444 + $actions = array();
445 +
473 446 $saved_actions = FrmDb::check_cache( json_encode( $args ), 'frm_actions', $args, 'get_posts' );
474 -
475 447 foreach ( $saved_actions as $action ) {
476 448 $actions[] = array(
477 449 'form_id' => $action->menu_order,
478 450 'type' => $action->post_excerpt,
@@ -485,9 +457,8 @@
485 457 }
486 458
487 459 /**
488 460 * @since 3.06.04
489 - *
490 461 * @return bool
491 462 */
492 463 private function tracking_allowed() {
493 464 return FrmUsageController::tracking_allowed();
@@ -494,11 +465,8 @@
494 465 }
495 466
496 467 /**
497 468 * @since 3.06.04
498 - *
499 - * @param mixed $value Value.
500 - *
501 469 * @return string
502 470 */
503 471 private function maybe_json( $value ) {
504 472 return is_array( $value ) ? json_encode( $value ) : $value;