Code Duplication    Length = 8-8 lines in 2 locations

classes/autoptimizeCriticalCSSCore.php 2 locations

@@ 358-365 (lines=8) @@
355
            $status_msg = __( 'Valid' );
356
            $color      = '#46b450'; // Green.
357
            $message    = null;
358
        } elseif ( $key && 1 == $key_status ) {
359
            // Key exists but its validation has failed.
360
            // Set invalid key status.
361
            $status     = 'invalid';
362
            $status_msg = __( 'Invalid' );
363
            $color      = '#dc3232'; // Red.
364
            $message    = __( 'Your API key is invalid. Please enter a valid <a href="https://criticalcss.com/?aff=1" target="_blank">criticalcss.com</a> key.', 'autoptimize' );
365
        } elseif ( $key && ! $key_status ) {
366
            // Key exists but it has no valid status yet
367
            // Perform key validation.
368
            $key_check = $self->ao_ccss_key_validation( $key );
@@ 387-394 (lines=8) @@
384
                    $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' );
385
                }
386
            }
387
        } else {
388
            // No key nor status
389
            // Set no key status.
390
            $status     = 'nokey';
391
            $status_msg = __( 'None' );
392
            $color      = '#ffb900'; // Yellow.
393
            $message    = __( 'Please enter a valid <a href="https://criticalcss.com/?aff=1" target="_blank">criticalcss.com</a> API key to start.', 'autoptimize' );
394
        }
395
396
        // Fill returned values.
397
        $key_return['status'] = $status;