Code Duplication    Length = 15-16 lines in 2 locations

classes/models/FrmMigrate.php 2 locations

@@ 332-347 (lines=16) @@
329
	 *
330
	 * @since 3.0.05
331
	 */
332
	private function revert_widget_field_size() {
333
		$widgets = get_option( 'widget_frm_show_form' );
334
		if ( empty( $widgets ) ) {
335
			return;
336
		}
337
338
		$widgets = maybe_unserialize( $widgets );
339
		foreach ( $widgets as $k => $widget ) {
340
			if ( ! is_array( $widget ) || ! isset( $widget['size'] ) ) {
341
				continue;
342
			}
343
344
			$this->maybe_convert_migrated_size( $widgets[ $k ]['size'] );
345
		}
346
		update_option( 'widget_frm_show_form', $widgets );
347
	}
348
349
	/**
350
	 * Divide by 9 to reverse the multiplication
@@ 430-444 (lines=15) @@
427
	/**
428
	 * Change the characters in widgets to pixels
429
	 */
430
	private function adjust_widget_size() {
431
		$widgets = get_option( 'widget_frm_show_form' );
432
		if ( empty( $widgets ) ) {
433
			return;
434
		}
435
436
		$widgets = maybe_unserialize( $widgets );
437
		foreach ( $widgets as $k => $widget ) {
438
			if ( ! is_array( $widget ) || ! isset( $widget['size'] ) ) {
439
				continue;
440
			}
441
			$this->convert_character_to_px( $widgets[ $k ]['size'] );
442
		}
443
		update_option( 'widget_frm_show_form', $widgets );
444
	}
445
446
	private function convert_character_to_px( &$size ) {
447
		$pixel_conversion = 9;