diff --git a/classes/controllers/FrmAddonsController.php b/classes/controllers/FrmAddonsController.php index c64dccdc70..61216f8353 100644 --- a/classes/controllers/FrmAddonsController.php +++ b/classes/controllers/FrmAddonsController.php @@ -892,7 +892,7 @@ protected static function prepare_addon_link( &$link ) { $link = $site_url . $link; } - $link = FrmAppHelper::make_affiliate_url( $link ); + $link = FrmAppHelper::make_affiliate_url( $link ); $utm = array( 'campaign' => 'addons', @@ -1053,7 +1053,6 @@ protected static function maybe_show_cred_form() { if ( $show_form ) { $form = ob_get_clean(); $message = __( 'Sorry, your site requires FTP authentication. Please download plugins from FormidableForms.com and install them manually.', 'formidable' ); - $data = $form; $response = array( 'success' => false, 'message' => $message, diff --git a/classes/controllers/FrmFormTemplatesController.php b/classes/controllers/FrmFormTemplatesController.php index 3133ef7dcb..47c9f3a119 100644 --- a/classes/controllers/FrmFormTemplatesController.php +++ b/classes/controllers/FrmFormTemplatesController.php @@ -566,7 +566,7 @@ private static function organize_and_set_categories() { 'count' => 0, ); } - $special_categories['all-items'] = array( + $special_categories['all-items'] = array( 'name' => __( 'All Templates', 'formidable' ), 'count' => self::get_template_count(), ); diff --git a/classes/controllers/FrmStylesController.php b/classes/controllers/FrmStylesController.php index 5af70af3c6..6e8a99b1d9 100644 --- a/classes/controllers/FrmStylesController.php +++ b/classes/controllers/FrmStylesController.php @@ -292,8 +292,7 @@ private static function get_css_version( $css_key, $version ) { */ public static function add_tags_to_css( $tag, $handle ) { if ( ( 'formidable' === $handle || 'jquery-theme' === $handle ) && strpos( $tag, ' property=' ) === false ) { - $frm_settings = FrmAppHelper::get_settings(); - $tag = str_replace( ' type="', ' property="stylesheet" type="', $tag ); + $tag = str_replace( ' type="', ' property="stylesheet" type="', $tag ); } return $tag; @@ -345,7 +344,7 @@ public static function load_styler() { $style_id = self::get_style_id_for_styler(); if ( ! $style_id ) { - $error_args = array( + $error_args = array( 'title' => __( 'No styles', 'formidable' ), 'body' => __( 'You must have a style to use the Visual Styler.', 'formidable' ), 'cancel_url' => admin_url( 'admin.php?page=formidable' ), @@ -363,7 +362,7 @@ public static function load_styler() { $form = FrmForm::getOne( $form_id ); if ( ! is_object( $form ) ) { - $error_args = array( + $error_args = array( 'title' => __( 'No forms', 'formidable' ), 'body' => __( 'You must have a form to use the Visual Styler.', 'formidable' ), 'cancel_url' => admin_url( 'admin.php?page=formidable' ), diff --git a/classes/controllers/FrmXMLController.php b/classes/controllers/FrmXMLController.php index 3fdfa89727..1b36ff3564 100644 --- a/classes/controllers/FrmXMLController.php +++ b/classes/controllers/FrmXMLController.php @@ -598,7 +598,7 @@ public static function get_parent_terms_slugs( $terms ) { return $parent_slugs; } - $results = FrmDb::get_results( 'terms', array( 'term_id' => $parent_term_ids ), 'term_id, slug' ); + $results = FrmDb::get_results( 'terms', array( 'term_id' => $parent_term_ids ), 'term_id, slug' ); return wp_list_pluck( $results, 'slug', 'term_id' ); } diff --git a/classes/helpers/FrmAppHelper.php b/classes/helpers/FrmAppHelper.php index 7f87b2681b..4b8cc98bfc 100644 --- a/classes/helpers/FrmAppHelper.php +++ b/classes/helpers/FrmAppHelper.php @@ -435,7 +435,7 @@ public static function is_form_builder_page( $check_for_settings = true ) { * @return bool */ public static function is_formidable_admin() { - $page = self::simple_get( 'page', 'sanitize_title' ); + $page = self::simple_get( 'page', 'sanitize_title' ); if ( empty( $page ) ) { return self::is_view_builder_page(); diff --git a/classes/helpers/FrmCSVExportHelper.php b/classes/helpers/FrmCSVExportHelper.php index 11fb461d4b..3775022e8a 100644 --- a/classes/helpers/FrmCSVExportHelper.php +++ b/classes/helpers/FrmCSVExportHelper.php @@ -504,7 +504,7 @@ private static function has_parent_id() { */ private static function prepare_next_csv_rows( $next_set ) { if ( FrmAppHelper::pro_is_installed() ) { - $where = array( + $where = array( 'or' => 1, 'id' => $next_set, 'parent_item_id' => $next_set, diff --git a/classes/helpers/FrmDashboardHelper.php b/classes/helpers/FrmDashboardHelper.php index 08fd024839..e6aa15b11d 100644 --- a/classes/helpers/FrmDashboardHelper.php +++ b/classes/helpers/FrmDashboardHelper.php @@ -189,7 +189,7 @@ public static function show_connect_links( $buttons = array(), $button_classes = $buttons = self::get_license_buttons(); } - foreach ( $buttons as $i => $button ) { + foreach ( $buttons as $button ) { $add_classes = ! empty( $button['classes'] ) ? ' ' . $button['classes'] : ' frm-button-secondary'; ?> id; + $field_id = $field->id; if ( 'hidden' === $field->type && ! empty( $field->field_options['original_type'] ) ) { $field_obj = FrmFieldFactory::get_field_type( $field->field_options['original_type'], $field ); diff --git a/classes/helpers/FrmFormsListHelper.php b/classes/helpers/FrmFormsListHelper.php index 9f91c8bf44..8589f4cbdc 100644 --- a/classes/helpers/FrmFormsListHelper.php +++ b/classes/helpers/FrmFormsListHelper.php @@ -27,7 +27,7 @@ public function __construct( $args ) { * @return void */ public function prepare_items() { - global $wpdb, $per_page, $mode; + global $per_page, $mode; $page = $this->get_pagenum(); $per_page = $this->get_items_per_page( 'formidable_page_formidable_per_page' ); @@ -53,7 +53,7 @@ public function prepare_items() { FrmAppController::apply_saved_sort_preference( $orderby, $order ); - $start = self::get_param( + $start = self::get_param( array( 'param' => 'start', 'default' => ( $page - 1 ) * $per_page, @@ -237,7 +237,7 @@ public function pagination( $which ) { * @return string */ public function single_row( $item, $style = '' ) { - global $frm_vars, $mode; + global $mode; // Set up the hover actions for this user $actions = array(); diff --git a/classes/helpers/FrmHtmlHelper.php b/classes/helpers/FrmHtmlHelper.php index 1041d602f7..1c7f719f91 100644 --- a/classes/helpers/FrmHtmlHelper.php +++ b/classes/helpers/FrmHtmlHelper.php @@ -99,7 +99,7 @@ public static function echo_unit_input( $args = array() ) { } } - $input_number_attrs = array_merge( + $input_number_attrs = array_merge( $args['input_number_attrs'], array( 'type' => ! empty( $selected_unit ) ? 'number' : 'text', diff --git a/classes/models/FrmCreateFile.php b/classes/models/FrmCreateFile.php index eab40ae55d..56eb22c974 100644 --- a/classes/models/FrmCreateFile.php +++ b/classes/models/FrmCreateFile.php @@ -33,12 +33,12 @@ class FrmCreateFile { /** * @var int */ - public $chmod_dir = 0755; + public $chmod_dir = 0755; /** * @var int */ - public $chmod_file = 0644; + public $chmod_file = 0644; /** * @var bool diff --git a/classes/models/FrmField.php b/classes/models/FrmField.php index 2eff721861..a836d823f9 100644 --- a/classes/models/FrmField.php +++ b/classes/models/FrmField.php @@ -8,7 +8,7 @@ class FrmField { /** * @var bool */ - public static $use_cache = true; + public static $use_cache = true; /** * @var int diff --git a/classes/models/FrmForm.php b/classes/models/FrmForm.php index 7dd9a2653a..528a9f674a 100644 --- a/classes/models/FrmForm.php +++ b/classes/models/FrmForm.php @@ -978,8 +978,6 @@ public static function get_published_forms( $query = array(), $limit = 999, $inc * @return object count of forms */ public static function get_count() { - global $wpdb; - $cache_key = 'frm_form_counts'; $counts = wp_cache_get( $cache_key, 'frm_form' ); diff --git a/classes/models/FrmFormAction.php b/classes/models/FrmFormAction.php index 983f7bf71b..69293d18b9 100644 --- a/classes/models/FrmFormAction.php +++ b/classes/models/FrmFormAction.php @@ -660,7 +660,7 @@ public static function get_action_for_form( $form_id, $type = 'all', $atts = arr * @return int The filtered limit value. */ public static function get_action_limit( $form_id, $limit = 99 ) { - $type = 'all'; + $type = 'all'; return (int) apply_filters( 'frm_form_action_limit', (int) $limit, compact( 'type', 'form_id' ) ); } diff --git a/classes/models/FrmFormMigrator.php b/classes/models/FrmFormMigrator.php index 2b6d6ec086..f30e82d820 100644 --- a/classes/models/FrmFormMigrator.php +++ b/classes/models/FrmFormMigrator.php @@ -38,7 +38,7 @@ abstract class FrmFormMigrator { /** * @var array */ - protected $fields_map = array(); + protected $fields_map = array(); /** * @var mixed @@ -48,7 +48,7 @@ abstract class FrmFormMigrator { /** * @var array */ - protected $current_section = array(); + protected $current_section = array(); /** * Define required properties. diff --git a/classes/models/fields/FrmFieldName.php b/classes/models/fields/FrmFieldName.php index 04bae95d08..683da482d9 100644 --- a/classes/models/fields/FrmFieldName.php +++ b/classes/models/fields/FrmFieldName.php @@ -281,7 +281,7 @@ public function show_after_default( $args ) { $show_warning = false; - foreach ( $this->sub_fields as $name => $sub_field ) { + foreach ( $this->sub_fields as $sub_field ) { $description = FrmField::get_option( $field, $sub_field['name'] . '_desc' ); if ( in_array( $description, array( 'First', 'Last' ), true ) ) { diff --git a/classes/models/fields/FrmFieldType.php b/classes/models/fields/FrmFieldType.php index d8ba1c1275..792e9f23e9 100644 --- a/classes/models/fields/FrmFieldType.php +++ b/classes/models/fields/FrmFieldType.php @@ -841,7 +841,7 @@ protected function auto_width_setting( $args ) { * @return array */ public function get_new_field_defaults() { - $field = array( + $field = array( 'name' => $this->get_new_field_name(), 'description' => '', 'type' => $this->type, diff --git a/classes/views/frm-entries/form.php b/classes/views/frm-entries/form.php index 7fa7f1b908..782ff490a9 100644 --- a/classes/views/frm-entries/form.php +++ b/classes/views/frm-entries/form.php @@ -80,8 +80,6 @@ FrmFieldsHelper::show_fields( $fields_to_show, $errors, $form, $form_action ); }//end if -$frm_settings = FrmAppHelper::get_settings(); - if ( FrmAppHelper::is_admin() && ( ! isset( $_GET['action'] ) || 'elementor' !== $_GET['action'] ) ) { ?>
diff --git a/classes/views/frm-fields/back-end/settings.php b/classes/views/frm-fields/back-end/settings.php index 9ec08e489d..d735948d6a 100644 --- a/classes/views/frm-fields/back-end/settings.php +++ b/classes/views/frm-fields/back-end/settings.php @@ -219,7 +219,7 @@ if ( FrmAppHelper::pro_is_connected() && ! is_callable( array( 'FrmProHtmlHelper', 'echo_radio_group' ) ) ) { switch ( $type ) { case 'calc': - $default_value_type['data'] = array( + $default_value_type['data'] = array( 'show' => '#calc-for-{id}', 'disable' => '#default-value-for-{id}', ); diff --git a/classes/views/frm-form-actions/_action_inside.php b/classes/views/frm-form-actions/_action_inside.php index 07378d27e1..ed97a15d04 100644 --- a/classes/views/frm-form-actions/_action_inside.php +++ b/classes/views/frm-form-actions/_action_inside.php @@ -27,7 +27,7 @@ action_options['event'] ) ) { - $events = 'create'; + $action_control->action_options['event'] = 'create'; } if ( ! is_array( $action_control->action_options['event'] ) ) { diff --git a/classes/views/frm-form-actions/_email_settings.php b/classes/views/frm-form-actions/_email_settings.php index 771a536aa9..7ca174d92b 100644 --- a/classes/views/frm-form-actions/_email_settings.php +++ b/classes/views/frm-form-actions/_email_settings.php @@ -10,7 +10,6 @@ $selected_style = 'plain'; } -$frm_settings = FrmAppHelper::get_settings(); $default_style = FrmEmailStylesController::get_default_email_style(); ?>

diff --git a/classes/views/summary-emails/base.php b/classes/views/summary-emails/base.php index 3afdfaae9e..e3c506c49e 100644 --- a/classes/views/summary-emails/base.php +++ b/classes/views/summary-emails/base.php @@ -13,7 +13,6 @@ die( 'You are not allowed to call this page directly.' ); } -$frm_settings = FrmAppHelper::get_settings(); ?> diff --git a/classes/views/xml/posts_xml.php b/classes/views/xml/posts_xml.php index eb5f0f4052..2454d6a8c7 100644 --- a/classes/views/xml/posts_xml.php +++ b/classes/views/xml/posts_xml.php @@ -116,7 +116,6 @@ } $frm_inc_tax[] = $term->term_id; - $label = 'category' === $term->taxonomy || 'tag' === $term->taxonomy ? $term->taxonomy : 'term'; ?> term_id ); ?>taxonomy ); ?>parent ] ) ) { diff --git a/square/controllers/FrmSquareLiteActionsController.php b/square/controllers/FrmSquareLiteActionsController.php index 8f414b88bf..345566c697 100644 --- a/square/controllers/FrmSquareLiteActionsController.php +++ b/square/controllers/FrmSquareLiteActionsController.php @@ -545,7 +545,7 @@ public static function load_scripts( $form_id ) { false ); - $square_vars = array( + $square_vars = array( 'formId' => $form_id, 'nonce' => wp_create_nonce( 'frm_square_ajax' ), 'ajax' => esc_url_raw( FrmAppHelper::get_ajax_url() ), diff --git a/stripe/controllers/FrmStrpLiteActionsController.php b/stripe/controllers/FrmStrpLiteActionsController.php index 484fa68264..dc5f1c86c7 100644 --- a/stripe/controllers/FrmStrpLiteActionsController.php +++ b/stripe/controllers/FrmStrpLiteActionsController.php @@ -317,7 +317,7 @@ public static function before_save_settings( $settings, $action ) { // Gateway is a radio button but it should always be an array in the database for // compatibility with the payments submodule where it is a checkbox. - $settings['gateway'] = ! empty( $settings['gateway'] ) ? (array) $settings['gateway'] : array( 'stripe' ); + $settings['gateway'] = ! empty( $settings['gateway'] ) ? (array) $settings['gateway'] : array( 'stripe' ); $is_stripe = in_array( 'stripe', $settings['gateway'], true ); diff --git a/stripe/controllers/FrmTransLiteActionsController.php b/stripe/controllers/FrmTransLiteActionsController.php index e05263b714..8c8bf65621 100755 --- a/stripe/controllers/FrmTransLiteActionsController.php +++ b/stripe/controllers/FrmTransLiteActionsController.php @@ -563,7 +563,7 @@ function () use ( $entry_id, &$destroy_callback ) { * @return array */ public static function before_save_settings( $settings, $action ) { - $settings['gateway'] = ! empty( $settings['gateway'] ) ? (array) $settings['gateway'] : array( 'stripe' ); + $settings['gateway'] = ! empty( $settings['gateway'] ) ? (array) $settings['gateway'] : array( 'stripe' ); if ( in_array( 'square', $settings['gateway'] ) ) { $currency = FrmSquareLiteConnectHelper::get_merchant_currency(); diff --git a/stripe/helpers/FrmStrpLiteConnectHelper.php b/stripe/helpers/FrmStrpLiteConnectHelper.php index f7808f7dc7..654731e1f6 100644 --- a/stripe/helpers/FrmStrpLiteConnectHelper.php +++ b/stripe/helpers/FrmStrpLiteConnectHelper.php @@ -888,7 +888,7 @@ public static function create_plan( $plan ) { * @return bool */ public static function update_intent( $intent_id, $data ) { - $data = self::post_with_authenticated_body( 'update_intent', compact( 'intent_id', 'data' ) ); + $data = self::post_with_authenticated_body( 'update_intent', compact( 'intent_id', 'data' ) ); return false !== $data; } diff --git a/stripe/helpers/FrmTransLiteListHelper.php b/stripe/helpers/FrmTransLiteListHelper.php index ea3767b780..4724ca8c0c 100755 --- a/stripe/helpers/FrmTransLiteListHelper.php +++ b/stripe/helpers/FrmTransLiteListHelper.php @@ -441,7 +441,6 @@ private function get_form_id_column( $item, $atts ) { * @return string */ private function get_user_id_column( $item ) { - global $wpdb; $val = FrmDb::get_var( 'frm_items', array( 'id' => $item->item_id ), 'user_id' ); return FrmTransLiteAppHelper::get_user_link( $val ); } diff --git a/stripe/models/FrmStrpLiteAuth.php b/stripe/models/FrmStrpLiteAuth.php index b03ee87490..29c88c9b35 100644 --- a/stripe/models/FrmStrpLiteAuth.php +++ b/stripe/models/FrmStrpLiteAuth.php @@ -817,7 +817,10 @@ public static function get_referer_url( $entry_id, $delete_meta = true ) { return false; } - self::delete_temporary_referer_meta( (int) $row->id ); + if ( $delete_meta ) { + self::delete_temporary_referer_meta( (int) $row->id ); + } + return $meta['referer']; } diff --git a/tests/phpunit/fields/test_FrmFieldValidate.php b/tests/phpunit/fields/test_FrmFieldValidate.php index 7d9e6de3d5..bb04deb057 100644 --- a/tests/phpunit/fields/test_FrmFieldValidate.php +++ b/tests/phpunit/fields/test_FrmFieldValidate.php @@ -140,8 +140,6 @@ public function test_empty_required_fields() { $error_fields = array(); if ( ! empty( $errors ) ) { - $error_field_ids = array_keys( $errors ); - foreach ( $fields as $field ) { if ( ! isset( $errors[ 'field' . $field->id ] ) ) { $error_fields[] = $field->type; diff --git a/tests/phpunit/forms/test_FrmForm.php b/tests/phpunit/forms/test_FrmForm.php index daf2c08ba8..f75d8da291 100644 --- a/tests/phpunit/forms/test_FrmForm.php +++ b/tests/phpunit/forms/test_FrmForm.php @@ -61,7 +61,7 @@ public function test_destroy() { continue; } - $id = FrmForm::destroy( $form->id ); + FrmForm::destroy( $form->id ); $form_exists = FrmForm::getOne( $form->id ); $this->assertEmpty( $form_exists, 'Failed to delete form ' . $form->form_key ); diff --git a/tests/phpunit/misc/test_FrmAppHelper.php b/tests/phpunit/misc/test_FrmAppHelper.php index 3cd01881ee..17acf4d9f0 100644 --- a/tests/phpunit/misc/test_FrmAppHelper.php +++ b/tests/phpunit/misc/test_FrmAppHelper.php @@ -530,8 +530,6 @@ private function assert_output_not_contains( $output, $substring, $message = '' * @covers FrmAppHelper::get_unique_key */ public function test_get_unique_key() { - global $wpdb; - // Test field keys $table_name = 'frm_fields'; $column = 'field_key'; diff --git a/tests/phpunit/misc/test_FrmDirectFileAccess.php b/tests/phpunit/misc/test_FrmDirectFileAccess.php index d31628cb14..304dc01b15 100644 --- a/tests/phpunit/misc/test_FrmDirectFileAccess.php +++ b/tests/phpunit/misc/test_FrmDirectFileAccess.php @@ -20,7 +20,7 @@ private function all_php_file_paths( $dir = false, &$results = array() ) { $files_to_ignore = array( 'set-php-version.php', 'stubs.php', '.php-cs-fixer.php', 'rector.php' ); $folders_to_ignore = array( 'tests', 'vendor', 'languages', 'node_modules', 'js', 'phpcs-sniffs' ); - foreach ( $files as $key => $value ) { + foreach ( $files as $value ) { $path = realpath( $dir . DIRECTORY_SEPARATOR . $value ); if ( ! is_dir( $path ) ) { diff --git a/tests/phpunit/stripe/FrmStrpLiteUnitTest.php b/tests/phpunit/stripe/FrmStrpLiteUnitTest.php index b0593d8340..a33e339ed0 100644 --- a/tests/phpunit/stripe/FrmStrpLiteUnitTest.php +++ b/tests/phpunit/stripe/FrmStrpLiteUnitTest.php @@ -449,7 +449,7 @@ protected function get_simple_stripe_action() { */ protected function maybe_create_plan() { $this->get_customer(); - $plan = $this->get_plan_options(); + $plan = $this->get_plan_options(); return FrmStrpLiteSubscriptionHelper::maybe_create_plan( $plan ); } } diff --git a/tests/phpunit/styles/test_FrmStylesHelper.php b/tests/phpunit/styles/test_FrmStylesHelper.php index 27728d0aad..20451eb0bd 100644 --- a/tests/phpunit/styles/test_FrmStylesHelper.php +++ b/tests/phpunit/styles/test_FrmStylesHelper.php @@ -124,7 +124,6 @@ public function test_get_form_count_for_style() { $default_count = 0; foreach ( $data_for_all_published_forms as $row ) { - $form_id = $row->id; $options = $row->options; FrmAppHelper::unserialize_or_decode( $options );