Code Duplication    Length = 15-15 lines in 2 locations

json-endpoints/class.wpcom-json-api-site-settings-endpoint.php 2 locations

@@ 533-547 (lines=15) @@
530
					}
531
					break;
532
533
				case Jetpack_SEO_Utils::FRONT_PAGE_META_OPTION:
534
					if ( ! Jetpack_SEO_Utils::is_enabled_jetpack_seo() && ! Jetpack_SEO_Utils::has_grandfathered_front_page_meta() ) {
535
						return new WP_Error( 'unauthorized', __( 'SEO tools are not enabled for this site.', 'jetpack' ), 403 );
536
					}
537
538
					if ( ! is_string( $value ) ) {
539
						return new WP_Error( 'invalid_input', __( 'Invalid SEO meta description value.', 'jetpack' ), 400 );
540
					}
541
542
					$new_description = Jetpack_SEO_Utils::update_front_page_meta_description( $value );
543
544
					if ( ! empty( $new_description ) ) {
545
						$updated[ $key ] = $new_description;
546
					}
547
					break;
548
549
				case Jetpack_SEO_Titles::TITLE_FORMATS_OPTION:
550
					if ( ! Jetpack_SEO_Utils::is_enabled_jetpack_seo() ) {
@@ 549-563 (lines=15) @@
546
					}
547
					break;
548
549
				case Jetpack_SEO_Titles::TITLE_FORMATS_OPTION:
550
					if ( ! Jetpack_SEO_Utils::is_enabled_jetpack_seo() ) {
551
						return new WP_Error( 'unauthorized', __( 'SEO tools are not enabled for this site.', 'jetpack' ), 403 );
552
					}
553
554
					if ( ! Jetpack_SEO_Titles::are_valid_title_formats( $value ) ) {
555
						return new WP_Error( 'invalid_input', __( 'Invalid SEO title format.', 'jetpack' ), 400 );
556
					}
557
558
					$new_title_formats = Jetpack_SEO_Titles::update_title_formats( $value );
559
560
					if ( ! empty( $new_title_formats ) ) {
561
						$updated[ $key ] = $new_title_formats;
562
					}
563
					break;
564
565
				case 'verification_services_codes':
566
					$verification_codes = jetpack_verification_validate( $value );