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
5 changes: 5 additions & 0 deletions classes/controllers/FrmAddonsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ protected static function fallback_plugin_list() {
$info['slug'] = $k;
$list[ $k ] = array_merge( $defaults, $info );
}

return $list;
}

Expand Down Expand Up @@ -742,6 +743,7 @@ public static function get_addon( $plugin ) {
return $addon;
}
}

return false;
}

Expand All @@ -757,6 +759,7 @@ protected static function get_license_type() {
if ( isset( $addons['error'] ) && isset( $addons['error']['type'] ) ) {
$license_type = $addons['error']['type'];
}

return $license_type;
}

Expand Down Expand Up @@ -1113,6 +1116,7 @@ protected static function install_addon() {
'success' => false,
);
}

return $plugin;
}

Expand Down Expand Up @@ -1230,6 +1234,7 @@ protected static function handle_addon_action( $installed, $action ) {
if ( wp_doing_ajax() ) {
wp_send_json_error( array( 'error' => $result->get_error_message() ) );
}

return array(
'message' => $result->get_error_message(),
'success' => false,
Expand Down
2 changes: 2 additions & 0 deletions classes/controllers/FrmAppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ private static function get_os() {
} elseif ( str_contains( $agent, 'windows' ) ) {
$os = ' windows';
}

return $os;
}

Expand Down Expand Up @@ -1459,6 +1460,7 @@ private static function in_our_pages() {
if ( ! empty( $current_screen->post_type ) && 'frm_logs' === $current_screen->post_type ) {
return true;
}

return in_array( $pagenow, array( 'term.php', 'edit-tags.php' ), true ) && 'frm_application' === FrmAppHelper::simple_get( 'taxonomy' );
}

Expand Down
1 change: 1 addition & 0 deletions classes/controllers/FrmDashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ private static function get_dashboard_options( $option_name = null ) {
if ( null !== $option_name ) {
return $options[ $option_name ];
}

return $options;
}

Expand Down
1 change: 1 addition & 0 deletions classes/controllers/FrmFieldsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,7 @@ private static function get_form_for_js_validation( $field ) {
return $frm_vars['js_validate_forms'][ $field['parent_form_id'] ];
}
}

return false;
}

Expand Down
1 change: 1 addition & 0 deletions classes/controllers/FrmFormActionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ private static function active_actions( $action_controls ) {
$allowed[] = $action_control->id_base;
}
}

return $allowed;
}

Expand Down
1 change: 1 addition & 0 deletions classes/controllers/FrmSettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ private static function payment_sections_sort_callback( $a, $b ) {
if ( false === $first_key || false === $second_key ) {
return 0;
}

return $first_key - $second_key;
}

Expand Down
1 change: 1 addition & 0 deletions classes/controllers/FrmSimpleBlocksController.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ public static function simple_form_render( $attributes ) {
if ( ! empty( $attributes['className'] ) ) {
$form = preg_replace( '/\bfrm_forms\b/', 'frm_forms ' . esc_attr( $attributes['className'] ), $form, 1 );
}

return self::maybe_remove_fade_on_load_for_block_preview( $form );
}

Expand Down
1 change: 1 addition & 0 deletions classes/controllers/FrmStylesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,7 @@ public static function get_custom_css( $single_style_settings = null ) {
if ( ! empty( $single_style_settings['single_style_custom_css'] ) && ! empty( $single_style_settings['enable_style_custom_css'] ) ) {
return $single_style_settings['single_style_custom_css'];
}

return '';
}

Expand Down
1 change: 1 addition & 0 deletions classes/controllers/FrmUsageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public static function schedule_send() {
// Remove the scheduled event if it's not allowed and it's scheduled.
wp_unschedule_event( $timestamp, 'formidable_send_usage' );
}

return;
}

Expand Down
1 change: 1 addition & 0 deletions classes/controllers/FrmXMLController.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ private static function get_posted_form() {
if ( ! $form ) {
return $form;
}

return json_decode( $form, true );
}

Expand Down
1 change: 1 addition & 0 deletions classes/helpers/FrmApiHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public static function is_for_user( $item ) {
if ( in_array( 'free_not_first_30', $who, true ) && self::is_free_not_first_30() ) {
return true;
}

return self::check_free_segments( $who );
}

