Code Duplication    Length = 11-15 lines in 2 locations

projects/plugins/jetpack/class.jetpack.php 1 location

@@ 5138-5148 (lines=11) @@
5135
		return self::connection()->get_assumed_site_creation_date();
5136
	}
5137
5138
	public static function apply_activation_source_to_args( &$args ) {
5139
		list( $activation_source_name, $activation_source_keyword ) = get_option( 'jetpack_activation_source' );
5140
5141
		if ( $activation_source_name ) {
5142
			$args['_as'] = urlencode( $activation_source_name );
5143
		}
5144
5145
		if ( $activation_source_keyword ) {
5146
			$args['_ak'] = urlencode( $activation_source_keyword );
5147
		}
5148
	}
5149
5150
	function build_reconnect_url( $raw = false ) {
5151
		$url = wp_nonce_url( self::admin_url( 'action=reconnect' ), 'jetpack-reconnect' );

projects/packages/connection/src/class-manager.php 1 location

@@ 1456-1470 (lines=15) @@
1453
	 * @param array $args arguments that need to have the source added.
1454
	 * @return array $amended arguments.
1455
	 */
1456
	public static function apply_activation_source_to_args( $args ) {
1457
		list( $activation_source_name, $activation_source_keyword ) = get_option( 'jetpack_activation_source' );
1458
1459
		if ( $activation_source_name ) {
1460
			// phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode
1461
			$args['_as'] = urlencode( $activation_source_name );
1462
		}
1463
1464
		if ( $activation_source_keyword ) {
1465
			// phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode
1466
			$args['_ak'] = urlencode( $activation_source_keyword );
1467
		}
1468
1469
		return $args;
1470
	}
1471
1472
	/**
1473
	 * Generates two secret tokens and the end of life timestamp for them.