Code Duplication    Length = 6-11 lines in 2 locations

dynamic-featured-image.php 2 locations

@@ 390-400 (lines=11) @@
387
388
        $thumbnail     = null;
389
        $attachment_id = null;
390
        if (!empty($featured_img_full)) {
391
            $attachment_id = $this->get_image_id( $this->upload_url . $featured_img_full );
392
393
            $thumbnail = $this->get_image_thumb_by_attachment_id( $attachment_id, 'medium' );
394
395
            if ( empty( $thumbnail ) ) {
396
                // since medium sized thumbnail image is missing,
397
                // let's set full image url as thumbnail.
398
                $thumbnail = $featured_img_full;
399
            }
400
        }
401
402
        // Add a nonce field.
403
        echo $this->nonce_field( 'dfi_fimageplug-' . $featured_id ); // WPCS: XSS ok.
@@ 897-902 (lines=6) @@
894
        $dfi_images = get_post_meta( $post_id, 'dfiFeatured', true );
895
        $ret_val    = array();
896
897
        if ( ! empty( $dfi_images ) && is_array( $dfi_images ) ) {
898
            foreach ( $dfi_images as $dfi_image ) {
899
                $dfi_image_full = $this->separate( $dfi_image, 'full' );
900
                $ret_val[]      = (int) $this->get_image_id( $this->upload_url . $dfi_image_full );
901
            }
902
        }
903
904
        return $ret_val;
905
    }