Expand Down
10 changes: 10 additions & 0 deletions classes/helpers/FrmAppHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ public static function is_form_builder_page( $check_for_settings = true ) {
if ( $check_for_settings ) {
$check_actions[] = 'settings';
}

return self::is_admin_page( 'formidable' ) && in_array( $action, $check_actions, true );
}

Expand Down Expand Up @@ -903,6 +904,7 @@ public static function sanitize_value( $sanitize, &$value ) {
foreach ( $temp_values as $k => $v ) {
self::sanitize_value( $sanitize, $value[ $k ] );
}

return;
}

Expand Down Expand Up @@ -1103,6 +1105,7 @@ public static function kses_submit_button( $html ) {
if ( $included_draft_hook ) {
$html = str_replace( 'class="frm_save_draft"', 'class="frm_save_draft" [draft_hook]', $html );
}

return $html;
}

Expand Down Expand Up @@ -1484,6 +1487,7 @@ private static function is_a_valid_color( $value ) {
} elseif ( str_starts_with( $value, '#' ) ) {
$match = preg_match( '/^#([a-f0-9]{6}|[a-f0-9]{3})\b$/', $value );
}

return (bool) $match;
}

Expand Down Expand Up @@ -2767,6 +2771,7 @@ private static function maybe_truncate_key_before_appending( $column, $key ) {
}
}
}

return $key;
}

Expand Down Expand Up @@ -2823,6 +2828,7 @@ private static function prevent_numeric_and_reserved_keys( $key ) {
$key .= 'a';
}
}

return $key;
}

Expand Down Expand Up @@ -3358,6 +3364,7 @@ private static function get_unit( $unit ) {
return $u;
}
}

return 1;
}

Expand Down Expand Up @@ -3723,6 +3730,7 @@ public static function maybe_utf8_encode( $value ) {
if ( mb_check_encoding( $value, $from_format ) ) {
return mb_convert_encoding( $value, $to_format, $from_format );
}

return $value;
}

Expand Down Expand Up @@ -4230,6 +4238,7 @@ public static function get_menu_icon_class() {
return $settings->menu_icon;
}
}

return 'frmfont frm_logo_icon';
}

Expand Down Expand Up @@ -5014,6 +5023,7 @@ public static function is_valid_utf8( $string ) {
if ( function_exists( 'seems_utf8' ) ) {
return seems_utf8( $string );
}

return false;
}

Expand Down
1 change: 1 addition & 0 deletions classes/helpers/FrmCSVExportHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,7 @@ private static function get_field( $field_id ) {
return $field;
}
}

return false;
}

Expand Down
1 change: 1 addition & 0 deletions classes/helpers/FrmCurrencyHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public static function get_currency( $currency ) {
} else {
$currency = $currencies['USD'];
}

return $currency;
}

Expand Down
1 change: 1 addition & 0 deletions classes/helpers/FrmEmailHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public static function get_default_from_email() {
if ( $settings->from_email && is_email( $settings->from_email ) ) {
return $settings->from_email;
}

return get_option( 'admin_email' );
}
}
2 changes: 2 additions & 0 deletions classes/helpers/FrmFieldGridHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ private function should_first_close_the_active_field_wrapper() {
if ( 'end_divider' === $this->field->type ) {
return false;
}

return ! $this->can_support_current_layout() || $this->is_frm_first;
}

Expand Down Expand Up @@ -226,6 +227,7 @@ public function sync_list_size() {
if ( 'end_divider' === $this->field->type ) {
$this->maybe_close_section_helper();
}

return;
}

Expand Down
3 changes: 3 additions & 0 deletions classes/helpers/FrmFieldsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ private static function maybe_replace_substrings_with_field_name( $msg, $error,
if ( ! $field_name ) {
$field_name = 'unique_msg' === $error ? __( 'This value', 'formidable' ) : __( 'This field', 'formidable' );
}

return str_replace( $substrings, $field_name, $msg );
}

Expand Down Expand Up @@ -1130,6 +1131,7 @@ private static function trigger_shortcode_atts( $replace_with, $atts ) {
$function = 'atts_' . $included_att;
$replace_with = self::$function( $replace_with );
}

return $replace_with;
}

Expand Down Expand Up @@ -1862,6 +1864,7 @@ private static function switch_ids_except_strings( $replace, $replace_with, $exc
unset( $replace[ $index ] );
unset( $replace_with[ $index ] );
}

