Code Duplication    Length = 5-8 lines in 3 locations

includes/class-sensei.php 3 locations

@@ 603-607 (lines=5) @@
600
                    $course_link = '<a href="' . esc_url( get_permalink( $lesson_course_id ) ) . '">' . __( 'course', 'woothemes-sensei' ) . '</a>';
601
                    $wc_post_id = get_post_meta( $lesson_course_id, '_course_woocommerce_product',true );
602
                    if ( Sensei_WC::is_woocommerce_active() && ( 0 < $wc_post_id ) ) {
603
                        if ( $is_preview ) {
604
                            $this->permissions_message['message'] = sprintf( __('This is a preview lesson. Please purchase the %1$s to access all lessons.', 'woothemes-sensei' ), $course_link );
605
                        } else {
606
                            $this->permissions_message['message'] =  sprintf( __('Please purchase the %1$s before starting this Lesson.', 'woothemes-sensei' ), $course_link );
607
                        }
608
                    } else {
609
                        if ( $is_preview ) {
610
                            $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 );
@@ 608-615 (lines=8) @@
605
                        } else {
606
                            $this->permissions_message['message'] =  sprintf( __('Please purchase the %1$s before starting this Lesson.', 'woothemes-sensei' ), $course_link );
607
                        }
608
                    } else {
609
                        if ( $is_preview ) {
610
                            $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 );
611
                        } else {
612
                            /** This filter is documented in class-woothemes-sensei-frontend.php */
613
                            $this->permissions_message['message'] =  sprintf( __( 'Please sign up for the %1$s before starting the lesson.', 'woothemes-sensei' ), $course_link );
614
                        }
615
                    } // End If Statement
616
                } // End If Statement
617
                break;
618
            case 'quiz-single':
@@ 657-661 (lines=5) @@
654
                        $this->permissions_message['title'] = get_the_title( $post->ID ) . ': ' . __('Restricted Access', 'woothemes-sensei' );
655
                        $course_link = '<a href="' . esc_url( get_permalink( $lesson_course_id ) ) . '">' . __( 'course', 'woothemes-sensei' ) . '</a>';
656
                        $wc_post_id = get_post_meta( $lesson_course_id, '_course_woocommerce_product',true );
657
                        if ( Sensei_WC::is_woocommerce_active() && ( 0 < $wc_post_id ) ) {
658
                            $this->permissions_message['message'] = sprintf( __('Please purchase the %1$s before starting this Quiz.', 'woothemes-sensei' ), $course_link );
659
                        } else {
660
                            $this->permissions_message['message'] = sprintf( __('Please sign up for the %1$s before starting this Quiz.', 'woothemes-sensei' ), $course_link );
661
                        } // End If Statement
662
                    } else {
663
                        $user_allowed = true;
664
                    } // End If Statement