Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion classes/controllers/FrmHooksController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static function trigger_load_hook( $hooks = 'load_hooks' ) {
$trigger_hooks = $hooks;
$hooks = (array) $hooks;

if ( 'load_hooks' == $trigger_hooks ) {
if ( 'load_hooks' === $trigger_hooks ) {
if ( is_admin() ) {
$hooks[] = 'load_admin_hooks';

Expand Down
4 changes: 2 additions & 2 deletions classes/controllers/FrmSettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private static function get_settings_tabs() {
$installed_addons = apply_filters( 'frm_installed_addons', array() );

foreach ( $installed_addons as $installed_addon ) {
if ( ! $installed_addon->is_parent_licence && $installed_addon->plugin_name != 'Formidable Pro' && $installed_addon->needs_license ) {
if ( ! $installed_addon->is_parent_licence && $installed_addon->plugin_name !== 'Formidable Pro' && $installed_addon->needs_license ) {
$show_licenses = true;
break;
}
Expand Down Expand Up @@ -447,7 +447,7 @@ public static function route( $stop_load = false ) {

if ( $action === 'process-form' ) {
self::process_form( $stop_load );
} elseif ( $stop_load != 'stop_load' ) {
} elseif ( $stop_load !== 'stop_load' ) {
self::display_form();
}
}
Expand Down
4 changes: 2 additions & 2 deletions classes/controllers/FrmStylesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1304,9 +1304,9 @@ public static function show_entry_styles( $default_styles ) {
foreach ( $default_styles as $name => $val ) {
$setting = $name;

if ( 'border_width' == $name ) {
if ( 'border_width' === $name ) {
$setting = 'field_border_width';
} elseif ( 'alt_bg_color' == $name ) {
} elseif ( 'alt_bg_color' === $name ) {
$setting = 'bg_color_active';
}
$default_styles[ $name ] = $style->post_content[ $setting ];
Expand Down
6 changes: 3 additions & 3 deletions classes/helpers/FrmAppHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2382,7 +2382,7 @@ public static function permission_check( $permission, $show_message = 'show' ) {
$permission_error = self::permission_nonce_error( $permission );

if ( $permission_error !== false ) {
if ( 'hide' == $show_message ) {
if ( 'hide' === $show_message ) {
$permission_error = '';
}
wp_die( esc_html( $permission_error ) );
Expand Down Expand Up @@ -3532,15 +3532,15 @@ public static function maybe_add_tooltip( $name, $class = 'closed', $form_name =
return;
}

if ( 'open' == $class ) {
if ( 'open' === $class ) {
echo ' frm_help"';
} else {
echo ' class="frm_help"';
}

echo ' title="' . esc_attr( $tooltips[ $name ] );

if ( 'open' != $class ) {
if ( 'open' !== $class ) {
echo '"';
}
}
Expand Down
2 changes: 1 addition & 1 deletion classes/helpers/FrmFormsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,7 @@ public static function get_action_links( $form_id, $form ) {
$actions = array();
$trash_links = self::delete_trash_links( $form_id );

if ( 'trash' == $form->status ) {
if ( 'trash' === $form->status ) {
$actions['restore'] = $trash_links['restore'];

if ( current_user_can( 'frm_delete_forms' ) ) {
Expand Down
4 changes: 2 additions & 2 deletions classes/helpers/FrmFormsListHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ private function get_form_name( $item, $actions, $edit_link, $mode = 'list' ) {

$form_name = FrmAppHelper::kses( $form_name );

if ( 'excerpt' != $mode ) {
if ( 'excerpt' !== $mode ) {
$form_name = FrmAppHelper::truncate( $form_name, 50 );
}

Expand All @@ -475,7 +475,7 @@ private function get_form_name( $item, $actions, $edit_link, $mode = 'list' ) {
* @return void
*/
private function add_draft_label( $item, &$val ) {
if ( 'draft' === $item->status && 'draft' != $this->status ) {
if ( 'draft' === $item->status && 'draft' !== $this->status ) {
$val .= ' - <span class="post-state">' . esc_html__( 'Draft', 'formidable' ) . '</span>';
}
}
Expand Down
4 changes: 2 additions & 2 deletions classes/helpers/FrmListHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ protected function set_pagination_args( $args ) {
* @return int Number of items that correspond to the given pagination argument.
*/
public function get_pagination_arg( $key ) {
if ( 'page' == $key ) {
if ( 'page' === $key ) {
return $this->get_pagenum();
}

Expand Down Expand Up @@ -650,7 +650,7 @@ protected function pagination( $which ) {
)
);

if ( 'bottom' == $which ) {
if ( 'bottom' === $which ) {
$html_current_page = $current;
$total_pages_before = '<span class="screen-reader-text">' . __( 'Current Page', 'formidable' ) . '</span><span id="table-paging" class="paging-input">';
} else {
Expand Down
6 changes: 3 additions & 3 deletions classes/helpers/FrmXMLHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1259,13 +1259,13 @@ private static function populate_post( &$post, $item, $imported ) {
$post['attachment_url'] = (string) $item->attachment_url;
}

if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][ (int) $post['menu_order'] ] ) ) {
if ( $post['post_type'] === FrmFormActionsController::$action_post_type && isset( $imported['forms'][ (int) $post['menu_order'] ] ) ) {
// update to new form id
$post['menu_order'] = $imported['forms'][ (int) $post['menu_order'] ];
}

// Don't allow default styles to take over a site's default style
if ( 'frm_styles' == $post['post_type'] ) {
if ( 'frm_styles' === $post['post_type'] ) {
$post['menu_order'] = 0;
}

Expand Down Expand Up @@ -2223,7 +2223,7 @@ private static function format_email_data( &$atts, $notification ) {
if ( isset( $notification[ $f ] ) ) {
$atts[ $f ] = $notification[ $f ];

if ( 'custom' == $notification[ $f ] ) {
if ( 'custom' === $notification[ $f ] ) {
$atts[ $f ] = $notification[ 'cust_' . $f ];
} elseif ( is_numeric( $atts[ $f ] ) && ! empty( $atts[ $f ] ) ) {
$atts[ $f ] = '[' . $atts[ $f ] . ']';
Expand Down
6 changes: 3 additions & 3 deletions classes/models/FrmAddon.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,14 @@ public function edd_plugin_updater() {
*/
public function plugins_api_filter( $_data, $_action = '', $_args = null ) {

if ( $_action != 'plugin_information' ) {
if ( $_action !== 'plugin_information' ) {
return $_data;
}

$slug = basename( $this->plugin_file, '.php' );
$slug2 = str_replace( '/' . $slug . '.php', '', $this->plugin_folder );

if ( empty( $_args->slug ) || ( $_args->slug != $slug && $_args->slug !== $slug2 ) ) {
if ( empty( $_args->slug ) || ( $_args->slug !== $slug && $_args->slug !== $slug2 ) ) {
return $_data;
}

Expand Down Expand Up @@ -253,7 +253,7 @@ public function get_license() {
*/
protected function maybe_get_pro_license() {
// prevent a loop if $this is the pro plugin
$get_license = FrmAppHelper::pro_is_installed() && is_callable( 'FrmProAppHelper::get_updater' ) && $this->plugin_name != 'Formidable Pro';
$get_license = FrmAppHelper::pro_is_installed() && is_callable( 'FrmProAppHelper::get_updater' ) && $this->plugin_name !== 'Formidable Pro';

if ( ! $get_license ) {
return false;
Expand Down
4 changes: 2 additions & 2 deletions classes/models/FrmCreateFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,9 @@ private function get_ftp_creds( $type ) {
unset( $credentials['port'] );
}

if ( ( defined( 'FTP_SSH' ) && FTP_SSH ) || ( defined( 'FS_METHOD' ) && 'ssh2' == FS_METHOD ) ) {
if ( ( defined( 'FTP_SSH' ) && FTP_SSH ) || ( defined( 'FS_METHOD' ) && 'ssh2' === FS_METHOD ) ) {
$credentials['connection_type'] = 'ssh';
} elseif ( ( defined( 'FTP_SSL' ) && FTP_SSL ) && 'ftpext' == $type ) {
} elseif ( ( defined( 'FTP_SSL' ) && FTP_SSL ) && 'ftpext' === $type ) {
// Only the FTP Extension understands SSL.
$credentials['connection_type'] = 'ftps';
} elseif ( ! isset( $credentials['connection_type'] ) ) {
Expand Down
2 changes: 1 addition & 1 deletion classes/models/FrmDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ public static function check_cache( $cache_key, $group = '', $query = '', $type
return $results;
}

if ( 'get_posts' == $type ) {
if ( 'get_posts' === $type ) {
$results = get_posts( $query );
} elseif ( 'get_associative_results' === $type ) {
global $wpdb;
Expand Down
6 changes: 3 additions & 3 deletions classes/models/FrmField.php
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ private static function maybe_include_repeating_fields( $inc_repeat, &$where ) {
public static function include_sub_fields( &$results, $inc_embed, $type = 'all', $form_id = '' ) {
$no_sub_forms = empty( $results ) && $type === 'all';

if ( 'include' != $inc_embed || $no_sub_forms ) {
if ( 'include' !== $inc_embed || $no_sub_forms ) {
return;
}

Expand All @@ -1039,7 +1039,7 @@ public static function include_sub_fields( &$results, $inc_embed, $type = 'all',
$index_offset = 1;

foreach ( $form_fields as $k => $field ) {
if ( 'form' != $field->type || ! isset( $field->field_options['form_select'] ) ) {
if ( 'form' !== $field->type || ! isset( $field->field_options['form_select'] ) ) {
continue;
}

Expand Down Expand Up @@ -1334,7 +1334,7 @@ public static function get_original_field_type( $field ) {
$field_type = self::get_field_type( $field );
$original_type = self::get_option( $field, 'original_type' );

if ( ! empty( $original_type ) && $original_type != $field_type ) {
if ( ! empty( $original_type ) && $original_type !== $field_type ) {
// Check the original type for arrays.
$field_type = $original_type;
}
Expand Down
2 changes: 1 addition & 1 deletion classes/models/FrmFieldFormHtml.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ public function replace_shortcodes_after_input() {
$this->html .= "\n";

// Stop html filtering on confirmation field to prevent loop
if ( $this->field_obj->get_field_column( 'conf_field' ) != 'stop' ) {
if ( $this->field_obj->get_field_column( 'conf_field' ) !== 'stop' ) {
$this->filter_for_more_shortcodes();
}
}
Expand Down
6 changes: 3 additions & 3 deletions classes/models/FrmForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ public static function translatable_strings( $form ) {
* @return bool|int
*/
public static function set_status( $id, $status ) {
if ( 'trash' == $status ) {
if ( 'trash' === $status ) {
return self::trash( $id );
}

Expand Down Expand Up @@ -996,7 +996,7 @@ public static function get_count() {
$counts = array_fill_keys( $statuses, 0 );

foreach ( $results as $row ) {
if ( 'trash' != $row->status ) {
if ( 'trash' !== $row->status ) {
if ( $row->is_template ) {
++$counts['template'];
} else {
Expand All @@ -1006,7 +1006,7 @@ public static function get_count() {
++$counts['trash'];
}

if ( 'draft' == $row->status ) {
if ( 'draft' === $row->status ) {
++$counts['draft'];
}

Expand Down
6 changes: 3 additions & 3 deletions classes/models/FrmFormAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ public static function action_args( $form_id = 0, $limit = 99 ) {
'order' => 'ASC',
);

if ( $form_id && $form_id != 'all' ) {
if ( $form_id && $form_id !== 'all' ) {
$args['menu_order'] = $form_id;
}

Expand Down Expand Up @@ -843,7 +843,7 @@ public function destroy( $form_id = false, $type = 'default' ) {
$query['menu_order'] = $form_id;
}

if ( 'all' != $type ) {
if ( 'all' !== $type ) {
$query['post_excerpt'] = $this->id_base;
}

Expand Down Expand Up @@ -940,7 +940,7 @@ public function migrate_to_2( $form, $update = 'update' ) {
$post_id = $this->save_settings( $action );
}

if ( $post_id && 'update' == $update ) {
if ( $post_id && 'update' === $update ) {
global $wpdb;
$form->options = maybe_serialize( $form->options );

Expand Down
2 changes: 1 addition & 1 deletion classes/models/FrmTableHTMLGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ public function generate_two_cell_table_row( $label, $value, $args = array() ) {
$label = '<th scope="row"' . $this->td_style . '>' . wp_kses_post( $label ) . '</th>';
$value = '<td' . $this->td_style . '>' . $this->filter_value_for_display( $value, $args ) . '</td>';

if ( 'rtl' == $this->direction ) {
if ( 'rtl' === $this->direction ) {
$row .= $value;
$row .= $label;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
die( 'You are not allowed to call this page directly.' );
}
?>
<li id="frm_field_id_<?php echo esc_attr( $field_object->id ); ?>" class="<?php echo esc_attr( $li_classes ); ?> frm_field_loading" data-fid="<?php echo esc_attr( $field_object->id ); ?>" data-formid="<?php echo esc_attr( 'divider' == $field_object->type ? FrmField::get_option( $field_object, 'form_select' ) : $field_object->form_id ); ?>" data-ftype="<?php echo esc_attr( $display['type'] ); ?>">
<li id="frm_field_id_<?php echo esc_attr( $field_object->id ); ?>" class="<?php echo esc_attr( $li_classes ); ?> frm_field_loading" data-fid="<?php echo esc_attr( $field_object->id ); ?>" data-formid="<?php echo esc_attr( 'divider' === $field_object->type ? FrmField::get_option( $field_object, 'form_select' ) : $field_object->form_id ); ?>" data-ftype="<?php echo esc_attr( $display['type'] ); ?>">
<span class="frm-wait frm_visible_spinner"></span>
<span class="frm_hidden_fdata frm_hidden"><?php echo htmlspecialchars( json_encode( $field_object ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
</li>