admin_url( 'admin-ajax.php' ), 'enter' => __( 'Enter focus mode', 'killerconversions' ), 'exit' => __( 'Exit focus mode', 'killerconversions' ), 'saved' => __( 'Workspace preference saved for you on this site.', 'killerconversions' ), 'error' => __( 'Your focus preference could not be saved. Your edits are still here; try again.', 'killerconversions' ), ) ); } /** Keep WordPress notices intact; this bar changes chrome, never the form DOM. */ public static function toolbar( $embedded = false ) { if ( ! $embedded && class_exists( 'KCONV_Workspace_Navigation' ) && KCONV_Workspace_Navigation::will_render() ) { return; } if ( ! KCONV_Admin_Scope::plugin() || ! self::allowed() ) { return; } echo '
' . esc_html__( 'Back to WordPress', 'killerconversions' ) . '
'; wp_nonce_field( 'kconv_focus' ); echo '
'; } public static function save_focus() { if ( ! self::allowed() ) { wp_die( esc_html__( 'You cannot change this workspace preference.', 'killerconversions' ), '', array( 'response' => 403 ) ); } check_admin_referer( 'kconv_focus' ); $focus = isset( $_POST['focus'] ) && is_string( $_POST['focus'] ) ? sanitize_text_field( wp_unslash( $_POST['focus'] ) ) : ''; if ( ! in_array( $focus, array( '0', '1' ), true ) ) { wp_die( esc_html__( 'Choose a valid focus preference.', 'killerconversions' ), '', array( 'response' => 400 ) ); } update_user_meta( get_current_user_id(), self::key( 'focus' ), $focus ); if ( $focus !== get_user_meta( get_current_user_id(), self::key( 'focus' ), true ) ) { if ( wp_doing_ajax() ) { wp_send_json_error( array( 'message' => __( 'The preference could not be saved. Try again.', 'killerconversions' ) ), 503 ); } wp_die( esc_html__( 'The preference could not be saved. Try again.', 'killerconversions' ), '', array( 'response' => 503, 'back_link' => true ) ); } if ( wp_doing_ajax() ) { wp_send_json_success( array( 'focused' => '1' === $focus ) ); } wp_safe_redirect( wp_get_referer() ? wp_get_referer() : admin_url( 'admin.php?page=kconv-start' ) ); exit; } public static function screen() { if ( ! current_user_can( 'manage_options' ) ) { return; } if ( ! get_user_meta( get_current_user_id(), self::key( 'onboarding_shown' ), true ) ) { update_user_meta( get_current_user_id(), self::key( 'onboarding_shown' ), time() ); } $forms = get_posts( array( 'post_type' => 'kconv_form', 'post_status' => array( 'draft', 'publish' ), 'post_parent' => 0, 'posts_per_page' => 1, 'fields' => 'ids' ) ); echo '
'; KCONV_Admin::navigation( 'start' ); echo '
' . esc_html__( 'START HERE', 'killerconversions' ) . '

' . esc_html( $forms ? __( 'Start with a useful form.', 'killerconversions' ) : __( 'Create your first form.', 'killerconversions' ) ) . '

' . esc_html__( 'Choose a starting point, make it yours, then try it before publishing. All three starters are included in Free.', 'killerconversions' ) . '

'; $starters = array( array( 'contact', __( 'Collect enquiries', 'killerconversions' ), __( 'Give visitors a clear way to ask a question or request a callback.', 'killerconversions' ), __( 'Start an enquiry form', 'killerconversions' ) ), array( 'quote', __( 'Request a quote', 'killerconversions' ), __( 'Collect the project details you need to prepare a personal quote.', 'killerconversions' ), __( 'Start a quote enquiry', 'killerconversions' ) ), array( 'agency_brief', __( 'Collect a project brief', 'killerconversions' ), __( 'Collect the goals, service and timing needed for a useful reply.', 'killerconversions' ), __( 'Start a project brief form', 'killerconversions' ) ), ); foreach ( $starters as $index => $starter ) { echo ''; } echo '

' . esc_html__( 'From first draft to your website', 'killerconversions' ) . '

  1. ' . esc_html__( 'Make it yours', 'killerconversions' ) . '' . esc_html__( 'Edit the questions and choose where responses should go.', 'killerconversions' ) . '
  2. ' . esc_html__( 'Try your form', 'killerconversions' ) . '' . esc_html__( 'Check the visitor experience without sending a submission.', 'killerconversions' ) . '
  3. ' . esc_html__( 'Publish and add to a page', 'killerconversions' ) . '' . esc_html__( 'Use the form block or shortcode, then send a real test.', 'killerconversions' ) . '
'; echo '

' . esc_html__( 'Creating and using forms does not require sharing your domain or signing up for emails.', 'killerconversions' ) . '

'; KCONV_Pro_Discovery::preview_navigation( 'start' ); echo '
'; } }