Code Duplication    Length = 3-3 lines in 2 locations

modules/widgets/simple-payments.php 2 locations

@@ 180-182 (lines=3) @@
177
				wp_send_json_error( 'insufficient_post_permissions', 403 );
178
			}
179
180
			if ( empty( $_POST['params'] ) || ! is_array( $_POST['params'] ) ) {
181
				wp_send_json_error( 'missing_params', 400 );
182
			}
183
184
			$params = wp_unslash( $_POST['params'] );
185
			$errors = $this->validate_ajax_params( $params );
@@ 243-245 (lines=3) @@
240
				wp_send_json_error( 'customize_not_allowed', 403 );
241
			}
242
243
			if ( empty( $_POST['params'] ) || ! is_array( $_POST['params'] ) ) {
244
				wp_send_json_error( 'missing_params', 400 );
245
			}
246
247
			$params = wp_unslash( $_POST['params'] );
248
			$illegal_params = array_diff( array_keys( $params ), array( 'product_post_id' ) );