| @@ -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'] ) ) { |
| @@ -936,8 +956,29 @@ | ||
| 936 | 956 | FrmUsageController::load_scripts(); |
| 937 | 957 | } |
| 938 | 958 | |
| 939 | 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 | + /** | |
| 940 | 981 | * Enqueue required assets for the Legacy Views editor (Views v4.x). |
| 941 | 982 | * |
| 942 | 983 | * @since 6.1.2 |
| 943 | 984 | * |
| @@ -1288,9 +1329,9 @@ | ||
| 1288 | 1329 | } |
| 1289 | 1330 | |
| 1290 | 1331 | /** |
| 1291 | 1332 | * The payment cron is unscheduled when Formidable is deactivated. |
| 1292 | - * 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. | |
| 1293 | 1334 | * |
| 1294 | 1335 | * @since 6.5 |
| 1295 | 1336 | * |
| 1296 | 1337 | * @return void |
| @@ -1295,9 +1336,13 @@ | ||
| 1295 | 1336 | * |
| 1296 | 1337 | * @return void |
| 1297 | 1338 | */ |
| 1298 | 1339 | private static function maybe_activate_payment_cron() { |
| 1299 | - 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 ) { | |
| 1300 | 1345 | return; |
| 1301 | 1346 | } |
| 1302 | 1347 | |
| 1303 | 1348 | FrmTransLiteAppController::maybe_schedule_cron(); |
| @@ -1373,8 +1418,9 @@ | ||
| 1373 | 1418 | 'cancel_url' => '', |
| 1374 | 1419 | 'cancel_classes' => '', |
| 1375 | 1420 | 'continue_url' => '', |
| 1376 | 1421 | 'continue_classes' => '', |
| 1422 | + 'continue_target' => '', | |
| 1377 | 1423 | 'icon' => 'frm_lock_simple', |
| 1378 | 1424 | ); |
| 1379 | 1425 | |
| 1380 | 1426 | $error_args = wp_parse_args( $error_args, $defaults ); |