PHPackages                             automattic/jetpack-device-detection - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. automattic/jetpack-device-detection

ActiveJetpack-library[Utility &amp; Helpers](/categories/utility)

automattic/jetpack-device-detection
===================================

A way to detect device types based on User-Agent header.

v3.4.0(3mo ago)1069.3k↑405.1%36GPL-2.0-or-laterPHPPHP &gt;=7.2CI failing

Since Jun 25Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/Automattic/jetpack-device-detection)[ Packagist](https://packagist.org/packages/automattic/jetpack-device-detection)[ RSS](/packages/automattic-jetpack-device-detection/feed)WikiDiscussions trunk Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (74)Used By (6)

Jetpack Device Detection
========================

[](#jetpack-device-detection)

A method to detect device types, originates from `jetpack_is_mobile`.

### Usage

[](#usage)

Retrieve device information.

```
use Automattic\Jetpack\Device_Detection;

$device_info = Device_Detection::get_info();

/**
 * array(
 *  'is_phone'            => (bool) Whether the current device is a mobile phone.
 *  'is_smartphone'       => (bool) Whether the current device is a smartphone.
 *  'is_tablet'           => (bool) Whether the current device is a tablet device.
 *  'is_handheld'         => (bool) Whether the current device is a handheld device.
 *  'is_desktop'          => (bool) Whether the current device is a laptop / desktop device.
 *  'platform'            => (string) Detected platform.
 *  'is_phone_matched_ua' => (string) Matched UA.
 * );
 */
```

Detect any mobile phone.

```
use Automattic\Jetpack\Device_Detection;

$is_phone = Device_Detection::is_phone();
```

Detect a smartphone.

```
use Automattic\Jetpack\Device_Detection;

$is_smartphone = Device_Detection::is_smartphone();
```

Detect a dumbphone.

```
use Automattic\Jetpack\Device_Detection;

$is_dumbphone = Device_Detection::is_phone() && ! Device_Detection::is_smartphone();
```

Detect a tablet.

```
use Automattic\Jetpack\Device_Detection;

$is_tablet = Device_Detection::is_tablet();
```

Detect a desktop device.

```
use Automattic\Jetpack\Device_Detection;

$is_desktop = Device_Detection::is_desktop();
```

Detect any handheld device.

```
use Automattic\Jetpack\Device_Detection;

$is_handheld = Device_Detection::is_handheld();
```

Using this package in your WordPress plugin
-------------------------------------------

[](#using-this-package-in-your-wordpress-plugin)

If you plan on using this package in your WordPress plugin, we would recommend that you use [Jetpack Autoloader](https://packagist.org/packages/automattic/jetpack-autoloader) as your autoloader. This will allow for maximum interoperability with other plugins that use this package as well.

Security
--------

[](#security)

Need to report a security vulnerability? Go to  or directly to our security bug bounty site .

License
-------

[](#license)

jetpack-device-detection is licensed under [GNU General Public License v2 (or later)](./LICENSE.txt)

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance85

Actively maintained with recent releases

Popularity40

Moderate usage in the ecosystem

Community35

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~34 days

Recently: every ~28 days

Total

61

Last Release

105d ago

Major Versions

v1.5.1 → v2.0.02023-11-20

v2.1.6 → v3.0.02024-11-14

PHP version history (2 changes)v2.0.0PHP &gt;=7.0

v3.0.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c5869ecbb8e0eac7e8b8e0f3cf7bdd8d5fcdc4abc10a72281872c53f8639d44?d=identicon)[automattic](/maintainers/automattic)

![](https://www.gravatar.com/avatar/11609890f6e7a840715f4cfc9622d77ea64b7dfc024df5643fbf8471a18c00f3?d=identicon)[kraft](/maintainers/kraft)

![](https://www.gravatar.com/avatar/5326730499ec14e274f51b9bcc39db6aac0fb38b33849715aae0e2587a2b93df?d=identicon)[jeherve](/maintainers/jeherve)

![](https://www.gravatar.com/avatar/6e220e167e341c28b1aa10bf0bb0374999068329f8683d3187ee3cf6749b8837?d=identicon)[dereksmart](/maintainers/dereksmart)

---

Top Contributors

[![anomiex](https://avatars.githubusercontent.com/u/1030580?v=4)](https://github.com/anomiex "anomiex (93 commits)")[![tbradsha](https://avatars.githubusercontent.com/u/32492176?v=4)](https://github.com/tbradsha "tbradsha (27 commits)")[![jeherve](https://avatars.githubusercontent.com/u/426388?v=4)](https://github.com/jeherve "jeherve (24 commits)")[![kraftbj](https://avatars.githubusercontent.com/u/88897?v=4)](https://github.com/kraftbj "kraftbj (16 commits)")[![samiff](https://avatars.githubusercontent.com/u/15803018?v=4)](https://github.com/samiff "samiff (13 commits)")[![zinigor](https://avatars.githubusercontent.com/u/374293?v=4)](https://github.com/zinigor "zinigor (9 commits)")[![coder-karen](https://avatars.githubusercontent.com/u/16754605?v=4)](https://github.com/coder-karen "coder-karen (5 commits)")[![sdixon194](https://avatars.githubusercontent.com/u/33553323?v=4)](https://github.com/sdixon194 "sdixon194 (5 commits)")[![gmjuhasz](https://avatars.githubusercontent.com/u/36671565?v=4)](https://github.com/gmjuhasz "gmjuhasz (4 commits)")[![chihsuan](https://avatars.githubusercontent.com/u/4344253?v=4)](https://github.com/chihsuan "chihsuan (3 commits)")[![haqadn](https://avatars.githubusercontent.com/u/3737780?v=4)](https://github.com/haqadn "haqadn (2 commits)")[![kangzj](https://avatars.githubusercontent.com/u/1425433?v=4)](https://github.com/kangzj "kangzj (2 commits)")[![manzoorwanijk](https://avatars.githubusercontent.com/u/18226415?v=4)](https://github.com/manzoorwanijk "manzoorwanijk (2 commits)")[![nunyvega](https://avatars.githubusercontent.com/u/16329583?v=4)](https://github.com/nunyvega "nunyvega (2 commits)")[![simison](https://avatars.githubusercontent.com/u/87168?v=4)](https://github.com/simison "simison (2 commits)")[![vianasw](https://avatars.githubusercontent.com/u/298685?v=4)](https://github.com/vianasw "vianasw (2 commits)")[![ice9js](https://avatars.githubusercontent.com/u/8056203?v=4)](https://github.com/ice9js "ice9js (2 commits)")[![gravityrail](https://avatars.githubusercontent.com/u/51896?v=4)](https://github.com/gravityrail "gravityrail (1 commits)")[![adimoldovan](https://avatars.githubusercontent.com/u/3854374?v=4)](https://github.com/adimoldovan "adimoldovan (1 commits)")[![allilevine](https://avatars.githubusercontent.com/u/1689238?v=4)](https://github.com/allilevine "allilevine (1 commits)")

---

Tags

jetpack

### Embed Badge

![Health badge](/badges/automattic-jetpack-device-detection/health.svg)

```
[![Health](https://phpackages.com/badges/automattic-jetpack-device-detection/health.svg)](https://phpackages.com/packages/automattic-jetpack-device-detection)
```

###  Alternatives

[florianv/swap

Exchange rates library for PHP

1.3k6.4M16](/packages/florianv-swap)[akaunting/laravel-money

Currency formatting and conversion package for Laravel

7825.3M18](/packages/akaunting-laravel-money)[kartik-v/yii2-widget-affix

A scrollspy and affixed enhanced navigation to highlight page sections (sub repo split from yii2-widgets)

153.8M3](/packages/kartik-v-yii2-widget-affix)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
