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