diff --git a/classes/controllers/FrmAddonsController.php b/classes/controllers/FrmAddonsController.php index 7dd39f79d9..347ad69465 100644 --- a/classes/controllers/FrmAddonsController.php +++ b/classes/controllers/FrmAddonsController.php @@ -326,17 +326,17 @@ protected static function fallback_plugin_list() { ), 'mailchimp' => array( 'title' => 'Mailchimp Forms', - 'excerpt' => 'Get on the path to more sales and leads in a matter of minutes. Add leads to a Mailchimp mailing list when they submit forms and update their information along with the entry.', + 'excerpt' => 'Get on the path to more sales and leads in a matter of minutes. Add leads to a Mailchimp mailing list when they submit forms and update their information along with the entry.', // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong ), 'registration' => array( 'title' => 'User Registration Forms', 'link' => 'downloads/user-registration/', - 'excerpt' => 'Give new users access to your site as quickly and painlessly as possible. Allow users to register, edit and be able to login to their profiles on your site from the front end in a clean, customized registration form.', + 'excerpt' => 'Give new users access to your site as quickly and painlessly as possible. Allow users to register, edit and be able to login to their profiles on your site from the front end in a clean, customized registration form.', // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong ), 'paypal' => array( 'title' => 'PayPal Standard Forms', 'link' => 'downloads/paypal-standard/', - 'excerpt' => 'Automate your business by collecting instant payments from your clients. Collect information, calculate a total, and send them on to PayPal. Require a payment before publishing content on your site.', + 'excerpt' => 'Automate your business by collecting instant payments from your clients. Collect information, calculate a total, and send them on to PayPal. Require a payment before publishing content on your site.', // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong ), 'stripe' => array( 'title' => 'Stripe Forms', @@ -370,7 +370,7 @@ protected static function fallback_plugin_list() { ), 'zapier' => array( 'title' => 'Zapier Forms', - 'excerpt' => 'Connect with hundreds of different applications through Zapier. Insert a new row in a Google docs spreadsheet, post on Twitter, or add a new Dropbox file with your form.', + 'excerpt' => 'Connect with hundreds of different applications through Zapier. Insert a new row in a Google docs spreadsheet, post on Twitter, or add a new Dropbox file with your form.', // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong ), 'signature' => array( 'title' => 'Digital Signature Forms', @@ -1244,7 +1244,7 @@ protected static function handle_addon_action( $installed, $action ) { */ private static function get_addon_activation_response() { $activating_page = self::get_activating_page(); - $message = $activating_page ? __( 'Your plugin has been activated. Would you like to save and reload the page now?', 'formidable' ) : __( 'Your plugin has been activated.', 'formidable' ); + $message = $activating_page ? __( 'Your plugin has been activated. Would you like to save and reload the page now?', 'formidable' ) : __( 'Your plugin has been activated.', 'formidable' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong return array( 'message' => $message, @@ -1495,7 +1495,7 @@ public static function addon_upgrade_link( $addon, $upgrade_link ) { $class .= ' frm-button-secondary frm-button-sm'; } ?> - + id ) ? admin_url( 'admin.php?page=formidable-entries&frm_action=new&form=' . $latest_available_form->id ) : ''; + $add_entry_cta_link = false !== $latest_available_form && isset( $latest_available_form->id ) ? admin_url( 'admin.php?page=formidable-entries&frm_action=new&form=' . $latest_available_form->id ) : ''; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong $lite_counters = array( self::view_args_build_counter( __( 'Total Forms', 'formidable' ), array(), $counters_value['forms'] ), @@ -287,7 +287,8 @@ private static function view_args_entries_placeholder( $forms_count ) { * * @param string $counter_type * @param int $counter_value - * @param false|object $latest_available_form The form object of the latest form available. If there are at least one form available we show "Add Entry" cta for entries counter. + * @param false|object $latest_available_form The form object of the latest form available. If there are at least one + * form available we show "Add Entry" cta for entries counter. * * @return array */ diff --git a/classes/controllers/FrmEntriesController.php b/classes/controllers/FrmEntriesController.php index f96f41e35a..fc2ed5297a 100644 --- a/classes/controllers/FrmEntriesController.php +++ b/classes/controllers/FrmEntriesController.php @@ -11,12 +11,12 @@ class FrmEntriesController { public static function menu() { FrmAppHelper::force_capability( 'frm_view_entries' ); - add_submenu_page( 'formidable', 'Formidable | ' . __( 'Entries', 'formidable' ), __( 'Entries', 'formidable' ), 'frm_view_entries', 'formidable-entries', 'FrmEntriesController::route' ); + add_submenu_page( 'formidable', 'Formidable | ' . __( 'Entries', 'formidable' ), __( 'Entries', 'formidable' ), 'frm_view_entries', 'formidable-entries', 'FrmEntriesController::route' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong $views_installed = is_callable( 'FrmProAppHelper::views_is_installed' ) && FrmProAppHelper::views_is_installed(); if ( ! $views_installed ) { - add_submenu_page( 'formidable', 'Formidable | ' . __( 'Views', 'formidable' ), __( 'Views', 'formidable' ), 'frm_view_entries', 'formidable-views', 'FrmFormsController::no_views' ); + add_submenu_page( 'formidable', 'Formidable | ' . __( 'Views', 'formidable' ), __( 'Views', 'formidable' ), 'frm_view_entries', 'formidable-views', 'FrmFormsController::no_views' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong self::maybe_redirect_to_views_upsell(); } else { self::maybe_redirect_to_views_index(); diff --git a/classes/controllers/FrmFormActionsController.php b/classes/controllers/FrmFormActionsController.php index ec02fe74c6..3872d7d195 100644 --- a/classes/controllers/FrmFormActionsController.php +++ b/classes/controllers/FrmFormActionsController.php @@ -692,7 +692,7 @@ public static function trigger_actions( $event, $form, $entry, $type = 'all', $a continue; } - $child_entry = ( is_numeric( $form->parent_form_id ) && $form->parent_form_id ) || ( $entry && ( (int) $entry->form_id !== (int) $form->id || $entry->parent_item_id ) ) || ! empty( $args['is_child'] ); + $child_entry = ( is_numeric( $form->parent_form_id ) && $form->parent_form_id ) || ( $entry && ( (int) $entry->form_id !== (int) $form->id || $entry->parent_item_id ) ) || ! empty( $args['is_child'] ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong if ( $child_entry ) { // maybe trigger actions for sub forms diff --git a/classes/controllers/FrmFormsController.php b/classes/controllers/FrmFormsController.php index dcbf77e0bf..0a5d166955 100644 --- a/classes/controllers/FrmFormsController.php +++ b/classes/controllers/FrmFormsController.php @@ -67,8 +67,8 @@ public static function register_widgets() { public static function logic_tip() { $images_url = FrmAppHelper::plugin_url() . '/images/'; $data_message = __( 'Only show the fields you need and create branching forms. Upgrade to get conditional logic and question branching.', 'formidable' ); - $data_message .= ' ' . esc_attr__( 'Conditional Logic options', 'formidable' ) . ''; - echo ''; + $data_message .= ' ' . esc_attr__( 'Conditional Logic options', 'formidable' ) . ''; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong + echo ''; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong esc_html_e( 'Conditional Logic', 'formidable' ); FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown8_icon', array( 'aria-hidden' => 'true' ) ); echo ''; @@ -880,7 +880,7 @@ public static function change_form_status( $status ) { $available_status['untrash']['message'] = sprintf( _n( '%1$s form restored from the Trash.', '%1$s forms restored from the Trash.', $count, 'formidable' ), $count ); /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ - $available_status['trash']['message'] = sprintf( _n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ), $count, '', '' ); + $available_status['trash']['message'] = sprintf( _n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ), $count, '', '' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong $message = $available_status[ $status ]['message']; @@ -918,7 +918,7 @@ public static function bulk_trash( $ids ) { /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ _n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ), $count, - '', + '', // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong '' ); } @@ -1069,7 +1069,7 @@ public static function insert_form_button() { FrmAppHelper::load_admin_wide_js(); $menu_name = FrmAppHelper::get_menu_name(); $icon = apply_filters( 'frm_media_icon', FrmAppHelper::svg_logo() ); - self::$formidable_tinymce_button = '' . FrmAppHelper::kses( $icon, 'all' ) . ' ' . esc_html( $menu_name ) . ''; + self::$formidable_tinymce_button = '' . FrmAppHelper::kses( $icon, 'all' ) . ' ' . esc_html( $menu_name ) . ''; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } echo self::$formidable_tinymce_button; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } @@ -1345,7 +1345,7 @@ private static function get_edit_vars( $id, $errors = array(), $message = '', $c if ( $form->parent_form_id ) { /* translators: %1$s: Start link HTML, %2$s: End link HTML */ - wp_die( sprintf( esc_html__( 'You are trying to edit a child form. Please edit from %1$shere%2$s', 'formidable' ), '', '' ) ); + wp_die( sprintf( esc_html__( 'You are trying to edit a child form. Please edit from %1$shere%2$s', 'formidable' ), '', '' ) ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } $frm_field_selection = FrmField::field_selection(); @@ -2616,7 +2616,7 @@ 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; + 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; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } /** @@ -3193,7 +3193,7 @@ private static function redirect_after_submit_using_js( $args ) { private static function get_redirect_message( $success_url, $success_msg, $args ) { $success_msg = apply_filters( 'frm_content', $success_msg, $args['form'], $args['entry_id'] ); $success_msg = do_shortcode( FrmAppHelper::use_wpautop( $success_msg ) ); - $redirect_msg = '
' . $success_msg . '
' . + $redirect_msg = '
' . $success_msg . '
' . // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong self::get_redirect_fallback_message( $success_url, $args ) . '
'; diff --git a/classes/controllers/FrmInboxController.php b/classes/controllers/FrmInboxController.php index f77fa4b83e..10fe9145ef 100644 --- a/classes/controllers/FrmInboxController.php +++ b/classes/controllers/FrmInboxController.php @@ -94,9 +94,9 @@ private static function add_tracking_request() { $message->add_message( array( 'key' => 'usage', - 'message' => 'Gathering usage data allows us to improve Formidable. Your forms will be considered as we evaluate new features, judge the quality of an update, or determine if an improvement makes sense. You can always visit the Global Settings and choose to stop sharing data. Read more about what data we collect.', + 'message' => 'Gathering usage data allows us to improve Formidable. Your forms will be considered as we evaluate new features, judge the quality of an update, or determine if an improvement makes sense. You can always visit the Global Settings and choose to stop sharing data. Read more about what data we collect.', // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'subject' => __( 'Help Formidable improve with usage tracking', 'formidable' ), - 'cta' => 'Dismiss Activate usage tracking', + 'cta' => 'Dismiss Activate usage tracking', // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'type' => 'feedback', ) ); diff --git a/classes/controllers/FrmOnboardingWizardController.php b/classes/controllers/FrmOnboardingWizardController.php index f4e132c3db..9eebe2e653 100644 --- a/classes/controllers/FrmOnboardingWizardController.php +++ b/classes/controllers/FrmOnboardingWizardController.php @@ -466,7 +466,7 @@ public static function mark_onboarding_as_skipped() { * @return array Configuration for the onboarding wizard slide-in notification. */ public static function add_wizard_to_floating_links( $inbox_messages ) { - $message = __( 'Welcome to Formidable Forms! Click here to run the Onboarding Wizard and it will guide you through the basic settings and get you started in 2 minutes.', 'formidable' ); + $message = __( 'Welcome to Formidable Forms! Click here to run the Onboarding Wizard and it will guide you through the basic settings and get you started in 2 minutes.', 'formidable' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong if ( ! is_array( $inbox_messages ) ) { $inbox_messages = array(); @@ -476,7 +476,7 @@ public static function add_wizard_to_floating_links( $inbox_messages ) { 'subject' => esc_html__( 'Begin With Ease!', 'formidable' ), 'message' => esc_html( $message ), 'slidein' => esc_html( $message ), - 'cta' => '' . esc_html__( 'Begin Setup', 'formidable' ) . '', + 'cta' => '' . esc_html__( 'Begin Setup', 'formidable' ) . '', // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'created' => time(), 'key' => 'onboarding_wizard', ); diff --git a/classes/controllers/FrmSMTPController.php b/classes/controllers/FrmSMTPController.php index 0898d9e15b..c4582aaf35 100644 --- a/classes/controllers/FrmSMTPController.php +++ b/classes/controllers/FrmSMTPController.php @@ -165,7 +165,7 @@ protected function output_section_heading() { ?>

-

+

', esc_url( FrmAppHelper::plugin_url() . '/images/smtp-screenshot-tnail.png' ), esc_attr__( 'WP Mail SMTP screenshot', 'formidable' ), - '  ', + '  ', // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong esc_html__( 'Over 1,000,000 websites use WP Mail SMTP.', 'formidable' ), esc_html__( 'Send emails authenticated via trusted parties.', 'formidable' ), esc_html__( 'Transactional Mailers: Pepipost, SendinBlue, Mailgun, SendGrid, Amazon SES.', 'formidable' ), @@ -440,7 +440,7 @@ public function redirect_to_smtp_settings() { */ private function stmp_logo() { ?> - +
-
diff --git a/classes/controllers/FrmStylesController.php b/classes/controllers/FrmStylesController.php index c3843c0c54..cbde3237d4 100644 --- a/classes/controllers/FrmStylesController.php +++ b/classes/controllers/FrmStylesController.php @@ -74,8 +74,8 @@ public static function register_post_types() { * @return void */ public static function menu() { - add_submenu_page( 'formidable', 'Formidable | ' . __( 'Styles', 'formidable' ), __( 'Styles', 'formidable' ), 'frm_change_settings', 'formidable-styles', 'FrmStylesController::route' ); - add_submenu_page( 'themes.php', 'Formidable | ' . __( 'Styles', 'formidable' ), __( 'Forms', 'formidable' ), 'frm_change_settings', 'formidable-styles2', 'FrmStylesController::route' ); + add_submenu_page( 'formidable', 'Formidable | ' . __( 'Styles', 'formidable' ), __( 'Styles', 'formidable' ), 'frm_change_settings', 'formidable-styles', 'FrmStylesController::route' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong + add_submenu_page( 'themes.php', 'Formidable | ' . __( 'Styles', 'formidable' ), __( 'Forms', 'formidable' ), 'frm_change_settings', 'formidable-styles2', 'FrmStylesController::route' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } /** @@ -140,7 +140,7 @@ public static function admin_init() { $style = apply_filters( 'frm_style_head', false ); if ( $style ) { - wp_enqueue_style( 'frm-single-custom-theme', admin_url( 'admin-ajax.php?action=frmpro_load_css&flat=1' ) . '&' . http_build_query( $style->post_content ), array(), $version ); + wp_enqueue_style( 'frm-single-custom-theme', admin_url( 'admin-ajax.php?action=frmpro_load_css&flat=1' ) . '&' . http_build_query( $style->post_content ), array(), $version ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } } @@ -848,7 +848,7 @@ public static function custom_css( $message = '', $extra_args = array() ) { $id = $settings ? $id : 'frm_custom_css_box'; $show_errors = $extra_args['show_errors'] ?? true; $custom_css = $extra_args['custom_css'] ?? self::get_custom_css(); - $heading = $extra_args['heading'] ?? __( 'You can add custom css here or in your theme style.css. Any CSS added here will be used anywhere the Formidable CSS is loaded.', 'formidable' ); + $heading = $extra_args['heading'] ?? __( 'You can add custom css here or in your theme style.css. Any CSS added here will be used anywhere the Formidable CSS is loaded.', 'formidable' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong $textarea_params = ! empty( $extra_args['textarea_params'] ) ? $extra_args['textarea_params'] : array( 'name' => 'frm_custom_css', 'id' => $id, @@ -1386,13 +1386,13 @@ public static function do_accordion_sections( $screen, $context, $data_object ) $accordion_content_id = 'frm_style_section_' . $box['id']; ?> -
  • +
  • -

    diff --git a/classes/controllers/FrmXMLController.php b/classes/controllers/FrmXMLController.php index 8b25cd3f85..21f770e480 100644 --- a/classes/controllers/FrmXMLController.php +++ b/classes/controllers/FrmXMLController.php @@ -9,7 +9,7 @@ class FrmXMLController { * @return void */ public static function menu() { - add_submenu_page( 'formidable', 'Formidable | ' . __( 'Import/Export', 'formidable' ), __( 'Import/Export', 'formidable' ), 'frm_edit_forms', 'formidable-import', 'FrmXMLController::route' ); + add_submenu_page( 'formidable', 'Formidable | ' . __( 'Import/Export', 'formidable' ), __( 'Import/Export', 'formidable' ), 'frm_edit_forms', 'formidable-import', 'FrmXMLController::route' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } /** @@ -350,7 +350,7 @@ public static function import_xml() { return; } - // phpcs:ignore WordPress.Security.NonceVerification.Missing + // phpcs:ignore WordPress.Security.NonceVerification.Missing, SlevomatCodingStandard.Files.LineLength.LineTooLong $has_file = ! empty( $_FILES['frm_import_file'] ) && ! empty( $_FILES['frm_import_file']['name'] ) && ! empty( $_FILES['frm_import_file']['size'] ) && (int) $_FILES['frm_import_file']['size'] > 0; if ( ! $has_file ) { diff --git a/classes/helpers/FrmAppHelper.php b/classes/helpers/FrmAppHelper.php index 20cc5c113a..8899cf6482 100644 --- a/classes/helpers/FrmAppHelper.php +++ b/classes/helpers/FrmAppHelper.php @@ -327,10 +327,12 @@ public static function svg_logo( $atts = array() ) { ); $atts = array_merge( $defaults, $atts ); + // phpcs:disable SlevomatCodingStandard.Files.LineLength.LineTooLong return ' '; + // phpcs:enable SlevomatCodingStandard.Files.LineLength.LineTooLong } /** @@ -736,7 +738,8 @@ public static function get_param( $param, $default = '', $src = 'get', $sanitize } if ( $src === 'get' ) { - $value = isset( $_POST[ $param ] ) ? wp_unslash( $_POST[ $param ] ) : ( isset( $_GET[ $param ] ) ? wp_unslash( $_GET[ $param ] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + $value = isset( $_POST[ $param ] ) ? wp_unslash( $_POST[ $param ] ) : ( isset( $_GET[ $param ] ) ? wp_unslash( $_GET[ $param ] ) : $default ); if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized @@ -1949,7 +1952,7 @@ public static function maybe_autocomplete_options( $args ) { $value_label['label'] = self::truncate( $value_label['label'], $args['truncate'] ); } ?> - + __( 'Give this action a label for easy reference.', 'formidable' ), - 'email_to' => __( 'Add one or more recipient addresses separated by a ",". FORMAT: Name or name@email.com. [default-email] is the address set in the global "Default Email Address" settings.', 'formidable' ), + 'email_to' => __( 'Add one or more recipient addresses separated by a ",". FORMAT: Name or name@email.com. [default-email] is the address set in the global "Default Email Address" settings.', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'cc' => __( 'Add CC addresses separated by a ",". FORMAT: Name or name@email.com.', 'formidable' ), 'bcc' => __( 'Add BCC addresses separated by a ",". FORMAT: Name or name@email.com.', 'formidable' ), - 'reply_to' => __( 'If you would like a different reply to address than the "from" address, add a single address here. FORMAT: Name or name@email.com.', 'formidable' ), + 'reply_to' => __( 'If you would like a different reply to address than the "from" address, add a single address here. FORMAT: Name or name@email.com.', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'from' => __( 'Enter the name and/or email address of the sender. FORMAT: John Bates or john@example.com.', 'formidable' ), /* translators: %1$s: Form name, %2$s: Date */ - 'email_subject' => esc_attr( sprintf( __( 'If you leave the subject blank, the default will be used: %1$s Form submitted on %2$s', 'formidable' ), $form_name, self::site_name() ) ), - 'new_tab' => __( 'This option will open the link in a new browser tab. Please note that some popup blockers may prevent this from happening, in which case the link will be displayed.', 'formidable' ), + 'email_subject' => esc_attr( sprintf( __( 'If you leave the subject blank, the default will be used: %1$s Form submitted on %2$s', 'formidable' ), $form_name, self::site_name() ) ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong + 'new_tab' => __( 'This option will open the link in a new browser tab. Please note that some popup blockers may prevent this from happening, in which case the link will be displayed.', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong ); if ( ! isset( $tooltips[ $name ] ) ) { @@ -3805,7 +3808,7 @@ public static function load_admin_wide_js( $load = true ) { 'url' => self::plugin_url(), 'app_url' => 'https://formidableforms.com/', 'applicationsUrl' => admin_url( 'admin.php?page=formidable-applications' ), - 'canAccessApplicationDashboard' => current_user_can( is_callable( 'FrmProApplicationsHelper::get_required_templates_capability' ) ? FrmProApplicationsHelper::get_required_templates_capability() : 'frm_edit_forms' ), + 'canAccessApplicationDashboard' => current_user_can( is_callable( 'FrmProApplicationsHelper::get_required_templates_capability' ) ? FrmProApplicationsHelper::get_required_templates_capability() : 'frm_edit_forms' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'loading' => __( 'Loading…', 'formidable' ), 'nonce' => wp_create_nonce( 'frm_ajax' ), 'proIncludesSliderJs' => is_callable( 'FrmProFormsHelper::prepare_custom_currency' ), @@ -3873,7 +3876,7 @@ public static function localize_script( $location ) { 'no_valid_default' => __( 'Default value will NOT pass form validation', 'formidable' ), 'confirm' => __( 'Are you sure?', 'formidable' ), 'conf_delete' => __( 'Are you sure you want to delete this field and all data associated with it?', 'formidable' ), - 'conf_delete_sec' => __( 'All fields inside this Section will be deleted along with their data. Are you sure you want to delete this group of fields?', 'formidable' ), + 'conf_delete_sec' => __( 'All fields inside this Section will be deleted along with their data. Are you sure you want to delete this group of fields?', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'conf_no_repeat' => __( 'Warning: If you have entries with multiple rows, all but the first row will be lost.', 'formidable' ), 'default_unique' => FrmFieldsHelper::default_unique_msg(), 'default_conf' => __( 'The entered values do not match', 'formidable' ), @@ -3881,7 +3884,7 @@ public static function localize_script( $location ) { 'confirm_email' => __( 'Confirm Email', 'formidable' ), 'conditional_text' => __( 'Conditional content here', 'formidable' ), 'new_option' => __( 'New Option', 'formidable' ), - 'css_invalid_size' => __( 'In certain browsers (e.g. Firefox) text will not display correctly if the field height is too small relative to the field padding and text size. Please increase your field height or decrease your field padding.', 'formidable' ), + 'css_invalid_size' => __( 'In certain browsers (e.g. Firefox) text will not display correctly if the field height is too small relative to the field padding and text size. Please increase your field height or decrease your field padding.', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'enter_password' => __( 'Enter Password', 'formidable' ), 'confirm_password' => __( 'Confirm Password', 'formidable' ), 'import_complete' => __( 'Import Complete', 'formidable' ), @@ -3899,9 +3902,9 @@ public static function localize_script( $location ) { 'edit_action_text' => __( 'Please edit the existing form action.', 'formidable' ), 'unsafe_params' => FrmFormsHelper::reserved_words(), /* Translators: %s is the name of a Detail Page Slug that is a reserved word.*/ - 'slug_is_reserved' => sprintf( __( 'The Detail Page Slug "%s" is reserved by WordPress. This may cause problems. Is this intentional?', 'formidable' ), '****' ), + 'slug_is_reserved' => sprintf( __( 'The Detail Page Slug "%s" is reserved by WordPress. This may cause problems. Is this intentional?', 'formidable' ), '****' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong /* Translators: %s is the name of a parameter that is a reserved word. More than one word could be listed here, though that would not be common. */ - 'param_is_reserved' => sprintf( __( 'The parameter "%s" is reserved by WordPress. This may cause problems when included in the URL. Is this intentional? ', 'formidable' ), '****' ), + 'param_is_reserved' => sprintf( __( 'The parameter "%s" is reserved by WordPress. This may cause problems when included in the URL. Is this intentional? ', 'formidable' ), '****' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'reserved_words' => __( 'See the list of reserved words in WordPress.', 'formidable' ), 'repeat_limit_min' => __( 'Please enter a Repeat Limit that is greater than 1.', 'formidable' ), 'checkbox_limit' => __( 'Please select a limit between 0 and 200.', 'formidable' ), @@ -4007,7 +4010,7 @@ public static function min_version_notice( $min_version ) { } $wp_list_table = _get_list_table( 'WP_Plugins_List_Table' ); - echo '
    ' . + echo '
    ' . // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong esc_html__( 'You are running an outdated version of Formidable. This plugin may not work correctly if you do not update Formidable.', 'formidable' ) . '
    '; } @@ -4062,7 +4065,7 @@ private static function php_version_notice() { $message = array(); if ( version_compare( phpversion(), '7.0', '<' ) ) { - $message[] = __( 'The version of PHP on your server is too low. If this is not corrected, you may see issues with Formidable Forms. Please contact your web host and ask to be updated to PHP 7.0+.', 'formidable' ); + $message[] = __( 'The version of PHP on your server is too low. If this is not corrected, you may see issues with Formidable Forms. Please contact your web host and ask to be updated to PHP 7.0+.', 'formidable' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } foreach ( $message as $m ) { diff --git a/classes/helpers/FrmCSVExportHelper.php b/classes/helpers/FrmCSVExportHelper.php index 92c0cccd1e..38a9f7eb06 100644 --- a/classes/helpers/FrmCSVExportHelper.php +++ b/classes/helpers/FrmCSVExportHelper.php @@ -256,7 +256,8 @@ private static function set_class_parameters() { self::get_csv_format(); self::$charset = get_option( 'blog_charset' ); - $col_sep = ! empty( $_POST['csv_col_sep'] ) ? sanitize_text_field( wp_unslash( $_POST['csv_col_sep'] ) ) : self::$column_separator; // phpcs:ignore WordPress.Security.NonceVerification.Missing + // phpcs:ignore WordPress.Security.NonceVerification.Missing + $col_sep = ! empty( $_POST['csv_col_sep'] ) ? sanitize_text_field( wp_unslash( $_POST['csv_col_sep'] ) ) : self::$column_separator; self::$column_separator = apply_filters( 'frm_csv_column_sep', $col_sep, $args ); } @@ -589,6 +590,7 @@ private static function add_repeat_field_values_to_csv( &$entries ) { if ( ! isset( $entries[ self::$entry->parent_item_id ]->embedded_fields ) ) { $entries[ self::$entry->parent_item_id ]->embedded_fields = array(); } + $entries[ self::$entry->parent_item_id ]->embedded_fields[ self::$entry->id ] = self::$entry->form_id; } @@ -620,7 +622,7 @@ private static function fill_missing_repeater_metas( $metas, &$entries ) { if ( ! isset( $metas[ $repeater_child->id ] ) ) { $metas[ $repeater_child->id ] = ''; - if ( ! isset( $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ] ) || ! is_array( $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ] ) ) { + if ( ! isset( $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ] ) || ! is_array( $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ] ) ) { // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ] = array(); } @@ -712,7 +714,7 @@ private static function get_separate_value_label( $field_value, $field ) { 'show_icon' => false, 'entry_id' => self::$entry->id, 'sep' => self::$separator, - 'embedded_field_id' => isset( self::$entry->embedded_fields ) && isset( self::$entry->embedded_fields[ self::$entry->id ] ) ? 'form' . self::$entry->embedded_fields[ self::$entry->id ] : 0, + 'embedded_field_id' => isset( self::$entry->embedded_fields ) && isset( self::$entry->embedded_fields[ self::$entry->id ] ) ? 'form' . self::$entry->embedded_fields[ self::$entry->id ] : 0, // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong ) ); } @@ -845,7 +847,7 @@ public static function encode_value( $line ) { // this map was derived from the differences between the MacRoman and UTF-8 Charsets // Reference: // http://www.alanwood.net/demos/macroman.html. - $convmap = array( 256, 304, 0, 0xffff, 306, 337, 0, 0xffff, 340, 375, 0, 0xffff, 377, 401, 0, 0xffff, 403, 709, 0, 0xffff, 712, 727, 0, 0xffff, 734, 936, 0, 0xffff, 938, 959, 0, 0xffff, 961, 8210, 0, 0xffff, 8213, 8215, 0, 0xffff, 8219, 8219, 0, 0xffff, 8227, 8229, 0, 0xffff, 8231, 8239, 0, 0xffff, 8241, 8248, 0, 0xffff, 8251, 8259, 0, 0xffff, 8261, 8363, 0, 0xffff, 8365, 8481, 0, 0xffff, 8483, 8705, 0, 0xffff, 8707, 8709, 0, 0xffff, 8711, 8718, 0, 0xffff, 8720, 8720, 0, 0xffff, 8722, 8729, 0, 0xffff, 8731, 8733, 0, 0xffff, 8735, 8746, 0, 0xffff, 8748, 8775, 0, 0xffff, 8777, 8799, 0, 0xffff, 8801, 8803, 0, 0xffff, 8806, 9673, 0, 0xffff, 9675, 63742, 0, 0xffff, 63744, 64256, 0, 0xffff ); + $convmap = array( 256, 304, 0, 0xffff, 306, 337, 0, 0xffff, 340, 375, 0, 0xffff, 377, 401, 0, 0xffff, 403, 709, 0, 0xffff, 712, 727, 0, 0xffff, 734, 936, 0, 0xffff, 938, 959, 0, 0xffff, 961, 8210, 0, 0xffff, 8213, 8215, 0, 0xffff, 8219, 8219, 0, 0xffff, 8227, 8229, 0, 0xffff, 8231, 8239, 0, 0xffff, 8241, 8248, 0, 0xffff, 8251, 8259, 0, 0xffff, 8261, 8363, 0, 0xffff, 8365, 8481, 0, 0xffff, 8483, 8705, 0, 0xffff, 8707, 8709, 0, 0xffff, 8711, 8718, 0, 0xffff, 8720, 8720, 0, 0xffff, 8722, 8729, 0, 0xffff, 8731, 8733, 0, 0xffff, 8735, 8746, 0, 0xffff, 8748, 8775, 0, 0xffff, 8777, 8799, 0, 0xffff, 8801, 8803, 0, 0xffff, 8806, 9673, 0, 0xffff, 9675, 63742, 0, 0xffff, 63744, 64256, 0, 0xffff ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong break; case 'ISO-8859-1': $convmap = array( 256, 10000, 0, 0xffff ); diff --git a/classes/helpers/FrmEmailSummaryHelper.php b/classes/helpers/FrmEmailSummaryHelper.php index 5a6b3faeae..0cc490c6f1 100644 --- a/classes/helpers/FrmEmailSummaryHelper.php +++ b/classes/helpers/FrmEmailSummaryHelper.php @@ -414,7 +414,7 @@ public static function get_heading2_style() { * @return string */ public static function get_button_style( $display_block = false ) { - return 'display: ' . ( $display_block ? 'block' : 'inline-block' ) . '; font-size: 0.875em; line-height: 2.4; border-radius: 1.2em; border: 1px solid #d0d5dd; font-weight: 600; text-align: center; margin-top: 2.6em; color: #1d2939; text-decoration: none; padding-left: 1em; padding-right: 1em;'; + return 'display: ' . ( $display_block ? 'block' : 'inline-block' ) . '; font-size: 0.875em; line-height: 2.4; border-radius: 1.2em; border: 1px solid #d0d5dd; font-weight: 600; text-align: center; margin-top: 2.6em; color: #1d2939; text-decoration: none; padding-left: 1em; padding-right: 1em;'; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } /** @@ -428,7 +428,7 @@ public static function get_button_style( $display_block = false ) { public static function section_heading_with_icon( $icon, $text ) { ?>

    - <?php echo esc_attr( $icon ); ?> + <?php echo esc_attr( $icon ); ?>

    id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing + $other_vals = wp_unslash( $_POST['item_meta']['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing, SlevomatCodingStandard.Files.LineLength.LineTooLong FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals ); // Set the validation value now @@ -525,11 +525,11 @@ public static function set_other_repeating_vals( $field, &$value, &$args ) { } // Check if there are any other posted "other" values for this field. - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing, SlevomatCodingStandard.Files.LineLength.LineTooLong // Save original value $args['temp_value'] = $value; $args['other'] = true; - $other_vals = wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing + $other_vals = wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing, SlevomatCodingStandard.Files.LineLength.LineTooLong FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals ); // Set the validation value now. diff --git a/classes/helpers/FrmEntriesListHelper.php b/classes/helpers/FrmEntriesListHelper.php index e13eeb7cee..e98bd0f75c 100644 --- a/classes/helpers/FrmEntriesListHelper.php +++ b/classes/helpers/FrmEntriesListHelper.php @@ -342,7 +342,7 @@ public function single_row( $item, $style = '' ) { // Set up the checkbox ( because the user is editable, otherwise its empty ) $checkbox = ""; /* translators: %s: Form name */ - $checkbox .= "'; + $checkbox .= "'; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong $r = ""; @@ -499,7 +499,7 @@ private function get_actions( &$actions, $item, $view_link ) { if ( current_user_can( 'frm_delete_entries' ) ) { $delete_link = '?page=formidable-entries&frm_action=destroy&id=' . $item->id . '&form=' . $this->params['form']; - $actions['delete'] = '' . __( 'Delete', 'formidable' ) . ''; + $actions['delete'] = '' . __( 'Delete', 'formidable' ) . ''; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } $actions = apply_filters( 'frm_row_actions', $actions, $item ); diff --git a/classes/helpers/FrmFieldsHelper.php b/classes/helpers/FrmFieldsHelper.php index ad63af8e53..dfb6010513 100644 --- a/classes/helpers/FrmFieldsHelper.php +++ b/classes/helpers/FrmFieldsHelper.php @@ -345,7 +345,7 @@ private static function get_posted_field_setting( $setting, &$value ) { } if ( str_contains( $setting, 'html' ) ) { - $value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing + $value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing, SlevomatCodingStandard.Files.LineLength.LineTooLong // Conditionally strip script tags if the user sending $_POST data is not allowed to use unfiltered HTML. if ( ! FrmAppHelper::allow_unfiltered_html() ) { @@ -353,9 +353,9 @@ private static function get_posted_field_setting( $setting, &$value ) { } } elseif ( str_starts_with( $setting, 'format_' ) ) { // TODO: Remove stripslashes on output, and use on input only. - $value = sanitize_text_field( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing + $value = sanitize_text_field( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing, SlevomatCodingStandard.Files.LineLength.LineTooLong } else { - $value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing + $value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing, SlevomatCodingStandard.Files.LineLength.LineTooLong FrmAppHelper::sanitize_value( 'wp_kses_post', $value ); } } @@ -693,7 +693,7 @@ public static function show_single_option( $field ) { $opt = self::get_label_from_array( $opt, $opt_key, $field ); $field_name = $base_name . ( $default_type === 'checkbox' ? '[' . $opt_key . ']' : '' ); - // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict, Universal.Operators.StrictComparisons + // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict, Universal.Operators.StrictComparisons, SlevomatCodingStandard.Files.LineLength.LineTooLong $checked = isset( $field['default_value'] ) && ( ( ! is_array( $field['default_value'] ) && $field['default_value'] == $field_val ) || ( is_array( $field['default_value'] ) && in_array( $field_val, $field['default_value'] ) ) ); // If this is an "Other" option, get the HTML for it. @@ -1541,10 +1541,10 @@ public static function get_other_val( $args ) { // phpcs:ignore SlevomatCodingSt // For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing if ( FrmField::is_field_with_multiple_values( $field ) ) { - // phpcs:ignore WordPress.Security.NonceVerification.Missing - $other_val = isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ) : ''; + $other_val = isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing, SlevomatCodingStandard.Files.LineLength.LineTooLong } else { - $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing + // phpcs:ignore WordPress.Security.NonceVerification.Missing + $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ); } return $other_val; @@ -1554,7 +1554,7 @@ public static function get_other_val( $args ) { // phpcs:ignore SlevomatCodingSt // For normal fields if ( FrmField::is_field_with_multiple_values( $field ) ) { - // phpcs:ignore WordPress.Security.NonceVerification.Missing + // phpcs:ignore WordPress.Security.NonceVerification.Missing, SlevomatCodingStandard.Files.LineLength.LineTooLong $other_val = isset( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ) : ''; } else { $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing @@ -2527,7 +2527,7 @@ public static function get_display_format_options( $field ) { 'svg' => 'frm_image_as_option', 'addon' => 'pro', 'upgrade' => __( 'Image Options', 'formidable' ), - 'message' => __( 'Show images instead of radio buttons or check boxes. This is ideal for polls, surveys, segmenting questionnaires and more.', 'formidable' ) . '', + 'message' => __( 'Show images instead of radio buttons or check boxes. This is ideal for polls, surveys, segmenting questionnaires and more.', 'formidable' ) . '', // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'content' => 'image-options', ), 'buttons' => array( diff --git a/classes/helpers/FrmFormMigratorsHelper.php b/classes/helpers/FrmFormMigratorsHelper.php index f8382ee00d..00c2be510a 100644 --- a/classes/helpers/FrmFormMigratorsHelper.php +++ b/classes/helpers/FrmFormMigratorsHelper.php @@ -56,7 +56,7 @@ public static function maybe_add_to_inbox() { 'key' => $form['class'], 'subject' => 'You have new importable forms', 'message' => 'Did you know you can import your forms created in ' . esc_html( $form['name'] ) . '?', - 'cta' => '' . esc_html__( 'Learn More', 'formidable' ) . '', + 'cta' => '' . esc_html__( 'Learn More', 'formidable' ) . '', // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'icon' => 'frm_cloud_upload_solid_icon', 'type' => 'news', ) @@ -153,7 +153,7 @@ private static function install_button( $install, $label = '' ) { if ( $install['installed'] ) { ?> - + - + esc_html__( 'Get Super Powers with Pre-built Forms', 'formidable' ), - 'description' => esc_html__( 'Unleash the potential of hundreds of form templates and save precious time. Renew today for unparalleled form-building speed.', 'formidable' ), + 'description' => esc_html__( 'Unleash the potential of hundreds of form templates and save precious time. Renew today for unparalleled form-building speed.', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'link_text' => esc_html__( 'Renew Now', 'formidable' ), 'link_url' => $args['renew_link'], 'id' => 'frm-renew-subscription-banner', diff --git a/classes/helpers/FrmFormsHelper.php b/classes/helpers/FrmFormsHelper.php index d8b2a5dc3b..5ea6e1f9d6 100644 --- a/classes/helpers/FrmFormsHelper.php +++ b/classes/helpers/FrmFormsHelper.php @@ -77,7 +77,7 @@ public static function forms_dropdown( $field_name, $field_value = '', $args = a @@ -104,7 +104,7 @@ public static function add_html_attr( $class, $param, &$add_html ) { * * @return void */ - public static function form_switcher( $selected = false ) { // phpcs:ignore SlevomatCodingStandard.Complexity.Cognitive.ComplexityTooHigh, Generic.Metrics.CyclomaticComplexity.MaxExceeded + public static function form_switcher( $selected = false ) { // phpcs:ignore SlevomatCodingStandard.Complexity.Cognitive.ComplexityTooHigh, Generic.Metrics.CyclomaticComplexity.MaxExceeded, SlevomatCodingStandard.Files.LineLength.LineTooLong $where = apply_filters( 'frm_forms_dropdown', array(), '' ); $forms = FrmForm::get_published_forms( $where ); @@ -374,7 +374,7 @@ public static function setup_new_vars( $values = array() ) { unset( $defaults ); if ( ! isset( $values['form_key'] ) ) { - $values['form_key'] = $post_values && isset( $post_values['form_key'] ) ? $post_values['form_key'] : FrmAppHelper::get_unique_key( '', $wpdb->prefix . 'frm_forms', 'form_key' ); + $values['form_key'] = $post_values && isset( $post_values['form_key'] ) ? $post_values['form_key'] : FrmAppHelper::get_unique_key( '', $wpdb->prefix . 'frm_forms', 'form_key' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } $values = self::fill_default_opts( $values, false, $post_values ); @@ -424,11 +424,11 @@ public static function fill_default_opts( $values, $record, $post_values ) { // } foreach ( $default as $k => $v ) { - $values[ $var ][ $k ] = $post_values && isset( $post_values[ $var ][ $k ] ) ? $post_values[ $var ][ $k ] : ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) ? $record->options[ $var ][ $k ] : $v ); + $values[ $var ][ $k ] = $post_values && isset( $post_values[ $var ][ $k ] ) ? $post_values[ $var ][ $k ] : ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) ? $record->options[ $var ][ $k ] : $v ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong if ( is_array( $v ) ) { foreach ( $v as $k1 => $v1 ) { - $values[ $var ][ $k ][ $k1 ] = $post_values && isset( $post_values[ $var ][ $k ][ $k1 ] ) ? $post_values[ $var ][ $k ][ $k1 ] : ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) && isset( $record->options[ $var ][ $k ][ $k1 ] ) ? $record->options[ $var ][ $k ][ $k1 ] : $v1 ); + $values[ $var ][ $k ][ $k1 ] = $post_values && isset( $post_values[ $var ][ $k ][ $k1 ] ) ? $post_values[ $var ][ $k ][ $k1 ] : ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) && isset( $record->options[ $var ][ $k ][ $k1 ] ) ? $record->options[ $var ][ $k ][ $k1 ] : $v1 ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong unset( $k1, $v1 ); } } @@ -436,7 +436,7 @@ public static function fill_default_opts( $values, $record, $post_values ) { // unset( $k, $v ); } } else { - $values[ $var ] = $post_values && isset( $post_values['options'][ $var ] ) ? $post_values['options'][ $var ] : ( $record && isset( $record->options[ $var ] ) ? $record->options[ $var ] : $default ); + $values[ $var ] = $post_values && isset( $post_values['options'][ $var ] ) ? $post_values['options'][ $var ] : ( $record && isset( $record->options[ $var ] ) ? $record->options[ $var ] : $default ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } unset( $var, $default ); @@ -920,7 +920,7 @@ public static function replace_shortcodes( $html, $form, $title = false, $descri $replace_with = ''; } - FrmShortcodeHelper::remove_inline_conditions( ( FrmAppHelper::is_true( $show ) && $replace_with != '' ), $code, $replace_with, $html ); // phpcs:ignore Universal.Operators.StrictComparisons + FrmShortcodeHelper::remove_inline_conditions( ( FrmAppHelper::is_true( $show ) && $replace_with != '' ), $code, $replace_with, $html ); // phpcs:ignore Universal.Operators.StrictComparisons, SlevomatCodingStandard.Files.LineLength.LineTooLong } // Replace [form_key]. @@ -1452,7 +1452,7 @@ public static function css_classes() { ), 'frm_scroll_box' => array( 'label' => __( 'Scroll Box', 'formidable' ), - 'title' => __( 'If you have many checkbox or radio button options, you may add this class to allow your user to easily scroll through the options. Or add a scrolling area around content in an HTML field.', 'formidable' ), + 'title' => __( 'If you have many checkbox or radio button options, you may add this class to allow your user to easily scroll through the options. Or add a scrolling area around content in an HTML field.', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong ), 'frm_first' => array( 'label' => __( 'First', 'formidable' ), @@ -1869,13 +1869,13 @@ private static function create_unsafe_param_warning( $unsafe_params_in_redirect if ( $count === 1 ) { /* translators: %s: the name of a single parameter in the redirect URL */ - return sprintf( esc_html__( 'The redirect URL is using the parameter "%s", which is reserved by WordPress. ', 'formidable' ), $unsafe_params_in_redirect[0] ) . $caution . $reserved_words_link; + return sprintf( esc_html__( 'The redirect URL is using the parameter "%s", which is reserved by WordPress. ', 'formidable' ), $unsafe_params_in_redirect[0] ) . $caution . $reserved_words_link; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } $unsafe_params_string = implode( '", "', $unsafe_params_in_redirect ); /* translators: %s: the names of two or more parameters in the redirect URL, separated by commas */ - return sprintf( esc_html__( 'The redirect URL is using the parameters "%s", which are reserved by WordPress. ', 'formidable' ), $unsafe_params_string ) . $caution . $reserved_words_link; + return sprintf( esc_html__( 'The redirect URL is using the parameters "%s", which are reserved by WordPress. ', 'formidable' ), $unsafe_params_string ) . $caution . $reserved_words_link; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } /** diff --git a/classes/helpers/FrmFormsListHelper.php b/classes/helpers/FrmFormsListHelper.php index 2c4d068013..fdf5a85983 100644 --- a/classes/helpers/FrmFormsListHelper.php +++ b/classes/helpers/FrmFormsListHelper.php @@ -205,7 +205,7 @@ public function get_views() { if ( $counts->{$status} || 'draft' !== $status ) { /* translators: %1$s: Status, %2$s: Number of items */ - $links[ $status ] = '' . sprintf( __( '%1$s (%2$s)', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . ''; + $links[ $status ] = '' . sprintf( __( '%1$s (%2$s)', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . ''; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } unset( $status, $name ); @@ -308,7 +308,7 @@ public function single_row( $item, $style = '' ) { ); } else { $text = FrmEntry::getRecordCount( $item->id ); - $val = current_user_can( 'frm_view_entries' ) ? '' . $text . '' : $text; + $val = current_user_can( 'frm_view_entries' ) ? '' . $text . '' : $text; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong unset( $text ); } break; @@ -340,7 +340,7 @@ public function single_row( $item, $style = '' ) { * @return string */ protected function column_shortcode( $form ) { - $val = '' . FrmAppHelper::icon_by_class( 'frmfont frm_code_icon', array( 'echo' => false ) ) . ''; + $val = '' . FrmAppHelper::icon_by_class( 'frmfont frm_code_icon', array( 'echo' => false ) ) . ''; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong $val .= $this->column_style( $form ); $val .= $this->column_views( $form ); $val = apply_filters( 'frm_form_list_actions', $val, array( 'form' => $form ) ); @@ -376,7 +376,7 @@ protected function column_style( $form ) { } $href = FrmStylesHelper::get_edit_url( $style, $form->id ); - return '' . FrmAppHelper::icon_by_class( 'frmfont frm_pallet_icon', array( 'echo' => false ) ) . ''; + return '' . FrmAppHelper::icon_by_class( 'frmfont frm_pallet_icon', array( 'echo' => false ) ) . ''; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } /** @@ -454,7 +454,7 @@ private function get_form_name( $item, $actions, $edit_link, $mode = 'list' ) { if ( 'trash' === $this->status ) { $val .= $form_name; } else { - $val .= '' . FrmAppHelper::kses( $form_name ) . ' '; + $val .= '' . FrmAppHelper::kses( $form_name ) . ' '; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } $this->add_draft_label( $item, $val ); diff --git a/classes/helpers/FrmListHelper.php b/classes/helpers/FrmListHelper.php index 7c768f42b2..c01848e6da 100644 --- a/classes/helpers/FrmListHelper.php +++ b/classes/helpers/FrmListHelper.php @@ -950,7 +950,7 @@ public function get_column_count() { * * @return void */ - public function print_column_headers( $with_id = true ) { // phpcs:ignore SlevomatCodingStandard.Complexity.Cognitive.ComplexityTooHigh, Generic.Metrics.CyclomaticComplexity.MaxExceeded + public function print_column_headers( $with_id = true ) { // phpcs:ignore SlevomatCodingStandard.Complexity.Cognitive.ComplexityTooHigh, Generic.Metrics.CyclomaticComplexity.MaxExceeded, SlevomatCodingStandard.Files.LineLength.LineTooLong list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info(); $current_url = set_url_scheme( 'http://' . FrmAppHelper::get_server_value( 'HTTP_HOST' ) . FrmAppHelper::get_server_value( 'REQUEST_URI' ) ); @@ -1268,7 +1268,7 @@ protected function single_row_columns( $item ) { * @return string The row actions output. In this case, an empty string. */ protected function handle_row_actions( $item, $column_name, $primary ) { - return $column_name == $primary ? '' : ''; // phpcs:ignore Universal.Operators.StrictComparisons + return $column_name == $primary ? '' : ''; // phpcs:ignore Universal.Operators.StrictComparisons, SlevomatCodingStandard.Files.LineLength.LineTooLong } /** diff --git a/classes/helpers/FrmStylesCardHelper.php b/classes/helpers/FrmStylesCardHelper.php index 46bf33cc4c..e2f4e1b5ca 100644 --- a/classes/helpers/FrmStylesCardHelper.php +++ b/classes/helpers/FrmStylesCardHelper.php @@ -271,7 +271,7 @@ public static function get_style_param_for_card( $style ) { if ( empty( $style->post_content['fieldset_bg_color'] ) ) { $background_color = '#fff'; } else { - $background_color = str_starts_with( $style->post_content['fieldset_bg_color'], 'rgb' ) ? $style->post_content['fieldset_bg_color'] : '#' . $style->post_content['fieldset_bg_color']; + $background_color = str_starts_with( $style->post_content['fieldset_bg_color'], 'rgb' ) ? $style->post_content['fieldset_bg_color'] : '#' . $style->post_content['fieldset_bg_color']; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } $styles[] = '--preview-background-color: ' . $background_color; diff --git a/classes/helpers/FrmStylesHelper.php b/classes/helpers/FrmStylesHelper.php index 2a6a54e299..7b631a1cc0 100644 --- a/classes/helpers/FrmStylesHelper.php +++ b/classes/helpers/FrmStylesHelper.php @@ -205,7 +205,7 @@ public static function bs_icon_select( $style, $frm_style, $type = 'arrow' ) {
  • post_content['collapse_icon'] == $key ? 'class="active"' : ''; // phpcs:ignore Universal.Operators.StrictComparisons ?>> ' + __( 'In order to install XML, your server must have DOMDocument installed. Follow our documentation on %1$s to ensure DOMDocument is properly set up and XML support is enabled.', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong + 'Importing Forms, Entries, and Views' // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong ); return new WP_Error( 'SimpleXML_parse_error', $error_message, libxml_get_errors() ); @@ -960,7 +960,7 @@ private static function update_custom_style_setting_after_import( $form_id ) { $saved_style = $form['options']['custom_style']; $form['options']['custom_style'] = $form['options']['old_style']; self::update_custom_style_setting_on_import( $form ); - $has_changed = $form['options']['custom_style'] != $saved_style && $form['options']['custom_style'] != $form['options']['old_style']; // phpcs:ignore Universal.Operators.StrictComparisons + $has_changed = $form['options']['custom_style'] != $saved_style && $form['options']['custom_style'] != $form['options']['old_style']; // phpcs:ignore Universal.Operators.StrictComparisons, SlevomatCodingStandard.Files.LineLength.LineTooLong if ( $has_changed ) { FrmForm::update( $form['id'], $form ); @@ -1287,7 +1287,7 @@ private static function populate_post( &$post, $item, $imported ) { * @param stdClass $meta * @param array $imported */ - private static function populate_postmeta( &$post, $meta, $imported ) { // phpcs:ignore SlevomatCodingStandard.Complexity.Cognitive.ComplexityTooHigh, Generic.Metrics.CyclomaticComplexity.MaxExceeded + private static function populate_postmeta( &$post, $meta, $imported ) { // phpcs:ignore SlevomatCodingStandard.Complexity.Cognitive.ComplexityTooHigh, Generic.Metrics.CyclomaticComplexity.MaxExceeded, SlevomatCodingStandard.Files.LineLength.LineTooLong global $frm_duplicate_ids; $m = array( @@ -2314,7 +2314,7 @@ private static function setup_new_notification( &$new_notification, $notificatio // Set from if ( ! empty( $atts['reply_to'] ) || ! empty( $atts['reply_to_name'] ) ) { - $new_notification['post_content']['from'] = ( empty( $atts['reply_to_name'] ) ? '[sitename]' : $atts['reply_to_name'] ) . ' <' . ( empty( $atts['reply_to'] ) ? '[admin_email]' : $atts['reply_to'] ) . '>'; + $new_notification['post_content']['from'] = ( empty( $atts['reply_to_name'] ) ? '[sitename]' : $atts['reply_to_name'] ) . ' <' . ( empty( $atts['reply_to'] ) ? '[admin_email]' : $atts['reply_to'] ) . '>'; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } } @@ -2385,7 +2385,7 @@ private static function migrate_autoresponder_to_action( $form_options, $form_id } if ( $reply_to || $reply_to_name ) { - $new_notification2['post_content']['from'] = ( empty( $reply_to_name ) ? '[sitename]' : $reply_to_name ) . ' <' . ( empty( $reply_to ) ? '[admin_email]' : $reply_to ) . '>'; + $new_notification2['post_content']['from'] = ( empty( $reply_to_name ) ? '[sitename]' : $reply_to_name ) . ' <' . ( empty( $reply_to ) ? '[admin_email]' : $reply_to ) . '>'; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } $notifications[] = $new_notification2; diff --git a/classes/models/FrmAddon.php b/classes/models/FrmAddon.php index b1704bf03e..2e20b6f33e 100644 --- a/classes/models/FrmAddon.php +++ b/classes/models/FrmAddon.php @@ -476,7 +476,7 @@ public function show_license_message( $file, $plugin ) { if ( empty( $this->license ) ) { /* translators: %1$s: Plugin name, %2$s: Start link HTML, %3$s: end link HTML */ - $message = sprintf( esc_html__( 'Your %1$s license key is missing. Please add it on the %2$slicenses page%3$s.', 'formidable' ), esc_html( $this->plugin_name ), '', '' ); + $message = sprintf( esc_html__( 'Your %1$s license key is missing. Please add it on the %2$slicenses page%3$s.', 'formidable' ), esc_html( $this->plugin_name ), '', '' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } else { $api = new FrmFormApi( $this->license ); $errors = $api->error_for_license(); @@ -493,9 +493,9 @@ public function show_license_message( $file, $plugin ) { $wp_list_table = _get_list_table( 'WP_Plugins_List_Table' ); $id = sanitize_title( $plugin['Name'] ) . '-next'; - echo '

    '; + echo '

    '; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong FrmAppHelper::kses_echo( $message, 'a' ); - echo ''; + echo ''; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong echo '

    '; } @@ -646,7 +646,7 @@ private function is_current_version( $transient ) { return true; } - return isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) && $transient->checked[ $this->plugin_folder ] === $transient->response[ $this->plugin_folder ]->new_version; + return isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) && $transient->checked[ $this->plugin_folder ] === $transient->response[ $this->plugin_folder ]->new_version; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } /** @@ -1009,7 +1009,7 @@ public function send_mothership_request( $action ) { if ( is_wp_error( $resp ) ) { $link = FrmAppHelper::admin_upgrade_link( 'api', 'knowledgebase/why-cant-i-activate-formidable-pro/' ); /* translators: %1$s: Start link HTML, %2$s: End link HTML */ - $message = sprintf( __( 'You had an error communicating with the Formidable API. %1$sClick here%2$s for more information.', 'formidable' ), '', '' ); + $message = sprintf( __( 'You had an error communicating with the Formidable API. %1$sClick here%2$s for more information.', 'formidable' ), '', '' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong $message .= ' ' . $resp->get_error_message(); } elseif ( 'error' === $body || is_wp_error( $body ) ) { $message = __( 'You had an HTTP error connecting to the Formidable API', 'formidable' ); diff --git a/classes/models/FrmEntry.php b/classes/models/FrmEntry.php index 30fffcf82a..7a1c30ca72 100644 --- a/classes/models/FrmEntry.php +++ b/classes/models/FrmEntry.php @@ -222,7 +222,9 @@ private static function should_check_for_unique_id_match() { /** * Convert form data to the actual value that would be saved into the database. - * This is important for the duplicate check as something like 'a:2:{s:5:"typed";s:0:"";s:6:"output";s:0:"";}' (a signature value) is actually an empty string and does not get saved. + * + * This is important for the duplicate check as something like 'a:2:{s:5:"typed";s:0:"";s:6:"output";s:0:"";}' + * (a signature value) is actually an empty string and does not get saved. * * @param array $filter_vals * @param int $entry_id @@ -623,7 +625,7 @@ public static function getAll( $where, $order_by = '', $limit = '', $meta = fals $entries = wp_cache_get( $cache_key, 'frm_entry' ); if ( false === $entries ) { - $fields = 'it.id, it.item_key, it.name, it.ip, it.form_id, it.post_id, it.user_id, it.parent_item_id, it.updated_by, it.created_at, it.updated_at, it.is_draft, it.description'; + $fields = 'it.id, it.item_key, it.name, it.ip, it.form_id, it.post_id, it.user_id, it.parent_item_id, it.updated_by, it.created_at, it.updated_at, it.is_draft, it.description'; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong $table = $wpdb->prefix . 'frm_items it '; if ( $inc_form ) { diff --git a/classes/models/FrmEntryMeta.php b/classes/models/FrmEntryMeta.php index 758986c1da..72413bcfa9 100644 --- a/classes/models/FrmEntryMeta.php +++ b/classes/models/FrmEntryMeta.php @@ -185,7 +185,7 @@ public static function update_entry_metas( $entry_id, $values ) { FrmDb::get_where_clause_and_values( $where ); // Delete any leftovers - $wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $wpdb->prefix . 'frm_item_metas ' . $where['where'], $where['values'] ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + $wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $wpdb->prefix . 'frm_item_metas ' . $where['where'], $where['values'] ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, SlevomatCodingStandard.Files.LineLength.LineTooLong self::clear_cache(); } @@ -393,7 +393,7 @@ public static function getAll( $where = array(), $order_by = '', $limit = '', $s FrmDb::prepend_and_or_where( ' WHERE ', $where ) . $order_by . $limit; $cache_key = 'all_' . FrmAppHelper::maybe_json_encode( $where ) . $order_by . $limit; - $results = FrmDb::check_cache( $cache_key, 'frm_entry', $query, ( $limit == ' LIMIT 1' ? 'get_row' : 'get_results' ) ); // phpcs:ignore Universal.Operators.StrictComparisons + $results = FrmDb::check_cache( $cache_key, 'frm_entry', $query, ( $limit == ' LIMIT 1' ? 'get_row' : 'get_results' ) ); // phpcs:ignore Universal.Operators.StrictComparisons, SlevomatCodingStandard.Files.LineLength.LineTooLong if ( ! $results || ! $stripslashes ) { return $results; @@ -492,7 +492,7 @@ private static function should_join_fields_table( &$where ) { * * @return void */ - private static function get_ids_query( $where, $order_by, $limit, $unique, $args, array &$query ) { // phpcs:ignore SlevomatCodingStandard.Complexity.Cognitive.ComplexityTooHigh + private static function get_ids_query( $where, $order_by, $limit, $unique, $args, array &$query ) { // phpcs:ignore SlevomatCodingStandard.Complexity.Cognitive.ComplexityTooHigh, SlevomatCodingStandard.Files.LineLength.LineTooLong global $wpdb; $query[] = 'SELECT'; $defaults = array( @@ -634,7 +634,7 @@ public static function search_entry_metas( $search, $field_id, $operator ) { $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 + $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, SlevomatCodingStandard.Files.LineLength.LineTooLong }//end if $results = $wpdb->get_col( $query, 0 ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared diff --git a/classes/models/FrmEntryValidate.php b/classes/models/FrmEntryValidate.php index ea62a1ed5e..1015233633 100644 --- a/classes/models/FrmEntryValidate.php +++ b/classes/models/FrmEntryValidate.php @@ -27,7 +27,7 @@ public static function validate( $values, $exclude = false ) { return $errors; } - if ( FrmAppHelper::is_admin() && is_user_logged_in() && ( ! isset( $values[ 'frm_submit_entry_' . $values['form_id'] ] ) || ! wp_verify_nonce( $values[ 'frm_submit_entry_' . $values['form_id'] ], 'frm_submit_entry_nonce' ) ) ) { + if ( FrmAppHelper::is_admin() && is_user_logged_in() && ( ! isset( $values[ 'frm_submit_entry_' . $values['form_id'] ] ) || ! wp_verify_nonce( $values[ 'frm_submit_entry_' . $values['form_id'] ], 'frm_submit_entry_nonce' ) ) ) { // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong $frm_settings = FrmAppHelper::get_settings(); $errors['form'] = $frm_settings->admin_permission; } diff --git a/classes/models/FrmField.php b/classes/models/FrmField.php index 77bcf1da5a..401b48b982 100644 --- a/classes/models/FrmField.php +++ b/classes/models/FrmField.php @@ -137,35 +137,35 @@ public static function pro_field_selection() { 'date' => array( 'name' => __( 'Date', 'formidable' ), 'icon' => 'frmfont frm_calendar2_icon', - 'message' => __( 'Capture exact calendar dates effortlessly with a sleek pop-up date picker, ensuring clarity and consistency for scheduling, tracking deadlines, and more.', 'formidable' ), + 'message' => __( 'Capture exact calendar dates effortlessly with a sleek pop-up date picker, ensuring clarity and consistency for scheduling, tracking deadlines, and more.', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'upsell_image' => $upsell_images_url . 'date-field-preview.webp', 'learn-more' => 'date', ), 'time' => array( 'name' => __( 'Time', 'formidable' ), 'icon' => 'frmfont frm_clock_icon', - 'message' => __( 'Precisely log important moments with an intuitive time selection tool, perfect for managing events, availability, or operational hours.', 'formidable' ), + 'message' => __( 'Precisely log important moments with an intuitive time selection tool, perfect for managing events, availability, or operational hours.', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'upsell_image' => $upsell_images_url . 'time-field-preview.webp', 'learn-more' => 'time', ), 'scale' => array( 'name' => __( 'Scale', 'formidable' ), 'icon' => 'frmfont frm_linear_scale_icon', - 'message' => esc_html__( 'Easily measure satisfaction or quantity using a simple, clear numerical scale, giving you fast, quantifiable insights into user feedback.', 'formidable' ), + 'message' => esc_html__( 'Easily measure satisfaction or quantity using a simple, clear numerical scale, giving you fast, quantifiable insights into user feedback.', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'upsell_image' => $upsell_images_url . 'scale-field-preview.webp', 'learn-more' => 'scale', ), 'star' => array( 'name' => __( 'Star Rating', 'formidable' ), 'icon' => 'frmfont frm_star2_icon', - 'message' => esc_html__( 'Capture instant, appealing feedback with a familiar visual star system, providing immediate and engaging quality assessments from your users.', 'formidable' ), + 'message' => esc_html__( 'Capture instant, appealing feedback with a familiar visual star system, providing immediate and engaging quality assessments from your users.', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'upsell_image' => $upsell_images_url . 'star-field-preview.webp', 'learn-more' => 'star-ratings', ), 'range' => array( 'name' => __( 'Slider', 'formidable' ), 'icon' => 'frmfont frm_code_commit_icon', - 'message' => esc_html__( 'Let users quickly select values within a range using a dynamic, interactive slider, creating a modern and enjoyable data input experience.', 'formidable' ), + 'message' => esc_html__( 'Let users quickly select values within a range using a dynamic, interactive slider, creating a modern and enjoyable data input experience.', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'upsell_image' => $upsell_images_url . 'slider-field-preview.webp', 'learn-more' => 'slider', ), @@ -193,7 +193,7 @@ public static function pro_field_selection() { 'divider|repeat' => array( 'name' => __( 'Repeater', 'formidable' ), 'icon' => 'frmfont frm_refresh_icon', - 'message' => esc_html__( 'Allow users to add rows of fields dynamically as needed (like for multiple attendees or items), making complex data entry flexible and intuitive.', 'formidable' ), + 'message' => esc_html__( 'Allow users to add rows of fields dynamically as needed (like for multiple attendees or items), making complex data entry flexible and intuitive.', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'upsell_image' => $upsell_images_url . 'repeater-field-preview.webp', 'learn-more' => 'repeatable-section', ), @@ -204,21 +204,21 @@ public static function pro_field_selection() { 'divider' => array( 'name' => __( 'Section', 'formidable' ), 'icon' => 'frmfont frm_header_icon', - 'message' => esc_html__( 'Enhance the user experience and improve completion rates by dividing long surveys into clean, manageable steps with distinct pages.', 'formidable' ), + 'message' => esc_html__( 'Enhance the user experience and improve completion rates by dividing long surveys into clean, manageable steps with distinct pages.', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'upsell_image' => $upsell_images_url . 'section-field-preview.webp', 'learn-more' => 'section-heading', ), 'break' => array( 'name' => __( 'Page Break', 'formidable' ), 'icon' => 'frmfont frm_page_break_icon', - 'message' => esc_html__( 'Enhance the user experience and improve completion rates by dividing long surveys into clean, manageable steps with distinct pages.', 'formidable' ), + 'message' => esc_html__( 'Enhance the user experience and improve completion rates by dividing long surveys into clean, manageable steps with distinct pages.', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'upsell_image' => $upsell_images_url . 'page-break-field-preview.webp', 'learn-more' => 'page-breaks', ), 'form' => array( 'name' => __( 'Embed Form', 'formidable' ), 'icon' => 'frmfont frm_file_text2_icon', - 'message' => esc_html__( 'Seamlessly integrate other existing forms or external content directly inside your current form, creating powerful, interconnected workflows.', 'formidable' ), + 'message' => esc_html__( 'Seamlessly integrate other existing forms or external content directly inside your current form, creating powerful, interconnected workflows.', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'upsell_image' => $upsell_images_url . 'embed-form-field-preview.webp', 'learn-more' => 'embed-form', ), @@ -226,7 +226,7 @@ public static function pro_field_selection() { 'name' => __( 'Likert Scale', 'formidable' ), 'icon' => 'frmfont frm_likert_scale frm_show_upgrade', 'addon' => 'surveys', - 'message' => esc_html__( 'Get nuanced, detailed opinions using standardized agreement scales, unlocking deeper insights beyond simple yes/no answers.', 'formidable' ), + 'message' => esc_html__( 'Get nuanced, detailed opinions using standardized agreement scales, unlocking deeper insights beyond simple yes/no answers.', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'upsell_image' => $upsell_images_url . 'likert-field-preview.webp', 'learn-more' => 'likert-scale', ), @@ -234,21 +234,21 @@ public static function pro_field_selection() { 'name' => __( 'NPS', 'formidable' ), 'icon' => 'frmfont frm_nps frm_show_upgrade', 'addon' => 'surveys', - 'message' => esc_html__( 'Directly measure customer loyalty with the industry-standard Net Promoter ScoreĀ® field, giving you a single, vital metric for business growth.', 'formidable' ), + 'message' => esc_html__( 'Directly measure customer loyalty with the industry-standard Net Promoter ScoreĀ® field, giving you a single, vital metric for business growth.', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'upsell_image' => $upsell_images_url . 'nps-field-preview.webp', 'learn-more' => 'net-promoter-score', ), 'password' => array( 'name' => __( 'Password', 'formidable' ), 'icon' => 'frmfont frm_lock_closed2_icon', - 'message' => esc_html__( 'Confidently collect sensitive credentials or create secure sections with a dedicated field that masks input for privacy and security.', 'formidable' ), + 'message' => esc_html__( 'Confidently collect sensitive credentials or create secure sections with a dedicated field that masks input for privacy and security.', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'upsell_image' => $upsell_images_url . 'password-field-preview.webp', 'learn-more' => 'password-2', ), 'tag' => array( 'name' => __( 'Tags', 'formidable' ), 'icon' => 'frmfont frm_price_tags2_icon', - 'message' => esc_html__( 'Facilitate easy categorization and analysis by letting users select or create multiple relevant keywords or labels for their entry.', 'formidable' ), + 'message' => esc_html__( 'Facilitate easy categorization and analysis by letting users select or create multiple relevant keywords or labels for their entry.', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'upsell_image' => $upsell_images_url . 'tags-field-preview.webp', 'learn-more' => 'tags', ), @@ -261,14 +261,14 @@ public static function pro_field_selection() { 'address' => array( 'name' => __( 'Address', 'formidable' ), 'icon' => 'frmfont frm_location2_icon', - 'message' => esc_html__( 'Instantly capture location information, simplifying logistics and contact collection. (Or go further with our Geolocation add-on!)', 'formidable' ), + 'message' => esc_html__( 'Instantly capture location information, simplifying logistics and contact collection. (Or go further with our Geolocation add-on!)', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'upsell_image' => $upsell_images_url . 'address-field-preview.webp', 'learn-more' => 'address', ), 'summary' => array( 'name' => __( 'Summary', 'formidable' ), 'icon' => 'frmfont frm_file_text3_icon', - 'message' => __( 'Provide users with a clean, final review of all their entered data before submission, reducing errors and improving data quality.', 'formidable' ), + 'message' => __( 'Provide users with a clean, final review of all their entered data before submission, reducing errors and improving data quality.', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'upsell_image' => $upsell_images_url . 'summary-field-preview.webp', 'learn-more' => 'summary-review-before-submit', ), @@ -294,7 +294,7 @@ public static function pro_field_selection() { 'require' => 'Simply Schedule Appointments', 'message' => sprintf( /* translators: %1$s: Link opening HTML, %2$s: Link tag closing */ - esc_html__( 'Appointment fields are an integration with %1$sSimply Schedule Appointments%2$s. Get started now to schedule appointments directly from your forms.', 'formidable' ), + esc_html__( 'Appointment fields are an integration with %1$sSimply Schedule Appointments%2$s. Get started now to schedule appointments directly from your forms.', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong '', '' ), @@ -306,7 +306,7 @@ public static function pro_field_selection() { 'name' => __( 'Product', 'formidable' ), 'icon' => 'frmfont frm_product2_icon', 'section' => 'pricing', - 'message' => __( 'Turn your form into a simple storefront by adding fields to list products, choose quantities, and calculate totals, enabling direct sales.', 'formidable' ), + 'message' => __( 'Turn your form into a simple storefront by adding fields to list products, choose quantities, and calculate totals, enabling direct sales.', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'upsell_image' => $upsell_images_url . 'product-field-preview.webp', 'learn-more' => 'features/pricing-fields', ), @@ -314,7 +314,7 @@ public static function pro_field_selection() { 'name' => __( 'Quantity', 'formidable' ), 'icon' => 'frmfont frm_quantity_icon', 'section' => 'pricing', - 'message' => __( 'Turn your form into a simple storefront by adding fields to list products, choose quantities, and calculate totals, enabling direct sales.', 'formidable' ), + 'message' => __( 'Turn your form into a simple storefront by adding fields to list products, choose quantities, and calculate totals, enabling direct sales.', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'upsell_image' => $upsell_images_url . 'quantity-field-preview.webp', 'learn-more' => 'features/pricing-fields', ), @@ -322,7 +322,7 @@ public static function pro_field_selection() { 'name' => __( 'Total', 'formidable' ), 'icon' => 'frmfont frm_total2_icon', 'section' => 'pricing', - 'message' => __( 'Turn your form into a simple storefront by adding fields to list products, choose quantities, and calculate totals, enabling direct sales.', 'formidable' ), + 'message' => __( 'Turn your form into a simple storefront by adding fields to list products, choose quantities, and calculate totals, enabling direct sales.', 'formidable' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'upsell_image' => $upsell_images_url . 'total-field-preview.webp', 'learn-more' => 'features/pricing-fields', ), @@ -784,7 +784,7 @@ public static function delete_form_transient( $form_id ) { delete_transient( 'frm_form_fields_' . $form_id . 'excludeexclude' ); global $wpdb; - $wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE %s OR option_name LIKE %s OR option_name LIKE %s OR option_name LIKE %s', '_transient_timeout_frm_form_fields_' . $form_id . 'ex%', '_transient_frm_form_fields_' . $form_id . 'ex%', '_transient_timeout_frm_form_fields_' . $form_id . 'in%', '_transient_frm_form_fields_' . $form_id . 'in%' ) ); + $wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE %s OR option_name LIKE %s OR option_name LIKE %s OR option_name LIKE %s', '_transient_timeout_frm_form_fields_' . $form_id . 'ex%', '_transient_frm_form_fields_' . $form_id . 'ex%', '_transient_timeout_frm_form_fields_' . $form_id . 'in%', '_transient_frm_form_fields_' . $form_id . 'in%' ) ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong FrmDb::cache_delete_group( 'frm_field' ); diff --git a/classes/models/FrmForm.php b/classes/models/FrmForm.php index 55b2608f91..c1a95a684c 100644 --- a/classes/models/FrmForm.php +++ b/classes/models/FrmForm.php @@ -313,7 +313,7 @@ public static function set_update_options( $new_values, $values, $args = array() $options['custom_style'] = $values['options']['custom_style'] ?? 0; $options['before_html'] = $values['options']['before_html'] ?? FrmFormsHelper::get_default_html( 'before' ); $options['after_html'] = $values['options']['after_html'] ?? FrmFormsHelper::get_default_html( 'after' ); - $options['submit_html'] = isset( $values['options']['submit_html'] ) && '' !== $values['options']['submit_html'] ? $values['options']['submit_html'] : FrmFormsHelper::get_default_html( 'submit' ); + $options['submit_html'] = isset( $values['options']['submit_html'] ) && '' !== $values['options']['submit_html'] ? $values['options']['submit_html'] : FrmFormsHelper::get_default_html( 'submit' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong /** * Allows modifying form options before updating or creating. @@ -357,7 +357,7 @@ public static function update_fields( $id, $values ) { // phpcs:ignore SlevomatC $existing_keys = array_keys( $values['item_meta'] ); foreach ( $all_fields as $fid ) { - // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict + // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict, SlevomatCodingStandard.Files.LineLength.LineTooLong if ( ! in_array( $fid->id, $existing_keys ) && ( isset( $values['frm_fields_submitted'] ) && in_array( $fid->id, $values['frm_fields_submitted'] ) ) || isset( $values['options'] ) ) { $values['item_meta'][ $fid->id ] = ''; } @@ -405,7 +405,7 @@ public static function update_fields( $id, $values ) { // phpcs:ignore SlevomatC 'default_value' => isset( $values[ 'default_value_' . $field_id ] ) ? FrmAppHelper::maybe_json_encode( $values[ 'default_value_' . $field_id ] ) : '', ); - if ( ! FrmAppHelper::allow_unfiltered_html() && isset( $values['field_options'][ 'options_' . $field_id ] ) && is_array( $values['field_options'][ 'options_' . $field_id ] ) ) { + if ( ! FrmAppHelper::allow_unfiltered_html() && isset( $values['field_options'][ 'options_' . $field_id ] ) && is_array( $values['field_options'][ 'options_' . $field_id ] ) ) { // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong foreach ( $values['field_options'][ 'options_' . $field_id ] as $option_key => $option ) { if ( is_array( $option ) ) { foreach ( $option as $key => $item ) { @@ -632,7 +632,7 @@ public static function set_status( $id, $status ) { FrmDb::get_where_clause_and_values( $where ); array_unshift( $where['values'], $status ); - $query_results = $wpdb->query( $wpdb->prepare( 'UPDATE ' . $wpdb->prefix . 'frm_forms SET status = %s ' . $where['where'], $where['values'] ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + $query_results = $wpdb->query( $wpdb->prepare( 'UPDATE ' . $wpdb->prefix . 'frm_forms SET status = %s ' . $where['where'], $where['values'] ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, SlevomatCodingStandard.Files.LineLength.LineTooLong } else { $query_results = $wpdb->update( $wpdb->prefix . 'frm_forms', array( 'status' => $status ), array( 'id' => $id ) ); $wpdb->update( $wpdb->prefix . 'frm_forms', array( 'status' => $status ), array( 'parent_form_id' => $id ) ); @@ -723,7 +723,7 @@ public static function destroy( $id ) { } // Disconnect the fields from this form - $wpdb->query( $wpdb->prepare( 'DELETE fi FROM ' . $wpdb->prefix . 'frm_fields AS fi LEFT JOIN ' . $wpdb->prefix . 'frm_forms fr ON (fi.form_id = fr.id) WHERE fi.form_id=%d OR parent_form_id=%d', $id, $id ) ); + $wpdb->query( $wpdb->prepare( 'DELETE fi FROM ' . $wpdb->prefix . 'frm_fields AS fi LEFT JOIN ' . $wpdb->prefix . 'frm_forms fr ON (fi.form_id = fr.id) WHERE fi.form_id=%d OR parent_form_id=%d', $id, $id ) ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong $query_results = $wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $wpdb->prefix . 'frm_forms WHERE id=%d OR parent_form_id=%d', $id, $id ) ); @@ -930,7 +930,7 @@ public static function getAll( $where = array(), $order_by = '', $limit = '' ) { global $wpdb; // The query has already been prepared if this is not an array. - $query = 'SELECT * FROM ' . $wpdb->prefix . 'frm_forms' . FrmDb::prepend_and_or_where( ' WHERE ', $where ) . FrmDb::esc_order( $order_by ) . FrmDb::esc_limit( $limit ); + $query = 'SELECT * FROM ' . $wpdb->prefix . 'frm_forms' . FrmDb::prepend_and_or_where( ' WHERE ', $where ) . FrmDb::esc_order( $order_by ) . FrmDb::esc_limit( $limit ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong $results = $wpdb->get_results( $query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared } diff --git a/classes/models/FrmFormAction.php b/classes/models/FrmFormAction.php index 3772271039..290ca45393 100644 --- a/classes/models/FrmFormAction.php +++ b/classes/models/FrmFormAction.php @@ -998,7 +998,7 @@ public static function trigger_labels() { public function render_conditional_logic_call_to_action() { ?>

    - +

    diff --git a/classes/models/FrmInbox.php b/classes/models/FrmInbox.php index 9ae0c7d6e5..0a8adeac0c 100644 --- a/classes/models/FrmInbox.php +++ b/classes/models/FrmInbox.php @@ -171,7 +171,7 @@ private function clean_messages() { foreach ( self::$messages as $t => $message ) { $read = ! empty( $message['read'] ) && isset( $message['read'][ get_current_user_id() ] ) && $message['read'][ get_current_user_id() ] < strtotime( '-1 month' ); - $dismissed = ! empty( $message['dismissed'] ) && isset( $message['dismissed'][ get_current_user_id() ] ) && $message['dismissed'][ get_current_user_id() ] < strtotime( '-1 week' ); + $dismissed = ! empty( $message['dismissed'] ) && isset( $message['dismissed'][ get_current_user_id() ] ) && $message['dismissed'][ get_current_user_id() ] < strtotime( '-1 week' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong if ( $read || $dismissed || ! $this->within_valid_timeframe( $message ) ) { unset( self::$messages[ $t ] ); diff --git a/classes/models/FrmMigrate.php b/classes/models/FrmMigrate.php index 84dff80669..17db77aeee 100644 --- a/classes/models/FrmMigrate.php +++ b/classes/models/FrmMigrate.php @@ -152,7 +152,7 @@ private function check_that_tables_exist() { $message = array( 'key' => 'failed-to-create-tables', 'subject' => 'Something went wrong setting up the database', - 'message' => 'For steps to continue, see our documentation. If you need assistance, we recommend that you reach out to your hosting provider. Then click here to try again.', + 'message' => 'For steps to continue, see our documentation. If you need assistance, we recommend that you reach out to your hosting provider. Then click here to try again.', // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'cta' => 'Learn More', 'type' => 'error', ); @@ -432,7 +432,7 @@ public function uninstall() { remove_action( 'before_delete_post', 'FrmProDisplaysController::before_delete_post' ); remove_action( 'deleted_post', 'FrmProEntriesController::delete_entry' ); - $post_ids = $wpdb->get_col( $wpdb->prepare( 'SELECT ID FROM ' . $wpdb->posts . ' WHERE post_type in (%s, %s, %s)', FrmFormActionsController::$action_post_type, FrmStylesController::$post_type, 'frm_display' ) ); + $post_ids = $wpdb->get_col( $wpdb->prepare( 'SELECT ID FROM ' . $wpdb->posts . ' WHERE post_type in (%s, %s, %s)', FrmFormActionsController::$action_post_type, FrmStylesController::$post_type, 'frm_display' ) ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong foreach ( $post_ids as $post_id ) { // Delete's each post. @@ -446,7 +446,7 @@ public function uninstall() { delete_transient( 'frmpro_options' ); delete_transient( FrmOnboardingWizardController::TRANSIENT_NAME ); - $wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE %s OR option_name LIKE %s', '_transient_timeout_frm_form_fields_%', '_transient_frm_form_fields_%' ) ); + $wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE %s OR option_name LIKE %s', '_transient_timeout_frm_form_fields_%', '_transient_frm_form_fields_%' ) ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong do_action( 'frm_after_uninstall' ); diff --git a/classes/models/FrmPluginSearch.php b/classes/models/FrmPluginSearch.php index f90cc6c40f..38c4e63e4b 100644 --- a/classes/models/FrmPluginSearch.php +++ b/classes/models/FrmPluginSearch.php @@ -322,7 +322,7 @@ public function insert_related_links( $links, $plugin ) { ), admin_url( 'plugins.php' ) ); - $links['frm_get_started'] = '' . __( 'Activate', 'formidable' ) . ''; + $links['frm_get_started'] = '' . __( 'Activate', 'formidable' ) . ''; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } } elseif ( ! $is_active && isset( $plugin['url'] ) ) { // Go to the add-ons page to install. diff --git a/classes/models/FrmRecaptchaSettings.php b/classes/models/FrmRecaptchaSettings.php index 2edc2570a0..b189de872f 100644 --- a/classes/models/FrmRecaptchaSettings.php +++ b/classes/models/FrmRecaptchaSettings.php @@ -50,7 +50,7 @@ public function get_documentation_url() { * @return string */ public function get_site_key_tooltip() { - return __( 'reCAPTCHA is a free, accessible CAPTCHA service that helps to digitize books while blocking spam on your blog. reCAPTCHA asks commenters to retype two words scanned from a book to prove that they are a human. This verifies that they are not a spambot.', 'formidable' ); + return __( 'reCAPTCHA is a free, accessible CAPTCHA service that helps to digitize books while blocking spam on your blog. reCAPTCHA asks commenters to retype two words scanned from a book to prove that they are a human. This verifies that they are not a spambot.', 'formidable' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } /** diff --git a/classes/models/FrmReviews.php b/classes/models/FrmReviews.php index a43b42bd90..8093a2c841 100644 --- a/classes/models/FrmReviews.php +++ b/classes/models/FrmReviews.php @@ -157,11 +157,11 @@ private function add_to_inbox( $title, $name, $asked ) { $message->add_message( array( 'key' => $key, - 'message' => __( 'If you are enjoying Formidable, could you do me a BIG favor and give us a review to help me grow my little business and boost our motivation?', 'formidable' ) . '
    ' . + 'message' => __( 'If you are enjoying Formidable, could you do me a BIG favor and give us a review to help me grow my little business and boost our motivation?', 'formidable' ) . '
    ' . // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong '- Steph Wells
    ' . '' . esc_html__( 'Co-Founder and CTO of Formidable Forms', 'formidable' ) . '', 'subject' => str_replace( $name, '', $title ), - 'cta' => '' . + 'cta' => '' . // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong esc_html__( 'Ok, you deserve it', 'formidable' ) . '', 'type' => 'feedback', ) diff --git a/classes/models/FrmSolution.php b/classes/models/FrmSolution.php index ad9f6d9efb..68aac5deec 100644 --- a/classes/models/FrmSolution.php +++ b/classes/models/FrmSolution.php @@ -473,7 +473,7 @@ protected function step_top( $step ) { ); } else { ?> - + @@ -579,7 +579,7 @@ protected function show_app_install( $step ) { if ( ! $has_file ) { echo '

    ' . esc_html__( 'We didn\'t find anything to import. Please contact our team.', 'formidable' ) . '

    '; } elseif ( ! isset( $addons[ $id ]['beta']['package'] ) ) { - echo '

    ' . esc_html__( 'Looks like you may not have a current subscription for this solution. Please check your account.', 'formidable' ) . '

    '; + echo '

    ' . esc_html__( 'Looks like you may not have a current subscription for this solution. Please check your account.', 'formidable' ) . '

    '; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } else { $xml = $addons[ $id ]['beta']['package']; @@ -692,7 +692,7 @@ protected function show_page_options() { - +

    sanitize_post_content( wp_unslash( $_POST['frm_style_setting']['post_content'] ) ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing + $new_instance['post_content'] = isset( $_POST['frm_style_setting']['post_content'] ) ? $this->sanitize_post_content( wp_unslash( $_POST['frm_style_setting']['post_content'] ) ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing, SlevomatCodingStandard.Files.LineLength.LineTooLong $new_instance['post_content']['custom_css'] = $custom_css; unset( $custom_css ); @@ -522,7 +522,7 @@ public function get_all( $orderby = 'title', $order = 'ASC', $limit = 99 ) { if ( ! $temp_styles ) { global $wpdb; // make sure there wasn't a conflict with the query - $query = $wpdb->prepare( 'SELECT * FROM ' . $wpdb->posts . ' WHERE post_type=%s AND post_status=%s ORDER BY post_title ASC LIMIT 99', FrmStylesController::$post_type, 'publish' ); + $query = $wpdb->prepare( 'SELECT * FROM ' . $wpdb->posts . ' WHERE post_type=%s AND post_status=%s ORDER BY post_title ASC LIMIT 99', FrmStylesController::$post_type, 'publish' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong $temp_styles = FrmDb::check_cache( 'frm_backup_style_check', 'frm_styles', $query, 'get_results' ); if ( ! $temp_styles ) { @@ -602,7 +602,7 @@ public function override_defaults( $settings ) { return $settings; } - $settings['line_height'] = ! isset( $settings['field_height'] ) || $settings['field_height'] == '' || $settings['field_height'] === 'auto' ? 'normal' : $settings['field_height']; // phpcs:ignore Universal.Operators.StrictComparisons + $settings['line_height'] = ! isset( $settings['field_height'] ) || $settings['field_height'] == '' || $settings['field_height'] === 'auto' ? 'normal' : $settings['field_height']; // phpcs:ignore Universal.Operators.StrictComparisons, SlevomatCodingStandard.Files.LineLength.LineTooLong if ( ! isset( $settings['form_desc_size'] ) && isset( $settings['description_font_size'] ) ) { $settings['form_desc_size'] = $settings['description_font_size']; diff --git a/classes/models/FrmTurnstileSettings.php b/classes/models/FrmTurnstileSettings.php index 8f411bba51..a728d61511 100644 --- a/classes/models/FrmTurnstileSettings.php +++ b/classes/models/FrmTurnstileSettings.php @@ -61,7 +61,7 @@ public function get_settings_prefix() { * @return string */ public function get_site_key_tooltip() { - return __( 'Turnstile is a free tool to replace CAPTCHAs. Turnstile delivers frustration-free, CAPTCHA-free web experiences to website visitors - with just a simple snippet of free code. Moreover, Turnstile stops abuse and confirms visitors are real without the data privacy concerns or awful user experience of CAPTCHAs.', 'formidable' ); + return __( 'Turnstile is a free tool to replace CAPTCHAs. Turnstile delivers frustration-free, CAPTCHA-free web experiences to website visitors - with just a simple snippet of free code. Moreover, Turnstile stops abuse and confirms visitors are real without the data privacy concerns or awful user experience of CAPTCHAs.', 'formidable' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } /** diff --git a/classes/models/fields/FrmFieldType.php b/classes/models/fields/FrmFieldType.php index d65b7dba5d..21e28c25b9 100644 --- a/classes/models/fields/FrmFieldType.php +++ b/classes/models/fields/FrmFieldType.php @@ -1217,7 +1217,7 @@ public function front_field_input( $args, $shortcode_atts ) { $this->add_aria_description( $args, $input_html ); $this->add_extra_html_atts( $args, $input_html ); - return ''; + return ''; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } /** diff --git a/classes/models/fields/FrmFieldUserID.php b/classes/models/fields/FrmFieldUserID.php index 18b18c9185..1ec0b2c0b8 100644 --- a/classes/models/fields/FrmFieldUserID.php +++ b/classes/models/fields/FrmFieldUserID.php @@ -52,7 +52,7 @@ public function prepare_field_html( $args ) { $args = $this->fill_display_field_values( $args ); $value = $this->get_field_value( $args ); - echo '' . "\n"; + echo '' . "\n"; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } /** diff --git a/phpcs.xml b/phpcs.xml index afc84ccdd4..104498c0c3 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -113,59 +113,7 @@ views/* - tests/phpunit/* - helpers/FrmAppHelper.php - fields/FrmFieldUserID.php - controllers/FrmStylesController.php - fields/FrmFieldType.php - helpers/FrmStrpLiteAppHelper.php - helpers/FrmFormsListHelper.php - controllers/FrmSMTPController.php - controllers/FrmInboxController.php - models/FrmEntry.php - controllers/FrmSettingsController.php - controllers/FrmAddonsController.php - controllers/FrmAppController.php - controllers/FrmDashboardController.php - controllers/FrmEntriesController.php - controllers/FrmFormActionsController.php - controllers/FrmFormsController.php - controllers/FrmOnboardingWizardController.php - controllers/FrmXMLController.php - helpers/FrmCSVExportHelper.php - helpers/FrmEmailSummaryHelper.php - helpers/FrmEntriesHelper.php - helpers/FrmEntriesListHelper.php - helpers/FrmFieldsHelper.php - helpers/FrmFormMigratorsHelper.php - helpers/FrmFormsHelper.php - helpers/FrmFormTemplatesHelper.php - helpers/FrmListHelper.php - helpers/FrmStylesCardHelper.php - helpers/FrmStylesHelper.php - helpers/FrmXMLHelper.php - models/FrmAddon.php - models/FrmEntryMeta.php - models/FrmEntryValidate.php - models/FrmField.php - models/FrmForm.php - models/FrmFormAction.php - models/FrmInbox.php - models/FrmMigrate.php - models/FrmPluginSearch.php - models/FrmRecaptchaSettings.php - models/FrmReviews.php - models/FrmSettings.php - models/FrmSolution.php - models/FrmStyle.php - models/FrmTurnstileSettings.php - widgets/FrmShowForm.php - css/_single_theme.css.php - css/custom_theme.css.php - stripe/helpers/FrmStrpLiteConnectHelper.php - stripe/helpers/FrmTransLiteListHelper.php - stripe/models/FrmStrpLiteAuth.php - stripe/models/FrmTransLiteAction.php + css/* diff --git a/stripe/helpers/FrmStrpLiteAppHelper.php b/stripe/helpers/FrmStrpLiteAppHelper.php index b6d2b34c95..8e15c07051 100644 --- a/stripe/helpers/FrmStrpLiteAppHelper.php +++ b/stripe/helpers/FrmStrpLiteAppHelper.php @@ -143,7 +143,7 @@ public static function not_connected_warning() { ', '', '', '' ); + printf( esc_html__( 'Credit Cards will not work without %1$sconnecting Stripe%2$s or %3$sconnecting Square%4$s first.', 'formidable' ), '', '', '', '' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong ?>
    diff --git a/stripe/helpers/FrmStrpLiteConnectHelper.php b/stripe/helpers/FrmStrpLiteConnectHelper.php index 47849dd675..bfeb33c4f8 100644 --- a/stripe/helpers/FrmStrpLiteConnectHelper.php +++ b/stripe/helpers/FrmStrpLiteConnectHelper.php @@ -657,7 +657,7 @@ private static function render_settings() { */ public static function stripe_icon() { ?> - + ' . esc_html__( 'Edit', 'formidable' ) . ''; } - $actions['delete'] = '' . esc_html__( 'Delete', 'formidable' ) . ''; + $actions['delete'] = '' . esc_html__( 'Delete', 'formidable' ) . ''; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong return $actions; } diff --git a/stripe/models/FrmStrpLiteAuth.php b/stripe/models/FrmStrpLiteAuth.php index c327a31f5e..e415b861be 100644 --- a/stripe/models/FrmStrpLiteAuth.php +++ b/stripe/models/FrmStrpLiteAuth.php @@ -271,7 +271,8 @@ public static function get_payment_intents( $name ) { return array(); } - $intents = $_POST[ $name ]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing + $intents = $_POST[ $name ]; FrmAppHelper::sanitize_value( 'sanitize_text_field', $intents ); return $intents; } @@ -290,7 +291,8 @@ public static function update_intent_ajax() { wp_die(); } - $form = json_decode( stripslashes( $_POST['form'] ), true ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + $form = json_decode( stripslashes( $_POST['form'] ), true ); if ( ! is_array( $form ) ) { wp_die(); diff --git a/stripe/models/FrmTransLiteAction.php b/stripe/models/FrmTransLiteAction.php index a59aef15b3..0b95315b98 100755 --- a/stripe/models/FrmTransLiteAction.php +++ b/stripe/models/FrmTransLiteAction.php @@ -179,6 +179,7 @@ public function show_fields_dropdown( $form_atts, $field_atts ) { $has_field = false; ?> + form_id . ' duplicated from field ' . $original_field->id ); + $this->assertNotFalse( strpos( $response, 'form_id . ' duplicated from field ' . $original_field->id ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong global $frm_duplicate_ids; $this->assertNotEmpty( $frm_duplicate_ids ); diff --git a/tests/phpunit/forms/test_FrmForm.php b/tests/phpunit/forms/test_FrmForm.php index 8ec56d20cd..5069fbfde9 100644 --- a/tests/phpunit/forms/test_FrmForm.php +++ b/tests/phpunit/forms/test_FrmForm.php @@ -45,7 +45,7 @@ protected function _check_if_child_fields_duplicate( $old_child_forms, $new_chil $new_child_form_fields = FrmField::get_all_for_form( $new_child_form->id ); // Check if there are the same number of child form fields in the duplicated child form - $this->assertEquals( count( $old_child_form_fields ), count( $new_child_form_fields ), 'When a form is duplicated, the fields in the repeating section are not duplicated correctly.' ); + $this->assertEquals( count( $old_child_form_fields ), count( $new_child_form_fields ), 'When a form is duplicated, the fields in the repeating section are not duplicated correctly.' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } /** @@ -150,7 +150,7 @@ public function test_sanitize_field_opt() { $this->assert_sanitize_field_opt_calc( $safe_less_than_comparison, '50< 100 ? 1 : 0' ); $original_value = '50>100 ? 1 : 0'; - $this->assert_sanitize_field_opt_calc( $original_value, $original_value, 'greater than comparisons do not get stripped, so they do not get any additional string padding.' ); + $this->assert_sanitize_field_opt_calc( $original_value, $original_value, 'greater than comparisons do not get stripped, so they do not get any additional string padding.' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong $original_value = '50 >100 ? 1 : 0'; $this->assert_sanitize_field_opt_calc( $original_value, $original_value ); diff --git a/tests/phpunit/misc/test_FrmAppController.php b/tests/phpunit/misc/test_FrmAppController.php index ce970c4dc4..aed23cfff2 100644 --- a/tests/phpunit/misc/test_FrmAppController.php +++ b/tests/phpunit/misc/test_FrmAppController.php @@ -169,7 +169,7 @@ public function test_compare_for_update() { 'new_plugin_version' => FrmAppHelper::plugin_version(), ) ); - $this->assertEquals( $test['expected'], $upgrade, $test['version'] . ' db: ' . $test['db'] . ' => ' . $current . ( $upgrade ? ' needs no update ' : ' needs an update' ) . ' from ' . $option ); + $this->assertEquals( $test['expected'], $upgrade, $test['version'] . ' db: ' . $test['db'] . ' => ' . $current . ( $upgrade ? ' needs no update ' : ' needs an update' ) . ' from ' . $option ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } } diff --git a/tests/phpunit/misc/test_FrmAppHelper.php b/tests/phpunit/misc/test_FrmAppHelper.php index 1cf2fd89bf..096e371ca4 100644 --- a/tests/phpunit/misc/test_FrmAppHelper.php +++ b/tests/phpunit/misc/test_FrmAppHelper.php @@ -363,7 +363,7 @@ public function test_kses_icon() { $icon = ''; $this->assertEquals( $icon, FrmAppHelper::kses_icon( $icon ) ); - $icon = ''; + $icon = ''; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong $this->assertEquals( $icon, FrmAppHelper::kses_icon( $icon ) ); $icon = ''; @@ -741,7 +741,7 @@ public function test_truncate() { 'expected' => 'This is my...', ), array( - 'string' => htmlentities( '' ), + 'string' => htmlentities( '' ), // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong 'length' => 60, 'expected' => '<img src="data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAABkAA', ), diff --git a/tests/phpunit/misc/test_FrmMisc.php b/tests/phpunit/misc/test_FrmMisc.php index f87be119d3..ae4024ddc9 100644 --- a/tests/phpunit/misc/test_FrmMisc.php +++ b/tests/phpunit/misc/test_FrmMisc.php @@ -34,9 +34,9 @@ public function test_frm_class_autoloader() { public function test_no_references_to_map_files() { $popper_js = file_get_contents( FrmAppHelper::plugin_path() . '/js/popper.min.js' ); - $this->assertStringNotContainsString( 'sourceMappingURL=popper.min.js.map', $popper_js, 'We do not want the popper JS file to include a source map reference. Since the sourcem ap is not included, this shows 404 errors in Safari.' ); + $this->assertStringNotContainsString( 'sourceMappingURL=popper.min.js.map', $popper_js, 'We do not want the popper JS file to include a source map reference. Since the sourcem ap is not included, this shows 404 errors in Safari.' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong $bootstrap_js = file_get_contents( FrmAppHelper::plugin_path() . '/js/bootstrap.min.js' ); - $this->assertStringNotContainsString( 'sourceMappingURL=bootstrap.min.js.map', $bootstrap_js, 'We do not want the popper JS file to include a source map reference. Since the sourcem ap is not included, this shows 404 errors in Safari.' ); + $this->assertStringNotContainsString( 'sourceMappingURL=bootstrap.min.js.map', $bootstrap_js, 'We do not want the popper JS file to include a source map reference. Since the sourcem ap is not included, this shows 404 errors in Safari.' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } } diff --git a/tests/phpunit/misc/test_FrmOverlayController.php b/tests/phpunit/misc/test_FrmOverlayController.php index 7e616cc84f..5a505d8092 100644 --- a/tests/phpunit/misc/test_FrmOverlayController.php +++ b/tests/phpunit/misc/test_FrmOverlayController.php @@ -45,9 +45,9 @@ public function test_open_overlay() { $this->assertNotFalse( $overlay_recurring_execution_controller_mock->open_overlay( $test_data ), 'The overlay controller doesn\'t open - recurring execution' ); $get_time_mock->willReturn( strtotime( '+3 day', time() ) ); - $this->assertFalse( $overlay_recurring_execution_controller_mock->open_overlay( $test_data ), 'The overlay controller should not execute before the recurring time interval has passed.' ); + $this->assertFalse( $overlay_recurring_execution_controller_mock->open_overlay( $test_data ), 'The overlay controller should not execute before the recurring time interval has passed.' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong $get_time_mock->willReturn( strtotime( $recurring_execution_interval, time() ) ); - $this->assertNotFalse( $overlay_recurring_execution_controller_mock->open_overlay( $test_data ), 'The overlay controller doesn\'t open after the recurring time interval has passed.' ); + $this->assertNotFalse( $overlay_recurring_execution_controller_mock->open_overlay( $test_data ), 'The overlay controller doesn\'t open after the recurring time interval has passed.' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong } } diff --git a/tests/phpunit/onboarding-wizard/test_FrmOnboardingWizardController.php b/tests/phpunit/onboarding-wizard/test_FrmOnboardingWizardController.php index 5f8dacb5ad..963324c9f5 100644 --- a/tests/phpunit/onboarding-wizard/test_FrmOnboardingWizardController.php +++ b/tests/phpunit/onboarding-wizard/test_FrmOnboardingWizardController.php @@ -41,7 +41,7 @@ public function test_do_admin_redirects() { add_filter( 'wp_redirect', '__return_false' ); // Bypasses redirect and exit for uninterrupted PHPUnit execution. $_GET['page'] = 'formidable'; $this->controller::do_admin_redirects(); - $this->assertEquals( 'no', get_transient( $this->controller::TRANSIENT_NAME ), 'Transient should be set to "no" to indicate a redirect to the Onboarding Wizard is expected.' ); + $this->assertEquals( 'no', get_transient( $this->controller::TRANSIENT_NAME ), 'Transient should be set to "no" to indicate a redirect to the Onboarding Wizard is expected.' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong // Reset for the next case. unset( $_GET['page'] ); diff --git a/tests/phpunit/xml/test_FrmXMLController.php b/tests/phpunit/xml/test_FrmXMLController.php index 2482aaf1f3..dff62ba233 100644 --- a/tests/phpunit/xml/test_FrmXMLController.php +++ b/tests/phpunit/xml/test_FrmXMLController.php @@ -9,7 +9,7 @@ public function test_validate_xml_url() { $example_access_key_id = 'ABC123'; $expires = time(); $signature = 'DEF456'; - $example_url = "https://s3.amazonaws.com/fp.strategy11.com/form-templates/contact-us-form.xml?AWSAccessKeyId={$example_access_key_id}&Expires={$expires}&Signature={$signature}"; + $example_url = "https://s3.amazonaws.com/fp.strategy11.com/form-templates/contact-us-form.xml?AWSAccessKeyId={$example_access_key_id}&Expires={$expires}&Signature={$signature}"; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong $this->assertTrue( $this->validate_xml_url( $example_url ) ); $this->assertFalse( $this->validate_xml_url( 'https://example.com' ), 'We want to block any requests that are not from our S3 Bucket' ); diff --git a/tests/phpunit/xml/test_FrmXMLHelper.php b/tests/phpunit/xml/test_FrmXMLHelper.php index 3fc3684f61..a4cda44156 100644 --- a/tests/phpunit/xml/test_FrmXMLHelper.php +++ b/tests/phpunit/xml/test_FrmXMLHelper.php @@ -153,7 +153,7 @@ public function test_cdata() { $this->assertEquals( '', FrmXMLHelper::cdata( serialize( array( 'Red', 'Blue' ) ) ) ); $this->assertEquals( '', FrmXMLHelper::cdata( serialize( array( 60418, 60419, 60420 ) ) ) ); $this->assertEquals( - '', + '', // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong FrmXMLHelper::cdata( serialize( array(