Completed
Push — master ( 649509...5121e2 )
by Stephanie
03:07
created
classes/models/FrmReviews.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,6 @@
 block discarded – undo
62 62
 	 * Maybe show review request
63 63
 	 *
64 64
 	 * @since 3.04.03
65
-	 * @param int $asked
66 65
 	 */
67 66
 	private function review() {
68 67
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	 */
42 42
 	private function set_review_status() {
43 43
 		$user_id = get_current_user_id();
44
-		$review  = array();//get_user_meta( $user_id, $this->option_name, true );
44
+		$review  = array(); //get_user_meta( $user_id, $this->option_name, true );
45 45
 		$default = array(
46 46
 			'time'      => time() - WEEK_IN_SECONDS,
47 47
 			'dismissed' => false,
@@ -70,12 +70,12 @@  discard block
 block discarded – undo
70 70
 		$show_intervals = array( 50, 200, 500 );
71 71
 		$asked = $this->review_status['asked'];
72 72
 
73
-		if ( ! isset( $show_intervals[ $asked ] ) ) {
73
+		if ( ! isset( $show_intervals[$asked] ) ) {
74 74
 			return;
75 75
 		}
76 76
 
77 77
 		$entries = FrmEntry::getRecordCount();
78
-		$count   = $show_intervals[ $asked ];
78
+		$count   = $show_intervals[$asked];
79 79
 		$user    = wp_get_current_user();
80 80
 
81 81
 		// Only show review request if the site has collected enough entries
Please login to merge, or discard this patch.
classes/controllers/FrmAppController.php 1 patch
Indentation   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -3,14 +3,14 @@  discard block
 block discarded – undo
3 3
 class FrmAppController {
4 4
 
5 5
 	public static function menu() {
6
-        FrmAppHelper::maybe_add_permissions();
7
-        if ( ! current_user_can( 'frm_view_forms' ) ) {
8
-            return;
9
-        }
6
+		FrmAppHelper::maybe_add_permissions();
7
+		if ( ! current_user_can( 'frm_view_forms' ) ) {
8
+			return;
9
+		}
10 10
 
11 11
 		$menu_name = FrmAppHelper::get_menu_name();
12 12
 		add_menu_page( 'Formidable', $menu_name, 'frm_view_forms', 'formidable', 'FrmFormsController::route', '', self::get_menu_position() );
13
-    }
13
+	}
14 14
 
15 15
 	private static function get_menu_position() {
16 16
 		return apply_filters( 'frm_menu_position', '29.3' );
@@ -39,15 +39,15 @@  discard block
 block discarded – undo
39 39
 		return $is_white_page;
40 40
 	}
41 41
 
42
-    public static function load_wp_admin_style() {
43
-        FrmAppHelper::load_font_style();
44
-    }
42
+	public static function load_wp_admin_style() {
43
+		FrmAppHelper::load_font_style();
44
+	}
45 45
 
46 46
 	public static function get_form_nav( $form, $show_nav = false, $title = 'show' ) {
47 47
 		$show_nav = FrmAppHelper::get_param( 'show_nav', $show_nav, 'get', 'absint' );
48
-        if ( empty( $show_nav ) || ! $form ) {
49
-            return;
50
-        }
48
+		if ( empty( $show_nav ) || ! $form ) {
49
+			return;
50
+		}
51 51
 
52 52
 		FrmForm::maybe_get_form( $form );
53 53
 		if ( ! is_object( $form ) ) {
@@ -108,22 +108,22 @@  discard block
 block discarded – undo
108 108
 		return apply_filters( 'frm_form_nav_list', $nav_items, $nav_args );
109 109
 	}
110 110
 
111
-    // Adds a settings link to the plugins page
112
-    public static function settings_link( $links ) {
111
+	// Adds a settings link to the plugins page
112
+	public static function settings_link( $links ) {
113 113
 		$settings = '<a href="' . esc_url( admin_url( 'admin.php?page=formidable' ) ) . '">' . __( 'Build a Form', 'formidable' ) . '</a>';
114
-        array_unshift( $links, $settings );
114
+		array_unshift( $links, $settings );
115 115
 
116
-        return $links;
117
-    }
116
+		return $links;
117
+	}
118 118
 
119
-    public static function pro_get_started_headline() {
119
+	public static function pro_get_started_headline() {
120 120
 		self::maybe_show_upgrade_bar();
121 121
 		self::review_request();
122 122
 
123
-        // Don't display this error as we're upgrading the thing, or if the user shouldn't see the message
124
-        if ( 'upgrade-plugin' == FrmAppHelper::simple_get( 'action', 'sanitize_title' ) || ! current_user_can( 'update_plugins' ) ) {
125
-            return;
126
-        }
123
+		// Don't display this error as we're upgrading the thing, or if the user shouldn't see the message
124
+		if ( 'upgrade-plugin' == FrmAppHelper::simple_get( 'action', 'sanitize_title' ) || ! current_user_can( 'update_plugins' ) ) {
125
+			return;
126
+		}
127 127
 
128 128
 		$pro_installed = is_dir( WP_PLUGIN_DIR . '/formidable-pro' );
129 129
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 			} else {
139 139
 				$inst_install_url = 'https://formidableforms.com/knowledgebase/install-formidable-forms/?utm_source=WordPress&utm_medium=get-started&utm_campaign=liteplugin';
140 140
 			}
141
-        ?>
141
+		?>
142 142
 <div class="error" class="frm_previous_install">
143 143
 		<?php
144 144
 		echo apply_filters( // WPCS: XSS ok.
@@ -155,8 +155,8 @@  discard block
 block discarded – undo
155 155
 		?>
156 156
 </div>
157 157
 <?php
158
-        }
159
-    }
158
+		}
159
+	}
160 160
 
161 161
 	private static function maybe_show_upgrade_bar() {
162 162
 		if ( ! FrmAppHelper::is_formidable_admin() || FrmAppHelper::pro_is_installed() ) {
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 		}
290 290
 	}
291 291
 
292
-    public static function admin_js() {
292
+	public static function admin_js() {
293 293
 		$version = FrmAppHelper::plugin_version();
294 294
 		FrmAppHelper::load_admin_wide_js( false );
295 295
 
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 
311 311
 		wp_register_script( 'formidable_admin', FrmAppHelper::plugin_url() . '/js/formidable_admin.js', $dependecies, $version, true );
312 312
 		wp_register_style( 'formidable-admin', FrmAppHelper::plugin_url() . '/css/frm_admin.css', array(), $version );
313
-        wp_register_script( 'bootstrap_tooltip', FrmAppHelper::plugin_url() . '/js/bootstrap.min.js', array( 'jquery' ), '3.3.4' );
313
+		wp_register_script( 'bootstrap_tooltip', FrmAppHelper::plugin_url() . '/js/bootstrap.min.js', array( 'jquery' ), '3.3.4' );
314 314
 		wp_register_style( 'formidable-grids', FrmAppHelper::plugin_url() . '/css/frm_grids.css', array(), $version );
315 315
 
316 316
 		// load multselect js
@@ -322,10 +322,10 @@  discard block
 block discarded – undo
322 322
 		global $pagenow;
323 323
 		if ( strpos( $page, 'formidable' ) === 0 || ( $pagenow == 'edit.php' && $post_type == 'frm_display' ) ) {
324 324
 
325
-            wp_enqueue_script( 'admin-widgets' );
326
-            wp_enqueue_style( 'widgets' );
327
-            wp_enqueue_script( 'formidable' );
328
-            wp_enqueue_script( 'formidable_admin' );
325
+			wp_enqueue_script( 'admin-widgets' );
326
+			wp_enqueue_style( 'widgets' );
327
+			wp_enqueue_script( 'formidable' );
328
+			wp_enqueue_script( 'formidable_admin' );
329 329
 			FrmAppHelper::localize_script( 'admin' );
330 330
 
331 331
 			wp_enqueue_style( 'formidable-admin' );
@@ -340,36 +340,36 @@  discard block
 block discarded – undo
340 340
 				}
341 341
 			}
342 342
 
343
-            wp_register_script( 'formidable-editinplace', FrmAppHelper::plugin_url() . '/js/jquery/jquery.editinplace.packed.js', array( 'jquery' ), '2.3.0' );
343
+			wp_register_script( 'formidable-editinplace', FrmAppHelper::plugin_url() . '/js/jquery/jquery.editinplace.packed.js', array( 'jquery' ), '2.3.0' );
344 344
 
345 345
 			do_action( 'frm_enqueue_builder_scripts' );
346
-        } else if ( $pagenow == 'post.php' || ( $pagenow == 'post-new.php' && $post_type == 'frm_display' ) ) {
347
-            if ( isset( $_REQUEST['post_type'] ) ) {
348
-                $post_type = sanitize_title( $_REQUEST['post_type'] );
346
+		} else if ( $pagenow == 'post.php' || ( $pagenow == 'post-new.php' && $post_type == 'frm_display' ) ) {
347
+			if ( isset( $_REQUEST['post_type'] ) ) {
348
+				$post_type = sanitize_title( $_REQUEST['post_type'] );
349 349
 			} else if ( isset( $_REQUEST['post'] ) && absint( $_REQUEST['post'] ) ) {
350 350
 				$post = get_post( absint( $_REQUEST['post'] ) );
351
-                if ( ! $post ) {
352
-                    return;
353
-                }
354
-                $post_type = $post->post_type;
355
-            } else {
356
-                return;
357
-            }
358
-
359
-            if ( $post_type == 'frm_display' ) {
360
-                wp_enqueue_script( 'jquery-ui-draggable' );
361
-                wp_enqueue_script( 'formidable_admin' );
362
-                wp_enqueue_style( 'formidable-admin' );
351
+				if ( ! $post ) {
352
+					return;
353
+				}
354
+				$post_type = $post->post_type;
355
+			} else {
356
+				return;
357
+			}
358
+
359
+			if ( $post_type == 'frm_display' ) {
360
+				wp_enqueue_script( 'jquery-ui-draggable' );
361
+				wp_enqueue_script( 'formidable_admin' );
362
+				wp_enqueue_style( 'formidable-admin' );
363 363
 				FrmAppHelper::localize_script( 'admin' );
364
-            }
365
-        } else if ( $pagenow == 'widgets.php' ) {
366
-            FrmAppHelper::load_admin_wide_js();
367
-        }
368
-    }
364
+			}
365
+		} else if ( $pagenow == 'widgets.php' ) {
366
+			FrmAppHelper::load_admin_wide_js();
367
+		}
368
+	}
369 369
 
