' . esc_html( $starter[1] ) . '
' . esc_html( $starter[2] ) . '
' . esc_html( $starter[3] ) . '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 '
'; } 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 '' . esc_html__( 'Choose a starting point, make it yours, then try it before publishing. All three starters are included in Free.', 'killerconversions' ) . '
' . esc_html( $starter[2] ) . '
' . esc_html( $starter[3] ) . '' . 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 '