PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.2
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.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 -145 6.5.26.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 ) ) {
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.
@@ -644,9 +622,8 @@
644 622 $plugin_url = FrmAppHelper::plugin_url();
645 623 $version = FrmAppHelper::plugin_version();
646 624
647 625 FrmAppHelper::load_admin_wide_js();
648 - FrmOverlayController::register_assets();
649 626
650 627 wp_register_style( 'formidable_admin_global', $plugin_url . '/css/admin/frm_admin_global.css', array(), $version );
651 628 wp_enqueue_style( 'formidable_admin_global' );
652 629
@@ -660,19 +637,8 @@
660 637 wp_register_script( 'formidable_settings', $plugin_url . '/js/admin/settings.js', array(), $version, true );
661 638
662 639 $page = FrmAppHelper::simple_get( 'page', 'sanitize_title' );
663 640
664 - // Enqueue Floating Links.
665 - $is_valid_page =
666 - FrmAppHelper::is_formidable_admin() &&
667 - ! FrmAppHelper::is_style_editor_page() &&
668 - ! FrmAppHelper::is_admin_page( 'formidable-views-editor' ) &&
669 - ! FrmAppHelper::simple_get( 'frm_action', 'sanitize_title' );
670 - if ( $is_valid_page && FrmAppHelper::is_formidable_branding() ) {
671 - self::enqueue_floating_links( $plugin_url, $version );
672 - }
673 - unset( $is_valid_page );
674 -
675 641 if ( 'formidable-applications' === $page ) {
676 642 FrmApplicationsController::load_assets();
677 643 return;
678 644 }
@@ -704,19 +670,8 @@
704 670 }
705 671
706 672 wp_register_script( 'bootstrap-multiselect', $plugin_url . '/js/bootstrap-multiselect.js', array( 'jquery', 'bootstrap_tooltip', 'popper' ), '1.1.1', true );
707 673
708 - if ( ! class_exists( 'FrmTransHooksController', false ) ) {
709 - /**
710 - * Gateway fields are included for add-on compatibility but we do not want it to be visible.
711 - * They do however need to be visible when the payments submodule is active.
712 - */
713 - wp_add_inline_style(
714 - 'formidable-admin',
715 - '#frm_builder_page li[data-ftype="gateway"] { display: none; }'
716 - );
717 - }
718 -
719 674 $post_type = FrmAppHelper::simple_get( 'post_type', 'sanitize_title' );
720 675
721 676 global $pagenow;
722 677 if ( strpos( $page, 'formidable' ) === 0 || ( $pagenow === 'edit.php' && $post_type === 'frm_display' ) ) {
@@ -761,17 +716,8 @@
761 716 self::enqueue_legacy_views_assets();
762 717 }
763 718 }
764 719
765 - }
766 -
767 - /**
768 - * @since 6.3.2
769 - *
770 - * @return void
771 - */
772 - public static function admin_enqueue_scripts() {
773 - self::load_wp_admin_style();
774 720 self::maybe_force_formidable_block_on_gutenberg_page();
775 721 }
776 722
777 723 /**
@@ -1061,33 +1007,8 @@
1061 1007 delete_site_option( 'frmpro-authorized' );
1062 1008 wp_die();
1063 1009 }
1064 1010
1065 - /**
1066 - * This is triggered when Formidable is activated.
1067 - *
1068 - * @return void
1069 - */
1070 - public static function handle_activation() {
1071 - self::maybe_activate_payment_cron();
1072 - }
1073 -
1074 - /**
1075 - * The payment cron is unscheduled when Formidable is deactivated.
1076 - * We need to add it back again on activation if Stripe is configured.
1077 - *
1078 - * @since 6.5
1079 - *
1080 - * @return void
1081 - */
1082 - private static function maybe_activate_payment_cron() {
1083 - if ( ! FrmStrpLiteConnectHelper::stripe_connect_is_setup() ) {
1084 - return;
1085 - }
1086 -
1087 - FrmTransLiteAppController::maybe_schedule_cron();
1088 - }
1089 -
1090 1011 public static function set_footer_text( $text ) {
1091 1012 if ( FrmAppHelper::is_formidable_admin() ) {
1092 1013 $text = '';
1093 1014 }
@@ -1095,31 +1016,8 @@
1095 1016 return $text;
1096 1017 }
1097 1018
1098 1019 /**
1099 - * Add admin footer links.
1100 - *
1101 - * @since 6.4.1
1102 - *
1103 - * @return void
1104 - */
1105 - public static function add_admin_footer_links() {
1106 - $post_type = FrmAppHelper::simple_get( 'post_type', 'sanitize_title' );
1107 -
1108 - // Check admin privileges, screen mode, and branding
1109 - $is_not_admin = ! FrmAppHelper::is_formidable_admin() && $post_type !== 'frm_logs';
1110 - $is_full_screen = FrmAppHelper::is_full_screen();
1111 - $is_not_formidable_branding = ! FrmAppHelper::is_formidable_branding();
1112 -
1113 - // Exit if any of the above conditions are met
1114 - if ( $is_not_admin || $is_full_screen || $is_not_formidable_branding ) {
1115 - return;
1116 - }
1117 -
1118 - include FrmAppHelper::plugin_path() . '/classes/views/shared/admin-footer-links.php';
1119 - }
1120 -
1121 - /**
1122 1020 * @deprecated 3.0.04
1123 1021 *
1124 1022 * @codeCoverageIgnore
1125 1023 *
@@ -1157,40 +1055,6 @@
1157 1055 */
1158 1056 public static function get_form_shortcode( $atts ) {
1159 1057 _deprecated_function( __FUNCTION__, '1.07.05', 'FrmFormsController::get_form_shortcode' );
1160 1058 return FrmFormsController::get_form_shortcode( $atts );
1161 - }
1162 -
1163 - /**
1164 - * Handles Floating Links' scripts and styles enqueueing.
1165 - *
1166 - * @since 6.4
1167 - *
1168 - * @param string $plugin_url URL of the plugin.
1169 - * @param string $version Current version of the plugin.
1170 - * @return void
1171 - */
1172 - private static function enqueue_floating_links( $plugin_url, $version ) {
1173 - if ( ! $plugin_url || ! $version ) {
1174 - // If any required parameters are missing, exit early.
1175 - return;
1176 - }
1177 -
1178 - // Enqueue the Floating Links styles.
1179 - wp_enqueue_style( 's11-floating-links', $plugin_url . '/css/packages/s11-floating-links.css', array(), $version );
1180 -
1181 - // Enqueue the Floating Links script.
1182 - wp_enqueue_script( 's11-floating-links', $plugin_url . '/js/packages/floating-links/s11-floating-links.js', array(), $version, true );
1183 -
1184 - // Enqueue the config script.
1185 - wp_enqueue_script( 's11-floating-links-config', $plugin_url . '/js/packages/floating-links/config.js', array( 'wp-i18n' ), $version, true );
1186 -
1187 - if ( function_exists( 'wp_set_script_translations' ) ) {
1188 - wp_set_script_translations( 's11-floating-links-config', 's11-' );
1189 - }
1190 -
1191 - $floating_links_data = array(
1192 - 'proIsInstalled' => FrmAppHelper::pro_is_installed(),
1193 - );
1194 - wp_localize_script( 's11-floating-links-config', 's11FloatingLinksData', $floating_links_data );
1195 1059 }
1196 1060 }