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
1 change: 0 additions & 1 deletion classes/controllers/FrmAddonsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ protected static function get_api_addons() {
*/
public static function get_addons_count() {
$addons = self::get_api_addons();

return count( $addons );
}

Expand Down
2 changes: 0 additions & 2 deletions classes/controllers/FrmEntriesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,6 @@ public static function update_hidden_cols( $meta_id, $object_id, $meta_key, $met
*/
private static function hidden_column_key( $menu_name = '' ) {
$base = self::base_column_key( $menu_name );

return 'manage' . $base . 'columnshidden';
}

Expand Down Expand Up @@ -835,7 +834,6 @@ public static function prepare_redirect_url( $url ) {
*/
public static function delete_entry_before_redirect( $url, $form, $atts ) {
self::_delete_entry( $atts['id'], $form );

return $url;
}

Expand Down
1 change: 0 additions & 1 deletion classes/controllers/FrmFieldsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ public static function duplicate() {
*/
public static function get_field_array_from_id( $field_id ) {
$field = FrmField::getOne( $field_id );

return FrmFieldsHelper::setup_edit_vars( $field );
}

Expand Down
4 changes: 0 additions & 4 deletions classes/controllers/FrmFormsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ public static function logic_tip() {
*/
public static function prevent_divi_conflict( $shortcodes ) {
$shortcodes[] = 'formidable';

return $shortcodes;
}

Expand Down Expand Up @@ -1635,7 +1634,6 @@ private static function get_settings_tabs( $values ) {
*/
public static function advanced_settings( $values ) {
$first_h3 = 'frm_first_h3';

include FrmAppHelper::plugin_path() . '/classes/views/frm-forms/settings-advanced.php';
}

Expand Down Expand Up @@ -2236,7 +2234,6 @@ public static function rename_form() {
*/
public static function json_error( $errors ) {
$errors['json'] = __( 'Abnormal HTML characters prevented your form from saving correctly', 'formidable' );

return $errors;
}

Expand Down Expand Up @@ -2623,7 +2620,6 @@ private static function get_saved_errors( $form, $params ) {
*/
public static function just_created_entry( $form_id ) {
global $frm_vars;

return isset( $frm_vars['created_entries'] ) && isset( $frm_vars['created_entries'][ $form_id ] ) && isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ? $frm_vars['created_entries'][ $form_id ]['entry_id'] : 0;
}

Expand Down
3 changes: 0 additions & 3 deletions classes/controllers/FrmSettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ public static function maybe_render_currency_selector( $frm_settings ) {
*/
public static function message_settings() {
$frm_settings = FrmAppHelper::get_settings();

include FrmAppHelper::plugin_path() . '/classes/views/frm-settings/messages.php';
}

Expand All @@ -330,7 +329,6 @@ public static function captcha_settings() {
*/
public static function email_settings() {
$frm_settings = FrmAppHelper::get_settings();

include FrmAppHelper::plugin_path() . '/classes/views/frm-settings/email/email-styles.php';
}

Expand Down Expand Up @@ -369,7 +367,6 @@ public static function payments_settings() {
*/
public static function misc_settings() {
$frm_settings = FrmAppHelper::get_settings();

include FrmAppHelper::plugin_path() . '/classes/views/frm-settings/misc.php';
}

Expand Down
2 changes: 0 additions & 2 deletions classes/controllers/FrmStylesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,6 @@ public static function enqueue_style() {
*/
public static function get_style_opts() {
$frm_style = new FrmStyle();

return $frm_style->get_all();
}

Expand Down Expand Up @@ -1325,7 +1324,6 @@ public static function show_entry_styles( $default_styles ) {
*/
public static function &important_style( $important, $field ) {
$important = self::get_style_val( 'important_style', $field['form_id'] );

return $important;
}

Expand Down
2 changes: 0 additions & 2 deletions classes/factories/FrmFieldFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ public static function get_field_object( $field ) {
*/
public static function get_field_type( $field_type, $field = 0 ) {
$class = self::get_field_type_class( $field_type );

return empty( $class ) ? new FrmFieldDefault( $field, $field_type ) : new $class( $field, $field_type );
}

Expand Down Expand Up @@ -137,7 +136,6 @@ public static function field_has_html( $type ) {
*/
public static function field_has_property( $type, $property ) {
$field = self::get_field_type( $type );

return $field->{$property};
}
}
4 changes: 0 additions & 4 deletions classes/helpers/FrmAppHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ public static function get_settings( $args = array() ) {
*/
public static function get_menu_name() {
$frm_settings = self::get_settings();

return FrmAddonsController::is_license_expired() || ! self::pro_is_installed() ? 'Formidable' : $frm_settings->menu;
}

Expand Down Expand Up @@ -1050,7 +1049,6 @@ private static function decode_amp( &$string ) {
*/
public static function kses( $value, $allowed = array() ) {
$allowed_html = self::allowed_html( $allowed );

return wp_kses( $value, $allowed_html );
}

Expand Down Expand Up @@ -3221,7 +3219,6 @@ private static function add_time_to_date( $time_format, $date ) {
*/
public static function get_localized_date( $date_format, $date ) {
$date = get_date_from_gmt( $date );

return date_i18n( $date_format, strtotime( $date ) );
}

Expand Down Expand Up @@ -4890,7 +4887,6 @@ public static function dismiss_warning_message( $option = '' ) {
*/
public static function copy_for_lite_license() {
$message = __( 'You\'re using Formidable Forms Lite - no license needed. Enjoy!', 'formidable' ) . ' 🙂';

return apply_filters( 'frm_license_type_text', $message );
}

Expand Down
1 change: 0 additions & 1 deletion classes/helpers/FrmEntriesHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,6 @@ public static function get_entry_status( $status ) {
*/
public static function get_entry_status_label( $status ) {
$statuses = self::get_entry_statuses();

return $statuses[ self::get_entry_status( $status ) ];
}

Expand Down
5 changes: 0 additions & 5 deletions classes/helpers/FrmFieldsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public static function get_html_id( $field, $plus = '' ) {
*/
public static function setup_edit_vars( $field, $doing_ajax = false ) {
$values = self::field_object_to_array( $field );

return apply_filters( 'frm_setup_edit_field_vars', $values, array( 'doing_ajax' => $doing_ajax ) );
}

Expand Down Expand Up @@ -186,7 +185,6 @@ private static function prepare_front_field( &$field_array, $field, $args ) {
*/
public static function get_default_field_options( $type ) {
$field_type = FrmFieldFactory::get_field_type( $type );

return $field_type->get_default_field_options();
}

Expand Down Expand Up @@ -418,7 +416,6 @@ private static function prepare_field_options_for_display( &$field_array, $field
*/
public static function get_default_field( $type ) {
$field_type = FrmFieldFactory::get_field_type( $type );

return $field_type->get_new_field_defaults();
}

Expand Down Expand Up @@ -764,7 +761,6 @@ private static function get_default_value_type( $field ) {
*/
public static function get_value_from_array( $opt, $opt_key, $field ) {
$opt = apply_filters( 'frm_field_value_saved', $opt, $opt_key, $field );

return FrmFieldsController::check_value( $opt, $opt_key, $field );
}

Expand All @@ -777,7 +773,6 @@ public static function get_value_from_array( $opt, $opt_key, $field ) {
*/
public static function get_label_from_array( $opt, $opt_key, $field ) {
$opt = apply_filters( 'frm_field_label_seen', $opt, $opt_key, $field );

return FrmFieldsController::check_label( $opt );
}

Expand Down
3 changes: 0 additions & 3 deletions classes/helpers/FrmFormsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public static function form_error_class() {
*/
public static function get_direct_link( $key, $form = false ) {
$target_url = esc_url( admin_url( 'admin-ajax.php?action=frm_forms_preview&form=' . $key ) );

return apply_filters( 'frm_direct_link', $target_url, $key, $form );
}

Expand Down Expand Up @@ -1101,7 +1100,6 @@ private static function form_has_top_labels( $form ) {
*/
private static function field_has_top_label( $field, $form ) {
$label_position = FrmFieldsHelper::label_position( $field['label'], $field, $form );

return in_array( $label_position, array( 'top', 'inside', 'hidden' ), true );
}

Expand Down Expand Up @@ -1340,7 +1338,6 @@ private static function get_form_name_from_data( $data ) {
*/
public static function delete_trash_link( $id, $status, $length = 'label' ) {
$link_details = self::delete_trash_info( $id, $status );

return self::format_link_html( $link_details, $length );
}

Expand Down
1 change: 0 additions & 1 deletion classes/helpers/FrmListHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,6 @@ private function link_label( $link ) {

private function current_url() {
$current_url = set_url_scheme( 'http://' . FrmAppHelper::get_server_value( 'HTTP_HOST' ) . FrmAppHelper::get_server_value( 'REQUEST_URI' ) );

return remove_query_arg( array( 'hotkeys_highlight_last', 'hotkeys_highlight_first' ), $current_url );
}

Expand Down
1 change: 0 additions & 1 deletion classes/helpers/FrmStylesHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ private static function get_rgb_array_from_hex( $hex ) {
*/
public static function hex2rgba( $hex, $a ) {
$rgb = self::hex2rgb( $hex );

return 'rgba(' . $rgb . ',' . $a . ')';
}

Expand Down
1 change: 0 additions & 1 deletion classes/helpers/FrmSubmitHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ private static function has_submit_field_in_list( $fields ) {
*/
public static function get_current_action_from_global_var( $form_id ) {
global $frm_vars;

return $frm_vars['form_params'][ $form_id ]['action'] ?? 'create';
}

Expand Down
3 changes: 0 additions & 3 deletions classes/models/FrmAddon.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ public static function load_hooks() {
*/
public function insert_installed_addon( $plugins ) {
$plugins[ $this->plugin_slug ] = $this;

return $plugins;
}

Expand All @@ -150,7 +149,6 @@ public function insert_installed_addon( $plugins ) {
*/
public static function get_addon( $plugin_slug ) {
$plugins = apply_filters( 'frm_installed_addons', array() );

return $plugins[ $plugin_slug ] ?? false;
}

Expand Down Expand Up @@ -303,7 +301,6 @@ public function activate_defined_license() {
*/
public function get_defined_license() {
$constant_name = 'FRM_' . strtoupper( $this->plugin_slug ) . '_LICENSE';

return defined( $constant_name ) ? constant( $constant_name ) : false;
}

Expand Down
3 changes: 0 additions & 3 deletions classes/models/FrmDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ private static function add_query_placeholder( $key, $value, &$where ) {
*/
public static function get_count( $table, $where = array(), $args = array() ) {
$count = self::get_var( $table, $where, 'COUNT(*)', $args );

return (int) $count;
}

Expand Down Expand Up @@ -534,7 +533,6 @@ private static function esc_query_args( &$args ) {
*/
public static function esc_like( $term ) {
global $wpdb;

return $wpdb->esc_like( $term );
}

Expand Down Expand Up @@ -635,7 +633,6 @@ public static function esc_limit( $limit ) {
*/
public static function prepare_array_values( $array, $type = '%s' ) {
$placeholders = array_fill( 0, count( $array ), $type );

return implode( ', ', $placeholders );
}

Expand Down
1 change: 0 additions & 1 deletion classes/models/FrmEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,6 @@ private function prepare_email_setting( $value, $user_id_args ) {
*/
private function explode_emails( $emails ) {
$emails = ! empty( $emails ) ? preg_split( '/(,|;)/', $emails ) : '';

return is_array( $emails ) ? array_map( 'trim', $emails ) : trim( $emails );
}

Expand Down
1 change: 0 additions & 1 deletion classes/models/FrmEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,6 @@ public static function update_entry_from_xml( $id, $values ) {
*/
public static function get_id_by_key( $key ) {
$entry_id = FrmDb::get_var( 'frm_items', array( 'item_key' => sanitize_title( $key ) ) );

return (int) $entry_id;
}

Expand Down
1 change: 0 additions & 1 deletion classes/models/FrmEntryFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,6 @@ protected function prepare_display_value_for_html_table( $display_value, $field_
*/
protected function prepare_display_value_for_plain_text_content( $display_value ) {
$display_value = $this->flatten_array( $display_value );

return $this->strip_html( $display_value );
}

Expand Down
3 changes: 0 additions & 3 deletions classes/models/FrmEntryValidate.php
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,6 @@ private static function is_honeypot_spam( $values ) {
*/
private static function is_spam_bot() {
$ip = FrmAppHelper::get_ip_address();

return empty( $ip );
}

Expand All @@ -628,7 +627,6 @@ private static function is_spam_bot() {
*/
private static function is_akismet_spam( $values ) {
global $wpcom_api_key;

return is_callable( 'Akismet::http_post' ) && ( get_option( 'wordpress_api_key' ) || $wpcom_api_key ) && self::akismet( $values );
}

Expand All @@ -639,7 +637,6 @@ private static function is_akismet_spam( $values ) {
*/
private static function is_akismet_enabled_for_user( $form_id ) {
$form = FrmForm::getOne( $form_id );

return ! empty( $form->options['akismet'] ) && ( $form->options['akismet'] !== 'logged' || ! is_user_logged_in() );
}

Expand Down
4 changes: 0 additions & 4 deletions classes/models/FrmField.php
Original file line number Diff line number Diff line change
Expand Up @@ -1517,7 +1517,6 @@ public static function get_option_in_object( $field, $option ) {
*/
public static function is_repeating_field( $field ) {
$is_repeating_field = is_array( $field ) ? 'divider' === $field['type'] : 'divider' === $field->type;

return $is_repeating_field && self::is_option_true( $field, 'repeat' );
}

Expand All @@ -1528,7 +1527,6 @@ public static function is_repeating_field( $field ) {
*/
public static function get_id_by_key( $key ) {
$id = FrmDb::get_var( 'frm_fields', array( 'field_key' => sanitize_title( $key ) ) );

return (int) $id;
}

Expand All @@ -1548,7 +1546,6 @@ public static function get_key_by_id( $id ) {
*/
public static function is_image( $field ) {
$type = self::get_field_type( $field );

return ( $type === 'url' && self::get_option( $field, 'show_image' ) );
}

Expand Down Expand Up @@ -1619,7 +1616,6 @@ public static function is_field_type( $field, $is_type ) {
*/
public static function is_combo_field( $field ) {
$field_type_obj = FrmFieldFactory::get_field_factory( $field );

return ! empty( $field_type_obj->is_combo_field );
}
}
1 change: 0 additions & 1 deletion classes/models/FrmFieldFormHtml.php
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,6 @@ private function replace_shortcodes_with_atts() {
*/
private function replace_input_shortcode( $shortcode_atts ) {
$shortcode_atts = $this->prepare_input_shortcode_atts( $shortcode_atts );

return $this->field_obj->include_front_field_input( $this->pass_args, $shortcode_atts );
}

Expand Down
2 changes: 0 additions & 2 deletions classes/models/FrmForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,6 @@ public static function get_admin_params( $form = null ) {
*/
public static function get_current_form_id( $default_form = 'none' ) {
$form = 'first' === $default_form ? self::get_current_form() : self::maybe_get_current_form();

return $form ? $form->id : 0;
}

Expand Down Expand Up @@ -1291,7 +1290,6 @@ public static function &is_visible_to_user( $form ) {
*/
public static function show_submit( $form ) {
$show = ( ! $form->is_template && $form->status === 'published' && ! FrmAppHelper::is_admin() );

return apply_filters( 'frm_show_submit_button', $show, $form );
}

Expand Down
Loading
Loading