Code Duplication    Length = 8-8 lines in 2 locations

classes/autoptimizeCriticalCSSCore.php 2 locations

@@ 389-396 (lines=8) @@
386
            $status_msg = __( 'Valid' );
387
            $color      = '#46b450'; // Green.
388
            $message    = null;
389
        } elseif ( $key && 1 == $key_status ) {
390
            // Key exists but its validation has failed.
391
            // Set invalid key status.
392
            $status     = 'invalid';
393
            $status_msg = __( 'Invalid' );
394
            $color      = '#dc3232'; // Red.
395
            $message    = __( 'Your API key is invalid. Please enter a valid <a href="https://criticalcss.com/?aff=1" target="_blank">criticalcss.com</a> key.', 'autoptimize' );
396
        } elseif ( $key && ! $key_status ) {
397
            // Key exists but it has no valid status yet
398
            // Perform key validation.
399
            $key_check = $self->ao_ccss_key_validation( $key );
@@ 418-425 (lines=8) @@
415
                    $message = __( 'Something went wrong when checking your API key, make sure you server can communicate with https://criticalcss.com and/ or try again later.', 'autoptimize' );
416
                }
417
            }
418
        } else {
419
            // No key nor status
420
            // Set no key status.
421
            $status     = 'nokey';
422
            $status_msg = __( 'None' );
423
            $color      = '#ffb900'; // Yellow.
424
            $message    = __( 'Please enter a valid <a href="https://criticalcss.com/?aff=1" target="_blank">criticalcss.com</a> API key to start.', 'autoptimize' );
425
        }
426
427
        // Fill returned values.
428
        $key_return['status'] = $status;