Code Duplication    Length = 15-15 lines in 2 locations

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

@@ 739-753 (lines=15) @@
736
					}
737
					break;
738
739
				case Jetpack_SEO_Utils::FRONT_PAGE_META_OPTION:
740
					if ( ! Jetpack_SEO_Utils::is_enabled_jetpack_seo() && ! Jetpack_SEO_Utils::has_grandfathered_front_page_meta() ) {
741
						return new WP_Error( 'unauthorized', __( 'SEO tools are not enabled for this site.', 'jetpack' ), 403 );
742
					}
743
744
					if ( ! is_string( $value ) ) {
745
						return new WP_Error( 'invalid_input', __( 'Invalid SEO meta description value.', 'jetpack' ), 400 );
746
					}
747
748
					$new_description = Jetpack_SEO_Utils::update_front_page_meta_description( $value );
749
750
					if ( ! empty( $new_description ) ) {
751
						$updated[ $key ] = $new_description;
752
					}
753
					break;
754
755
				case Jetpack_SEO_Titles::TITLE_FORMATS_OPTION:
756
					if ( ! Jetpack_SEO_Utils::is_enabled_jetpack_seo() ) {
@@ 755-769 (lines=15) @@
752
					}
753
					break;
754
755
				case Jetpack_SEO_Titles::TITLE_FORMATS_OPTION:
756
					if ( ! Jetpack_SEO_Utils::is_enabled_jetpack_seo() ) {
757
						return new WP_Error( 'unauthorized', __( 'SEO tools are not enabled for this site.', 'jetpack' ), 403 );
758
					}
759
760
					if ( ! Jetpack_SEO_Titles::are_valid_title_formats( $value ) ) {
761
						return new WP_Error( 'invalid_input', __( 'Invalid SEO title format.', 'jetpack' ), 400 );
762
					}
763
764
					$new_title_formats = Jetpack_SEO_Titles::update_title_formats( $value );
765
766
					if ( ! empty( $new_title_formats ) ) {
767
						$updated[ $key ] = $new_title_formats;
768
					}
769
					break;
770
771
				case 'verification_services_codes':
772
					$verification_codes = jetpack_verification_validate( $value );