2019-11-15 23:26:29 +01:00
< ? php
/**
2020-09-15 14:30:05 +02:00
* Deprecated . Use Automattic\Jetpack\Device_Detection\User_Agent_Info instead .
*
2021-04-27 08:32:47 +02:00
* @ package automattic / jetpack
2019-11-15 23:26:29 +01:00
*
2020-09-15 14:30:05 +02:00
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*
2022-04-02 10:26:41 +02:00
* Note : we cannot get rid of the class and its methods yet as multiple plugins
* still use it . See https :// github . com / Automattic / jetpack / pull / 16434 / files #r667190852
*
2020-09-15 14:30:05 +02:00
* @ phpcs : disable WordPress . NamingConventions . ValidVariableName . UsedPropertyNotSnakeCase
* @ phpcs : disable WordPress . NamingConventions . ValidVariableName . VariableNotSnakeCase
* @ phpcs : disable WordPress . NamingConventions . ValidVariableName . PropertyNotSnakeCase
* @ phpcs : disable WordPress . NamingConventions . ValidFunctionName . MethodNameInvalid
* @ phpcs : disable WordPress . Files . FileName
2019-11-15 23:26:29 +01:00
*/
2023-09-26 10:24:36 +02:00
use Automattic\Jetpack\Device_Detection\User_Agent_Info ;
2019-11-15 23:26:29 +01:00
2020-09-15 14:30:05 +02:00
/**
* A class providing device properties detection .
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
*/
2019-11-15 23:26:29 +01:00
class Jetpack_User_Agent_Info {
2020-09-15 14:30:05 +02:00
/**
* User_Agent_Info instance from the `jetpack-device-detection` package .
*
* @ var User_Agent_Info
*/
private $ua_info ;
2019-11-15 23:26:29 +01:00
2022-12-15 17:41:53 +01:00
/**
* Report deprecation if appropriate .
*
* Currently we don 't when running on WordPress.com, as there' s still a lot
* there that needs cleaning up first .
*
* @ param string $method Method .
* @ param string $repl Replacement method .
*/
private static function warn_deprecated ( $method , $repl ) {
if ( ! defined ( 'IS_WPCOM' ) || ! IS_WPCOM ) {
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Strings passed are safe.
_deprecated_function ( $method , 'Jetpack 8.7' , " \\ Automattic \\ Jetpack \\ Device_Detection \\ User_Agent_Info $repl from the `automattic/jetpack-device-detection` package " );
}
}
2020-09-15 14:30:05 +02:00
/**
* The constructor .
*
* @ param string $ua ( Optional ) User agent .
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
*/
public function __construct ( $ua = '' ) {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '' );
2020-09-15 14:30:05 +02:00
$this -> ua_info = new User_Agent_Info ( $ua );
2019-11-15 23:26:29 +01:00
}
/**
* This method detects the mobile User Agent name .
*
2020-09-15 14:30:05 +02:00
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
*
2019-11-15 23:26:29 +01:00
* @ return string The matched User Agent name , false otherwise .
*/
2020-09-15 14:30:05 +02:00
public function get_mobile_user_agent_name () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '->get_mobile_user_agent_name' );
2020-09-15 14:30:05 +02:00
return $this -> ua_info -> get_mobile_user_agent_name ();
2019-11-15 23:26:29 +01:00
}
/**
* This method detects the mobile device ' s platform . All return strings are from the class constants .
* Note that this function returns the platform name , not the UA name / type . You should use a different function
* if you need to test the UA capabilites .
*
2020-09-15 14:30:05 +02:00
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
*
2019-11-15 23:26:29 +01:00
* @ return string Name of the platform , false otherwise .
*/
public function get_platform () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '->get_platform' );
2020-09-15 14:30:05 +02:00
return $this -> ua_info -> get_platform ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* This method detects for UA which can display iPhone - optimized web content .
* Includes iPhone , iPod Touch , Android , WebOS , Fennec ( Firefox mobile ), etc .
*
2020-09-15 14:30:05 +02:00
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public function isTierIphone () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '->isTierIphone' );
2020-09-15 14:30:05 +02:00
return $this -> ua_info -> isTierIphone ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* This method detects for UA which are likely to be capable
* but may not necessarily support JavaScript .
* Excludes all iPhone Tier UA .
*
2020-09-15 14:30:05 +02:00
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public function isTierRichCss () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '->isTierRichCss' );
2020-09-15 14:30:05 +02:00
return $this -> ua_info -> isTierRichCss ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
* Detects if the user is using a tablet .
* props Corey Gilmore , BGR . com
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
*
* @ return bool
*/
public static function is_tablet () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '->is_tablet' );
2020-09-15 14:30:05 +02:00
return ( new User_Agent_Info () ) -> is_tablet ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* Detects if the current UA is the default iPhone or iPod Touch Browser .
*
2020-09-15 14:30:05 +02:00
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_iphoneOrIpod () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '->is_iphone_or_ipod' );
2020-09-15 14:30:05 +02:00
return ( new User_Agent_Info () ) -> is_iphoneOrIpod ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* Detects if the current UA is iPhone Mobile Safari or another iPhone or iPod Touch Browser .
*
* They type can check for any iPhone , an iPhone using Safari , or an iPhone using something other than Safari .
*
* Note : If you want to check for Opera mini , Opera mobile or Firefox mobile ( or any 3 rd party iPhone browser ),
* you should put the check condition before the check for 'iphone-any' or 'iphone-not-safari' .
* Otherwise those browsers will be 'catched' by the iphone string .
*
2020-09-15 14:30:05 +02:00
* @ param string $type Type of iPhone detection .
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_iphone_or_ipod ( $type = 'iphone-any' ) {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_iphone_or_ipod' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_iphone_or_ipod ( $type );
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
* Detects if the current UA is Chrome for iOS
*
* The User - Agent string in Chrome for iOS is the same as the Mobile Safari User - Agent , with CriOS /< ChromeRevision > instead of Version /< VersionNum >.
* - 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 / 9 B206 Safari / 7534.48 . 3
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
*/
public static function is_chrome_for_iOS () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_chrome_for_iOS' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_chrome_for_iOS ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* Detects if the current UA is Twitter for iPhone
*
* 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 / 8 L1 Twitter for iPhone
* Mozilla / 5.0 ( iPhone ; CPU iPhone OS 5_1_1 like Mac OS X ) AppleWebKit / 534.46 ( KHTML , like Gecko ) Mobile / 9 B206 Twitter for iPhone
*
2020-09-15 14:30:05 +02:00
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_twitter_for_iphone () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_twitter_for_iphone' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_twitter_for_iphone ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* Detects if the current UA is Twitter for iPad
*
* 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 / 8 L1 Twitter for iPad
* 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 / 9 B206 Twitter for iPhone
*
2020-09-15 14:30:05 +02:00
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_twitter_for_ipad () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_twitter_for_ipad' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_twitter_for_ipad ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* Detects if the current UA is Facebook for iPhone
* - Facebook 4020.0 ( iPhone ; iPhone OS 5.0 . 1 ; fr_FR )
* - 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 ]
* - Mozilla / 5.0 ( iPhone ; CPU iPhone OS 5_1_1 like Mac OS X ) AppleWebKit / 534.46 ( KHTML , like Gecko ) Mobile / 9 B206 [ FBAN / FBIOS ; FBAV / 5.0 ; FBBV / 47423 ; FBDV / iPhone3 , 1 ; FBMD / iPhone ; FBSN / iPhone OS ; FBSV / 5.1 . 1 ; FBSS / 2 ; FBCR / 3 ITA ; FBID / phone ; FBLC / en_US ]
2020-09-15 14:30:05 +02:00
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_facebook_for_iphone () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_facebook_for_iphone' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_facebook_for_iphone ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* Detects if the current UA is Facebook for iPad
* - Facebook 4020.0 ( iPad ; iPhone OS 5.0 . 1 ; en_US )
* - 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 ]
* - Mozilla / 5.0 ( iPad ; CPU OS 6_0 like Mac OS X ) AppleWebKit / 536.26 ( KHTML , like Gecko ) Mobile / 10 A403 [ 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 ]
2020-09-15 14:30:05 +02:00
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_facebook_for_ipad () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_facebook_for_ipad' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_facebook_for_ipad ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
* Detects if the current UA is WordPress for iOS .
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_wordpress_for_ios () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_wordpress_for_ios' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_wordpress_for_ios ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* Detects if the current device is an iPad .
* They type can check for any iPad , an iPad using Safari , or an iPad using something other than Safari .
*
* Note : If you want to check for Opera mini , Opera mobile or Firefox mobile ( or any 3 rd party iPad browser ),
* you should put the check condition before the check for 'iphone-any' or 'iphone-not-safari' .
* Otherwise those browsers will be 'catched' by the ipad string .
*
2020-09-15 14:30:05 +02:00
* @ param string $type iPad type .
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
*/
public static function is_ipad ( $type = 'ipad-any' ) {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_ipad' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_ipad ( $type );
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* Detects if the current browser is Firefox Mobile ( Fennec )
*
2020-09-15 14:30:05 +02:00
* See http :// www . useragentstring . com / pages / Fennec /
2019-11-15 23:26:29 +01:00
* Mozilla / 5.0 ( Windows NT 6.1 ; WOW64 ; rv : 2.1 . 1 ) Gecko / 20110415 Firefox / 4.0 . 2 pre Fennec / 4.0 . 1
* Mozilla / 5.0 ( X11 ; U ; Linux i686 ; en - US ; rv : 1.9 . 1 b2pre ) Gecko / 20081015 Fennec / 1.0 a1
2020-09-15 14:30:05 +02:00
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_firefox_mobile () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_firefox_mobile' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_firefox_mobile ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* Detects if the current browser is Firefox for desktop
*
2020-09-15 14:30:05 +02:00
* See https :// developer . mozilla . org / en - US / docs / Web / HTTP / Headers / User - Agent / Firefox
2019-11-15 23:26:29 +01:00
* Mozilla / 5.0 ( platform ; rv : geckoversion ) Gecko / geckotrail Firefox / firefoxversion
* The platform section will include 'Mobile' for phones and 'Tablet' for tablets .
*
2020-09-15 14:30:05 +02:00
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_firefox_desktop () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_firefox_desktop' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_firefox_desktop ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* Detects if the current browser is FirefoxOS Native browser
2020-09-15 14:30:05 +02:00
*
* Mozilla / 5.0 ( Mobile ; rv : 14.0 ) Gecko / 14.0 Firefox / 14.0
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
*/
public static function is_firefox_os () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_firefox_os' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_firefox_os ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* Detects if the current browser is Opera Mobile
*
* What is the difference between Opera Mobile and Opera Mini ?
* - Opera Mobile is a full Internet browser for mobile devices .
* - Opera Mini always uses a transcoder to convert the page for a small display .
* ( it uses Opera advanced server compression technology to compress web content before it gets to a device .
* The rendering engine is on Opera ' s server . )
*
* Opera / 9.80 ( Windows NT 6.1 ; Opera Mobi / 14316 ; U ; en ) Presto / 2.7 . 81 Version / 11.00 "
* Opera / 9.50 ( Nintendo DSi ; Opera / 507 ; U ; en - US )
2020-09-15 14:30:05 +02:00
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_opera_mobile () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_opera_mobile' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_opera_mobile ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* Detects if the current browser is Opera Mini
*
* Opera / 8.01 ( J2ME / MIDP ; Opera Mini / 3.0 . 6306 / 1528 ; en ; U ; ssr )
* Opera / 9.80 ( Android ; Opera Mini / 6.0 . 24212 / 24.746 U ; en ) Presto / 2.5 . 25 Version / 10.5454
* Opera / 9.80 ( iPhone ; Opera Mini / 5.0 . 01 9802 / 18.738 ; U ; en ) Presto / 2.4 . 15
* Opera / 9.80 ( J2ME / iPhone ; Opera Mini / 5.0 . 01 9802 / 886 ; U ; ja ) Presto / 2.4 . 15
* Opera / 9.80 ( J2ME / iPhone ; Opera Mini / 5.0 . 01 9802 / 886 ; U ; ja ) Presto / 2.4 . 15
* Opera / 9.80 ( Series 60 ; Opera Mini / 5.1 . 22783 / 23.334 ; U ; en ) Presto / 2.5 . 25 Version / 10.54
* Opera / 9.80 ( BlackBerry ; Opera Mini / 5.1 . 22303 / 22.387 ; U ; en ) Presto / 2.5 . 25 Version / 10.54
*
2020-09-15 14:30:05 +02:00
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_opera_mini () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_opera_mini' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_opera_mini ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* Detects if the current browser is Opera Mini , but not on a smart device OS ( Android , iOS , etc )
* Used to send users on dumb devices to m . wor
2020-09-15 14:30:05 +02:00
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_opera_mini_dumb () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_opera_mini_dumb' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_opera_mini_dumb ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* Detects if the current browser is Opera Mobile or Mini .
*
* Opera Mini 5 Beta : Opera / 9.80 ( J2ME / MIDP ; Opera Mini / 5.0 . 15650 / 756 ; U ; en ) Presto / 2.2 . 0
* Opera Mini 8 : Opera / 8.01 ( J2ME / MIDP ; Opera Mini / 3.0 . 6306 / 1528 ; en ; U ; ssr )
2020-09-15 14:30:05 +02:00
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_OperaMobile () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_opera_mini() or \Automattic\Jetpack\Device_Detection\User_Agent_Info::is_opera_mobile()' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_OperaMobile ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* Detects if the current browser is a Windows Phone 7 device .
* ex : Mozilla / 4.0 ( compatible ; MSIE 7.0 ; Windows Phone OS 7.0 ; Trident / 3.1 ; IEMobile / 7.0 ; LG ; GW910 )
2020-09-15 14:30:05 +02:00
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_WindowsPhone7 () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_WindowsPhone7' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_WindowsPhone7 ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* Detects if the current browser is a Windows Phone 8 device .
* ex : Mozilla / 5.0 ( compatible ; MSIE 10.0 ; Windows Phone 8.0 ; Trident / 6.0 ; ARM ; Touch ; IEMobile / 10.0 ; < Manufacturer > ; < Device > [; < Operator > ])
2020-09-15 14:30:05 +02:00
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_windows_phone_8 () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_windows_phone_8' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_windows_phone_8 ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* Detects if the current browser is on a Palm device running the new WebOS . This EXCLUDES TouchPad .
*
2020-09-15 14:30:05 +02:00
* 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
* 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
2019-11-15 23:26:29 +01:00
*
2020-09-15 14:30:05 +02:00
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_PalmWebOS () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_PalmWebOS' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_PalmWebOS ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* Detects if the current browser is the HP TouchPad default browser . This excludes phones wt WebOS .
*
* 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
* 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
*
2020-09-15 14:30:05 +02:00
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_TouchPad () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_TouchPad' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_TouchPad ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* Detects if the current browser is the Series 60 Open Source Browser .
*
* 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
*
* 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
*
* 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
*
2020-09-15 14:30:05 +02:00
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_S60_OSSBrowser () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_S60_OSSBrowser' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_S60_OSSBrowser ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* Detects if the device platform is the Symbian Series 60.
*
2020-09-15 14:30:05 +02:00
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_symbian_platform () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_symbian_platform' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_symbian_platform ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* Detects if the device platform is the Symbian Series 40.
* Nokia Browser for Series 40 is a proxy based browser , previously known as Ovi Browser .
* This browser will report 'NokiaBrowser' in the header , however some older version will also report 'OviBrowser' .
*
2020-09-15 14:30:05 +02:00
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_symbian_s40_platform () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_symbian_s40_platform' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_symbian_s40_platform ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
* Returns if the device belongs to J2ME capable family .
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
*
* @ return bool
*/
public static function is_J2ME_platform () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_J2ME_platform' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_J2ME_platform ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* Detects if the current UA is on one of the Maemo - based Nokia Internet Tablets .
2020-09-15 14:30:05 +02:00
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_MaemoTablet () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_MaemoTablet' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_MaemoTablet ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* Detects if the current UA is a MeeGo device ( Nokia Smartphone ) .
2020-09-15 14:30:05 +02:00
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_MeeGo () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_MeeGo' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_MeeGo ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
* The is_webkit () method can be used to check the User Agent for an webkit generic browser .
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_webkit () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_webkit' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_webkit ();
2019-11-15 23:26:29 +01:00
}
/**
* Detects if the current browser is the Native Android browser .
*
2020-09-15 14:30:05 +02:00
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
*
2019-11-15 23:26:29 +01:00
* @ return boolean true if the browser is Android otherwise false
*/
2020-09-15 14:30:05 +02:00
public static function is_android () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_android' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_android ();
2019-11-15 23:26:29 +01:00
}
/**
* Detects if the current browser is the Native Android Tablet browser .
2020-09-15 14:30:05 +02:00
* Assumes 'Android' should be in the user agent , but not 'mobile'
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*
* @ return boolean true if the browser is Android and not 'mobile' otherwise false
*/
2020-09-15 14:30:05 +02:00
public static function is_android_tablet () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_android_tablet' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_android_tablet ();
2019-11-15 23:26:29 +01:00
}
/**
* Detects if the current browser is the Kindle Fire Native browser .
*
* 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
* 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
*
2020-09-15 14:30:05 +02:00
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
*
2019-11-15 23:26:29 +01:00
* @ return boolean true if the browser is Kindle Fire Native browser otherwise false
*/
2020-09-15 14:30:05 +02:00
public static function is_kindle_fire () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_kindle_fire' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_kindle_fire ();
2019-11-15 23:26:29 +01:00
}
/**
* Detects if the current browser is the Kindle Touch Native browser
*
* 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 +
*
2020-09-15 14:30:05 +02:00
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
*
2019-11-15 23:26:29 +01:00
* @ return boolean true if the browser is Kindle monochrome Native browser otherwise false
*/
2020-09-15 14:30:05 +02:00
public static function is_kindle_touch () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_kindle_touch' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_kindle_touch ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
* Detect if user agent is the WordPress . com Windows 8 app ( used ONLY on the custom oauth stylesheet )
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
*/
public static function is_windows8_auth () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_windows8_auth' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_windows8_auth ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
* Detect if user agent is the WordPress . com Windows 8 app .
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
*/
public static function is_wordpress_for_win8 () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_wordpress_for_win8' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_wordpress_for_win8 ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
* Detect if user agent is the WordPress . com Desktop app .
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
*/
public static function is_wordpress_desktop_app () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_wordpress_desktop_app' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_wordpress_desktop_app ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
* The is_blackberry_tablet () method can be used to check the User Agent for a RIM blackberry tablet .
2019-11-15 23:26:29 +01:00
* The user agent of the BlackBerry® Tablet OS follows a format similar to the following :
* 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 +
*
2020-09-15 14:30:05 +02:00
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_blackberry_tablet () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_blackberry_tablet' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_blackberry_tablet ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
* The is_blackbeberry () method can be used to check the User Agent for a blackberry device .
* Note that opera mini on BB matches this rule .
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_blackbeberry () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_blackbeberry' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_blackbeberry ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
* The is_blackberry_10 () method can be used to check the User Agent for a BlackBerry 10 device .
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
*/
public static function is_blackberry_10 () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_blackberry_10' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_blackberry_10 ();
2019-11-15 23:26:29 +01:00
}
/**
* Retrieve the blackberry OS version .
*
* Return strings are from the following list :
* - blackberry - 10
* - blackberry - 7
* - blackberry - 6
* - blackberry - torch //only the first edition. The 2nd edition has the OS7 onboard and doesn't need any special rule.
* - blackberry - 5
* - blackberry - 4.7
* - blackberry - 4.6
* - blackberry - 4.5
*
2020-09-15 14:30:05 +02:00
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
*
* @ return string Version of the BB OS . If version is not found , get_blackbeberry_OS_version will return boolean false .
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function get_blackbeberry_OS_version () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::get_blackbeberry_OS_version' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: get_blackbeberry_OS_version ();
2019-11-15 23:26:29 +01:00
}
/**
* Retrieve the blackberry browser version .
*
* Return string are from the following list :
* - blackberry - 10
* - blackberry - webkit
* - blackberry - 5
* - blackberry - 4.7
* - blackberry - 4.6
*
2020-09-15 14:30:05 +02:00
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
*
* @ return string Type of the BB browser . If browser ' s version is not found , detect_blackbeberry_browser_version will return boolean false .
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function detect_blackberry_browser_version () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::detect_blackberry_browser_version' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: detect_blackberry_browser_version ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
* Checks if a visitor is coming from one of the WordPress mobile apps .
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
*
* @ return bool
*/
public static function is_mobile_app () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_mobile_app' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_mobile_app ();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
2019-11-15 23:26:29 +01:00
* Detects if the current browser is Nintendo 3 DS handheld .
*
2020-09-15 14:30:05 +02:00
* Example : Mozilla / 5.0 ( Nintendo 3 DS ; U ; ; en ) Version / 1.7498 . US
2019-11-15 23:26:29 +01:00
* can differ in language , version and region
2020-09-15 14:30:05 +02:00
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
2019-11-15 23:26:29 +01:00
*/
2020-09-15 14:30:05 +02:00
public static function is_Nintendo_3DS () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_Nintendo_3DS' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_Nintendo_3DS ();
2019-11-15 23:26:29 +01:00
}
/**
* Was the current request made by a known bot ?
*
2020-09-15 14:30:05 +02:00
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
*
2019-11-15 23:26:29 +01:00
* @ return boolean
*/
2020-09-15 14:30:05 +02:00
public static function is_bot () {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_bot' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_bot ();
2019-11-15 23:26:29 +01:00
}
/**
* Is the given user - agent a known bot ?
* 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 .
*
2020-09-15 14:30:05 +02:00
* @ param string $ua A user - agent string .
*
* @ deprecated 8.7 . 0 Use Automattic\Jetpack\Device_Detection\User_Agent_Info
*
2019-11-15 23:26:29 +01:00
* @ return boolean
*/
2020-09-15 14:30:05 +02:00
public static function is_bot_user_agent ( $ua = null ) {
2022-12-15 17:41:53 +01:00
self :: warn_deprecated ( __METHOD__ , '::is_bot_user_agent' );
2020-09-15 14:30:05 +02:00
return User_Agent_Info :: is_bot_user_agent ( $ua );
2019-11-15 23:26:29 +01:00
}
}