Code Duplication    Length = 3-13 lines in 2 locations

_inc/lib/class.core-rest-api-endpoints.php 2 locations

@@ 3691-3703 (lines=13) @@
3688
		$plugin = $request['plugin'] . '.php';
3689
3690
		// Is the plugin installed?
3691
		if ( ! in_array( $plugin, array_keys( $plugins ), true ) ) {
3692
			return new WP_Error(
3693
				'plugin_not_found',
3694
				esc_html(
3695
					sprintf(
3696
						/* translators: placeholder is a plugin slug. */
3697
						__( 'Plugin %s is not installed.', 'jetpack' ),
3698
						$plugin
3699
					)
3700
				),
3701
				array( 'status' => 404 )
3702
			);
3703
		}
3704
3705
		// Is the plugin active already?
3706
		$status = Jetpack_Plugins::get_plugin_status( $plugin );
@@ 3786-3788 (lines=3) @@
3783
3784
		$plugin = stripslashes( $request['plugin'] );
3785
3786
		if ( ! in_array( $plugin, array_keys( $plugins ) ) ) {
3787
			return new WP_Error( 'plugin_not_found', esc_html( sprintf( __( 'Plugin %s is not installed.', 'jetpack' ), $plugin ) ), array( 'status' => 404 ) );
3788
		}
3789
3790
		$plugin_data = $plugins[ $plugin ];
3791