Code Duplication    Length = 6-11 lines in 2 locations

dynamic-featured-image.php 2 locations

@@ 367-377 (lines=11) @@
364
365
        $thumbnail     = null;
366
        $attachment_id = null;
367
        if ( ! empty( $featured_img_full ) ) {
368
            $attachment_id = $this->get_image_id( $this->upload_url . $featured_img_full );
369
370
            $thumbnail = $this->get_image_thumb_by_attachment_id( $attachment_id, 'medium' );
371
372
            if ( empty( $thumbnail ) ) {
373
                // since medium sized thumbnail image is missing,
374
                // let's set full image url as thumbnail.
375
                $thumbnail = $featured_img_full;
376
            }
377
        }
378
379
        // Add a nonce field.
380
        echo $this->nonce_field( 'dfi_fimageplug-' . $featured_id ); // WPCS: XSS ok.
@@ 894-899 (lines=6) @@
891
        $dfi_images = get_post_meta( $post_id, 'dfiFeatured', true );
892
        $ret_val    = array();
893
894
        if ( ! empty( $dfi_images ) && is_array( $dfi_images ) ) {
895
            foreach ( $dfi_images as $dfi_image ) {
896
                $dfi_image_full = $this->separate( $dfi_image, 'full' );
897
                $ret_val[]      = (int) $this->get_image_id( $this->upload_url . $dfi_image_full );
898
            }
899
        }
900
        return $ret_val;
901
    }
902