Code Duplication    Length = 15-16 lines in 2 locations

classes/models/FrmMigrate.php 2 locations

@@ 310-325 (lines=16) @@
307
	 * reverse the extra size changes in widgets
308
	 * @since 3.0.05
309
	 */
310
	private function revert_widget_field_size() {
311
		$widgets = get_option( 'widget_frm_show_form' );
312
		if ( empty( $widgets ) ) {
313
			return;
314
		}
315
316
		$widgets = maybe_unserialize( $widgets );
317
		foreach ( $widgets as $k => $widget ) {
318
			if ( ! is_array( $widget ) || ! isset( $widget['size'] ) ) {
319
				continue;
320
			}
321
322
			$this->maybe_convert_migrated_size( $widgets[ $k ]['size'] );
323
		}
324
		update_option( 'widget_frm_show_form', $widgets );
325
	}
326
327
	/**
328
	 * Divide by 9 to reverse the multiplication
@@ 407-421 (lines=15) @@
404
	/**
405
	 * Change the characters in widgets to pixels
406
	 */
407
	private function adjust_widget_size() {
408
		$widgets = get_option( 'widget_frm_show_form' );
409
		if ( empty( $widgets ) ) {
410
			return;
411
		}
412
413
		$widgets = maybe_unserialize( $widgets );
414
		foreach ( $widgets as $k => $widget ) {
415
			if ( ! is_array( $widget ) || ! isset( $widget['size'] ) ) {
416
				continue;
417
			}
418
			$this->convert_character_to_px( $widgets[ $k ]['size'] );
419
		}
420
		update_option( 'widget_frm_show_form', $widgets );
421
	}
422
423
	private function convert_character_to_px( &$size ) {
424
		$pixel_conversion = 9;