Bez popisu

class.jetpack-user-agent.php 31KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665
  1. <?php
  2. /**
  3. * Deprecated. Use Automattic\Jetpack\Device_Detection\User_Agent_Info instead.
  4. *
  5. * @package automattic/jetpack
  6. *
  7. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  8. *
  9. * @phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
  10. * @phpcs:disable WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
  11. * @phpcs:disable WordPress.NamingConventions.ValidVariableName.PropertyNotSnakeCase
  12. * @phpcs:disable WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
  13. * @phpcs:disable WordPress.Files.FileName
  14. */
  15. use \Automattic\Jetpack\Device_Detection\User_Agent_Info;
  16. /**
  17. * A class providing device properties detection.
  18. *
  19. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  20. */
  21. class Jetpack_User_Agent_Info {
  22. /**
  23. * User_Agent_Info instance from the `jetpack-device-detection` package.
  24. *
  25. * @var User_Agent_Info
  26. */
  27. private $ua_info;
  28. /**
  29. * The constructor.
  30. *
  31. * @param string $ua (Optional) User agent.
  32. *
  33. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  34. */
  35. public function __construct( $ua = '' ) {
  36. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info from the `automattic/jetpack-device-detection` package' );
  37. $this->ua_info = new User_Agent_Info( $ua );
  38. }
  39. /**
  40. * This method detects the mobile User Agent name.
  41. *
  42. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  43. *
  44. * @return string The matched User Agent name, false otherwise.
  45. */
  46. public function get_mobile_user_agent_name() {
  47. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info->get_mobile_user_agent_name from the `automattic/jetpack-device-detection` package' );
  48. return $this->ua_info->get_mobile_user_agent_name();
  49. }
  50. /**
  51. * This method detects the mobile device's platform. All return strings are from the class constants.
  52. * Note that this function returns the platform name, not the UA name/type. You should use a different function
  53. * if you need to test the UA capabilites.
  54. *
  55. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  56. *
  57. * @return string Name of the platform, false otherwise.
  58. */
  59. public function get_platform() {
  60. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info->get_platform from the `automattic/jetpack-device-detection` package' );
  61. return $this->ua_info->get_platform();
  62. }
  63. /**
  64. * This method detects for UA which can display iPhone-optimized web content.
  65. * Includes iPhone, iPod Touch, Android, WebOS, Fennec (Firefox mobile), etc.
  66. *
  67. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  68. */
  69. public function isTierIphone() {
  70. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info->isTierIphone from the `automattic/jetpack-device-detection` package' );
  71. return $this->ua_info->isTierIphone();
  72. }
  73. /**
  74. * This method detects for UA which are likely to be capable
  75. * but may not necessarily support JavaScript.
  76. * Excludes all iPhone Tier UA.
  77. *
  78. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  79. */
  80. public function isTierRichCss() {
  81. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info->isTierRichCss from the `automattic/jetpack-device-detection` package' );
  82. return $this->ua_info->isTierRichCss();
  83. }
  84. /**
  85. * Detects if the user is using a tablet.
  86. * props Corey Gilmore, BGR.com
  87. *
  88. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  89. *
  90. * @return bool
  91. */
  92. public static function is_tablet() {
  93. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info->is_tablet from the `automattic/jetpack-device-detection` package' );
  94. return ( new User_Agent_Info() )->is_tablet();
  95. }
  96. /**
  97. * Detects if the current UA is the default iPhone or iPod Touch Browser.
  98. *
  99. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  100. */
  101. public static function is_iphoneOrIpod() {
  102. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info->is_iphone_or_ipod from the `automattic/jetpack-device-detection` package' );
  103. return ( new User_Agent_Info() )->is_iphoneOrIpod();
  104. }
  105. /**
  106. * Detects if the current UA is iPhone Mobile Safari or another iPhone or iPod Touch Browser.
  107. *
  108. * They type can check for any iPhone, an iPhone using Safari, or an iPhone using something other than Safari.
  109. *
  110. * Note: If you want to check for Opera mini, Opera mobile or Firefox mobile (or any 3rd party iPhone browser),
  111. * you should put the check condition before the check for 'iphone-any' or 'iphone-not-safari'.
  112. * Otherwise those browsers will be 'catched' by the iphone string.
  113. *
  114. * @param string $type Type of iPhone detection.
  115. *
  116. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  117. */
  118. public static function is_iphone_or_ipod( $type = 'iphone-any' ) {
  119. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_iphone_or_ipod from the `automattic/jetpack-device-detection` package' );
  120. return User_Agent_Info::is_iphone_or_ipod( $type );
  121. }
  122. /**
  123. * Detects if the current UA is Chrome for iOS
  124. *
  125. * The User-Agent string in Chrome for iOS is the same as the Mobile Safari User-Agent, with CriOS/<ChromeRevision> instead of Version/<VersionNum>.
  126. * - 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
  127. *
  128. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  129. */
  130. public static function is_chrome_for_iOS() {
  131. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_chrome_for_iOS from the `automattic/jetpack-device-detection` package' );
  132. return User_Agent_Info::is_chrome_for_iOS();
  133. }
  134. /**
  135. * Detects if the current UA is Twitter for iPhone
  136. *
  137. * 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
  138. * 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
  139. *
  140. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  141. */
  142. public static function is_twitter_for_iphone() {
  143. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_twitter_for_iphone from the `automattic/jetpack-device-detection` package' );
  144. return User_Agent_Info::is_twitter_for_iphone();
  145. }
  146. /**
  147. * Detects if the current UA is Twitter for iPad
  148. *
  149. * 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
  150. * 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
  151. *
  152. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  153. */
  154. public static function is_twitter_for_ipad() {
  155. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_twitter_for_ipad from the `automattic/jetpack-device-detection` package' );
  156. return User_Agent_Info::is_twitter_for_ipad();
  157. }
  158. /**
  159. * Detects if the current UA is Facebook for iPhone
  160. * - Facebook 4020.0 (iPhone; iPhone OS 5.0.1; fr_FR)
  161. * - 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]
  162. * - 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]
  163. *
  164. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  165. */
  166. public static function is_facebook_for_iphone() {
  167. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_facebook_for_iphone from the `automattic/jetpack-device-detection` package' );
  168. return User_Agent_Info::is_facebook_for_iphone();
  169. }
  170. /**
  171. * Detects if the current UA is Facebook for iPad
  172. * - Facebook 4020.0 (iPad; iPhone OS 5.0.1; en_US)
  173. * - 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]
  174. * - 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]
  175. *
  176. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  177. */
  178. public static function is_facebook_for_ipad() {
  179. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_facebook_for_ipad from the `automattic/jetpack-device-detection` package' );
  180. return User_Agent_Info::is_facebook_for_ipad();
  181. }
  182. /**
  183. * Detects if the current UA is WordPress for iOS.
  184. *
  185. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  186. */
  187. public static function is_wordpress_for_ios() {
  188. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_wordpress_for_ios from the `automattic/jetpack-device-detection` package' );
  189. return User_Agent_Info::is_wordpress_for_ios();
  190. }
  191. /**
  192. * Detects if the current device is an iPad.
  193. * They type can check for any iPad, an iPad using Safari, or an iPad using something other than Safari.
  194. *
  195. * Note: If you want to check for Opera mini, Opera mobile or Firefox mobile (or any 3rd party iPad browser),
  196. * you should put the check condition before the check for 'iphone-any' or 'iphone-not-safari'.
  197. * Otherwise those browsers will be 'catched' by the ipad string.
  198. *
  199. * @param string $type iPad type.
  200. *
  201. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  202. */
  203. public static function is_ipad( $type = 'ipad-any' ) {
  204. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_ipad from the `automattic/jetpack-device-detection` package' );
  205. return User_Agent_Info::is_ipad( $type );
  206. }
  207. /**
  208. * Detects if the current browser is Firefox Mobile (Fennec)
  209. *
  210. * See http://www.useragentstring.com/pages/Fennec/
  211. * Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.1.1) Gecko/20110415 Firefox/4.0.2pre Fennec/4.0.1
  212. * Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1
  213. *
  214. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  215. */
  216. public static function is_firefox_mobile() {
  217. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_firefox_mobile from the `automattic/jetpack-device-detection` package' );
  218. return User_Agent_Info::is_firefox_mobile();
  219. }
  220. /**
  221. * Detects if the current browser is Firefox for desktop
  222. *
  223. * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox
  224. * Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion
  225. * The platform section will include 'Mobile' for phones and 'Tablet' for tablets.
  226. *
  227. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  228. */
  229. public static function is_firefox_desktop() {
  230. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_firefox_desktop from the `automattic/jetpack-device-detection` package' );
  231. return User_Agent_Info::is_firefox_desktop();
  232. }
  233. /**
  234. * Detects if the current browser is FirefoxOS Native browser
  235. *
  236. * Mozilla/5.0 (Mobile; rv:14.0) Gecko/14.0 Firefox/14.0
  237. *
  238. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  239. */
  240. public static function is_firefox_os() {
  241. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_firefox_os from the `automattic/jetpack-device-detection` package' );
  242. return User_Agent_Info::is_firefox_os();
  243. }
  244. /**
  245. * Detects if the current browser is Opera Mobile
  246. *
  247. * What is the difference between Opera Mobile and Opera Mini?
  248. * - Opera Mobile is a full Internet browser for mobile devices.
  249. * - Opera Mini always uses a transcoder to convert the page for a small display.
  250. * (it uses Opera advanced server compression technology to compress web content before it gets to a device.
  251. * The rendering engine is on Opera's server.)
  252. *
  253. * Opera/9.80 (Windows NT 6.1; Opera Mobi/14316; U; en) Presto/2.7.81 Version/11.00"
  254. * Opera/9.50 (Nintendo DSi; Opera/507; U; en-US)
  255. *
  256. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  257. */
  258. public static function is_opera_mobile() {
  259. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_opera_mobile from the `automattic/jetpack-device-detection` package' );
  260. return User_Agent_Info::is_opera_mobile();
  261. }
  262. /**
  263. * Detects if the current browser is Opera Mini
  264. *
  265. * Opera/8.01 (J2ME/MIDP; Opera Mini/3.0.6306/1528; en; U; ssr)
  266. * Opera/9.80 (Android;Opera Mini/6.0.24212/24.746 U;en) Presto/2.5.25 Version/10.5454
  267. * Opera/9.80 (iPhone; Opera Mini/5.0.019802/18.738; U; en) Presto/2.4.15
  268. * Opera/9.80 (J2ME/iPhone;Opera Mini/5.0.019802/886; U; ja) Presto/2.4.15
  269. * Opera/9.80 (J2ME/iPhone;Opera Mini/5.0.019802/886; U; ja) Presto/2.4.15
  270. * Opera/9.80 (Series 60; Opera Mini/5.1.22783/23.334; U; en) Presto/2.5.25 Version/10.54
  271. * Opera/9.80 (BlackBerry; Opera Mini/5.1.22303/22.387; U; en) Presto/2.5.25 Version/10.54
  272. *
  273. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  274. */
  275. public static function is_opera_mini() {
  276. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_opera_mini from the `automattic/jetpack-device-detection` package' );
  277. return User_Agent_Info::is_opera_mini();
  278. }
  279. /**
  280. * Detects if the current browser is Opera Mini, but not on a smart device OS(Android, iOS, etc)
  281. * Used to send users on dumb devices to m.wor
  282. *
  283. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  284. */
  285. public static function is_opera_mini_dumb() {
  286. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_opera_mini_dumb from the `automattic/jetpack-device-detection` package' );
  287. return User_Agent_Info::is_opera_mini_dumb();
  288. }
  289. /**
  290. * Detects if the current browser is Opera Mobile or Mini.
  291. *
  292. * Opera Mini 5 Beta: Opera/9.80 (J2ME/MIDP; Opera Mini/5.0.15650/756; U; en) Presto/2.2.0
  293. * Opera Mini 8: Opera/8.01 (J2ME/MIDP; Opera Mini/3.0.6306/1528; en; U; ssr)
  294. *
  295. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  296. */
  297. public static function is_OperaMobile() {
  298. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_opera_mini() or \Automattic\Jetpack\Device_Detection\User_Agent_Info::is_opera_mobile() from the `automattic/jetpack-device-detection` package' );
  299. return User_Agent_Info::is_OperaMobile();
  300. }
  301. /**
  302. * Detects if the current browser is a Windows Phone 7 device.
  303. * ex: Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; LG; GW910)
  304. *
  305. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  306. */
  307. public static function is_WindowsPhone7() {
  308. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_WindowsPhone7 from the `automattic/jetpack-device-detection` package' );
  309. return User_Agent_Info::is_WindowsPhone7();
  310. }
  311. /**
  312. * Detects if the current browser is a Windows Phone 8 device.
  313. * ex: Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; ARM; Touch; IEMobile/10.0; <Manufacturer>; <Device> [;<Operator>])
  314. *
  315. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  316. */
  317. public static function is_windows_phone_8() {
  318. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_windows_phone_8 from the `automattic/jetpack-device-detection` package' );
  319. return User_Agent_Info::is_windows_phone_8();
  320. }
  321. /**
  322. * Detects if the current browser is on a Palm device running the new WebOS. This EXCLUDES TouchPad.
  323. *
  324. * 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
  325. * 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
  326. *
  327. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  328. */
  329. public static function is_PalmWebOS() {
  330. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_PalmWebOS from the `automattic/jetpack-device-detection` package' );
  331. return User_Agent_Info::is_PalmWebOS();
  332. }
  333. /**
  334. * Detects if the current browser is the HP TouchPad default browser. This excludes phones wt WebOS.
  335. *
  336. * 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
  337. * 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
  338. *
  339. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  340. */
  341. public static function is_TouchPad() {
  342. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_TouchPad from the `automattic/jetpack-device-detection` package' );
  343. return User_Agent_Info::is_TouchPad();
  344. }
  345. /**
  346. * Detects if the current browser is the Series 60 Open Source Browser.
  347. *
  348. * 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
  349. *
  350. * 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
  351. *
  352. * 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
  353. *
  354. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  355. */
  356. public static function is_S60_OSSBrowser() {
  357. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_S60_OSSBrowser from the `automattic/jetpack-device-detection` package' );
  358. return User_Agent_Info::is_S60_OSSBrowser();
  359. }
  360. /**
  361. * Detects if the device platform is the Symbian Series 60.
  362. *
  363. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  364. */
  365. public static function is_symbian_platform() {
  366. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_symbian_platform from the `automattic/jetpack-device-detection` package' );
  367. return User_Agent_Info::is_symbian_platform();
  368. }
  369. /**
  370. * Detects if the device platform is the Symbian Series 40.
  371. * Nokia Browser for Series 40 is a proxy based browser, previously known as Ovi Browser.
  372. * This browser will report 'NokiaBrowser' in the header, however some older version will also report 'OviBrowser'.
  373. *
  374. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  375. */
  376. public static function is_symbian_s40_platform() {
  377. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_symbian_s40_platform from the `automattic/jetpack-device-detection` package' );
  378. return User_Agent_Info::is_symbian_s40_platform();
  379. }
  380. /**
  381. * Returns if the device belongs to J2ME capable family.
  382. *
  383. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  384. *
  385. * @return bool
  386. */
  387. public static function is_J2ME_platform() {
  388. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_J2ME_platform from the `automattic/jetpack-device-detection` package' );
  389. return User_Agent_Info::is_J2ME_platform();
  390. }
  391. /**
  392. * Detects if the current UA is on one of the Maemo-based Nokia Internet Tablets.
  393. *
  394. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  395. */
  396. public static function is_MaemoTablet() {
  397. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_MaemoTablet from the `automattic/jetpack-device-detection` package' );
  398. return User_Agent_Info::is_MaemoTablet();
  399. }
  400. /**
  401. * Detects if the current UA is a MeeGo device (Nokia Smartphone).
  402. *
  403. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  404. */
  405. public static function is_MeeGo() {
  406. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_MeeGo from the `automattic/jetpack-device-detection` package' );
  407. return User_Agent_Info::is_MeeGo();
  408. }
  409. /**
  410. * The is_webkit() method can be used to check the User Agent for an webkit generic browser.
  411. *
  412. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  413. */
  414. public static function is_webkit() {
  415. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_webkit from the `automattic/jetpack-device-detection` package' );
  416. return User_Agent_Info::is_webkit();
  417. }
  418. /**
  419. * Detects if the current browser is the Native Android browser.
  420. *
  421. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  422. *
  423. * @return boolean true if the browser is Android otherwise false
  424. */
  425. public static function is_android() {
  426. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_android from the `automattic/jetpack-device-detection` package' );
  427. return User_Agent_Info::is_android();
  428. }
  429. /**
  430. * Detects if the current browser is the Native Android Tablet browser.
  431. * Assumes 'Android' should be in the user agent, but not 'mobile'
  432. *
  433. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  434. *
  435. * @return boolean true if the browser is Android and not 'mobile' otherwise false
  436. */
  437. public static function is_android_tablet() {
  438. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_android_tablet from the `automattic/jetpack-device-detection` package' );
  439. return User_Agent_Info::is_android_tablet();
  440. }
  441. /**
  442. * Detects if the current browser is the Kindle Fire Native browser.
  443. *
  444. * 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
  445. * 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
  446. *
  447. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  448. *
  449. * @return boolean true if the browser is Kindle Fire Native browser otherwise false
  450. */
  451. public static function is_kindle_fire() {
  452. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_kindle_fire from the `automattic/jetpack-device-detection` package' );
  453. return User_Agent_Info::is_kindle_fire();
  454. }
  455. /**
  456. * Detects if the current browser is the Kindle Touch Native browser
  457. *
  458. * Mozilla/5.0 (X11; U; Linux armv7l like Android; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/533.2+ Kindle/3.0+
  459. *
  460. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  461. *
  462. * @return boolean true if the browser is Kindle monochrome Native browser otherwise false
  463. */
  464. public static function is_kindle_touch() {
  465. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_kindle_touch from the `automattic/jetpack-device-detection` package' );
  466. return User_Agent_Info::is_kindle_touch();
  467. }
  468. /**
  469. * Detect if user agent is the WordPress.com Windows 8 app (used ONLY on the custom oauth stylesheet)
  470. *
  471. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  472. */
  473. public static function is_windows8_auth() {
  474. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_windows8_auth from the `automattic/jetpack-device-detection` package' );
  475. return User_Agent_Info::is_windows8_auth();
  476. }
  477. /**
  478. * Detect if user agent is the WordPress.com Windows 8 app.
  479. *
  480. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  481. */
  482. public static function is_wordpress_for_win8() {
  483. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_wordpress_for_win8 from the `automattic/jetpack-device-detection` package' );
  484. return User_Agent_Info::is_wordpress_for_win8();
  485. }
  486. /**
  487. * Detect if user agent is the WordPress.com Desktop app.
  488. *
  489. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  490. */
  491. public static function is_wordpress_desktop_app() {
  492. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_wordpress_desktop_app from the `automattic/jetpack-device-detection` package' );
  493. return User_Agent_Info::is_wordpress_desktop_app();
  494. }
  495. /**
  496. * The is_blackberry_tablet() method can be used to check the User Agent for a RIM blackberry tablet.
  497. * The user agent of the BlackBerry® Tablet OS follows a format similar to the following:
  498. * Mozilla/5.0 (PlayBook; U; RIM Tablet OS 1.0.0; en-US) AppleWebKit/534.8+ (KHTML, like Gecko) Version/0.0.1 Safari/534.8+
  499. *
  500. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  501. */
  502. public static function is_blackberry_tablet() {
  503. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_blackberry_tablet from the `automattic/jetpack-device-detection` package' );
  504. return User_Agent_Info::is_blackberry_tablet();
  505. }
  506. /**
  507. * The is_blackbeberry() method can be used to check the User Agent for a blackberry device.
  508. * Note that opera mini on BB matches this rule.
  509. *
  510. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  511. */
  512. public static function is_blackbeberry() {
  513. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_blackbeberry from the `automattic/jetpack-device-detection` package' );
  514. return User_Agent_Info::is_blackbeberry();
  515. }
  516. /**
  517. * The is_blackberry_10() method can be used to check the User Agent for a BlackBerry 10 device.
  518. *
  519. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  520. */
  521. public static function is_blackberry_10() {
  522. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_blackberry_10 from the `automattic/jetpack-device-detection` package' );
  523. return User_Agent_Info::is_blackberry_10();
  524. }
  525. /**
  526. * Retrieve the blackberry OS version.
  527. *
  528. * Return strings are from the following list:
  529. * - blackberry-10
  530. * - blackberry-7
  531. * - blackberry-6
  532. * - blackberry-torch //only the first edition. The 2nd edition has the OS7 onboard and doesn't need any special rule.
  533. * - blackberry-5
  534. * - blackberry-4.7
  535. * - blackberry-4.6
  536. * - blackberry-4.5
  537. *
  538. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  539. *
  540. * @return string Version of the BB OS. If version is not found, get_blackbeberry_OS_version will return boolean false.
  541. */
  542. public static function get_blackbeberry_OS_version() {
  543. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::get_blackbeberry_OS_version from the `automattic/jetpack-device-detection` package' );
  544. return User_Agent_Info::get_blackbeberry_OS_version();
  545. }
  546. /**
  547. * Retrieve the blackberry browser version.
  548. *
  549. * Return string are from the following list:
  550. * - blackberry-10
  551. * - blackberry-webkit
  552. * - blackberry-5
  553. * - blackberry-4.7
  554. * - blackberry-4.6
  555. *
  556. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  557. *
  558. * @return string Type of the BB browser. If browser's version is not found, detect_blackbeberry_browser_version will return boolean false.
  559. */
  560. public static function detect_blackberry_browser_version() {
  561. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::detect_blackberry_browser_version from the `automattic/jetpack-device-detection` package' );
  562. return User_Agent_Info::detect_blackberry_browser_version();
  563. }
  564. /**
  565. * Checks if a visitor is coming from one of the WordPress mobile apps.
  566. *
  567. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  568. *
  569. * @return bool
  570. */
  571. public static function is_mobile_app() {
  572. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_mobile_app from the `automattic/jetpack-device-detection` package' );
  573. return User_Agent_Info::is_mobile_app();
  574. }
  575. /**
  576. * Detects if the current browser is Nintendo 3DS handheld.
  577. *
  578. * Example: Mozilla/5.0 (Nintendo 3DS; U; ; en) Version/1.7498.US
  579. * can differ in language, version and region
  580. *
  581. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  582. */
  583. public static function is_Nintendo_3DS() {
  584. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_Nintendo_3DS from the `automattic/jetpack-device-detection` package' );
  585. return User_Agent_Info::is_Nintendo_3DS();
  586. }
  587. /**
  588. * Was the current request made by a known bot?
  589. *
  590. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  591. *
  592. * @return boolean
  593. */
  594. public static function is_bot() {
  595. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_bot from the `automattic/jetpack-device-detection` package' );
  596. return User_Agent_Info::is_bot();
  597. }
  598. /**
  599. * Is the given user-agent a known bot?
  600. * If you want an is_bot check for the current request's UA, use is_bot() instead of passing a user-agent to this method.
  601. *
  602. * @param string $ua A user-agent string.
  603. *
  604. * @deprecated 8.7.0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
  605. *
  606. * @return boolean
  607. */
  608. public static function is_bot_user_agent( $ua = null ) {
  609. _deprecated_function( __METHOD__, 'Jetpack 8.7', '\Automattic\Jetpack\Device_Detection\User_Agent_Info::is_bot_user_agent from the `automattic/jetpack-device-detection` package' );
  610. return User_Agent_Info::is_bot_user_agent( $ua );
  611. }
  612. }