Code Duplication    Length = 5-8 lines in 3 locations

includes/class-sensei.php 3 locations

@@ 611-615 (lines=5) @@
608
                    $course_link = '<a href="' . esc_url( get_permalink( $lesson_course_id ) ) . '">' . __( 'course', 'woothemes-sensei' ) . '</a>';
609
                    $wc_post_id = get_post_meta( $lesson_course_id, '_course_woocommerce_product',true );
610
                    if ( Sensei_WC::is_woocommerce_active() && ( 0 < $wc_post_id ) ) {
611
                        if ( $is_preview ) {
612
                            $this->permissions_message['message'] = sprintf( __('This is a preview lesson. Please purchase the %1$s to access all lessons.', 'woothemes-sensei' ), $course_link );
613
                        } else {
614
                            $this->permissions_message['message'] =  sprintf( __('Please purchase the %1$s before starting this Lesson.', 'woothemes-sensei' ), $course_link );
615
                        }
616
                    } else {
617
                        if ( $is_preview ) {
618
                            $this->permissions_message['message'] = sprintf( __('This is a preview lesson. Please sign up for the %1$s to access all lessons.', 'woothemes-sensei' ), $course_link );
@@ 616-623 (lines=8) @@
613
                        } else {
614
                            $this->permissions_message['message'] =  sprintf( __('Please purchase the %1$s before starting this Lesson.', 'woothemes-sensei' ), $course_link );
615
                        }
616
                    } else {
617
                        if ( $is_preview ) {
618
                            $this->permissions_message['message'] = sprintf( __('This is a preview lesson. Please sign up for the %1$s to access all lessons.', 'woothemes-sensei' ), $course_link );
619
                        } else {
620
                            /** This filter is documented in class-woothemes-sensei-frontend.php */
621
                            $this->permissions_message['message'] =  sprintf( __( 'Please sign up for the %1$s before starting the lesson.', 'woothemes-sensei' ), $course_link );
622
                        }
623
                    } // End If Statement
624
                } // End If Statement
625
                break;
626
            case 'quiz-single':
@@ 665-669 (lines=5) @@
662
                        $this->permissions_message['title'] = get_the_title( $post->ID ) . ': ' . __('Restricted Access', 'woothemes-sensei' );
663
                        $course_link = '<a href="' . esc_url( get_permalink( $lesson_course_id ) ) . '">' . __( 'course', 'woothemes-sensei' ) . '</a>';
664
                        $wc_post_id = get_post_meta( $lesson_course_id, '_course_woocommerce_product',true );
665
                        if ( Sensei_WC::is_woocommerce_active() && ( 0 < $wc_post_id ) ) {
666
                            $this->permissions_message['message'] = sprintf( __('Please purchase the %1$s before starting this Quiz.', 'woothemes-sensei' ), $course_link );
667
                        } else {
668
                            $this->permissions_message['message'] = sprintf( __('Please sign up for the %1$s before starting this Quiz.', 'woothemes-sensei' ), $course_link );
669
                        } // End If Statement
670
                    } else {
671
                        $user_allowed = true;
672
                    } // End If Statement