Code Duplication    Length = 3-3 lines in 2 locations

modules/widgets/simple-payments.php 2 locations

@@ 134-136 (lines=3) @@
131
			}
132
133
			$post_type_object = get_post_type_object( Jetpack_Simple_Payments::$post_type_product );
134
			if ( ! current_user_can( $post_type_object->cap->create_posts ) || ! current_user_can( $post_type_object->cap->publish_posts ) ) {
135
				wp_send_json_error( 'insufficient_post_permissions', 403 );
136
			}
137
138
			$product_posts = get_posts( array(
139
				'numberposts' => 100,
@@ 167-169 (lines=3) @@
164
			}
165
166
			$post_type_object = get_post_type_object( Jetpack_Simple_Payments::$post_type_product );
167
			if ( ! current_user_can( $post_type_object->cap->create_posts ) || ! current_user_can( $post_type_object->cap->publish_posts ) ) {
168
				wp_send_json_error( 'insufficient_post_permissions', 403 );
169
			}
170
171
			if ( empty( $_POST['params'] ) || ! is_array( $_POST['params'] ) ) {
172
				wp_send_json_error( 'missing_params', 400 );