Code Duplication    Length = 19-19 lines in 2 locations

includes/class-sensei-lesson.php 2 locations

@@ 3515-3533 (lines=19) @@
3512
3513
            if ( Sensei_WC::is_woocommerce_active() && Sensei_WC::is_course_purchasable( $course_id ) ) {
3514
3515
                if( is_user_logged_in() && ! Sensei_Utils::user_started_course( $course_id, $current_user->ID )  ) {
3516
3517
	                    $a_element = '<a href="' . esc_url( get_permalink( $course_id ) ) . '" title="' . __( 'Sign Up', 'woothemes-sensei' )  . '">';
3518
	                    $a_element .= __( 'course', 'woothemes-sensei' );
3519
	                    $a_element .= '</a>';
3520
3521
	                    if( Sensei_Utils::is_preview_lesson( get_the_ID()  ) ){
3522
3523
		                    $message = sprintf( __( 'This is a preview lesson. Please purchase the %1$s before starting the lesson.', 'woothemes-sensei' ), $a_element );
3524
3525
	                    }else{
3526
3527
		                    $message = sprintf( __( 'Please purchase the %1$s before starting the lesson.', 'woothemes-sensei' ), $a_element );
3528
3529
	                    }
3530
3531
	                    Sensei()->notices->add_notice( $message, 'info' );
3532
3533
                }
3534
3535
	            if( ! is_user_logged_in() ) {
3536
@@ 3535-3553 (lines=19) @@
3532
3533
                }
3534
3535
	            if( ! is_user_logged_in() ) {
3536
3537
	                $a_element = '<a href="' . esc_url( get_permalink( $course_id ) ) . '" title="' . __( 'Sign Up', 'woothemes-sensei' )  . '">';
3538
	                $a_element .= __( 'course', 'woothemes-sensei' );
3539
	                $a_element .= '</a>';
3540
3541
	                if( Sensei_Utils::is_preview_lesson( get_the_ID()  ) ){
3542
3543
						$message = sprintf( __( 'This is a preview lesson. Please purchase the %1$s before starting the lesson.', 'woothemes-sensei' ), $a_element );
3544
3545
					}else{
3546
3547
						$message = sprintf( __( 'Please purchase the %1$s before starting the lesson.', 'woothemes-sensei' ), $a_element );
3548
3549
					}
3550
3551
					Sensei()->notices->add_notice( $message, 'alert' );
3552
3553
	            }
3554
3555
            } else { ?>
3556