Code Duplication    Length = 13-13 lines in 2 locations

sync/class.jetpack-sync-functions.php 1 location

@@ 33-45 (lines=13) @@
30
	 * Finds out if a site is using a version control system.
31
	 * @return string ( '1' | '0' )
32
	 **/
33
	public static function is_version_controlled() {
34
35
		if ( ! class_exists( 'WP_Automatic_Updater' ) ) {
36
			require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
37
		}
38
		$updater = new WP_Automatic_Updater();
39
		$is_version_controlled = strval( $updater->is_vcs_checkout( $context = ABSPATH ) );
40
		// transients should not be empty
41
		if ( empty( $is_version_controlled ) ) {
42
			$is_version_controlled = '0';
43
		}
44
		return $is_version_controlled;
45
	}
46
47
	/**
48
	 * Returns true if the site has file write access false otherwise.

class.jetpack.php 1 location

@@ 1214-1226 (lines=13) @@
1211
	 * Finds out if a site is using a version control system.
1212
	 * @return string ( '1' | '0' )
1213
	 **/
1214
	public static function is_version_controlled() {
1215
1216
		if ( !class_exists( 'WP_Automatic_Updater' ) ) {
1217
			require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
1218
		}
1219
		$updater = new WP_Automatic_Updater();
1220
		$is_version_controlled = strval( $updater->is_vcs_checkout( $context = ABSPATH ) );
1221
		// transients should not be empty
1222
		if ( empty( $is_version_controlled ) ) {
1223
			$is_version_controlled = '0';
1224
		}
1225
		return $is_version_controlled;
1226
	}
1227
1228
	/**
1229
	 * Determines whether the current theme supports featured images or not.