Title: DM Visitor Location Notification
Author: George-Paul Crețu
Published: <strong>2020 年 4 月 21 日</strong>
Last modified: 2020 年 7 月 3 日

---

搜索插件

![](https://ps.w.org/dm-visitor-location-notification/assets/banner-772x250.jpg?
rev=2288155)

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://ps.w.org/dm-visitor-location-notification/assets/icon-256x256.jpg?rev
=2288155)

# DM Visitor Location Notification

 作者：[George-Paul Crețu](https://profiles.wordpress.org/necroob/)

[下载](https://downloads.wordpress.org/plugin/dm-visitor-location-notification.zip)

 * [详情](https://cn.wordpress.org/plugins/dm-visitor-location-notification/#description)
 * [评价](https://cn.wordpress.org/plugins/dm-visitor-location-notification/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/dm-visitor-location-notification/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/dm-visitor-location-notification/#developers)

 [支持](https://wordpress.org/support/plugin/dm-visitor-location-notification/)

## 描述

The plugin uses **ipstack.com** to get visitors details based on IP.
 _You will 
need an API key from ipstack.com in order for it to work._

After activation you can use the shortcode `[dm-vln-notification]` on the page where
you want to show the notifications.

Potential usage for:
 – podcast sites – video libraries – shops – publications

Using this shortcode on your site will allow other visitors to get a sense of the
engagement your pages get.

#### Shortcodes

Two shortcodes are available for use:
 – `[dm-vln-notification]` – this one will
check the visitor details, create/update the records and show the notification message.–`[
dm-vln-top-countries]` – this one will show the top 10 countries that visited the
page (only unique IPs will be counted).

The `[dm-vln-top-countries]` can’t provide correct data if `[dm-vln-notification]`
was not added to that page at one point.
 Since `[dm-vln-notification]` does the
whole operation regarding visitor data display, save and update.

#### Settings

Dashboard page provides you with a number of options:
 – Adding API Key – Choose
the position of the notification – Style the color scheme for the notification –
Add Custom notification message for single and multiple users – Adjust the Notification
display time – Adjust the Frequency of the Ajax call – Set the seconds for with 
to check the DB (based on NOW – seconds we decide what users are new/online) – Pause
the API Request – Select a date and delete DB records previous to that

#### Custom notification message

Custom notification messages can be adjusted using dynamic variables.
 For Single
visitor you have: – `%dm_vln_country%` – displays the country with the flag – `%
dm_vln_city%` – displays the city (it is not 100% accurate).

For Multiple visitors you have:
 – `%dm_vln_visitor_number%` – shows the number 
of visitors – `%dm_vln_countries%` – displays list of country codes – `%dm_vln_flags%`–
displays list of flags instead of country codes – `%dm_vln_country_flags%` – displays
list of country codes associated with the flag.

You should only use one of the `%dm_vln_countries%`, `%dm_vln_flags%`, `%dm_vln_country_flags%`
or it will show you duplicate data.

In all custom message you can use HTML tags.

## 屏幕截图

[⌊Example of top visits for a page and multiple visitors from different countries
notification⌉⌊Example of top visits for a page and multiple visitors from different
countries notification⌉[

Example of top visits for a page and multiple visitors from different countries 
notification

[⌊Example of top visits for a page and multiple visitors from same country notification⌉⌊
Example of top visits for a page and multiple visitors from same country notification⌉[

Example of top visits for a page and multiple visitors from same country notification

[⌊Example of top visits for a page and single visitor notification⌉⌊Example of top
visits for a page and single visitor notification⌉[

Example of top visits for a page and single visitor notification

[⌊Settings page with API notification⌉⌊Settings page with API notification⌉[

Settings page with API notification

[⌊Add in the ipstack.com API Key⌉⌊Add in the ipstack.com API Key⌉[

Add in the ipstack.com API Key

[⌊Style the notification with these 3 options⌉⌊Style the notification with these
3 options⌉[

Style the notification with these 3 options

[⌊Customize the notification message by using the dynamic variables⌉⌊Customize the
notification message by using the dynamic variables⌉[

Customize the notification message by using the dynamic variables

## 安装

 1. Upload `dm-visitor-location-notification` folder to the `/wp-content/plugins/` 
    directory.
 2. Activate the plugin through the ‘Plugins’ menu in WordPress.
 3. Start using the shortcodes to display the notification and record data.

## 常见问题

### How does the plugin work?

On activation the plugin creates a DB table called **dm_visitor_location** with 
the columns: IP, Time, Continent, Country, Country_Code, City, Post_ID, id.
 The
IP is grabbed with a PHP function at the plugin level and passed to the API request
to IPStack, returning the Continent, Country, Country_Code and City.

For that to happen you will need to use `[dm-vln-notification]` on the page you 
want to show the notification.

The function behind the shortcode will get the IP, check if the IP exists in the
DB for the current Post_ID. If the IP doesn’t exists associated with the current
Post_ID it will save/create it. If the record already exits it will only update 
the timestamp.

The record exists if the IP and the Post_ID match.

This check is done in order to save API requests, only updating the timestamp on
the IPs that were already sent via the API request.

_Example: if the same IP returned to the same Post\_ID that it was visited before,
we only update the timestamp, we don’t create a new record._
 _If that IP visits
a different Post\_ID, we’ll create a new record with the new Post\_ID._

Based on these records we display the notification that someone is on the page with
that Post_ID.

### Can I use just the notifications without displaying the top countries?

Yes. You can only use the shortcode for notifications `[dm-vln-notification]` on
the page you want.

### How are the IPs stored?

The IPs are stored in the DB hashed under MD5.

### What happens with data when deactivating/uninstalling the plugin?

On deactivation nothing happens with the DB records, but once you delete the plugin
via WP Dashboard the plugin DB table will be removed.

### How are flag images created?

The flag images are `.svg` files.

### Can I style the notification?

Yes. You can use the existing settings to adjust the color scheme, or add CSS rules.
All notification elements have classes that you can use.
 Also the font family is
grabbed from the site, so no font family is added via the plugin.

### Do I get a notification for myself accessing the page?

No. You will not get a notification for yourself accessing the page. If your IP 
matches with the IP retrieved from DB, you will not be displayed to yourself as 
a visitor.

### Can I see a live demo?

Sure! Check it out [here](https://apps.devmaverick.com/dm-vln/)

## 评价

此插件暂无评价。

## 贡献者及开发者

「DM Visitor Location Notification」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ George-Paul Crețu ](https://profiles.wordpress.org/necroob/)

[帮助将「DM Visitor Location Notification」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/dm-visitor-location-notification)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/dm-visitor-location-notification/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/dm-visitor-location-notification/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/dm-visitor-location-notification/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/dm-visitor-location-notification/)。

## 更新日志

Nothing to display here.

## 额外信息

 *  版本 **1.0.0**
 *  最后更新：**6 年前**
 *  活跃安装数量 **不到10**
 *  WordPress 版本 ** 5.0 或更高版本 **
 *  已测试的最高版本为 **5.4.25**
 *  PHP 版本 ** 7.2 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/dm-visitor-location-notification/)
 * 标签
 * [country](https://cn.wordpress.org/plugins/tags/country/)[GeoIP](https://cn.wordpress.org/plugins/tags/geoip/)
   [geolocation](https://cn.wordpress.org/plugins/tags/geolocation/)[notification](https://cn.wordpress.org/plugins/tags/notification/)
   [visits](https://cn.wordpress.org/plugins/tags/visits/)
 *  [高级视图](https://cn.wordpress.org/plugins/dm-visitor-location-notification/advanced/)

## 评级

尚未提交反馈。

[您的评价](https://wordpress.org/support/plugin/dm-visitor-location-notification/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/dm-visitor-location-notification/reviews/)

## 贡献者

 *   [ George-Paul Crețu ](https://profiles.wordpress.org/necroob/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/dm-visitor-location-notification/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](http://devmaverick.com/donate)