370
-    public static function load_lang() {
371
-        load_plugin_textdomain( 'formidable', false, FrmAppHelper::plugin_folder() . '/languages/' );
372
-    }
370
+	public static function load_lang() {
371
+		load_plugin_textdomain( 'formidable', false, FrmAppHelper::plugin_folder() . '/languages/' );
372
+	}
373 373
 
374 374
 	/**
375 375
 	 * Check if the styles are updated when a form is loaded on the front-end
@@ -445,14 +445,14 @@  discard block
 block discarded – undo
445 445
 		wp_die();
446 446
 	}
447 447
 
448
-    public static function install() {
449
-        $frmdb = new FrmMigrate();
450
-        $frmdb->upgrade();
451
-    }
448
+	public static function install() {
449
+		$frmdb = new FrmMigrate();
450
+		$frmdb->upgrade();
451
+	}
452 452
 
453
-    public static function uninstall() {
453
+	public static function uninstall() {
454 454
 		FrmAppHelper::permission_check( 'administrator' );
455
-        check_ajax_referer( 'frm_ajax', 'nonce' );
455
+		check_ajax_referer( 'frm_ajax', 'nonce' );
456 456
 
457 457
 		$frmdb = new FrmMigrate();
458 458
 		$frmdb->uninstall();
@@ -461,28 +461,28 @@  discard block
 block discarded – undo
461 461
 		deactivate_plugins( FrmAppHelper::plugin_folder() . '/formidable.php', false, false );
462 462
 		echo esc_url_raw( admin_url( 'plugins.php?deactivate=true' ) );
463 463
 
464
-        wp_die();
465
-    }
464
+		wp_die();
465
+	}
466 466
 
467
-    public static function drop_tables( $tables ) {
468
-        global $wpdb;
469
-        $tables[] = $wpdb->prefix . 'frm_fields';
470
-        $tables[] = $wpdb->prefix . 'frm_forms';
471
-        $tables[] = $wpdb->prefix . 'frm_items';
472
-        $tables[] = $wpdb->prefix . 'frm_item_metas';
473
-        return $tables;
474
-    }
467
+	public static function drop_tables( $tables ) {
468
+		global $wpdb;
469
+		$tables[] = $wpdb->prefix . 'frm_fields';
470
+		$tables[] = $wpdb->prefix . 'frm_forms';
471
+		$tables[] = $wpdb->prefix . 'frm_items';
472
+		$tables[] = $wpdb->prefix . 'frm_item_metas';
473
+		return $tables;
474
+	}
475 475
 
476
-    public static function deauthorize() {
476
+	public static function deauthorize() {
477 477
 		FrmAppHelper::permission_check( 'frm_change_settings' );
478
-        check_ajax_referer( 'frm_ajax', 'nonce' );
478
+		check_ajax_referer( 'frm_ajax', 'nonce' );
479 479
 
480
-        delete_option( 'frmpro-credentials' );
481
-        delete_option( 'frmpro-authorized' );
482
-        delete_site_option( 'frmpro-credentials' );
483
-        delete_site_option( 'frmpro-authorized' );
484
-        wp_die();
485
-    }
480
+		delete_option( 'frmpro-credentials' );
481
+		delete_option( 'frmpro-authorized' );
482
+		delete_site_option( 'frmpro-credentials' );
483
+		delete_site_option( 'frmpro-authorized' );
484
+		wp_die();
485
+	}
486 486
 
487 487
 	public static function set_footer_text( $text ) {
488 488
 		if ( FrmAppHelper::is_formidable_admin() ) {
@@ -504,9 +504,9 @@  discard block
 block discarded – undo
504 504
 	 * @deprecated 1.07.05
505 505
 	 * @codeCoverageIgnore
506 506
 	 */
507
-    public static function get_form_shortcode( $atts ) {
508
-        return FrmDeprecated::get_form_shortcode( $atts );
509
-    }
507
+	public static function get_form_shortcode( $atts ) {
508
+		return FrmDeprecated::get_form_shortcode( $atts );
509
+	}
510 510
 
511 511
 	/**
512 512
 	 * @deprecated 2.5.4
Please login to merge, or discard this patch.