| @@ -356,11 +356,9 @@ | ||
| 356 | 356 | } |
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | $upgrade_link = FrmSalesApi::get_best_sale_value( 'plugin_page_cta_link' ); |
| 360 | - if ( $upgrade_link ) { | |
| 361 | - $upgrade_link = FrmAppHelper::maybe_add_missing_utm( $upgrade_link, array( 'medium' => 'plugin-row' ) ); | |
| 362 | - } else { | |
| 360 | + if ( ! $upgrade_link ) { | |
| 363 | 361 | $upgrade_link = FrmAppHelper::admin_upgrade_link( 'plugin-row' ); |
| 364 | 362 | } |
| 365 | 363 | |
| 366 | 364 | $settings[] = '<a href="' . esc_url( $upgrade_link ) . '" target="_blank" rel="noopener"><b style="color:#1da867;font-weight:700;">' . esc_html( $label ) . '</b></a>'; |
| @@ -486,9 +484,9 @@ | ||
| 486 | 484 | * @return void |
| 487 | 485 | */ |
| 488 | 486 | public static function remove_upsells() { |
| 489 | 487 | remove_action( 'frm_before_settings', 'FrmSettingsController::license_box' ); |
| 490 | - remove_action( 'frm_after_settings_tabs', 'FrmSettingsController::settings_cta' ); | |
| 488 | + remove_action( 'frm_after_settings', 'FrmSettingsController::settings_cta' ); | |
| 491 | 489 | remove_action( 'frm_after_field_options', 'FrmFormsController::logic_tip' ); |
| 492 | 490 | } |
| 493 | 491 | |
| 494 | 492 | /** |
| @@ -578,17 +576,15 @@ | ||
| 578 | 576 | } |
| 579 | 577 | |
| 580 | 578 | if ( 'formidable-pro-upgrade' === FrmAppHelper::get_param( 'page' ) && ! FrmAppHelper::pro_is_installed() && current_user_can( 'frm_view_forms' ) ) { |
| 581 | 579 | $redirect = FrmSalesApi::get_best_sale_value( 'menu_cta_link' ); |
| 582 | - $utm = array( | |
| 583 | - 'medium' => 'upgrade', | |
| 584 | - 'content' => 'submenu-upgrade', | |
| 585 | - ); | |
| 586 | - | |
| 587 | - if ( $redirect ) { | |
| 588 | - $redirect = FrmAppHelper::maybe_add_missing_utm( $redirect, $utm ); | |
| 589 | - } else { | |
| 590 | - $redirect = FrmAppHelper::admin_upgrade_link( $utm ); | |
| 580 | + if ( ! $redirect ) { | |
| 581 | + $redirect = FrmAppHelper::admin_upgrade_link( | |
| 582 | + array( | |
| 583 | + 'medium' => 'upgrade', | |
| 584 | + 'content' => 'submenu-upgrade', | |
| 585 | + ) | |
| 586 | + ); | |
| 591 | 587 | } |
| 592 | 588 | |
| 593 | 589 | wp_redirect( $redirect ); |
| 594 | 590 | die(); |
| @@ -731,9 +727,8 @@ | ||
| 731 | 727 | $post_type = FrmAppHelper::simple_get( 'post_type', 'sanitize_title' ); |
| 732 | 728 | |
| 733 | 729 | global $pagenow; |
| 734 | 730 | if ( strpos( $page, 'formidable' ) === 0 || ( $pagenow === 'edit.php' && $post_type === 'frm_display' ) ) { |
| 735 | - self::enqueue_global_settings_scripts( $page ); | |
| 736 | 731 | |
| 737 | 732 | wp_enqueue_script( 'admin-widgets' ); |
| 738 | 733 | wp_enqueue_style( 'widgets' ); |
| 739 | 734 | self::maybe_deregister_popper2(); |
| @@ -785,46 +780,11 @@ | ||
| 785 | 780 | if ( 'formidable-addons' === $page ) { |
| 786 | 781 | wp_register_script( 'formidable_addons', $plugin_url . '/js/admin/addons.js', array( 'formidable_admin', 'wp-dom-ready' ), $version, true ); |
| 787 | 782 | wp_enqueue_script( 'formidable_addons' ); |
| 788 | 783 | } |
| 789 | - | |
| 790 | - self::enqueue_builder_assets( $plugin_url, $version ); | |
| 791 | 784 | } |
| 792 | 785 | |
| 793 | 786 | /** |
| 794 | - * Enqueue the Form Builder assets. | |
| 795 | - * | |
| 796 | - * @since 6.24 | |
| 797 | - * | |
| 798 | - * @param string $plugin_url The plugin URL. | |
| 799 | - * @param string $version The plugin version. | |
| 800 | - * @return void | |
| 801 | - */ | |
| 802 | - private static function enqueue_builder_assets( $plugin_url, $version ) { | |
| 803 | - wp_register_style( 'formidable-settings-components', $plugin_url . '/css/admin/frm-settings-components.css', array( 'formidable-admin', 'formidable-grids' ), $version ); | |
| 804 | - wp_register_script( 'formidable-settings-components', $plugin_url . '/js/formidable-settings-components.js', array( 'formidable_admin' ), $version, true ); | |
| 805 | - | |
| 806 | - if ( ! FrmAppHelper::is_form_builder_page() ) { | |
| 807 | - return; | |
| 808 | - } | |
| 809 | - | |
| 810 | - wp_enqueue_style( 'formidable-settings-components' ); | |
| 811 | - wp_enqueue_script( 'formidable-settings-components' ); | |
| 812 | - } | |
| 813 | - | |
| 814 | - /** | |
| 815 | - * Enqueues global settings scripts. | |
| 816 | - * | |
| 817 | - * @param string $page The `page` param in URL. | |
| 818 | - */ | |
| 819 | - private static function enqueue_global_settings_scripts( $page ) { | |
| 820 | - if ( 'formidable-settings' === $page ) { | |
| 821 | - wp_enqueue_style( 'wp-color-picker' ); | |
| 822 | - wp_enqueue_script( 'formidable_settings' ); | |
| 823 | - } | |
| 824 | - } | |
| 825 | - | |
| 826 | - /** | |
| 827 | 787 | * Avoid loading dropzone CSS on the form list page. It isn't required there. |
| 828 | 788 | * |
| 829 | 789 | * @since 6.11 |
| 830 | 790 | * |
| @@ -911,9 +871,8 @@ | ||
| 911 | 871 | } |
| 912 | 872 | ' |
| 913 | 873 | ); |
| 914 | 874 | wp_enqueue_style( 'formidable-admin' ); |
| 915 | - wp_enqueue_script( 'formidable_legacy_views', FrmAppHelper::plugin_url() . '/js/admin/legacy-views.js', array( 'jquery', 'formidable_admin' ), FrmAppHelper::plugin_version() ); | |
| 916 | 875 | FrmAppHelper::localize_script( 'admin' ); |
| 917 | 876 | self::include_info_overlay(); |
| 918 | 877 | } |
| 919 | 878 | |
| @@ -1044,9 +1003,9 @@ | ||
| 1044 | 1003 | public static function create_rest_routes() { |
| 1045 | 1004 | $args = array( |
| 1046 | 1005 | 'methods' => 'GET', |
| 1047 | 1006 | 'callback' => 'FrmAppController::api_install', |
| 1048 | - 'permission_callback' => self::class . '::can_update_db', | |
| 1007 | + 'permission_callback' => __CLASS__ . '::can_update_db', | |
| 1049 | 1008 | ); |
| 1050 | 1009 | |
| 1051 | 1010 | register_rest_route( 'frm-admin/v1', '/install', $args ); |
| 1052 | 1011 | |
| @@ -1239,9 +1198,8 @@ | ||
| 1239 | 1198 | * |
| 1240 | 1199 | * @return void |
| 1241 | 1200 | */ |
| 1242 | 1201 | public static function add_admin_footer_links() { |
| 1243 | - FrmFormsController::include_device_too_small_message(); | |
| 1244 | 1202 | if ( self::should_show_footer_links() ) { |
| 1245 | 1203 | include FrmAppHelper::plugin_path() . '/classes/views/shared/admin-footer-links.php'; |
| 1246 | 1204 | } |
| 1247 | 1205 | } |
| @@ -1546,20 +1504,6 @@ | ||
| 1546 | 1504 | |
| 1547 | 1505 | delete_option( 'frm_db_version' ); |
| 1548 | 1506 | wp_safe_redirect( admin_url( 'admin.php?page=formidable' ) ); |
| 1549 | 1507 | exit; |
| 1550 | - } | |
| 1551 | - | |
| 1552 | - /** | |
| 1553 | - * Handles the small screen proceed action. | |
| 1554 | - * | |
| 1555 | - * @since 6.21 | |
| 1556 | - * | |
| 1557 | - * @return void | |
| 1558 | - */ | |
| 1559 | - public static function small_screen_proceed() { | |
| 1560 | - FrmAppHelper::permission_check( 'frm_view_forms' ); | |
| 1561 | - check_ajax_referer( 'frm_ajax', 'nonce' ); | |
| 1562 | - update_user_option( get_current_user_id(), 'frm_ignore_small_screen_warning', true ); | |
| 1563 | - wp_send_json_success(); | |
| 1564 | 1508 | } |
| 1565 | 1509 | } |