| @@ -726,8 +726,10 @@ | ||
| 726 | 726 | $is_error = AdminHelper::has_api_error( $response['data'] ); |
| 727 | 727 | |
| 728 | 728 | if ( $is_error['error'] ) { |
| 729 | 729 | |
| 730 | + do_action( 'cartflows_generate_analytics_lead', $flow, false ); | |
| 731 | + | |
| 730 | 732 | wp_send_json_error( |
| 731 | 733 | array( |
| 732 | 734 | 'error_code' => $is_error['error_code'], |
| 733 | 735 | 'call_to_action' => $is_error['call_to_action'], |
| @@ -747,11 +749,11 @@ | ||
| 747 | 749 | $cta = ''; |
| 748 | 750 | $btn = ''; |
| 749 | 751 | if ( 'not-installed' === $cf_pro_status ) { |
| 750 | 752 | /* translators: %1$s: link html start, %2$s: link html end*/ |
| 751 | - $btn = sprintf( __( 'CartFlows Pro Required! %1$sUpgrade to CartFlows Pro%2$s', 'cartflows' ), '<a target="_blank" href="https://cartflows.com/?utm_source=dashboard&utm_medium=free-cartflows&utm_campaign=go-pro">', '</a>' ); | |
| 753 | + $btn = sprintf( __( 'CartFlows Pro Required! %1$sUpgrade to CartFlows Pro%2$s', 'cartflows' ), '<a target="_blank" href="' . esc_url( \Cartflows_Helper::get_upgrade_to_pro_link( '', 'https://cartflows.com/' ) ) . '">', '</a>' ); | |
| 752 | 754 | /* translators: %1$s: link html start, %2$s: link html end*/ |
| 753 | - $cta = sprintf( __( 'To import the premium flow %1$supgrade to CartFlows Pro%2$s.', 'cartflows' ), '<a target="_blank" href="https://cartflows.com/?utm_source=dashboard&utm_medium=free-cartflows&utm_campaign=go-pro">', '</a>' ); | |
| 755 | + $cta = sprintf( __( 'To import the premium flow %1$supgrade to CartFlows Pro%2$s.', 'cartflows' ), '<a target="_blank" href="' . esc_url( \Cartflows_Helper::get_upgrade_to_pro_link( '', 'https://cartflows.com/' ) ) . '">', '</a>' ); | |
| 754 | 756 | } elseif ( 'inactive' === $cf_pro_status ) { |
| 755 | 757 | /* translators: %1$s: link html start, %2$s: link html end*/ |
| 756 | 758 | $btn = sprintf( __( 'Activate the CartFlows Pro to import the flow! %1$sActivate CartFlows Pro%2$s', 'cartflows' ), '<a target="_blank" href="' . admin_url( 'plugins.php?plugin_status=search&paged=1&s=CartFlows+Pro' ) . '">', '</a>' ); |
| 757 | 759 | /* translators: %1$s: link html start, %2$s: link html end*/ |
| @@ -797,8 +799,9 @@ | ||
| 797 | 799 | // Insert the post into the database. |
| 798 | 800 | $new_flow_id = wp_insert_post( $new_flow_post ); |
| 799 | 801 | |
| 800 | 802 | if ( is_wp_error( $new_flow_id ) ) { |
| 803 | + do_action( 'cartflows_generate_analytics_lead', $flow, false ); | |
| 801 | 804 | wp_send_json_error( $new_flow_id->get_error_message() ); |
| 802 | 805 | } |
| 803 | 806 | |
| 804 | 807 | $store_checkout = isset( $_POST['store_checkout'] ) ? sanitize_text_field( wp_unslash( $_POST['store_checkout'] ) ) : ''; |
| @@ -826,8 +829,9 @@ | ||
| 826 | 829 | $steps = isset( $flow['steps'] ) ? $flow['steps'] : array(); |
| 827 | 830 | |
| 828 | 831 | // Return of no steps are found in the imported flow. |
| 829 | 832 | if ( empty( $steps ) ) { |
| 833 | + do_action( 'cartflows_generate_analytics_lead', $flow, false ); | |
| 830 | 834 | $response_data = array( 'message' => __( 'Steps not found.', 'cartflows' ) ); |
| 831 | 835 | wp_send_json_error( $response_data ); |
| 832 | 836 | } |
| 833 | 837 | |
| @@ -884,8 +888,11 @@ | ||
| 884 | 888 | AdminHelper::track_funnel_creation_method( $creation_method ); |
| 885 | 889 | |
| 886 | 890 | wcf()->logger->import_log( 'COMPLETE! Importing Flow' ); |
| 887 | 891 | |
| 892 | + // Report the completed template import to the CartFlows server. | |
| 893 | + do_action( 'cartflows_generate_analytics_lead', $flow, true ); | |
| 894 | + | |
| 888 | 895 | wp_send_json_success( $response_data ); |
| 889 | 896 | } |
| 890 | 897 | |
| 891 | 898 | /** |
| @@ -935,9 +942,9 @@ | ||
| 935 | 942 | $response = \CartFlows_API::get_instance()->get_flow( $remote_flow_id ); |
| 936 | 943 | |
| 937 | 944 | if ( is_wp_error( $response['data'] ) ) { |
| 938 | 945 | /* translators: %1$s: html tag, %2$s: link html start %3$s: link html end */ |
| 939 | - $btn = sprintf( __( 'Request timeout error. Please check if the firewall or any security plugin is blocking the outgoing HTTP/HTTPS requests to templates.cartflows.com or not. %1$sTo resolve this issue, please check this %2$sarticle%3$s.', 'cartflows' ), '<br><br>', '<a target="_blank" href="https://cartflows.com/docs/request-timeout-error-while-importing-the-flow-step-templates/?utm_source=dashboard&utm_medium=free-cartflows&utm_campaign=docs">', '</a>' ); | |
| 946 | + $btn = sprintf( __( 'Request timeout error. Please check if the firewall or any security plugin is blocking the outgoing HTTP/HTTPS requests to templates.cartflows.com or not. %1$sTo resolve this issue, please check this %2$sarticle%3$s.', 'cartflows' ), '<br><br>', '<a target="_blank" href="' . esc_url( \Cartflows_Helper::get_kb_doc_link( 'https://cartflows.com/docs/request-timeout-error-while-importing-the-flow-step-templates/' ) ) . '">', '</a>' ); | |
| 940 | 947 | |
| 941 | 948 | wp_send_json_error( |
| 942 | 949 | array( |
| 943 | 950 | 'message' => $response['data']->get_error_message(), |
| @@ -957,9 +964,9 @@ | ||
| 957 | 964 | $msg = ''; |
| 958 | 965 | $cta = ''; |
| 959 | 966 | if ( 'not-installed' === $cf_pro_status ) { |
| 960 | 967 | /* translators: %1$s: link html start, %2$s: link html end*/ |
| 961 | - $cta = sprintf( __( '%1$sUpgrade to CartFlows Pro.%2$s', 'cartflows' ), '<a target="_blanks" class="wcf-button wcf-primary-button" href="https://cartflows.com/?utm_source=dashboard&utm_medium=free-cartflows&utm_campaign=go-pro">', '</a>' ); | |
| 968 | + $cta = sprintf( __( '%1$sUpgrade to CartFlows Pro.%2$s', 'cartflows' ), '<a target="_blanks" class="wcf-button wcf-primary-button" href="' . esc_url( \Cartflows_Helper::get_upgrade_to_pro_link( '', 'https://cartflows.com/' ) ) . '">', '</a>' ); | |
| 962 | 969 | $msg = __( 'To import the premium step, please upgrade to CartFlows Pro', 'cartflows' ); |
| 963 | 970 | } elseif ( 'inactive' === $cf_pro_status ) { |
| 964 | 971 | /* translators: %1$s: link html start, %2$s: link html end*/ |
| 965 | 972 | $cta = sprintf( __( '%1$sActivate CartFlows Pro%2$s', 'cartflows' ), '<a target="_blank" class="wcf-button wcf-primary-button" href="' . admin_url( 'plugins.php?plugin_status=search&paged=1&s=CartFlows+Pro' ) . '">', '</a>' ); |
| @@ -1061,9 +1068,9 @@ | ||
| 1061 | 1068 | // Get single step Rest API response. |
| 1062 | 1069 | $response = \CartFlows_API::get_instance()->get_flow( $remote_flow_id ); |
| 1063 | 1070 | if ( is_wp_error( $response['data'] ) ) { |
| 1064 | 1071 | /* translators: %1$s: html tag, %2$s: link html start %3$s: link html end */ |
| 1065 | - $btn = sprintf( __( 'Request timeout error. Please check if the firewall or any security plugin is blocking the outgoing HTTP/HTTPS requests to templates.cartflows.com or not. %1$sTo resolve this issue, please check this %2$s article%3$s.', 'cartflows' ), '<br><br>', '<a target="_blank" href="https://cartflows.com/docs/request-timeout-error-while-importing-the-flow-step-templates/?utm_source=dashboard&utm_medium=free-cartflows&utm_campaign=docs">', '</a>' ); | |
| 1072 | + $btn = sprintf( __( 'Request timeout error. Please check if the firewall or any security plugin is blocking the outgoing HTTP/HTTPS requests to templates.cartflows.com or not. %1$sTo resolve this issue, please check this %2$s article%3$s.', 'cartflows' ), '<br><br>', '<a target="_blank" href="' . esc_url( \Cartflows_Helper::get_kb_doc_link( 'https://cartflows.com/docs/request-timeout-error-while-importing-the-flow-step-templates/' ) ) . '">', '</a>' ); | |
| 1066 | 1073 | |
| 1067 | 1074 | wp_send_json_error( |
| 1068 | 1075 | array( |
| 1069 | 1076 | 'message' => $response['data']->get_error_message(), |
| @@ -1082,9 +1089,9 @@ | ||
| 1082 | 1089 | |
| 1083 | 1090 | $cta = ''; |
| 1084 | 1091 | if ( 'not-installed' === $cf_pro_status ) { |
| 1085 | 1092 | /* translators: %1$s: link html start, %2$s: link html end*/ |
| 1086 | - $cta = sprintf( __( 'Upgrade to %1$sCartFlows Pro.%2$s', 'cartflows' ), '<a target="_blanks" href="https://cartflows.com/?utm_source=dashboard&utm_medium=free-cartflows&utm_campaign=go-pro">', '</a>' ); | |
| 1093 | + $cta = sprintf( __( 'Upgrade to %1$sCartFlows Pro.%2$s', 'cartflows' ), '<a target="_blanks" href="' . esc_url( \Cartflows_Helper::get_upgrade_to_pro_link( '', 'https://cartflows.com/' ) ) . '">', '</a>' ); | |
| 1087 | 1094 | } elseif ( 'inactive' === $cf_pro_status ) { |
| 1088 | 1095 | /* translators: %1$s: link html start, %2$s: link html end*/ |
| 1089 | 1096 | $cta = sprintf( __( '%1$sActivate CartFlows Pro%2$s', 'cartflows' ), '<a target="_blank" href="' . admin_url( 'plugins.php?plugin_status=search&paged=1&s=CartFlows+Pro' ) . '">', '</a>' ); |
| 1090 | 1097 | } elseif ( 'active' === $cf_pro_status ) { |