{"id":18685436,"url":"https://github.com/wpbones/useragent","last_synced_at":"2026-03-07T15:32:11.228Z","repository":{"id":57082158,"uuid":"168550482","full_name":"wpbones/useragent","owner":"wpbones","description":"An useful version of mobile detect library for wpbones","archived":false,"fork":false,"pushed_at":"2025-05-27T05:47:51.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-15T22:20:45.549Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wpbones.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-31T15:45:31.000Z","updated_at":"2025-05-27T05:47:55.000Z","dependencies_parsed_at":"2024-10-24T20:58:57.709Z","dependency_job_id":"482a602c-0d4b-4edd-9dad-f185e1ca3579","html_url":"https://github.com/wpbones/useragent","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"ce7f6307891fbe9c432833b4c65c452b3d37ac82"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/wpbones/useragent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpbones%2Fuseragent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpbones%2Fuseragent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpbones%2Fuseragent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpbones%2Fuseragent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wpbones","download_url":"https://codeload.github.com/wpbones/useragent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpbones%2Fuseragent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30219541,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T14:02:48.375Z","status":"ssl_error","status_checked_at":"2026-03-07T14:02:43.192Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T10:22:32.392Z","updated_at":"2026-03-07T15:32:11.204Z","avatar_url":"https://github.com/wpbones.png","language":"PHP","readme":"# User Agent for WP Bones\n\n\u003cdiv align=\"center\"\u003e\n\n[![Latest Stable Version](https://poser.pugx.org/wpbones/useragent/v/stable?style=for-the-badge)](https://packagist.org/packages/wpbones/useragent) \u0026nbsp;\n[![Latest Unstable Version](https://poser.pugx.org/wpbones/useragent/v/unstable?style=for-the-badge)](https://packagist.org/packages/wpbones/useragent) \u0026nbsp;\n[![Total Downloads](https://poser.pugx.org/wpbones/useragent/downloads?style=for-the-badge)](https://packagist.org/packages/wpbones/useragent) \u0026nbsp;\n[![License](https://poser.pugx.org/wpbones/useragent/license?style=for-the-badge)](https://packagist.org/packages/wpbones/useragent) \u0026nbsp;\n[![Monthly Downloads](https://poser.pugx.org/wpbones/useragent/d/monthly?style=for-the-badge)](https://packagist.org/packages/wpbones/useragent)\n\n\u003c/div\u003e\n\nAn useful wrapper for [Mobile Detect](https://github.com/serbanghita/Mobile-Detect) to detect mobile devices for WP Bones.\n\n## Requirements\n\nThis package works with a WordPress plugin written with [WP Bones framework library](https://github.com/wpbones/WPBones).\n\n## Installation\n\nYou can install third party packages by using:\n\n```sh copy\nphp bones require wpbones/useragent\n```\n\nI advise to use this command instead of `composer require` because doing this an automatic renaming will done.\n\nYou can use composer to install this package:\n\n```sh copy\ncomposer require wpbones/useragent\n```\n\nYou may also to add `\"wpbones/useragent\": \"^1.0\"` in the `composer.json` file of your plugin:\n\n```json copy filename=\"composer.json\" {4}\n  \"require\": {\n    \"php\": \"\u003e=7.4\",\n    \"wpbones/wpbones\": \"~0.8\",\n    \"wpbones/useragent\": \"~1.0\"\n  },\n```\n\nand run\n\n```sh copy\ncomposer install\n```\n\n## How to\n\nYou will be able to use `wpbones_user_agent()` function to get an instance of Mobile Detect.\n\n```php copy\nif(wpbones_user_agent()-\u003eisMobile()) {\n  echo \"You're by Mobile\";\n} else {\n  echo \"You're by Desktop\";\n}\n```\n\n### Sample\n\n```php copy\n// Basic detection.\nwpbones_user_agent()-\u003eisMobile();\nwpbones_user_agent()-\u003eisTablet();\n\n// Magic methods.\nwpbones_user_agent()-\u003eisIphone();\nwpbones_user_agent()-\u003eisSamsung();\n// [...]\n\n// Alternative to magic methods.\nwpbones_user_agent()-\u003eis('iphone');\n\n// Find the version of component.\nwpbones_user_agent()-\u003eversion('Android');\n```\n\nYou may also\n\n```php copy\n// Any mobile device (phones or tablets).\nif ( wpbones_user_agent()-\u003eisMobile() ) {\n\n}\n\n// Any tablet device.\nif( wpbones_user_agent()-\u003eisTablet() ){\n\n}\n\n// Exclude tablets.\nif( wpbones_user_agent()-\u003eisMobile() \u0026\u0026 !wpbones_user_agent()-\u003eisTablet() ){\n\n}\n\n// Check for a specific platform with the help of the magic methods:\nif( wpbones_user_agent()-\u003eisiOS() ){\n\n}\n\nif( wpbones_user_agent()-\u003eisAndroidOS() ){\n\n}\n\n// Alternative method is() for checking specific properties.\n// WARNING: this method is in BETA, some keyword properties will change in the future.\nwpbones_user_agent()-\u003eis('Chrome')\nwpbones_user_agent()-\u003eis('iOS')\nwpbones_user_agent()-\u003eis('UCBrowser')\nwpbones_user_agent()-\u003eis('Opera')\n// [...]\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpbones%2Fuseragent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwpbones%2Fuseragent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpbones%2Fuseragent/lists"}