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.
@@ 896-901 (lines=6) @@
893
        $dfi_images = get_post_meta( $post_id, 'dfiFeatured', true );
894
        $ret_val    = array();
895
896
        if ( ! empty( $dfi_images ) && is_array( $dfi_images ) ) {
897
            foreach ( $dfi_images as $dfi_image ) {
898
                $dfi_image_full = $this->separate( $dfi_image, 'full' );
899
                $ret_val[]      = (int) $this->get_image_id( $this->upload_url . $dfi_image_full );
900
            }
901
        }
902
903
        return $ret_val;
904
    }