Code Duplication    Length = 6-11 lines in 2 locations

dynamic-featured-image.php 2 locations

@@ 359-369 (lines=11) @@
356
357
        $thumbnail     = null;
358
        $attachment_id = null;
359
        if ( ! empty( $featured_img_full ) ) {
360
            $attachment_id = $this->get_image_id( $this->upload_url . $featured_img_full );
361
362
            $thumbnail = $this->get_image_thumb_by_attachment_id( $attachment_id, 'medium' );
363
364
            if ( empty( $thumbnail ) ) {
365
                // since medium sized thumbnail image is missing,
366
                // let's set full image url as thumbnail.
367
                $thumbnail = $featured_img_full;
368
            }
369
        }
370
371
        // Add a nonce field.
372
        echo $this->nonce_field( 'dfi_fimageplug-' . $featured_id ); // WPCS: XSS ok.
@@ 875-880 (lines=6) @@
872
        $dfi_images = get_post_meta( $post_id, 'dfiFeatured', true );
873
        $ret_val    = array();
874
875
        if ( ! empty( $dfi_images ) && is_array( $dfi_images ) ) {
876
            foreach ( $dfi_images as $dfi_image ) {
877
                $dfi_image_full = $this->separate( $dfi_image, 'full' );
878
                $ret_val[]      = (int) $this->get_image_id( $this->upload_url . $dfi_image_full );
879
            }
880
        }
881
882
        return $ret_val;
883
    }