Code Duplication    Length = 3-3 lines in 2 locations

modules/widgets/simple-payments.php 2 locations

@@ 137-139 (lines=3) @@
134
				wp_send_json_error( 'insufficient_post_permissions', 403 );
135
			}
136
137
			if ( empty( $_POST['params'] ) || ! is_array( $_POST['params'] ) ) {
138
				wp_send_json_error( 'missing_params', 400 );
139
			}
140
141
			$params = wp_unslash( $_POST['params'] );
142
			$illegal_params = array_diff( array_keys( $params ), array( 'product_post_id', 'post_title', 'post_content', 'image_id', 'currency', 'price', 'multiple', 'email' ) );
@@ 189-191 (lines=3) @@
186
				wp_send_json_error( 'customize_not_allowed', 403 );
187
			}
188
189
			if ( empty( $_POST['params'] ) || ! is_array( $_POST['params'] ) ) {
190
				wp_send_json_error( 'missing_params', 400 );
191
			}
192
193
			$params = wp_unslash( $_POST['params'] );
194
			$illegal_params = array_diff( array_keys( $params ), array( 'product_post_id' ) );