| @@ -373,9 +373,11 @@ | ||
| 373 | 373 | public static function settings_link( $links ) { |
| 374 | 374 | $settings = array(); |
| 375 | 375 | |
| 376 | 376 | if ( ! FrmAppHelper::pro_is_installed() ) { |
| 377 | - if ( FrmAddonsController::is_license_expired() ) { | |
| 377 | + $is_expired = FrmAddonsController::is_license_expired(); | |
| 378 | + | |
| 379 | + if ( $is_expired ) { | |
| 378 | 380 | $label = __( 'Renew', 'formidable' ); |
| 379 | 381 | } else { |
| 380 | 382 | $label = FrmSalesApi::get_best_sale_value( 'plugin_page_cta_text' ); |
| 381 | 383 | |
| @@ -383,14 +385,20 @@ | ||
| 383 | 385 | $label = __( 'Upgrade to Pro', 'formidable' ); |
| 384 | 386 | } |
| 385 | 387 | } |
| 386 | 388 | |
| 387 | - $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' ); | |
| 388 | 391 | |
| 392 | + $utm = array( | |
| 393 | + 'campaign' => 'plugin-row', | |
| 394 | + 'content' => $upgrade_content, | |
| 395 | + ); | |
| 396 | + | |
| 389 | 397 | if ( $upgrade_link ) { |
| 390 | - $upgrade_link = FrmAppHelper::maybe_add_missing_utm( $upgrade_link, array( 'medium' => 'plugin-row' ) ); | |
| 398 | + $upgrade_link = FrmAppHelper::maybe_add_missing_utm( $upgrade_link, $utm ); | |
| 391 | 399 | } else { |
| 392 | - $upgrade_link = FrmAppHelper::admin_upgrade_link( 'plugin-row' ); | |
| 400 | + $upgrade_link = FrmAppHelper::admin_upgrade_link( $utm ); | |
| 393 | 401 | } |
| 394 | 402 | |
| 395 | 403 | $settings[] = '<a href="' . esc_url( $upgrade_link ) . '" target="_blank" rel="noopener"><b style="color:#1da867;font-weight:700;">' . esc_html( $label ) . '</b></a>'; |
| 396 | 404 | }//end if |
| @@ -728,11 +736,22 @@ | ||
| 728 | 736 | } |
| 729 | 737 | |
| 730 | 738 | wp_register_script( 'formidable_admin', $plugin_url . '/js/formidable_admin.js', self::get_admin_js_dependencies(), $version, true ); |
| 731 | 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 | + | |
| 732 | 750 | if ( FrmAppHelper::on_form_listing_page() ) { |
| 733 | 751 | // For the existing page dropdown in the Form embed modal. |
| 734 | 752 | wp_enqueue_script( 'jquery-ui-autocomplete' ); |
| 753 | + wp_enqueue_script( 'formidable_forms_list' ); | |
| 735 | 754 | } |
| 736 | 755 | |
| 737 | 756 | wp_register_script( 'bootstrap-multiselect', $plugin_url . '/js/bootstrap-multiselect.js', array( 'jquery', 'bootstrap_tooltip', 'popper' ), '2.0', true ); |
| 738 | 757 | |
| @@ -776,8 +795,9 @@ | ||
| 776 | 795 | wp_enqueue_script( 'formidable_entries' ); |
| 777 | 796 | } |
| 778 | 797 | |
| 779 | 798 | do_action( 'frm_enqueue_builder_scripts' ); |
| 799 | + self::maybe_enqueue_legacy_paypal_assets(); | |
| 780 | 800 | self::include_upgrade_overlay(); |
| 781 | 801 | self::include_info_overlay(); |
| 782 | 802 | } elseif ( FrmAppHelper::is_view_builder_page() ) { |
| 783 | 803 | if ( isset( $_REQUEST['post_type'] ) ) { |
| @@ -933,8 +953,29 @@ | ||
| 933 | 953 | wp_enqueue_style( FrmDashboardController::PAGE_SLUG, FrmAppHelper::plugin_url() . '/css/admin/dashboard.css', array(), FrmAppHelper::plugin_version() ); |
| 934 | 954 | } |
| 935 | 955 | |
| 936 | 956 | FrmUsageController::load_scripts(); |
| 957 | + } | |
| 958 | + | |
| 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' ); | |
| 937 | 978 | } |
| 938 | 979 | |
| 939 | 980 | /** |
| 940 | 981 | * Enqueue required assets for the Legacy Views editor (Views v4.x). |