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.
@@ 877-882 (lines=6) @@
874
        $dfi_images = get_post_meta( $post_id, 'dfiFeatured', true );
875
        $ret_val    = array();
876
877
        if ( ! empty( $dfi_images ) && is_array( $dfi_images ) ) {
878
            foreach ( $dfi_images as $dfi_image ) {
879
                $dfi_image_full = $this->separate( $dfi_image, 'full' );
880
                $ret_val[]      = (int) $this->get_image_id( $this->upload_url . $dfi_image_full );
881
            }
882
        }
883
		$ret_val = $this->sanitize_array( $ret_val );
884
        return $ret_val;
885
    }