Code Duplication    Length = 15-15 lines in 2 locations

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

@@ 784-798 (lines=15) @@
781
					}
782
					break;
783
784
				case Jetpack_SEO_Utils::FRONT_PAGE_META_OPTION:
785
					if ( ! Jetpack_SEO_Utils::is_enabled_jetpack_seo() && ! Jetpack_SEO_Utils::has_legacy_front_page_meta() ) {
786
						return new WP_Error( 'unauthorized', __( 'SEO tools are not enabled for this site.', 'jetpack' ), 403 );
787
					}
788
789
					if ( ! is_string( $value ) ) {
790
						return new WP_Error( 'invalid_input', __( 'Invalid SEO meta description value.', 'jetpack' ), 400 );
791
					}
792
793
					$new_description = Jetpack_SEO_Utils::update_front_page_meta_description( $value );
794
795
					if ( ! empty( $new_description ) ) {
796
						$updated[ $key ] = $new_description;
797
					}
798
					break;
799
800
				case Jetpack_SEO_Titles::TITLE_FORMATS_OPTION:
801
					if ( ! Jetpack_SEO_Utils::is_enabled_jetpack_seo() ) {
@@ 800-814 (lines=15) @@
797
					}
798
					break;
799
800
				case Jetpack_SEO_Titles::TITLE_FORMATS_OPTION:
801
					if ( ! Jetpack_SEO_Utils::is_enabled_jetpack_seo() ) {
802
						return new WP_Error( 'unauthorized', __( 'SEO tools are not enabled for this site.', 'jetpack' ), 403 );
803
					}
804
805
					if ( ! Jetpack_SEO_Titles::are_valid_title_formats( $value ) ) {
806
						return new WP_Error( 'invalid_input', __( 'Invalid SEO title format.', 'jetpack' ), 400 );
807
					}
808
809
					$new_title_formats = Jetpack_SEO_Titles::update_title_formats( $value );
810
811
					if ( ! empty( $new_title_formats ) ) {
812
						$updated[ $key ] = $new_title_formats;
813
					}
814
					break;
815
816
				case 'verification_services_codes':
817
					$verification_codes = jetpack_verification_validate( $value );