Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/jetpack
File: class.jetpack-user-agent.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Deprecated. Use Automattic\Jetpack\Device_Detection\User_Agent_Info instead.
[2] Fix | Delete
*
[3] Fix | Delete
* @package automattic/jetpack
[4] Fix | Delete
*
[5] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[6] Fix | Delete
*
[7] Fix | Delete
* Note: we cannot get rid of the class and its methods yet as multiple plugins
[8] Fix | Delete
* still use it. See https://github.com/Automattic/jetpack/pull/16434/files#r667190852
[9] Fix | Delete
*
[10] Fix | Delete
* @phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
[11] Fix | Delete
* @phpcs:disable WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
[12] Fix | Delete
* @phpcs:disable WordPress.NamingConventions.ValidVariableName.PropertyNotSnakeCase
[13] Fix | Delete
* @phpcs:disable WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
[14] Fix | Delete
* @phpcs:disable WordPress.Files.FileName
[15] Fix | Delete
*/
[16] Fix | Delete
[17] Fix | Delete
use Automattic\Jetpack\Device_Detection\User_Agent_Info;
[18] Fix | Delete
[19] Fix | Delete
/**
[20] Fix | Delete
* A class providing device properties detection.
[21] Fix | Delete
*
[22] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[23] Fix | Delete
*/
[24] Fix | Delete
class Jetpack_User_Agent_Info {
[25] Fix | Delete
[26] Fix | Delete
/**
[27] Fix | Delete
* User_Agent_Info instance from the `jetpack-device-detection` package.
[28] Fix | Delete
*
[29] Fix | Delete
* @var User_Agent_Info
[30] Fix | Delete
*/
[31] Fix | Delete
private $ua_info;
[32] Fix | Delete
[33] Fix | Delete
/**
[34] Fix | Delete
* Report deprecation if appropriate.
[35] Fix | Delete
*
[36] Fix | Delete
* Currently we don't when running on WordPress.com, as there's still a lot
[37] Fix | Delete
* there that needs cleaning up first.
[38] Fix | Delete
*
[39] Fix | Delete
* @param string $method Method.
[40] Fix | Delete
* @param string $repl Replacement method.
[41] Fix | Delete
*/
[42] Fix | Delete
private static function warn_deprecated( $method, $repl ) {
[43] Fix | Delete
if ( ! defined( 'IS_WPCOM' ) || ! IS_WPCOM ) {
[44] Fix | Delete
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Strings passed are safe.
[45] Fix | Delete
_deprecated_function( $method, 'Jetpack 8.7', "\\Automattic\\Jetpack\\Device_Detection\\User_Agent_Info$repl from the `automattic/jetpack-device-detection` package" );
[46] Fix | Delete
}
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
/**
[50] Fix | Delete
* The constructor.
[51] Fix | Delete
*
[52] Fix | Delete
* @param string $ua (Optional) User agent.
[53] Fix | Delete
*
[54] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[55] Fix | Delete
*/
[56] Fix | Delete
public function __construct( $ua = '' ) {
[57] Fix | Delete
self::warn_deprecated( __METHOD__, '' );
[58] Fix | Delete
$this->ua_info = new User_Agent_Info( $ua );
[59] Fix | Delete
}
[60] Fix | Delete
[61] Fix | Delete
/**
[62] Fix | Delete
* This method detects the mobile User Agent name.
[63] Fix | Delete
*
[64] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[65] Fix | Delete
*
[66] Fix | Delete
* @return string The matched User Agent name, false otherwise.
[67] Fix | Delete
*/
[68] Fix | Delete
public function get_mobile_user_agent_name() {
[69] Fix | Delete
self::warn_deprecated( __METHOD__, '->get_mobile_user_agent_name' );
[70] Fix | Delete
return $this->ua_info->get_mobile_user_agent_name();
[71] Fix | Delete
}
[72] Fix | Delete
[73] Fix | Delete
/**
[74] Fix | Delete
* This method detects the mobile device's platform. All return strings are from the class constants.
[75] Fix | Delete
* Note that this function returns the platform name, not the UA name/type. You should use a different function
[76] Fix | Delete
* if you need to test the UA capabilites.
[77] Fix | Delete
*
[78] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[79] Fix | Delete
*
[80] Fix | Delete
* @return string Name of the platform, false otherwise.
[81] Fix | Delete
*/
[82] Fix | Delete
public function get_platform() {
[83] Fix | Delete
self::warn_deprecated( __METHOD__, '->get_platform' );
[84] Fix | Delete
return $this->ua_info->get_platform();
[85] Fix | Delete
}
[86] Fix | Delete
[87] Fix | Delete
/**
[88] Fix | Delete
* This method detects for UA which can display iPhone-optimized web content.
[89] Fix | Delete
* Includes iPhone, iPod Touch, Android, WebOS, Fennec (Firefox mobile), etc.
[90] Fix | Delete
*
[91] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[92] Fix | Delete
*/
[93] Fix | Delete
public function isTierIphone() {
[94] Fix | Delete
self::warn_deprecated( __METHOD__, '->isTierIphone' );
[95] Fix | Delete
return $this->ua_info->isTierIphone();
[96] Fix | Delete
}
[97] Fix | Delete
[98] Fix | Delete
/**
[99] Fix | Delete
* This method detects for UA which are likely to be capable
[100] Fix | Delete
* but may not necessarily support JavaScript.
[101] Fix | Delete
* Excludes all iPhone Tier UA.
[102] Fix | Delete
*
[103] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[104] Fix | Delete
*/
[105] Fix | Delete
public function isTierRichCss() {
[106] Fix | Delete
self::warn_deprecated( __METHOD__, '->isTierRichCss' );
[107] Fix | Delete
return $this->ua_info->isTierRichCss();
[108] Fix | Delete
}
[109] Fix | Delete
[110] Fix | Delete
/**
[111] Fix | Delete
* Detects if the user is using a tablet.
[112] Fix | Delete
* props Corey Gilmore, BGR.com
[113] Fix | Delete
*
[114] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[115] Fix | Delete
*
[116] Fix | Delete
* @return bool
[117] Fix | Delete
*/
[118] Fix | Delete
public static function is_tablet() {
[119] Fix | Delete
self::warn_deprecated( __METHOD__, '->is_tablet' );
[120] Fix | Delete
return ( new User_Agent_Info() )->is_tablet();
[121] Fix | Delete
}
[122] Fix | Delete
[123] Fix | Delete
/**
[124] Fix | Delete
* Detects if the current UA is the default iPhone or iPod Touch Browser.
[125] Fix | Delete
*
[126] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[127] Fix | Delete
*/
[128] Fix | Delete
public static function is_iphoneOrIpod() {
[129] Fix | Delete
self::warn_deprecated( __METHOD__, '->is_iphone_or_ipod' );
[130] Fix | Delete
return ( new User_Agent_Info() )->is_iphoneOrIpod();
[131] Fix | Delete
}
[132] Fix | Delete
[133] Fix | Delete
/**
[134] Fix | Delete
* Detects if the current UA is iPhone Mobile Safari or another iPhone or iPod Touch Browser.
[135] Fix | Delete
*
[136] Fix | Delete
* They type can check for any iPhone, an iPhone using Safari, or an iPhone using something other than Safari.
[137] Fix | Delete
*
[138] Fix | Delete
* Note: If you want to check for Opera mini, Opera mobile or Firefox mobile (or any 3rd party iPhone browser),
[139] Fix | Delete
* you should put the check condition before the check for 'iphone-any' or 'iphone-not-safari'.
[140] Fix | Delete
* Otherwise those browsers will be 'catched' by the iphone string.
[141] Fix | Delete
*
[142] Fix | Delete
* @param string $type Type of iPhone detection.
[143] Fix | Delete
*
[144] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[145] Fix | Delete
*/
[146] Fix | Delete
public static function is_iphone_or_ipod( $type = 'iphone-any' ) {
[147] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_iphone_or_ipod' );
[148] Fix | Delete
return User_Agent_Info::is_iphone_or_ipod( $type );
[149] Fix | Delete
}
[150] Fix | Delete
[151] Fix | Delete
/**
[152] Fix | Delete
* Detects if the current UA is Chrome for iOS
[153] Fix | Delete
*
[154] Fix | Delete
* The User-Agent string in Chrome for iOS is the same as the Mobile Safari User-Agent, with CriOS/<ChromeRevision> instead of Version/<VersionNum>.
[155] Fix | Delete
* - Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3
[156] Fix | Delete
*
[157] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[158] Fix | Delete
*/
[159] Fix | Delete
public static function is_chrome_for_iOS() {
[160] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_chrome_for_iOS' );
[161] Fix | Delete
return User_Agent_Info::is_chrome_for_iOS();
[162] Fix | Delete
}
[163] Fix | Delete
[164] Fix | Delete
/**
[165] Fix | Delete
* Detects if the current UA is Twitter for iPhone
[166] Fix | Delete
*
[167] Fix | Delete
* Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_5 like Mac OS X; nb-no) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8L1 Twitter for iPhone
[168] Fix | Delete
* Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 Twitter for iPhone
[169] Fix | Delete
*
[170] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[171] Fix | Delete
*/
[172] Fix | Delete
public static function is_twitter_for_iphone() {
[173] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_twitter_for_iphone' );
[174] Fix | Delete
return User_Agent_Info::is_twitter_for_iphone();
[175] Fix | Delete
}
[176] Fix | Delete
[177] Fix | Delete
/**
[178] Fix | Delete
* Detects if the current UA is Twitter for iPad
[179] Fix | Delete
*
[180] Fix | Delete
* Old version 4.X - Mozilla/5.0 (iPad; U; CPU OS 4_3_5 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8L1 Twitter for iPad
[181] Fix | Delete
* Ver 5.0 or Higher - Mozilla/5.0 (iPad; CPU OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 Twitter for iPhone
[182] Fix | Delete
*
[183] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[184] Fix | Delete
*/
[185] Fix | Delete
public static function is_twitter_for_ipad() {
[186] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_twitter_for_ipad' );
[187] Fix | Delete
return User_Agent_Info::is_twitter_for_ipad();
[188] Fix | Delete
}
[189] Fix | Delete
[190] Fix | Delete
/**
[191] Fix | Delete
* Detects if the current UA is Facebook for iPhone
[192] Fix | Delete
* - Facebook 4020.0 (iPhone; iPhone OS 5.0.1; fr_FR)
[193] Fix | Delete
* - Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_0 like Mac OS X; en_US) AppleWebKit (KHTML, like Gecko) Mobile [FBAN/FBForIPhone;FBAV/4.0.2;FBBV/4020.0;FBDV/iPhone3,1;FBMD/iPhone;FBSN/iPhone OS;FBSV/5.0;FBSS/2; FBCR/O2;FBID/phone;FBLC/en_US;FBSF/2.0]
[194] Fix | Delete
* - Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 [FBAN/FBIOS;FBAV/5.0;FBBV/47423;FBDV/iPhone3,1;FBMD/iPhone;FBSN/iPhone OS;FBSV/5.1.1;FBSS/2; FBCR/3ITA;FBID/phone;FBLC/en_US]
[195] Fix | Delete
*
[196] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[197] Fix | Delete
*/
[198] Fix | Delete
public static function is_facebook_for_iphone() {
[199] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_facebook_for_iphone' );
[200] Fix | Delete
return User_Agent_Info::is_facebook_for_iphone();
[201] Fix | Delete
}
[202] Fix | Delete
[203] Fix | Delete
/**
[204] Fix | Delete
* Detects if the current UA is Facebook for iPad
[205] Fix | Delete
* - Facebook 4020.0 (iPad; iPhone OS 5.0.1; en_US)
[206] Fix | Delete
* - Mozilla/5.0 (iPad; U; CPU iPhone OS 5_0 like Mac OS X; en_US) AppleWebKit (KHTML, like Gecko) Mobile [FBAN/FBForIPhone;FBAV/4.0.2;FBBV/4020.0;FBDV/iPad2,1;FBMD/iPad;FBSN/iPhone OS;FBSV/5.0;FBSS/1; FBCR/;FBID/tablet;FBLC/en_US;FBSF/1.0]
[207] Fix | Delete
* - Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10A403 [FBAN/FBIOS;FBAV/5.0;FBBV/47423;FBDV/iPad2,1;FBMD/iPad;FBSN/iPhone OS;FBSV/6.0;FBSS/1; FBCR/;FBID/tablet;FBLC/en_US]
[208] Fix | Delete
*
[209] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[210] Fix | Delete
*/
[211] Fix | Delete
public static function is_facebook_for_ipad() {
[212] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_facebook_for_ipad' );
[213] Fix | Delete
return User_Agent_Info::is_facebook_for_ipad();
[214] Fix | Delete
}
[215] Fix | Delete
[216] Fix | Delete
/**
[217] Fix | Delete
* Detects if the current UA is WordPress for iOS.
[218] Fix | Delete
*
[219] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[220] Fix | Delete
*/
[221] Fix | Delete
public static function is_wordpress_for_ios() {
[222] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_wordpress_for_ios' );
[223] Fix | Delete
return User_Agent_Info::is_wordpress_for_ios();
[224] Fix | Delete
}
[225] Fix | Delete
[226] Fix | Delete
/**
[227] Fix | Delete
* Detects if the current device is an iPad.
[228] Fix | Delete
* They type can check for any iPad, an iPad using Safari, or an iPad using something other than Safari.
[229] Fix | Delete
*
[230] Fix | Delete
* Note: If you want to check for Opera mini, Opera mobile or Firefox mobile (or any 3rd party iPad browser),
[231] Fix | Delete
* you should put the check condition before the check for 'iphone-any' or 'iphone-not-safari'.
[232] Fix | Delete
* Otherwise those browsers will be 'catched' by the ipad string.
[233] Fix | Delete
*
[234] Fix | Delete
* @param string $type iPad type.
[235] Fix | Delete
*
[236] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[237] Fix | Delete
*/
[238] Fix | Delete
public static function is_ipad( $type = 'ipad-any' ) {
[239] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_ipad' );
[240] Fix | Delete
return User_Agent_Info::is_ipad( $type );
[241] Fix | Delete
}
[242] Fix | Delete
[243] Fix | Delete
/**
[244] Fix | Delete
* Detects if the current browser is Firefox Mobile (Fennec)
[245] Fix | Delete
*
[246] Fix | Delete
* See http://www.useragentstring.com/pages/Fennec/
[247] Fix | Delete
* Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.1.1) Gecko/20110415 Firefox/4.0.2pre Fennec/4.0.1
[248] Fix | Delete
* Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1
[249] Fix | Delete
*
[250] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[251] Fix | Delete
*/
[252] Fix | Delete
public static function is_firefox_mobile() {
[253] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_firefox_mobile' );
[254] Fix | Delete
return User_Agent_Info::is_firefox_mobile();
[255] Fix | Delete
}
[256] Fix | Delete
[257] Fix | Delete
/**
[258] Fix | Delete
* Detects if the current browser is Firefox for desktop
[259] Fix | Delete
*
[260] Fix | Delete
* See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox
[261] Fix | Delete
* Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion
[262] Fix | Delete
* The platform section will include 'Mobile' for phones and 'Tablet' for tablets.
[263] Fix | Delete
*
[264] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[265] Fix | Delete
*/
[266] Fix | Delete
public static function is_firefox_desktop() {
[267] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_firefox_desktop' );
[268] Fix | Delete
return User_Agent_Info::is_firefox_desktop();
[269] Fix | Delete
}
[270] Fix | Delete
[271] Fix | Delete
/**
[272] Fix | Delete
* Detects if the current browser is FirefoxOS Native browser
[273] Fix | Delete
*
[274] Fix | Delete
* Mozilla/5.0 (Mobile; rv:14.0) Gecko/14.0 Firefox/14.0
[275] Fix | Delete
*
[276] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[277] Fix | Delete
*/
[278] Fix | Delete
public static function is_firefox_os() {
[279] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_firefox_os' );
[280] Fix | Delete
return User_Agent_Info::is_firefox_os();
[281] Fix | Delete
}
[282] Fix | Delete
[283] Fix | Delete
/**
[284] Fix | Delete
* Detects if the current browser is Opera Mobile
[285] Fix | Delete
*
[286] Fix | Delete
* What is the difference between Opera Mobile and Opera Mini?
[287] Fix | Delete
* - Opera Mobile is a full Internet browser for mobile devices.
[288] Fix | Delete
* - Opera Mini always uses a transcoder to convert the page for a small display.
[289] Fix | Delete
* (it uses Opera advanced server compression technology to compress web content before it gets to a device.
[290] Fix | Delete
* The rendering engine is on Opera's server.)
[291] Fix | Delete
*
[292] Fix | Delete
* Opera/9.80 (Windows NT 6.1; Opera Mobi/14316; U; en) Presto/2.7.81 Version/11.00"
[293] Fix | Delete
* Opera/9.50 (Nintendo DSi; Opera/507; U; en-US)
[294] Fix | Delete
*
[295] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[296] Fix | Delete
*/
[297] Fix | Delete
public static function is_opera_mobile() {
[298] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_opera_mobile' );
[299] Fix | Delete
return User_Agent_Info::is_opera_mobile();
[300] Fix | Delete
}
[301] Fix | Delete
[302] Fix | Delete
/**
[303] Fix | Delete
* Detects if the current browser is Opera Mini
[304] Fix | Delete
*
[305] Fix | Delete
* Opera/8.01 (J2ME/MIDP; Opera Mini/3.0.6306/1528; en; U; ssr)
[306] Fix | Delete
* Opera/9.80 (Android;Opera Mini/6.0.24212/24.746 U;en) Presto/2.5.25 Version/10.5454
[307] Fix | Delete
* Opera/9.80 (iPhone; Opera Mini/5.0.019802/18.738; U; en) Presto/2.4.15
[308] Fix | Delete
* Opera/9.80 (J2ME/iPhone;Opera Mini/5.0.019802/886; U; ja) Presto/2.4.15
[309] Fix | Delete
* Opera/9.80 (J2ME/iPhone;Opera Mini/5.0.019802/886; U; ja) Presto/2.4.15
[310] Fix | Delete
* Opera/9.80 (Series 60; Opera Mini/5.1.22783/23.334; U; en) Presto/2.5.25 Version/10.54
[311] Fix | Delete
* Opera/9.80 (BlackBerry; Opera Mini/5.1.22303/22.387; U; en) Presto/2.5.25 Version/10.54
[312] Fix | Delete
*
[313] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[314] Fix | Delete
*/
[315] Fix | Delete
public static function is_opera_mini() {
[316] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_opera_mini' );
[317] Fix | Delete
return User_Agent_Info::is_opera_mini();
[318] Fix | Delete
}
[319] Fix | Delete
[320] Fix | Delete
/**
[321] Fix | Delete
* Detects if the current browser is Opera Mini, but not on a smart device OS(Android, iOS, etc)
[322] Fix | Delete
* Used to send users on dumb devices to m.wor
[323] Fix | Delete
*
[324] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[325] Fix | Delete
*/
[326] Fix | Delete
public static function is_opera_mini_dumb() {
[327] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_opera_mini_dumb' );
[328] Fix | Delete
return User_Agent_Info::is_opera_mini_dumb();
[329] Fix | Delete
}
[330] Fix | Delete
[331] Fix | Delete
/**
[332] Fix | Delete
* Detects if the current browser is a Windows Phone 7 device.
[333] Fix | Delete
* ex: Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; LG; GW910)
[334] Fix | Delete
*
[335] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[336] Fix | Delete
*/
[337] Fix | Delete
public static function is_WindowsPhone7() {
[338] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_WindowsPhone7' );
[339] Fix | Delete
return User_Agent_Info::is_WindowsPhone7();
[340] Fix | Delete
}
[341] Fix | Delete
[342] Fix | Delete
/**
[343] Fix | Delete
* Detects if the current browser is a Windows Phone 8 device.
[344] Fix | Delete
* ex: Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; ARM; Touch; IEMobile/10.0; <Manufacturer>; <Device> [;<Operator>])
[345] Fix | Delete
*
[346] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[347] Fix | Delete
*/
[348] Fix | Delete
public static function is_windows_phone_8() {
[349] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_windows_phone_8' );
[350] Fix | Delete
return User_Agent_Info::is_windows_phone_8();
[351] Fix | Delete
}
[352] Fix | Delete
[353] Fix | Delete
/**
[354] Fix | Delete
* Detects if the current browser is on a Palm device running the new WebOS. This EXCLUDES TouchPad.
[355] Fix | Delete
*
[356] Fix | Delete
* Ex1: Mozilla/5.0 (webOS/1.4.0; U; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Version/1.0 Safari/532.2 Pre/1.1
[357] Fix | Delete
* Ex2: Mozilla/5.0 (webOS/1.4.0; U; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Version/1.0 Safari/532.2 Pixi/1.1
[358] Fix | Delete
*
[359] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[360] Fix | Delete
*/
[361] Fix | Delete
public static function is_PalmWebOS() {
[362] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_PalmWebOS' );
[363] Fix | Delete
return User_Agent_Info::is_PalmWebOS();
[364] Fix | Delete
}
[365] Fix | Delete
[366] Fix | Delete
/**
[367] Fix | Delete
* Detects if the current browser is the HP TouchPad default browser. This excludes phones wt WebOS.
[368] Fix | Delete
*
[369] Fix | Delete
* TouchPad Emulator: Mozilla/5.0 (hp-desktop; Linux; hpwOS/2.0; U; it-IT) AppleWebKit/534.6 (KHTML, like Gecko) wOSBrowser/233.70 Safari/534.6 Desktop/1.0
[370] Fix | Delete
* TouchPad: Mozilla/5.0 (hp-tablet; Linux; hpwOS/3.0.0; U; en-US) AppleWebKit/534.6 (KHTML, like Gecko) wOSBrowser/233.70 Safari/534.6 TouchPad/1.0
[371] Fix | Delete
*
[372] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[373] Fix | Delete
*/
[374] Fix | Delete
public static function is_TouchPad() {
[375] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_TouchPad' );
[376] Fix | Delete
return User_Agent_Info::is_TouchPad();
[377] Fix | Delete
}
[378] Fix | Delete
[379] Fix | Delete
/**
[380] Fix | Delete
* Detects if the current browser is the Series 60 Open Source Browser.
[381] Fix | Delete
*
[382] Fix | Delete
* OSS Browser 3.2 on E75: Mozilla/5.0 (SymbianOS/9.3; U; Series60/3.2 NokiaE75-1/110.48.125 Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413
[383] Fix | Delete
*
[384] Fix | Delete
* 7.0 Browser (Nokia 5800 XpressMusic (v21.0.025)) : Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0 Nokia5800d-1/21.0.025; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413
[385] Fix | Delete
*
[386] Fix | Delete
* Browser 7.1 (Nokia N97 (v12.0.024)) : Mozilla/5.0 (SymbianOS/9.4; Series60/5.0 NokiaN97-1/12.0.024; Profile/MIDP-2.1 Configuration/CLDC-1.1; en-us) AppleWebKit/525 (KHTML, like Gecko) BrowserNG/7.1.12344
[387] Fix | Delete
*
[388] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[389] Fix | Delete
*/
[390] Fix | Delete
public static function is_S60_OSSBrowser() {
[391] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_S60_OSSBrowser' );
[392] Fix | Delete
return User_Agent_Info::is_S60_OSSBrowser();
[393] Fix | Delete
}
[394] Fix | Delete
[395] Fix | Delete
/**
[396] Fix | Delete
* Detects if the device platform is the Symbian Series 60.
[397] Fix | Delete
*
[398] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[399] Fix | Delete
*/
[400] Fix | Delete
public static function is_symbian_platform() {
[401] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_symbian_platform' );
[402] Fix | Delete
return User_Agent_Info::is_symbian_platform();
[403] Fix | Delete
}
[404] Fix | Delete
[405] Fix | Delete
/**
[406] Fix | Delete
* Detects if the device platform is the Symbian Series 40.
[407] Fix | Delete
* Nokia Browser for Series 40 is a proxy based browser, previously known as Ovi Browser.
[408] Fix | Delete
* This browser will report 'NokiaBrowser' in the header, however some older version will also report 'OviBrowser'.
[409] Fix | Delete
*
[410] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[411] Fix | Delete
*/
[412] Fix | Delete
public static function is_symbian_s40_platform() {
[413] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_symbian_s40_platform' );
[414] Fix | Delete
return User_Agent_Info::is_symbian_s40_platform();
[415] Fix | Delete
}
[416] Fix | Delete
[417] Fix | Delete
/**
[418] Fix | Delete
* Returns if the device belongs to J2ME capable family.
[419] Fix | Delete
*
[420] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[421] Fix | Delete
*
[422] Fix | Delete
* @return bool
[423] Fix | Delete
*/
[424] Fix | Delete
public static function is_J2ME_platform() {
[425] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_J2ME_platform' );
[426] Fix | Delete
return User_Agent_Info::is_J2ME_platform();
[427] Fix | Delete
}
[428] Fix | Delete
[429] Fix | Delete
/**
[430] Fix | Delete
* Detects if the current UA is on one of the Maemo-based Nokia Internet Tablets.
[431] Fix | Delete
*
[432] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[433] Fix | Delete
*/
[434] Fix | Delete
public static function is_MaemoTablet() {
[435] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_MaemoTablet' );
[436] Fix | Delete
return User_Agent_Info::is_MaemoTablet();
[437] Fix | Delete
}
[438] Fix | Delete
[439] Fix | Delete
/**
[440] Fix | Delete
* Detects if the current UA is a MeeGo device (Nokia Smartphone).
[441] Fix | Delete
*
[442] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[443] Fix | Delete
*/
[444] Fix | Delete
public static function is_MeeGo() {
[445] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_MeeGo' );
[446] Fix | Delete
return User_Agent_Info::is_MeeGo();
[447] Fix | Delete
}
[448] Fix | Delete
[449] Fix | Delete
/**
[450] Fix | Delete
* The is_webkit() method can be used to check the User Agent for an webkit generic browser.
[451] Fix | Delete
*
[452] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[453] Fix | Delete
*/
[454] Fix | Delete
public static function is_webkit() {
[455] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_webkit' );
[456] Fix | Delete
return User_Agent_Info::is_webkit();
[457] Fix | Delete
}
[458] Fix | Delete
[459] Fix | Delete
/**
[460] Fix | Delete
* Detects if the current browser is the Native Android browser.
[461] Fix | Delete
*
[462] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[463] Fix | Delete
*
[464] Fix | Delete
* @return boolean true if the browser is Android otherwise false
[465] Fix | Delete
*/
[466] Fix | Delete
public static function is_android() {
[467] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_android' );
[468] Fix | Delete
return User_Agent_Info::is_android();
[469] Fix | Delete
}
[470] Fix | Delete
[471] Fix | Delete
/**
[472] Fix | Delete
* Detects if the current browser is the Native Android Tablet browser.
[473] Fix | Delete
* Assumes 'Android' should be in the user agent, but not 'mobile'
[474] Fix | Delete
*
[475] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[476] Fix | Delete
*
[477] Fix | Delete
* @return boolean true if the browser is Android and not 'mobile' otherwise false
[478] Fix | Delete
*/
[479] Fix | Delete
public static function is_android_tablet() {
[480] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_android_tablet' );
[481] Fix | Delete
return User_Agent_Info::is_android_tablet();
[482] Fix | Delete
}
[483] Fix | Delete
[484] Fix | Delete
/**
[485] Fix | Delete
* Detects if the current browser is the Kindle Fire Native browser.
[486] Fix | Delete
*
[487] Fix | Delete
* Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-84) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true
[488] Fix | Delete
* Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-84) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=false
[489] Fix | Delete
*
[490] Fix | Delete
* @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
[491] Fix | Delete
*
[492] Fix | Delete
* @return boolean true if the browser is Kindle Fire Native browser otherwise false
[493] Fix | Delete
*/
[494] Fix | Delete
public static function is_kindle_fire() {
[495] Fix | Delete
self::warn_deprecated( __METHOD__, '::is_kindle_fire' );
[496] Fix | Delete
return User_Agent_Info::is_kindle_fire();
[497] Fix | Delete
}
[498] Fix | Delete
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function