diff --git a/classes/helpers/FrmFieldsHelper.php b/classes/helpers/FrmFieldsHelper.php index 93b599ed9e..6b9911d96f 100644 --- a/classes/helpers/FrmFieldsHelper.php +++ b/classes/helpers/FrmFieldsHelper.php @@ -481,9 +481,9 @@ public static function &label_position( $position, $field, $form ) { } $position = FrmStylesController::get_style_val( 'position', $form ); - if ( $position == 'none' ) { + if ( $position === 'none' ) { $position = 'top'; - } elseif ( $position == 'no_label' ) { + } elseif ( $position === 'no_label' ) { $position = 'none'; } elseif ( $position === 'inside' && ! self::is_placeholder_field_type( $field['type'] ) ) { $position = 'top'; diff --git a/classes/helpers/FrmFormsHelper.php b/classes/helpers/FrmFormsHelper.php index 6ec72f387d..911b064fb3 100644 --- a/classes/helpers/FrmFormsHelper.php +++ b/classes/helpers/FrmFormsHelper.php @@ -838,7 +838,7 @@ public static function submit_button_label( $submit ) { */ public static function maybe_hide_inline() { $frm_settings = FrmAppHelper::get_settings(); - if ( $frm_settings->load_style == 'none' ) { + if ( $frm_settings->load_style === 'none' ) { echo ' style="display:none;"'; } elseif ( $frm_settings->load_style === 'dynamic' ) { FrmStylesController::enqueue_style(); diff --git a/classes/models/FrmDb.php b/classes/models/FrmDb.php index 17a6156df8..d1ed53b21a 100644 --- a/classes/models/FrmDb.php +++ b/classes/models/FrmDb.php @@ -136,7 +136,7 @@ private static function interpret_array_to_sql( $key, $value, &$where, &$values */ $start = '%'; $end = '%'; - if ( $lowercase_key == 'like%' ) { + if ( $lowercase_key === 'like%' ) { $start = ''; $where = rtrim( $where, '%' ); } elseif ( $lowercase_key == '%like' ) { @@ -152,7 +152,7 @@ private static function interpret_array_to_sql( $key, $value, &$where, &$values $where .= ' IS NULL'; } else { // allow a - to prevent = from being added - if ( substr( $key, - 1 ) == '-' ) { + if ( substr( $key, - 1 ) === '-' ) { $where = rtrim( $where, '-' ); } else { $where .= '='; @@ -319,7 +319,7 @@ public static function append_where_is( $where_is ) { } // > and < need a little more work since we don't want them switched to >= and <= - if ( $where_is == '>' || $where_is == '<' ) { + if ( $where_is === '>' || $where_is === '<' ) { // The - indicates that the = should not be added later. return ' ' . $where_is . '-'; } @@ -459,9 +459,9 @@ private static function generate_query_string_from_pieces( $columns, $table, $wh */ private static function esc_query_args( &$args ) { foreach ( $args as $param => $value ) { - if ( $param == 'order_by' ) { + if ( $param === 'order_by' ) { $args[ $param ] = self::esc_order( $value ); - } elseif ( $param == 'limit' ) { + } elseif ( $param === 'limit' ) { $args[ $param ] = self::esc_limit( $value ); } diff --git a/classes/models/FrmEntryFormatter.php b/classes/models/FrmEntryFormatter.php index 5c05b96bf1..31ec07a6b3 100644 --- a/classes/models/FrmEntryFormatter.php +++ b/classes/models/FrmEntryFormatter.php @@ -371,7 +371,7 @@ protected function init_atts( $atts ) { * @return int|string */ protected function get_key_or_id( $field_value ) { - return $this->array_key == 'key' ? $field_value->get_field_key() : $field_value->get_field_id(); + return $this->array_key === 'key' ? $field_value->get_field_key() : $field_value->get_field_id(); } /** diff --git a/classes/models/FrmEntryMeta.php b/classes/models/FrmEntryMeta.php index 0b6150ec12..8815650db5 100644 --- a/classes/models/FrmEntryMeta.php +++ b/classes/models/FrmEntryMeta.php @@ -499,7 +499,7 @@ public static function search_entry_metas( $search, $field_id, $operator ) { $where .= $wpdb->prepare( ' field_id=%d', $field_id ); $query = 'SELECT DISTINCT item_id FROM ' . $wpdb->prefix . 'frm_item_metas' . FrmDb::prepend_and_or_where( ' WHERE ', $where ); } else { - if ( $operator == 'LIKE' ) { + if ( $operator === 'LIKE' ) { $search = '%' . $search . '%'; } $query = $wpdb->prepare( "SELECT DISTINCT item_id FROM {$wpdb->prefix}frm_item_metas WHERE meta_value {$operator} %s and field_id = %d", $search, $field_id ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.PreparedSQL.InterpolatedNotPrepared diff --git a/classes/models/FrmField.php b/classes/models/FrmField.php index 6d8e28f1b1..4ba240e90d 100644 --- a/classes/models/FrmField.php +++ b/classes/models/FrmField.php @@ -927,7 +927,7 @@ public static function getAll( $where = array(), $order_by = '', $limit = '', $b $limit = FrmDb::esc_limit( $limit ); $query = "SELECT fi.*, fr.name as form_name FROM {$table_name} fi LEFT OUTER JOIN {$form_table_name} fr ON fi.form_id=fr.id"; - $query_type = $limit == ' LIMIT 1' || $limit == 1 ? 'row' : 'results'; + $query_type = $limit === ' LIMIT 1' || $limit == 1 ? 'row' : 'results'; if ( is_array( $where ) ) { $args = array( diff --git a/classes/models/FrmForm.php b/classes/models/FrmForm.php index 6cf2aac005..51569ee02a 100644 --- a/classes/models/FrmForm.php +++ b/classes/models/FrmForm.php @@ -860,7 +860,7 @@ public static function getAll( $where = array(), $order_by = '', $limit = '' ) { } } - if ( $limit == ' LIMIT 1' || $limit == 1 ) { + if ( $limit === ' LIMIT 1' || $limit == 1 ) { // return the first form object if we are only getting one form $results = reset( $results ); } @@ -881,7 +881,7 @@ public static function getAll( $where = array(), $order_by = '', $limit = '' ) { public static function get_published_forms( $query = array(), $limit = 999, $inc_children = 'exclude' ) { $query['is_template'] = 0; $query['status'] = array( null, '', 'published' ); - if ( $inc_children == 'exclude' ) { + if ( $inc_children === 'exclude' ) { $query['parent_form_id'] = array( null, 0 ); } diff --git a/classes/models/FrmMigrate.php b/classes/models/FrmMigrate.php index 76f6c0b929..5690eb566a 100644 --- a/classes/models/FrmMigrate.php +++ b/classes/models/FrmMigrate.php @@ -517,7 +517,7 @@ private function migrate_to_25() { } foreach ( $styles as $style ) { - if ( $style->post_content['field_width'] == '400px' ) { + if ( $style->post_content['field_width'] === '400px' ) { $style->post_content['field_width'] = '100%'; $frm_style->save( (array) $style ); diff --git a/classes/views/addons/settings.php b/classes/views/addons/settings.php index 500e5d7f85..fd9baced93 100644 --- a/classes/views/addons/settings.php +++ b/classes/views/addons/settings.php @@ -13,7 +13,7 @@ $license = $plugin->license; $status = get_option( $plugin->option_name . 'active' ); - $activate = false !== $license && $status == 'valid' ? 'deactivate' : 'activate'; + $activate = false !== $license && $status === 'valid' ? 'deactivate' : 'activate'; $icon_class = empty( $license ) ? 'frm_hidden' : ''; ?> diff --git a/classes/views/styles/_sample_form.php b/classes/views/styles/_sample_form.php index ba6029243d..bffbffd26e 100644 --- a/classes/views/styles/_sample_form.php +++ b/classes/views/styles/_sample_form.php @@ -3,7 +3,7 @@ die( 'You are not allowed to call this page directly.' ); } -$pos_class = 'frm_' . ( $style->post_content['position'] == 'none' ? 'top' : ( $style->post_content['position'] == 'no_label' ? 'none' : $style->post_content['position'] ) ) . '_container'; +$pos_class = 'frm_' . ( $style->post_content['position'] === 'none' ? 'top' : ( $style->post_content['position'] === 'no_label' ? 'none' : $style->post_content['position'] ) ) . '_container'; ?>