Code Duplication    Length = 6-13 lines in 4 locations

class.jetpack.php 4 locations

@@ 349-361 (lines=13) @@
346
			}
347
348
			// Add missing version and old_version options
349
			if ( ! $version = Jetpack_Options::get_option( 'version' ) ) {
350
				$version = $old_version = '1.1:' . time();
351
				/**
352
				 * Fires on update, before bumping version numbers up to a new version.
353
				 *
354
				 * @since 3.4.0
355
				 *
356
				 * @param string $version Jetpack version number.
357
				 * @param bool false Does an old version exist. Default is false.
358
				 */
359
				do_action( 'updating_jetpack_version', $version, false );
360
				Jetpack_Options::update_options( compact( 'version', 'old_version' ) );
361
			}
362
		}
363
364
		// Upgrade from a single user token to a user_id-indexed array and a master_user ID
@@ 1671-1676 (lines=6) @@
1668
		}
1669
1670
		$version = Jetpack_Options::get_option( 'version' );
1671
		if ( ! $version ) {
1672
			$version = $old_version = JETPACK__VERSION . ':' . time();
1673
			/** This action is documented in class.jetpack.php */
1674
			do_action( 'updating_jetpack_version', $version, false );
1675
			Jetpack_Options::update_options( compact( 'version', 'old_version' ) );
1676
		}
1677
		list( $version ) = explode( ':', $version );
1678
1679
		$modules = array_filter( Jetpack::get_active_modules(), array( 'Jetpack', 'is_module' ) );
@@ 2189-2194 (lines=6) @@
2186
		}
2187
2188
		$jetpack_old_version = Jetpack_Options::get_option( 'version' ); // [sic]
2189
		if ( ! $jetpack_old_version ) {
2190
			$jetpack_old_version = $version = $old_version = '1.1:' . time();
2191
			/** This action is documented in class.jetpack.php */
2192
			do_action( 'updating_jetpack_version', $version, false );
2193
			Jetpack_Options::update_options( compact( 'version', 'old_version' ) );
2194
		}
2195
2196
		list( $jetpack_version ) = explode( ':', $jetpack_old_version ); // [sic]
2197
@@ 2989-2994 (lines=6) @@
2986
			Jetpack_Options::update_option( 'activated', 2 );
2987
		}
2988
2989
		if ( ! Jetpack_Options::get_option( 'version' ) ) {
2990
			$version = $old_version = JETPACK__VERSION . ':' . time();
2991
			/** This action is documented in class.jetpack.php */
2992
			do_action( 'updating_jetpack_version', $version, false );
2993
			Jetpack_Options::update_options( compact( 'version', 'old_version' ) );
2994
		}
2995
2996
		Jetpack::load_modules();
2997