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