PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.2.2
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.2.2
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/controllers/FrmAppController.php +9 -150 6.5.36.2.2 View file →
@@ -135,14 +135,8 @@
135 135 'formidable-welcome',
136 136 'formidable-applications',
137 137 );
138 138
139 - if ( ! class_exists( 'FrmTransHooksController', false ) && ! FrmTransLiteAppHelper::should_fallback_to_paypal() ) {
140 - // Only consider the payments page as a "white page" when the Payments submodule is off.
141 - // Otherwise this causes a lot of styling issues when the Stripe add-on (or Authorize.Net) is active.
142 - $white_pages[] = 'formidable-payments';
143 - }
144 -
145 139 $get_page = FrmAppHelper::simple_get( 'page', 'sanitize_title' );
146 140 $is_white_page = in_array( $get_page, $white_pages, true );
147 141
148 142 if ( ! $is_white_page ) {
@@ -292,10 +286,9 @@
292 286 public static function settings_link( $links ) {
293 287 $settings = array();
294 288
295 289 if ( ! FrmAppHelper::pro_is_installed() ) {
296 - $label = FrmAddonsController::is_license_expired() ? __( 'Renew', 'formidable' ) : __( 'Upgrade to Pro', 'formidable' );
297 - $settings[] = '<a href="' . esc_url( FrmAppHelper::admin_upgrade_link( 'plugin-row' ) ) . '" target="_blank" rel="noopener"><b style="color:#1da867;font-weight:700;">' . esc_html( $label ) . '</b></a>';
290 + $settings[] = '<a href="' . esc_url( FrmAppHelper::admin_upgrade_link( 'plugin-row' ) ) . '" target="_blank" rel="noopener"><b>' . esc_html__( 'Upgrade to Pro', 'formidable' ) . '</b></a>';
298 291 }
299 292
300 293 $settings[] = '<a href="' . esc_url( admin_url( 'admin.php?page=formidable' ) ) . '">' . __( 'Build a Form', 'formidable' ) . '</a>';
301 294
@@ -433,25 +426,10 @@
433 426 include $path . 'new-form-overlay.php';
434 427 }
435 428
436 429 /**
437 - * Create a basic form with an email field.
438 - *
439 - * @param string $form_key
440 - * @param string $title
441 - * @param string $description
442 430 * @return void
443 431 */
444 - public static function api_email_form( $form_key, $title, $description ) {
445 - $url = 'https://sandbox.formidableforms.com/api/wp-json/frm/v2/forms/' . $form_key . '?return=html&exclude_script=jquery&exclude_style=formidable-css';
446 - $view_path = FrmAppHelper::plugin_path() . '/classes/views/frm-forms/new-form-overlay/';
447 - $user = wp_get_current_user();
448 - require $view_path . 'leave-email.php';
449 - }
450 -
451 - /**
452 - * @return void
453 - */
454 432 public static function include_info_overlay() {
455 433 self::enqueue_dialog_assets();
456 434 add_action( 'admin_footer', 'FrmAppController::info_overlay_html' );
457 435 }
@@ -592,9 +570,9 @@
592 570 return;
593 571 }
594 572
595 573 if ( ! self::is_behind_proxy() ) {
596 - // This message is only applicable when using a reverse proxy.
574 + // This message is only applicable when where is a reverse proxy.
597 575 return;
598 576 }
599 577
600 578 if ( FrmAppHelper::get_post_param( 'frm_action', '', 'sanitize_text_field' ) ) {
@@ -601,16 +579,16 @@
601 579 // Avoid the message on a POST action. We don't want to show the message if we're saving global settings.
602 580 return;
603 581 }
604 582
605 - $global_settings_link = admin_url( 'admin.php?page=formidable-settings' ) . '#frm_custom_header_ip';
606 - $message = sprintf(
607 - // Translators: 1: Global Settings Link
608 - __( 'IP addresses in form submissions may no longer be accurate! If you are experiencing issues, we recommend going to %1$s and enabling the "Use custom headers when retrieving IPs with form submissions." setting.', 'formidable' ),
609 - '<a href="' . esc_url( $global_settings_link ) . '">Global Settings</a>'
583 + add_filter(
584 + 'frm_message_list',
585 + function( $show_messages ) {
586 + $global_settings_link = admin_url( 'admin.php?page=formidable-settings' ) . '#frm_custom_header_ip';
587 + $show_messages['ip_msg'] = 'IP addresses in form submissions may no longer be accurate! If you are experiencing issues, we recommend going to <a href="' . esc_url( $global_settings_link ) . '">Global Settings</a> and enabling the "Use custom headers when retrieving IPs with form submissions." setting.';
588 + return $show_messages;
589 + }
610 590 );
611 - $option_name = 'frm_dismiss_ip_address_notice';
612 - FrmAppHelper::add_dismissable_warning_message( $message, $option_name );
613 591 }
614 592
615 593 /**
616 594 * Check if any reverse proxy headers are set.
@@ -645,14 +623,8 @@
645 623 $version = FrmAppHelper::plugin_version();
646 624
647 625 FrmAppHelper::load_admin_wide_js();
648 626
649 - if ( class_exists( 'FrmOverlayController' ) ) {
650 - // This should always exist.
651 - // But it may not have loaded properly when updating the plugin.
652 - FrmOverlayController::register_assets();
653 - }
654 -
655 627 wp_register_style( 'formidable_admin_global', $plugin_url . '/css/admin/frm_admin_global.css', array(), $version );
656 628 wp_enqueue_style( 'formidable_admin_global' );
657 629
658 630 wp_register_style( 'formidable-admin', $plugin_url . '/css/frm_admin.css', array(), $version );
@@ -665,19 +637,8 @@
665 637 wp_register_script( 'formidable_settings', $plugin_url . '/js/admin/settings.js', array(), $version, true );
666 638
667 639 $page = FrmAppHelper::simple_get( 'page', 'sanitize_title' );
668 640
669 - // Enqueue Floating Links.
670 - $is_valid_page =
671 - FrmAppHelper::is_formidable_admin() &&
672 - ! FrmAppHelper::is_style_editor_page() &&
673 - ! FrmAppHelper::is_admin_page( 'formidable-views-editor' ) &&
674 - ! FrmAppHelper::simple_get( 'frm_action', 'sanitize_title' );
675 - if ( $is_valid_page && FrmAppHelper::is_formidable_branding() ) {
676 - self::enqueue_floating_links( $plugin_url, $version );
677 - }
678 - unset( $is_valid_page );
679 -
680 641 if ( 'formidable-applications' === $page ) {
681 642 FrmApplicationsController::load_assets();
682 643 return;
683 644 }
@@ -709,19 +670,8 @@
709 670 }
710 671
711 672 wp_register_script( 'bootstrap-multiselect', $plugin_url . '/js/bootstrap-multiselect.js', array( 'jquery', 'bootstrap_tooltip', 'popper' ), '1.1.1', true );
712 673
713 - if ( ! class_exists( 'FrmTransHooksController', false ) ) {
714 - /**
715 - * Gateway fields are included for add-on compatibility but we do not want it to be visible.
716 - * They do however need to be visible when the payments submodule is active.
717 - */
718 - wp_add_inline_style(
719 - 'formidable-admin',
720 - '#frm_builder_page li[data-ftype="gateway"] { display: none; }'
721 - );
722 - }
723 -
724 674 $post_type = FrmAppHelper::simple_get( 'post_type', 'sanitize_title' );
725 675
726 676 global $pagenow;
727 677 if ( strpos( $page, 'formidable' ) === 0 || ( $pagenow === 'edit.php' && $post_type === 'frm_display' ) ) {
@@ -766,17 +716,8 @@
766 716 self::enqueue_legacy_views_assets();
767 717 }
768 718 }
769 719
770 - }
771 -
772 - /**
773 - * @since 6.3.2
774 - *
775 - * @return void
776 - */
777 - public static function admin_enqueue_scripts() {
778 - self::load_wp_admin_style();
779 720 self::maybe_force_formidable_block_on_gutenberg_page();
780 721 }
781 722
782 723 /**
@@ -1066,33 +1007,8 @@
1066 1007 delete_site_option( 'frmpro-authorized' );
1067 1008 wp_die();
1068 1009 }
1069 1010
1070 - /**
1071 - * This is triggered when Formidable is activated.
1072 - *
1073 - * @return void
1074 - */
1075 - public static function handle_activation() {
1076 - self::maybe_activate_payment_cron();
1077 - }
1078 -
1079 - /**
1080 - * The payment cron is unscheduled when Formidable is deactivated.
1081 - * We need to add it back again on activation if Stripe is configured.
1082 - *
1083 - * @since 6.5
1084 - *
1085 - * @return void
1086 - */
1087 - private static function maybe_activate_payment_cron() {
1088 - if ( ! FrmStrpLiteConnectHelper::stripe_connect_is_setup() ) {
1089 - return;
1090 - }
1091 -
1092 - FrmTransLiteAppController::maybe_schedule_cron();
1093 - }
1094 -
1095 1011 public static function set_footer_text( $text ) {
1096 1012 if ( FrmAppHelper::is_formidable_admin() ) {
1097 1013 $text = '';
1098 1014 }
@@ -1100,31 +1016,8 @@
1100 1016 return $text;
1101 1017 }
1102 1018
1103 1019 /**
1104 - * Add admin footer links.
1105 - *
1106 - * @since 6.4.1
1107 - *
1108 - * @return void
1109 - */
1110 - public static function add_admin_footer_links() {
1111 - $post_type = FrmAppHelper::simple_get( 'post_type', 'sanitize_title' );
1112 -
1113 - // Check admin privileges, screen mode, and branding
1114 - $is_not_admin = ! FrmAppHelper::is_formidable_admin() && $post_type !== 'frm_logs';
1115 - $is_full_screen = FrmAppHelper::is_full_screen();
1116 - $is_not_formidable_branding = ! FrmAppHelper::is_formidable_branding();
1117 -
1118 - // Exit if any of the above conditions are met
1119 - if ( $is_not_admin || $is_full_screen || $is_not_formidable_branding ) {
1120 - return;
1121 - }
1122 -
1123 - include FrmAppHelper::plugin_path() . '/classes/views/shared/admin-footer-links.php';
1124 - }
1125 -
1126 - /**
1127 1020 * @deprecated 3.0.04
1128 1021 *
1129 1022 * @codeCoverageIgnore
1130 1023 *
@@ -1162,40 +1055,6 @@
1162 1055 */
1163 1056 public static function get_form_shortcode( $atts ) {
1164 1057 _deprecated_function( __FUNCTION__, '1.07.05', 'FrmFormsController::get_form_shortcode' );
1165 1058 return FrmFormsController::get_form_shortcode( $atts );
1166 - }
1167 -
1168 - /**
1169 - * Handles Floating Links' scripts and styles enqueueing.
1170 - *
1171 - * @since 6.4
1172 - *
1173 - * @param string $plugin_url URL of the plugin.
1174 - * @param string $version Current version of the plugin.
1175 - * @return void
1176 - */
1177 - private static function enqueue_floating_links( $plugin_url, $version ) {
1178 - if ( ! $plugin_url || ! $version ) {
1179 - // If any required parameters are missing, exit early.
1180 - return;
1181 - }
1182 -
1183 - // Enqueue the Floating Links styles.
1184 - wp_enqueue_style( 's11-floating-links', $plugin_url . '/css/packages/s11-floating-links.css', array(), $version );
1185 -
1186 - // Enqueue the Floating Links script.
1187 - wp_enqueue_script( 's11-floating-links', $plugin_url . '/js/packages/floating-links/s11-floating-links.js', array(), $version, true );
1188 -
1189 - // Enqueue the config script.
1190 - wp_enqueue_script( 's11-floating-links-config', $plugin_url . '/js/packages/floating-links/config.js', array( 'wp-i18n' ), $version, true );
1191 -
1192 - if ( function_exists( 'wp_set_script_translations' ) ) {
1193 - wp_set_script_translations( 's11-floating-links-config', 's11-' );
1194 - }
1195 -
1196 - $floating_links_data = array(
1197 - 'proIsInstalled' => FrmAppHelper::pro_is_installed(),
1198 - );
1199 - wp_localize_script( 's11-floating-links-config', 's11FloatingLinksData', $floating_links_data );
1200 1059 }
1201 1060 }