Completed
Push — develop ( 1d4633...83eb6a )
by David
02:35 queued 10s
created

User_Agent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 27
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A get_user_agent() 0 23 2
1
<?php
2
3
namespace Wordlift\Api;
4
5
use Wordlift;
6
7
class User_Agent {
8
9
	public static function get_user_agent() {
10
11
		// Get WL version.
12
		$wl_version = Wordlift::get_instance()->get_version();
13
14
		// Get the WP version.
15
		$wp_version = get_bloginfo( 'version' );
16
17
		// Get the home url.
18
		$home_url = home_url( '/' );
19
20
		// Get the locale flag.
21
		$locale = apply_filters( 'core_version_check_locale', get_locale() );
22
23
		// Get the multisite flag.
24
		$multisite = is_multisite() ? 'yes' : 'no';
25
26
		// Get the PHP version.
27
		$php_version = phpversion();
28
29
		/** @var string $wp_version The variable is defined in `version.php`. */
30
		return "WordLift/$wl_version WordPress/$wp_version (multisite:$multisite, url:$home_url, locale:$locale) PHP/$php_version";
31
	}
32
33
}