Code Duplication    Length = 3-3 lines in 2 locations

modules/widgets/simple-payments.php 2 locations

@@ 145-147 (lines=3) @@
142
			}
143
144
			$post_type_object = get_post_type_object( Jetpack_Simple_Payments::$post_type_product );
145
			if ( ! current_user_can( $post_type_object->cap->create_posts ) || ! current_user_can( $post_type_object->cap->publish_posts ) ) {
146
				wp_send_json_error( 'insufficient_post_permissions', 403 );
147
			}
148
149
			$product_posts = get_posts(
150
				array(
@@ 180-182 (lines=3) @@
177
			}
178
179
			$post_type_object = get_post_type_object( Jetpack_Simple_Payments::$post_type_product );
180
			if ( ! current_user_can( $post_type_object->cap->create_posts ) || ! current_user_can( $post_type_object->cap->publish_posts ) ) {
181
				wp_send_json_error( 'insufficient_post_permissions', 403 );
182
			}
183
184
			if ( empty( $_POST['params'] ) || ! is_array( $_POST['params'] ) ) {
185
				wp_send_json_error( 'missing_params', 400 );