return str_replace( $replace, $replace_with, $value );
}

Expand Down
1 change: 1 addition & 0 deletions classes/helpers/FrmFormMigratorsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ private static function import_links() {

$forms[] = $form;
}

return $forms;
}

Expand Down
3 changes: 3 additions & 0 deletions classes/helpers/FrmFormsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,7 @@ public static function get_form_style_class( $form = false ) {
if ( FrmAppHelper::is_admin_page( 'formidable-entries' ) ) {
return $class;
}

return null;
}

Expand Down Expand Up @@ -1304,6 +1305,7 @@ public static function edit_form_link_label( $data ) {
if ( ! $name ) {
return self::get_no_title_text();
}

return FrmAppHelper::truncate( $name, 40 );
}

Expand Down Expand Up @@ -2077,6 +2079,7 @@ public static function form_is_loaded_by_api() {
if ( ! empty( $frm_vars['inplace_edit'] ) ) {
return true;
}

return self::is_formidable_api_form() || self::is_gutenberg_editor() || self::is_elementor_ajax() || self::is_visual_views_preview();
}

Expand Down
1 change: 1 addition & 0 deletions classes/helpers/FrmShortcodeHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public static function get_contextual_codes() {
foreach ( $contextual_shortcodes as $type => $shortcodes ) {
$result[ $type ] = array_keys( $shortcodes );
}

return $result;
}

Expand Down
1 change: 1 addition & 0 deletions classes/helpers/FrmStringReaderHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public function read_until( $char ) {
while ( $this->pos <= $this->max && ( $one = $this->string[ $this->pos++ ] ) !== $char ) {
$value .= $one;
}

return $value;
}

Expand Down
2 changes: 2 additions & 0 deletions classes/helpers/FrmStylesHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ private static function get_rgb_array_from_rgb( $rgb ) {
// Drop the alpha. The function is expected to only return r,g,b with no alpha.
array_pop( $rgb );
}

return $rgb;
}

Expand Down Expand Up @@ -1156,6 +1157,7 @@ public static function get_bottom_value( $value ) {
if ( count( $parts ) < 3 ) {
return $parts[0];
}

return $parts[2];
}
}
1 change: 1 addition & 0 deletions classes/helpers/FrmSubmitHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ public static function only_contains_submit_field( $fields ) {

$submit_field = $field;
}

return $submit_field;
}

Expand Down
2 changes: 2 additions & 0 deletions classes/helpers/FrmTipsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ private static function get_tip_link( $tip ) {
if ( is_array( $tip['link'] ) ) {
$cta_link = FrmAppHelper::maybe_add_missing_utm( $cta_link, $tip['link'] );
}

return $cta_link;
}

Expand All @@ -114,6 +115,7 @@ private static function cta_label() {
if ( $cta_text ) {
return $cta_text;
}

return FrmAddonsController::is_license_expired() ? __( 'Renew', 'formidable' ) : __( 'Upgrade to Pro.', 'formidable' );
}

Expand Down
3 changes: 3 additions & 0 deletions classes/helpers/FrmXMLHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1246,6 +1246,7 @@ private static function maybe_prepare_json_view_content( $content ) {
if ( is_array( $maybe_decoded ) && isset( $maybe_decoded[0] ) && isset( $maybe_decoded[0]['box'] ) ) {
return FrmAppHelper::prepare_and_encode( $maybe_decoded );
}

return $content;
}

Expand Down Expand Up @@ -1827,6 +1828,7 @@ private static function default_field_options( $type ) {
if ( empty( $defaults['custom_html'] ) ) {
$defaults['custom_html'] = FrmFieldsHelper::get_default_html( $type );
}

return $defaults;
}

Expand Down Expand Up @@ -2440,6 +2442,7 @@ public static function get_supported_upload_file_types() {
// CSV Importing is only available in Pro.
$file_types[] = '.csv';
}

return $file_types;
}
}
1 change: 1 addition & 0 deletions classes/models/FrmAntiSpam.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ public function validate() {
// add an exception for the entries page.
return true;
}

return $this->process_antispam_filter( $this->get_missing_token_message() );
}

Expand Down
1 change: 1 addition & 0 deletions classes/models/FrmApplicationTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ private function get_required_license() {
if ( 'plus' === $required_license ) {
$required_license = 'personal';
}

return $required_license;
}

Expand Down
Loading