{"id":15292280,"url":"https://github.com/wpbones/geolocalizer","last_synced_at":"2026-01-24T16:06:10.438Z","repository":{"id":49901122,"uuid":"80837279","full_name":"wpbones/geolocalizer","owner":"wpbones","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-27T05:48:30.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-15T22:20:45.455Z","etag":null,"topics":["geocoding","geolocation","wordpress","wordpress-development","wordpress-plugin","wp-bones","wp-bones-packages"],"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,"zenodo":null}},"created_at":"2017-02-03T14:41:12.000Z","updated_at":"2025-05-27T05:48:33.000Z","dependencies_parsed_at":"2025-05-07T05:06:48.837Z","dependency_job_id":"1efdfa2e-1711-47db-a98b-eaede0c7d897","html_url":"https://github.com/wpbones/geolocalizer","commit_stats":{"total_commits":9,"total_committers":2,"mean_commits":4.5,"dds":0.4444444444444444,"last_synced_commit":"4cf2e2dbb0950b1cad491be15f10ccbb89a21ebc"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/wpbones/geolocalizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpbones%2Fgeolocalizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpbones%2Fgeolocalizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpbones%2Fgeolocalizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpbones%2Fgeolocalizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wpbones","download_url":"https://codeload.github.com/wpbones/geolocalizer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpbones%2Fgeolocalizer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28730897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T10:24:43.181Z","status":"ssl_error","status_checked_at":"2026-01-24T10:24:36.112Z","response_time":89,"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":["geocoding","geolocation","wordpress","wordpress-development","wordpress-plugin","wp-bones","wp-bones-packages"],"created_at":"2024-09-30T16:17:15.111Z","updated_at":"2026-01-24T16:06:10.421Z","avatar_url":"https://github.com/wpbones.png","language":"PHP","readme":"# Geo Localizer packager for WP Bones\n\n\u003cdiv align=\"center\"\u003e\n\n[![Latest Stable Version](https://poser.pugx.org/wpbones/geolocalizer/v/stable?style=for-the-badge)](https://packagist.org/packages/wpbones/geolocalizer) \u0026nbsp;\n[![Latest Unstable Version](https://poser.pugx.org/wpbones/geolocalizer/v/unstable?style=for-the-badge)](https://packagist.org/packages/wpbones/geolocalizer) \u0026nbsp;\n[![Total Downloads](https://poser.pugx.org/wpbones/geolocalizer/downloads?style=for-the-badge)](https://packagist.org/packages/wpbones/geolocalizer) \u0026nbsp;\n[![License](https://poser.pugx.org/wpbones/geolocalizer/license?style=for-the-badge)](https://packagist.org/packages/wpbones/geolocalizer) \u0026nbsp;\n[![Monthly Downloads](https://poser.pugx.org/wpbones/geolocalizer/d/monthly?style=for-the-badge)](https://packagist.org/packages/wpbones/geolocalizer)\n\n\u003c/div\u003e\n\nGeo Localizer provides a set of utilities to manage geolocation for WordPress/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/geolocalizer\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/geolocalizer\n```\n\nYou may also to add `\"wpbones/geolocalizer\": \"^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/geolocalizer\": \"~1.0\"\n  },\n```\n\nand run\n\n```sh copy\ncomposer install\n```\n\nAlternatively, you can get the single files `src/resources/assets/js/actions-and-filters.js` in your WP Bones plugin and compile it with `gulp`.\nAlso, you can get pre-compiled minified version `src/public/js/actions-and-filters.min.js`.\n\n## Migration\n\nIn the `database/migrations` you'll find the default migration database table used for the countries.\nAlso. in the `database/seeders` you'll find the data for countries database table.\n\nAnyway, you just copy these folders in your plugin `database/` folder.\n\n## Geo services\n\nThis version is using the [IPStack](https://ipstack.com/) service to get the country code and the rest of the data.\nYou have to create an account in IPStack and get your API key.\nIn your plugin you may use the API key b yusing the filter:\n\n```php copy\nadd_filter('wpbones_geolocalizer_ipstack_api_key', function () {\n    // get your api key rom your settings\n    // for example, MyPlugin::$plugin-\u003eoptions-\u003eget('General/ipstack_api_key');\n    return $your_api_key;\n});\n```\n\n## Testing\n\nIn order to check if your API key is valid you can use the following command:\n\n```php copy\n$info = MyPlugin\\GeoLocalizer\\GeoLocalizerProvider::geoIP();\n```\n\nYou should receive all information starting from your IP address. Otherwise, you'll receive an error from IPStack service.\n\n## Shortcode\n\nGeolocalizer provides a shortcode method. You can define you own shortcode in the your shortcode provider class:\n\n```php copy\nuse WPMyPlugin\\WPBones\\Foundation\\WordPressShortcodesServiceProvider as ServiceProvider;\nuse WPMyPlugin\\GeoLocalizer\\GeoLocalizerProvider;\n\nclass WPMyPluginShortcode extends ServiceProvider\n{\n\n  /**\n   * List of registred shortcodes. {shortcode}/method\n   *\n   * @var array\n   */\n  protected $shortcodes = [\n    'my_shortocde_geo' =\u003e 'my_shortocde_geo',\n  ];\n\n\n  public function my_shortocde_geo( $atts = [], $content = null )\n  {\n    return GeoLocalizerProvider::shortcode( $atts, $content );\n  }\n\n```\n\nThe you can use:\n\n```txt copy\n[my_shortocde_geo city=\"Rome\"]\n  Only for Rome\n[/my_shortocde_geo]\n```\n\n```txt copy\n[my_shortocde_geo city=\"rome\"]\n  Only for Rome\n[/my_shortocde_geo]\n```\n\n```txt copy\n[my_shortocde_geo city=\"rome,london\"]\n  Only for Rome and Landon\n[/my_shortocde_geo]\n```\n\n```txt copy\n[my_shortocde_geo region_name=\"lazio\"]\n  Only for region (Italy) Lazio\n[/my_shortocde_geo]\n```\n\n```txt copy\n[my_shortocde_geo country_code=\"IT\"]\n  Italian only\n[/my_shortocde_geo]\n```\n\n```txt copy\n[my_shortocde_geo country_name=\"italy\"]\n  Italian only\n[/my_shortocde_geo]\n```\n\n```txt copy\n[my_shortocde_geo zip_code=\"00137\"]\n  Wow\n[/my_shortocde_geo]\n```\n\n```txt copy\n[my_shortocde_geo ip=\"80.182.82.82\"]\n  Only for me\n[/my_shortocde_geo]\n```\n\n```txt copy\n[my_shortocde_geo time_zone=\"europe\\rome\"]\n  Rome/Berlin time zone\n[/my_shortocde_geo]\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpbones%2Fgeolocalizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwpbones%2Fgeolocalizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpbones%2Fgeolocalizer/lists"}