Code Duplication    Length = 4-8 lines in 3 locations

class.jetpack-network.php 1 location

@@ 420-427 (lines=8) @@
417
		// Save the secrets in the subsite so when the wpcom server does a pingback it
418
		// will be able to validate the connection
419
		$secrets = $jp->generate_secrets( 'register' );
420
		if (
421
			empty( $secrets[ 'secret_1' ] ) ||
422
			empty( $secrets[ 'secret_2' ]  ) ||
423
			empty( $secrets['exp'] ) ||
424
			$secrets['exp'] < time()
425
		) {
426
			return new Jetpack_Error( 'missing_secrets' );
427
		}
428
429
		// Gra info for gmt offset
430
		$gmt_offset = get_option( 'gmt_offset' );

class.jetpack-xmlrpc-server.php 1 location

@@ 172-175 (lines=4) @@
169
			return $this->error( new Jetpack_Error( 'verify_secrets_missing', 'Verification secrets not found', 400 ) );
170
		}
171
172
		if ( empty( $secrets['secret_1'] ) || empty( $secrets['secret_2'] ) || empty( $secrets['exp'] ) ) {
173
			Jetpack::delete_secret( $action, $state );
174
			return $this->error( new Jetpack_Error( 'verify_secrets_incomplete', 'Verification secrets are incomplete', 400 ) );
175
		}
176
177
		if ( $secrets['exp'] < time() ) {
178
			Jetpack::delete_secret( $action, $state );

class.jetpack.php 1 location

@@ 4681-4688 (lines=8) @@
4678
		add_action( 'pre_update_jetpack_option_register', array( 'Jetpack_Options', 'delete_option' ) );
4679
		$secrets = Jetpack::generate_secrets( 'register' );
4680
4681
		if (
4682
			empty( $secrets['secret_1'] ) ||
4683
			empty( $secrets['secret_2'] ) ||
4684
			empty( $secrets['exp'] ) ||
4685
			$secrets['exp'] < time()
4686
		) {
4687
			return new Jetpack_Error( 'missing_secrets' );
4688
		}
4689
4690
		$timeout = Jetpack::init()->get_remote_query_timeout_limit();
4691