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