Code Duplication    Length = 7-7 lines in 3 locations

src/wp-admin/includes/ajax-actions.php 3 locations

@@ 3625-3631 (lines=7) @@
3622
function wp_ajax_install_plugin() {
3623
	check_ajax_referer( 'updates' );
3624
3625
	if ( empty( $_POST['slug'] ) ) {
3626
		wp_send_json_error( array(
3627
			'slug'         => '',
3628
			'errorCode'    => 'no_plugin_specified',
3629
			'errorMessage' => __( 'No plugin specified.' ),
3630
		) );
3631
	}
3632
3633
	$status = array(
3634
		'install' => 'plugin',
@@ 3724-3730 (lines=7) @@
3721
function wp_ajax_update_plugin() {
3722
	check_ajax_referer( 'updates' );
3723
3724
	if ( empty( $_POST['plugin'] ) || empty( $_POST['slug'] ) ) {
3725
		wp_send_json_error( array(
3726
			'slug'         => '',
3727
			'errorCode'    => 'no_plugin_specified',
3728
			'errorMessage' => __( 'No plugin specified.' ),
3729
		) );
3730
	}
3731
3732
	$plugin = plugin_basename( sanitize_text_field( wp_unslash( $_POST['plugin'] ) ) );
3733
@@ 3827-3833 (lines=7) @@
3824
function wp_ajax_delete_plugin() {
3825
	check_ajax_referer( 'updates' );
3826
3827
	if ( empty( $_POST['slug'] ) || empty( $_POST['plugin'] ) ) {
3828
		wp_send_json_error( array(
3829
			'slug'         => '',
3830
			'errorCode'    => 'no_plugin_specified',
3831
			'errorMessage' => __( 'No plugin specified.' ),
3832
		) );
3833
	}
3834
3835
	$plugin = plugin_basename( sanitize_text_field( wp_unslash( $_POST['plugin'] ) ) );
3836