Code Duplication    Length = 8-8 lines in 2 locations

classes/autoptimizeCriticalCSSCore.php 2 locations

@@ 383-390 (lines=8) @@
380
            $status_msg = __( 'Valid' );
381
            $color      = '#46b450'; // Green.
382
            $message    = null;
383
        } elseif ( $key && 1 == $key_status ) {
384
            // Key exists but its validation has failed.
385
            // Set invalid key status.
386
            $status     = 'invalid';
387
            $status_msg = __( 'Invalid' );
388
            $color      = '#dc3232'; // Red.
389
            $message    = __( 'Your API key is invalid. Please enter a valid <a href="https://criticalcss.com/?aff=1" target="_blank">criticalcss.com</a> key.', 'autoptimize' );
390
        } elseif ( $key && ! $key_status ) {
391
            // Key exists but it has no valid status yet
392
            // Perform key validation.
393
            $key_check = $self->ao_ccss_key_validation( $key );
@@ 412-419 (lines=8) @@
409
                    $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' );
410
                }
411
            }
412
        } else {
413
            // No key nor status
414
            // Set no key status.
415
            $status     = 'nokey';
416
            $status_msg = __( 'None' );
417
            $color      = '#ffb900'; // Yellow.
418
            $message    = __( 'Please enter a valid <a href="https://criticalcss.com/?aff=1" target="_blank">criticalcss.com</a> API key to start.', 'autoptimize' );
419
        }
420
421
        // Fill returned values.
422
        $key_return['status'] = $status;