PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.16.3
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.16.3
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 -43 6.276.16.3 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,13 +253,11 @@
270 253 'login_msg',
271 254 'admin_permission',
272 255 );
273 256
274 - $default = $settings_list->default_options();
275 257 $message_settings = array();
276 -
277 258 foreach ( $messages as $message ) {
278 - $message_settings[ 'changed-' . $message ] = $settings_list->$message === $default[ $message ] ? 0 : 1;
259 + $message_settings[ $message ] = $settings_list->$message;
279 260 }
280 261
281 262 return $message_settings;
282 263 }
@@ -286,9 +267,8 @@
286 267 *
287 268 * @since 3.06.04
288 269 *
289 270 * @param FrmSettings $settings_list
290 - *
291 271 * @return array
292 272 */
293 273 private function permissions( $settings_list ) {
294 274 $permissions = array();
@@ -304,9 +284,8 @@
304 284 }
305 285
306 286 /**
307 287 * @since 3.06.04
308 - *
309 288 * @return array
310 289 */
311 290 private function forms() {
312 291 $s_query = array(
@@ -321,10 +300,10 @@
321 300 $forms = array();
322 301 $settings = array(
323 302 'form_class',
324 303 'akismet',
304 + 'honeypot',
325 305 'antispam',
326 - 'stopforumspam',
327 306 'custom_style',
328 307 'success_action',
329 308 'show_form',
330 309 'no_save',
@@ -354,9 +333,8 @@
354 333 'submit_conditions',
355 334 );
356 335
357 336 $style = new FrmStyle();
358 -
359 337 foreach ( $saved_forms as $form ) {
360 338 $new_form = array(
361 339 'form_id' => $form->id,
362 340 'description' => $form->description,
@@ -397,11 +375,8 @@
397 375 }
398 376
399 377 /**
400 378 * @since 3.06.04
401 - *
402 - * @param int|string $form_id Form ID.
403 - *
404 379 * @return int
405 380 */
406 381 private function form_field_count( $form_id ) {
407 382 global $wpdb;
@@ -418,11 +393,8 @@
418 393 }
419 394
420 395 /**
421 396 * @since 3.06.04
422 - *
423 - * @param int|string $form_id Form ID.
424 - *
425 397 * @return int
426 398 */
427 399 private function form_action_count( $form_id ) {
428 400 $args = array(
@@ -438,9 +410,8 @@
438 410 /**
439 411 * Get the last 100 fields created.
440 412 *
441 413 * @since 3.06.04
442 - *
443 414 * @return array
444 415 */
445 416 private function fields() {
446 417 $args = array(
@@ -447,21 +418,18 @@
447 418 'limit' => 50,
448 419 'order_by' => 'id DESC',
449 420 );
450 421
451 - $fields = FrmDb::get_results( 'frm_fields', array(), 'id, form_id, name, type, field_options', $args );
452 -
422 + $fields = FrmDb::get_results( 'frm_fields', array(), 'form_id, name, type, field_options', $args );
453 423 foreach ( $fields as $k => $field ) {
454 424 FrmAppHelper::unserialize_or_decode( $field->field_options );
455 425 $fields[ $k ]->field_options = json_encode( $field->field_options );
456 426 }
457 -
458 427 return $fields;
459 428 }
460 429
461 430 /**
462 431 * @since 3.06.04
463 - *
464 432 * @return array
465 433 */
466 434 private function actions() {
467 435 $args = array(
@@ -468,11 +436,11 @@
468 436 'post_type' => FrmFormActionsController::$action_post_type,
469 437 'numberposts' => 100,
470 438 );
471 439
472 - $actions = array();
440 + $actions = array();
441 +
473 442 $saved_actions = FrmDb::check_cache( json_encode( $args ), 'frm_actions', $args, 'get_posts' );
474 -
475 443 foreach ( $saved_actions as $action ) {
476 444 $actions[] = array(
477 445 'form_id' => $action->menu_order,
478 446 'type' => $action->post_excerpt,
@@ -485,9 +453,8 @@
485 453 }
486 454
487 455 /**
488 456 * @since 3.06.04
489 - *
490 457 * @return bool
491 458 */
492 459 private function tracking_allowed() {
493 460 return FrmUsageController::tracking_allowed();
@@ -494,11 +461,8 @@
494 461 }
495 462
496 463 /**
497 464 * @since 3.06.04
498 - *
499 - * @param mixed $value Value.
500 - *
501 465 * @return string
502 466 */
503 467 private function maybe_json( $value ) {
504 468 return is_array( $value ) ? json_encode( $value ) : $value;