PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
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 +68 -27 6.28 → trunk View file →
@@ -81,12 +81,11 @@
81 81 $classes .= ' frm-grey-body ';
82 82 }
83 83
84 84 if ( FrmAppHelper::is_full_screen() ) {
85 - $full_screen_on = self::get_full_screen_setting();
86 - $add_class = '';
85 + $add_class = '';
87 86
88 - if ( $full_screen_on ) {
87 + if ( self::get_full_screen_setting() ) {
89 88 $add_class = ' frm-full-screen is-fullscreen-mode';
90 89
91 90 // Load the CSS for .is-fullscreen-mode.
92 91 wp_enqueue_style( 'wp-edit-post' );
@@ -374,9 +373,11 @@
374 373 public static function settings_link( $links ) {
375 374 $settings = array();
376 375
377 376 if ( ! FrmAppHelper::pro_is_installed() ) {
378 - if ( FrmAddonsController::is_license_expired() ) {
377 + $is_expired = FrmAddonsController::is_license_expired();
378 +
379 + if ( $is_expired ) {
379 380 $label = __( 'Renew', 'formidable' );
380 381 } else {
381 382 $label = FrmSalesApi::get_best_sale_value( 'plugin_page_cta_text' );
382 383
@@ -384,14 +385,20 @@
384 385 $label = __( 'Upgrade to Pro', 'formidable' );
385 386 }
386 387 }
387 388
388 - $upgrade_link = FrmSalesApi::get_best_sale_value( 'plugin_page_cta_link' );
389 + $upgrade_content = $is_expired ? 'renew' : 'upgrade';
390 + $upgrade_link = FrmSalesApi::get_best_sale_value( 'plugin_page_cta_link' );
389 391
392 + $utm = array(
393 + 'campaign' => 'plugin-row',
394 + 'content' => $upgrade_content,
395 + );
396 +
390 397 if ( $upgrade_link ) {
391 - $upgrade_link = FrmAppHelper::maybe_add_missing_utm( $upgrade_link, array( 'medium' => 'plugin-row' ) );
398 + $upgrade_link = FrmAppHelper::maybe_add_missing_utm( $upgrade_link, $utm );
392 399 } else {
393 - $upgrade_link = FrmAppHelper::admin_upgrade_link( 'plugin-row' );
400 + $upgrade_link = FrmAppHelper::admin_upgrade_link( $utm );
394 401 }
395 402
396 403 $settings[] = '<a href="' . esc_url( $upgrade_link ) . '" target="_blank" rel="noopener"><b style="color:#1da867;font-weight:700;">' . esc_html( $label ) . '</b></a>';
397 404 }//end if
@@ -729,24 +736,28 @@
729 736 }
730 737
731 738 wp_register_script( 'formidable_admin', $plugin_url . '/js/formidable_admin.js', self::get_admin_js_dependencies(), $version, true );
732 739
740 + wp_register_script(
741 + 'formidable_forms_list',
742 + $plugin_url . '/js/admin/forms-list.js',
743 + array(
744 + 'formidable_dom',
745 + ),
746 + $version,
747 + true
748 + );
749 +
733 750 if ( FrmAppHelper::on_form_listing_page() ) {
734 751 // For the existing page dropdown in the Form embed modal.
735 752 wp_enqueue_script( 'jquery-ui-autocomplete' );
753 + wp_enqueue_script( 'formidable_forms_list' );
736 754 }
737 755
738 756 wp_register_script( 'bootstrap-multiselect', $plugin_url . '/js/bootstrap-multiselect.js', array( 'jquery', 'bootstrap_tooltip', 'popper' ), '2.0', true );
739 757
740 758 if ( ! class_exists( 'FrmTransHooksController', false ) ) {
741 - /**
742 - * Gateway fields are included for add-on compatibility but we do not want it to be visible.
743 - * They do however need to be visible when the payments submodule is active.
744 - */
745 - wp_add_inline_style(
746 - 'formidable-admin',
747 - '#frm_builder_page li[data-ftype="gateway"] { display: none; }'
748 - );
759 + FrmTransLiteAppController::hide_gateway_fields_in_builder();
749 760 }
750 761
751 762 $page = FrmAppHelper::simple_get( 'page', 'sanitize_title' );
752 763 $post_type = FrmAppHelper::simple_get( 'post_type', 'sanitize_title' );
@@ -784,8 +795,9 @@
784 795 wp_enqueue_script( 'formidable_entries' );
785 796 }
786 797
787 798 do_action( 'frm_enqueue_builder_scripts' );
799 + self::maybe_enqueue_legacy_paypal_assets();
788 800 self::include_upgrade_overlay();
789 801 self::include_info_overlay();
790 802 } elseif ( FrmAppHelper::is_view_builder_page() ) {
791 803 if ( isset( $_REQUEST['post_type'] ) ) {
@@ -873,12 +885,14 @@
873 885 *
874 886 * @return void
875 887 */
876 888 private static function enqueue_global_settings_scripts( $page ) {
877 - if ( 'formidable-settings' === $page ) {
878 - wp_enqueue_style( 'wp-color-picker' );
879 - wp_enqueue_script( 'formidable_settings' );
889 + if ( 'formidable-settings' !== $page ) {
890 + return;
880 891 }
892 +
893 + wp_enqueue_style( 'wp-color-picker' );
894 + wp_enqueue_script( 'formidable_settings' );
881 895 }
882 896
883 897 /**
884 898 * Avoid loading dropzone CSS on the form list page. It isn't required there.
@@ -942,8 +956,29 @@
942 956 FrmUsageController::load_scripts();
943 957 }
944 958
945 959 /**
960 + * Enqueue legacy PayPal action settings styles when the PayPal add-on is active.
961 + *
962 + * @since 6.31
963 + *
964 + * @return void
965 + */
966 + private static function maybe_enqueue_legacy_paypal_assets() {
967 + if ( ! FrmAppHelper::is_form_builder_page() || ! class_exists( 'FrmPaymentsController' ) ) {
968 + return;
969 + }
970 +
971 + wp_register_style(
972 + 'formidable-legacy-paypal',
973 + FrmAppHelper::plugin_url() . '/css/admin/frm-legacy-paypal.css',
974 + array( 'formidable-admin' ),
975 + FrmAppHelper::plugin_version()
976 + );
977 + wp_enqueue_style( 'formidable-legacy-paypal' );
978 + }
979 +
980 + /**
946 981 * Enqueue required assets for the Legacy Views editor (Views v4.x).
947 982 *
948 983 * @since 6.1.2
949 984 *
@@ -1181,14 +1216,16 @@
1181 1216 *
1182 1217 * @return void
1183 1218 */
1184 1219 private static function maybe_add_wp_site_health() {
1185 - if ( ! class_exists( 'WP_Site_Health' ) ) {
1186 - $wp_site_health_path = ABSPATH . 'wp-admin/includes/class-wp-site-health.php';
1220 + if ( class_exists( 'WP_Site_Health' ) ) {
1221 + return;
1222 + }
1187 1223
1188 - if ( file_exists( $wp_site_health_path ) ) {
1189 - require_once $wp_site_health_path;
1190 - }
1224 + $wp_site_health_path = ABSPATH . 'wp-admin/includes/class-wp-site-health.php';
1225 +
1226 + if ( file_exists( $wp_site_health_path ) ) {
1227 + require_once $wp_site_health_path;
1191 1228 }
1192 1229 }
1193 1230
1194 1231 /**
@@ -1292,9 +1329,9 @@
1292 1329 }
1293 1330
1294 1331 /**
1295 1332 * The payment cron is unscheduled when Formidable is deactivated.
1296 - * We need to add it back again on activation if Stripe is configured.
1333 + * We need to add it back again on activation if any payment gateway is configured.
1297 1334 *
1298 1335 * @since 6.5
1299 1336 *
1300 1337 * @return void
@@ -1299,9 +1336,13 @@
1299 1336 *
1300 1337 * @return void
1301 1338 */
1302 1339 private static function maybe_activate_payment_cron() {
1303 - if ( ! FrmStrpLiteConnectHelper::stripe_connect_is_setup() ) {
1340 + $stripe_connected = FrmStrpLiteConnectHelper::at_least_one_mode_is_setup();
1341 + $square_connected = FrmSquareLiteConnectHelper::at_least_one_mode_is_setup();
1342 + $paypal_connected = FrmPayPalLiteConnectHelper::at_least_one_mode_is_setup();
1343 +
1344 + if ( ! $stripe_connected && ! $square_connected && ! $paypal_connected ) {
1304 1345 return;
1305 1346 }
1306 1347
1307 1348 FrmTransLiteAppController::maybe_schedule_cron();
@@ -1377,8 +1418,9 @@
1377 1418 'cancel_url' => '',
1378 1419 'cancel_classes' => '',
1379 1420 'continue_url' => '',
1380 1421 'continue_classes' => '',
1422 + 'continue_target' => '',
1381 1423 'icon' => 'frm_lock_simple',
1382 1424 );
1383 1425
1384 1426 $error_args = wp_parse_args( $error_args, $defaults );
@@ -1585,10 +1627,9 @@
1585 1627 if ( false === $meta_key ) {
1586 1628 return;
1587 1629 }
1588 1630
1589 - $user_id = get_current_user_id();
1590 - $preferred_list_sort = get_user_meta( $user_id, $meta_key, true );
1631 + $preferred_list_sort = get_user_meta( get_current_user_id(), $meta_key, true );
1591 1632 $form_id = FrmAppHelper::simple_get( 'form', 'absint' );
1592 1633
1593 1634 if ( is_array( $preferred_list_sort ) && $form_id && is_int( $form_id ) && isset( $preferred_list_sort[ $form_id ] ) ) {
1594 1635 $preferred_list_sort = $preferred_list_sort[ $form_id ];